laurb9 / StepperDriver

Arduino library for A4988, DRV8825, DRV8834, DRV8880 and generic two-pin (DIR/STEP) stepper motor drivers
MIT License
556 stars 228 forks source link

What should be set for the "microstep" value? #117

Closed kazumasa-kusaba closed 1 year ago

kazumasa-kusaba commented 1 year ago

Thank you for developing this useful library. I have 2 questions about the value of "microsteps".

What should be set for the "microsteps" value?

I'm using A4988. What should I set to the following methods?

https://github.com/laurb9/StepperDriver/blob/be6a215849144099273e890cca75dbf4ef233787/src/A4988.cpp#L44

https://github.com/laurb9/StepperDriver/blob/be6a215849144099273e890cca75dbf4ef233787/src/A4988.cpp#L61

The value should be set directly to 1 or 2 or 4 or 8 or 16?

And do I need to call "setMicrostep" method if I want to change microstep?
It looks like all the ms pins are set HIGH in the begin method.
https://github.com/laurb9/StepperDriver/blob/be6a215849144099273e890cca75dbf4ef233787/src/A4988.cpp#L51

kazumasa-kusaba commented 1 year ago

And do I need to call "setMicrostep" method if I want to change microstep? It looks like all the ms pins are set HIGH in the begin method.

I'm sorry, the above question is my misunderstanding...

A4988::setMicrostep(short microsteps) method will be called in BasicStepperDriver::begin(float rpm, short microsteps) method and all the ms pins will be set to the appropriate values.

https://github.com/laurb9/StepperDriver/blob/be6a215849144099273e890cca75dbf4ef233787/src/BasicStepperDriver.cpp#L54

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.