First I made some test PCB's for the x12.17 driver. I used 28 SOIC boards and soldered away, and burned my nose, don't ask how! I wired everything up, credit to this guy : https://guy.carpenter.id.au/gaugette/2017/04/29/switecx25-quad-driver-tests/. check out his other stuff, like how to remove end stops from the motors if you happened to buy them with end stops as I did. https://guy.carpenter.id.au/gaugette/2012/04/04/pulling-out-the-stops/
I tried 2 different libraries to control the stepper motor and manually.
SwitecX25 / SwitecX12 library
Guy.carpenter added an extension to the SwitecX25 library to use with motor driver called, its called SwitecX12.
Conclusion: Couldn't make it work, and I have no idea how.
Manually
I manually pulled step pin LOW and HIGH with correct delays and such according to the datasheet of the motor driver.
This was actually working, it was smooth and controllable and also microstepping. For a single motor this could suffice.
Conclusion: Great but probably not ideal for more than one or a couple steppers, they would not be synchronized, as we are calling blocking functions. This would ultimately (probably) screw up the timing and steps in the long run. I could make my own stepper library, calling timers, flags, triggers and what not. But I'm too lazy and I hate low level.
Video of manual stepping:
Accelstepper / continuousStepper library
I used the Accelstepper library to run a simple test on both motor pointers. Where I use the AccelStepper::DRIVER setup. This seems to work alright, I will try to look more into this library as I believe this is the way to go. This library supports drivers, uses non blocking code, so multiple steppers could be used, and it is quite popular.
See AccelStepper documentation here:
https://www.airspayce.com/mikem/arduino/AccelStepper
https://hackaday.io/project/183713-using-the-arduino-accelstepper-library
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.