I am doing a project where I am controlling a nema 17 stepper motor with a raspberry pi 3b. The raspberry pi is controlling the motor through a pyqt5 gui (python 3 is the language). I am using tb6600 drivers set to 1/32 microstep for breakout. My question is, what is the most accurate and efficient way I can control this motor (part of the novelty is not writing the script in C)? Right now I am just getting down low and dirty by using the rpi.gpio library and time.sleep() to pulse the tb6600. I have thought about using the pyqt qthread sleep functions and also applying rpi.gpio pwm to the tb6600. Accuracy is most important. Suggestions from experience?

  • \$\begingroup\$ Check how those qthreads work. If I remember correctly, standard Python isn't really multithreaded. Sleep is also not usually very accurate. You have no guarantee when it will actually resume. I've had to fix code that used sleeps where the sleep didn't wake up until several minutes after the (few seconds) sleep had expired. \$\endgroup\$
    – JRE
    Commented Feb 8, 2018 at 11:48
  • \$\begingroup\$ IMO Real Time control and Python is no go. \$\endgroup\$ Commented Feb 8, 2018 at 14:17


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.