![]() |
|
[Python] Control steppermotor with RPI using python - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Python] Control steppermotor with RPI using python (/showthread.php?tid=5674242) |
Control steppermotor with RPI using python - SIM-1517404 - Jul 20, 2017 Hi, I'm working on controlling a bipolar stepper motor with the Raspberry pi using python scripts. I want to rotate the motor a specific set of degrees for a full 360 degree rotation. For example rotate the motor 11,25 degrees at a time a total of 32 times for a full rotation. I have all the connections set up, but when I rund a script I found online the motor goes crazy, rotating uncontrollably in both directions. Can someone point me in the right direction? The scripts I used is: Code import RPi.GPIO as GPIO* - koolkid - Jul 20, 2017 increase the delay to about 0.5 or 1 maybe 2 and post your results * - SIM-1517404 - Jul 20, 2017 (Jul 20, 2017 01:06 PM)koolkid Wrote: increase the delay to about 0.5 or 1 maybe 2 and post your results It goes 1 step forward, pauses for about a second, 1 step backwards, pauses for a second and repeat. * - koolkid - Jul 20, 2017 change the delay to 0.05 and see if that works * - SIM-1517404 - Jul 20, 2017 (Jul 20, 2017 01:36 PM)koolkid Wrote: change the delay to 0.05 and see if that works Does the same thing, just faster. I think my output pins on the motor are messed up, I'm gonna double check and I'll get back. * - koolkid - Jul 20, 2017 (Jul 20, 2017 01:42 PM)Swatchi Wrote: Does the same thing, just faster. I think my output pins on the motor are messed up, I'm gonna double check and I'll get back. ok do that and test it again and see if it works * - SIM-1517404 - Jul 21, 2017 (Jul 20, 2017 02:13 PM)koolkid Wrote: ok do that and test it again and see if it works Now it's not rotating at all. I have no clue what is wrong, trying to figure it out. * - koolkid - Jul 21, 2017 (Jul 21, 2017 05:34 AM)Swatchi Wrote: Now it's not rotating at all. I have no clue what is wrong, trying to figure it out. did you switch the pins around ?? * - SIM-1517404 - Jul 21, 2017 (Jul 21, 2017 05:45 AM)koolkid Wrote: did you switch the pins around ?? Yeah I did. The motor is getting voltage because it tightens up, but I don't know if maybe the driver is fried. I don't know what else to check/do at this point. * - koolkid - Jul 21, 2017 (Jul 21, 2017 05:55 AM)Swatchi Wrote: Yeah I did. The motor is getting voltage because it tightens up, but I don't know if maybe the driver is fried. I don't know what else to check/do at this point. try putting back the pins to their original state |