kwahoo2 / Mortar

BSD 3-Clause "New" or "Revised" License
33 stars 1 forks source link

Add support for DRV8825 #1

Closed kwahoo2 closed 9 months ago

kwahoo2 commented 10 months ago

Reason: Better availability by independent board manufacturers than DRV8814.

Datasheet: https://www.ti.com/lit/ds/slvsa73f/slvsa73f.pdf

Differences: Current implementation of DRV8814 driver uses continuous (floating point) microstepping. PWM of relevant phases is adjusted with precision dependent of pigpio library.

DRV8825 uses fixed size (up to 32) microstepping. Number of microsteps is defined by state of pins MODE0, MODE1, MODE2.

Apnet66 commented 10 months ago

Yes, 8825 drivers are available on ready-made boards. I wanted to do it on these drivers.

Apnet66 commented 10 months ago

(https://www.amazon.co.uk/Stepper-Motor-HAT-Controller-Microstepping/dp/B07PXF5DZ7)

kwahoo2 commented 9 months ago

Initial implementation of DRV8825 is here. 6f5ed32e0666fbce27c1c71ca0afe603ac62df9a c7b1fceec31b944652e066ae86567b6ad641d268

DRV8825 has to be chosen in the preferences window. mortarprefs

I am not closing the issue, since I am going to add (compile-time) option for pinout of the HAT @Apnet66 linked above.

As for now moment the code reuses old pins, so:

ALT ENBL: GPIO 4, physical pin 7
ALT DIR: GPIO 5, physical pin 29
ALT STEP:  GPIO 6, physical pin 31
AZI ENBL: GPIO 20, physical pin 38
AZI DIR: GPIO 12, physical pin 32
AZI STEP: GPIO 26, physical pin 37

Known limitations compared to DRV8814:

My prototype uses two DRV8825 StepStick boards;) 20231125_225450

Apnet66 commented 9 months ago

Thank you. I will try. I also have 2100 modules, they are 1/64 steps, it will be possible to achieve a result like 8814. The connection to the strawberry is not visible in the photo.

kwahoo2 commented 9 months ago

(https://www.amazon.co.uk/Stepper-Motor-HAT-Controller-Microstepping/dp/B07PXF5DZ7)

Implemented now as DRV8825 HAT (not tested on real hardware) There is pin-out tip after selecting the driver drv8825hat

Apnet66 commented 9 months ago

Hi. I ordered this module for an experiment. I'll try to assemble it using mechanics from another project, and recalculate the transmission link there. previous project, does not work with Stellarium. It works from the monitor, but the Developer has disappeared..You are running your project well.We will do it.