mattjlewis / diozero

Java Device I/O library that is portable across Single Board Computers and microcontrollers. Tested with Raspberry Pi, Odroid C2, BeagleBone Black, Next Thing CHIP, Asus Tinker Board and Arduinos / Pico. Supports GPIO, I2C, SPI as well as Serial communication. Also known to work with Udoo Quad.
https://www.diozero.com
MIT License
261 stars 59 forks source link

Probable bug in new StepperMotor setups #148

Closed EAGrahamJr closed 1 year ago

EAGrahamJr commented 1 year ago

In the process of applying stepper functions to an expansion board, it appears that the 1.4 implementation isn't actually "correct" vis-a-vis what is supplied via Adafruit - the notion of what constitutes a step is pretty "simple" for the Python implementation, which is calling my previous efforts into doubt.

Please assign to me :smirk: if you wish.

EAGrahamJr commented 1 year ago

One apparent difference is the Adafruit library considers a "step" to be somewhat differently defined than what is defined in spec sheets.

For example, the 28BYJ-48 is nominally 512 "steps" for a complete rotation. This calls for 4 cycles across the 4 pins in order to get the 1/512 step, or 2048 "quarter steps", which is what the Adafruit library is calling a step all by itself.

mattjlewis commented 1 year ago

Thank you

EAGrahamJr commented 1 year ago

Close - this turns out to be essentially a duplicate of #147 (see notes there).