Hello,
I've setup EMC with a manual lathe that I've fitted with a stepper motor and simple gear tooth sensor as an encoder. I'm getting awful spindle synchronization, I think it is bad trajectory planning since stepgen is keeping up with what it is told to do. For the first half an inch or so, the stepper does jerky accel/decel cycles and eventually converges on the approximate spindle-synched feed rate.
Here's a HAL scope screengrab, it is very dramatic. Green straight line is spindle-revs (showing it's relatively stable,) and curved lines are both the commanded position and the stepgen's feedback position. It's almost like the motion generation has a PID that needs tuning. What I'd expect is an initial acceleration to get up to speed, and then a decel to match the synchronized speed. Instead, it alternates between too fast and too slow, each time a little less off of the ideal synchronized speed, until it eventually sounds like it's converging (awful noisy stepper.)
I had to hack the encoder HAL module to generate the index pulse, which it's possible is the cause of the problem, but as far as I can tell it works correctly: spindle-revs increases steadily, spindle-index-enable gets set high by controller on g33, and encoder sinks it at the appropriate time. Also spindle-velocity seems correct
I've tried looking around at all the tunable parameters in the .ini and hal files, but I couldn't find anything that makes much difference. I'm truly stuck.
Any suggestions?
-Matt
P.S. A few numerical ballparks: encoder 66 pulse/rev (plus synthetic index pulse,) 4000 steps/inch, RPM was probably 100-200, thread pitch (K in g33) was 0.0625, step accel set to about 9, max velocity 1. I think base thread was 40us, servo thread maybe 800 us or so.