Thursday, February 08, 2007
Explanation of Stepping Motor Sync
Having the devices in a chain means that there's some delay as commands are repeated from device 1 to device 2 and such; this means if you tell controller A to move the head left and controller B to move the head back, A will start moving before B. To get them moving together, they have another bus that's connected directly instead of through serial repeaters.
The computer can send commands to the controllers that, instead of being executed immediately, will be stored for later. It can:
- Step Forward
- Step Back
- Seek an Absolute Position
Any corrections or comments? Is this mechanism actually used by the java control software?
Now I'm having my own ideas. Consider this code snippet:
#include <stdio.h>It prints this output:
const unsigned int numer=7, denom=16;
for(n=0; n<denom; n++)
printf(" %d\n", syncline());
$ ./a.outThis is a well-known line-drawing algorithm from back when computers were more like our PICs, and drove printers not unlike our axis systems. Consider numer and denom as a fraction telling the X axis controller to take precisely 7 out of 16 steps. Used in sync with the Y axis controller, it could follow an arbitrary line without needing go/stop/stop/go/stop commands from the controlling PC before every sync pulse -- just give it a destination, a fractional speed, and go to town.
0 1 0 1 0 1 0 0 1 0 1 0 1 0 1 0
Labels: stepper firmware
At some point before the release of RepRap 1.0 "Darwin" we really must document the code...
Links to this post: