CAD CAM EDM DRO - Yahoo Group Archive

Re: EMC and PIc-Servo

Posted by Andy Olney
on 1999-07-17 22:10:01 UTC
Andrew -

I have talked with both Fred Proctor and Jeff Kerr (picservo designer) about
what it would take to make EMC run a picservo.

Here is Fred's reply:

Andy,

I was forwarded your question on the possibility of adapting the EMC
code to interface to a servo board. This is quite possible. I prefer
using dumb I/O cards that have DACs and encoder counters, using the CPU
for all calculations, but if you have an I/O card already then it makes
sense to keep that and avoid paying for an I/O card.

You described taking the voltage output, which is proportional to the
desired velocity, and feeding this to the servo board. The board would
then close the loop on velocity, which is probably not what you want.
You can take the *input* to the PID calculations, and pass this directly
to the board. There are no extintf.h functions for this since I don't do
this now, but they could look like this:

extern int extPosWrite(int axis, double pos);

This would be called instead of the PID calculations done in
pidRunCycle, e.g.,

// assume 'softwareServo' is set somehow to non-zero for usual, 0 for
hardware boards
if (softwareServo) {
emcmotStatus->output[axis] =
pidRunCycle(&emcmotStatus->pid[axis],
emcmotStatus->input[axis],
jointPos[axis]);
}
else {
emcmotStatus->output[axis] = 0.0; // FIXME-- could read DACs on board
and fill this in
extPosWrite(axis, jointPos[axis]);
}

I haven't tested this but it's close to what will work.

--Fred

Jeff Kerr also said that he was able to talk to 2 axis at about 400
commands per second:

> Regarding the NIST EMC software, the stepper control may be the easiest
> to implement, although inelegant. We have implemented some contouring
> schemes reading the positions and commanding velocities and have gotten
> good results down to about 30 commands/second. Another alternative it
> to use two serial ports with two controllers on each port. This would
allow
> you to issue raw positions commands (Using the STOP command) for two
> axes at a rate of about 400 commands per second. This would probably
> be smooth enough, and is much simpler to implement.
>


To get EMC talking to a Picservo it looks like at least the following would
have to be done:

1. Write Fred's external interface.
2. Figure out how to make a serial port talk to the picservo from within RT
linux ( There is some code for a serial port interface on the RT linux
site).
3. Write the standard external interfaces to setup and initialize the
picservo boards as well as read the limit swithces etc.

I sure there is more to it as always. I am not much of a C programmer
understatement !) but I would like to get these little servo boards going
with EMC also.

Andy Olney

----- Original Message -----
From: Andrew Werby <drewid@...>
To: <CAD_CAM_EDM_DRO@onelist.com>
Sent: Friday, July 16, 1999 2:49 AM
Subject: [CAD_CAM_EDM_DRO] Re:Servos in EMC and the probe

Discussion Thread

Andy Olney 1999-07-17 22:10:01 UTC Re: EMC and PIc-Servo