Stepper motor module

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
filipmar.mf
Posts: 3
Joined: Thu Jul 28, 2016 3:21 pm

Stepper motor module

Postby filipmar.mf » Tue Mar 07, 2017 7:24 am

Hi,
there is my module for Stepper motor driven by Adafruit Easy driver.
https://github.com/Euter2/MicroPython/b ... stepper.py

Your feedback is welcome ;)

sjp770
Posts: 6
Joined: Thu Aug 24, 2017 12:50 am

Re: Stepper motor module

Postby sjp770 » Fri Aug 25, 2017 1:42 pm

Looks good, is there doco on how to use it? I'm still new to micropython.

User avatar
pythoncoder
Posts: 1863
Joined: Fri Jul 18, 2014 8:01 am

Re: Stepper motor module

Postby pythoncoder » Mon Aug 28, 2017 7:29 am

That's a useful driver. For anyone puzzled (as I was) Easy Driver is this nice piece of hardware: https://www.sparkfun.com/products/12779.

An asynchronous version of the driver would be an interesting project. It could use a timer interrupt or uasyncio to achieve nonblocking behaviour. The drawback would be a substantially lower maximum step rate, especially on the ESP8266.
Peter Hinch

sjp770
Posts: 6
Joined: Thu Aug 24, 2017 12:50 am

Re: Stepper motor module

Postby sjp770 » Thu Aug 31, 2017 3:09 am

My driver is a more common Polou A4988, (https://www.pololu.com/product/1182) Any idea if it would work with this or if there is a way to control it yet?

User avatar
dbc
Posts: 89
Joined: Fri Aug 28, 2015 11:02 pm
Location: Sunnyvale, CA

Re: Stepper motor module

Postby dbc » Fri Sep 01, 2017 11:03 pm

The drawback would be a substantially lower maximum step rate, especially on the ESP826
Yes, well, say you are using a common 200 steps/rev motor, and 1/4 microstepping, and two edges per step, or 1600 edges to generate per revolution. The OP's code has a 20 uSec minimum time between edges. At 20 uSec minimum time between edges, that is 32 mSec per revolution, or 1875 RPM, which is pretty zippy. (Feel free to look for errors in my math..) So I don't think a slower step rate is a problem for many applications.

Related, since motors have real mass, you can't make them go from 0 RPM to a fast step rate all in one go. It might be nice to add some kind of acceleration ramp parameter to the API.


Who is online

Users browsing this forum: No registered users and 1 guest