MadCow42
Posts: 89
Joined: Sun Jul 01, 2012 12:48 am

Re: Using RPi.GPIO to drive stepper motors

Postby MadCow42 » Thu Aug 02, 2012 3:10 am

h121 wrote:Hi and thanks for this info! It'll be very useful when I get my motors from Ebay :)

Anyway, I tried to use your code and ran into some minor problems. First of all, I think there are a few typos in the average error calculation, line 308 or so. However, Python allows us to calculate the average without using a loop to add the error values. You can simply replace lines 305-308 with this:

Code: Select all

        errorValue = sum(errors) / len(errors)

I'll post more comments after I get to use it with some actual hardware.


Thanks for the feedback (and bug fix!)

Kevin.
onlyjus
Posts: 3
Joined: Sat Oct 27, 2012 3:47 am

Re: Using RPi.GPIO to drive stepper motors

Postby onlyjus » Tue Nov 20, 2012 10:10 pm

Why not just use an easyDriver? I think you just need to hook up two GPIO pins to the Step and Dir inputs? Then you are off and running.
maecki
Posts: 1
Joined: Wed Sep 25, 2013 1:42 pm
Location: Germany
Contact:

Re: Using RPi.GPIO to drive stepper motors

Postby maecki » Wed Sep 25, 2013 1:45 pm

Don't forget the pins for sleep or enable to save energy. Easydriver normaly works with 5v but there is a solderpad to change to 3.3 V.
MadCow42
Posts: 89
Joined: Sun Jul 01, 2012 12:48 am

Re: Using RPi.GPIO to drive stepper motors

Postby MadCow42 » Wed Sep 25, 2013 4:12 pm

onlyjus wrote:Why not just use an easyDriver? I think you just need to hook up two GPIO pins to the Step and Dir inputs? Then you are off and running.


Current. I need to drive >1 amp per phase (including during a prolonged hold / lock) for max torque. Also - for the joy of building something from the bare bones upwards. :).