Originally Posted by
jiuning
Thank you Andy for such a nice tutorial oriented reply.
Now I think I understand the correct way to control the motor. The velocity PID control is done inside the motor drive which is in position mode, while the position PID control is done by another controller such as linuxcnc + some hardware. This will make the wiring quite simple.
I am a little confused about the math for the example you provided. I suppose the position resolution is not related to the length of the leadscrew, but to the pitch, e.g., 5 mm you mentioned in the example. Suppose the leadscrew is ideal and there is no backlash. For 1024 count encoder on the motor, the PID position loop driven by velocity mode would offer a position accuracy of 5/1024 ~ 0.005 mm. If the AD converter gives 12-bit analog control output (in the range of 0 - 10 V), and 10 V is corresponding to exactly 360 degree rotation, I would expect similar position resolution for analog control in position mode. For DYN4 with 16 bit encoder on the motor, the PID position loop driven by velocity mode would offer a position accuracy of 5/16384 ~ 0.0003 mm. Please correct me on the math if I made any mistake. Thanks!