Hi Dave.

Yes, for stepper motor machines, emc creates a pulse for each and every
incremental motion of the motors -- a typical machine might have 8000
pulses per inch, and that machine moving at 2 inches per second would
generate 16000 pulses per second.

After interpreting the gcode, the details of a specific move are sent to
the realtime trajectory planner.  Every 1ms, emc produces a new target
point which is reachable in the next 1ms from the current point given
the acceleration and velocity limits of the machine.

At this point, it becomes the role of the hardware-specific code to "do
something" to get hte motors to the right location.  In the case of
servos, this may involve using the "PID" algorithm to create an
appropriate analog velocity command.  In the case of a stepper system
attached to the parport, "stepgen" now enters the picture.

"stepgen", which also has an idea of the acceleration and velocity
constraints of the machine, has several pieces of data: the last
velocity, the current position, and the new position.  Taking all these
together, it finds a new velocity (which is really a frequency of
pulses) that will hit the new position or come as close as possible
given the machine constraints (in a properly-configured system, reaching
the new position is always possible; on a bad one, it sometimes isn't,
and the operator will be greated with a "following error" pop-up).  It
stores this new velocity (frequency) command in a particular memory
location.

The frequency command in that memory location is then read by the "fast
thread", which is executing typically at a rate between 10kHz to
50kHz--say, every 25 microseconds.  stepgen creates a series of pulses
at around the commanded frequency by using a "DDS" (direct digital
synthesis) algorithm; if the required rate is between 75 and 50
microseconds, then there will be a delay of either 2 or 3 periods of
25us between pulses.

The value produced by each step generator is then gathered according to
the HAL configuration and output on the parport.

.. and that's how babies are made^W^W^Wemc2 drives stepper systems.

Jeff

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to