I hope someone can help! I'm driving a bipolar stepper motor using an H-Bridge (SN754410), and it's all working fine but I really need to be able to release the motor after movements to conserve power.
I have an LCD fitted, so pins are restricted (I need a few controls and inputs, so I'm not using the AF shield. I also wanted to try to make it myself). I running the standard Arduino stepper library, but I can't for the life of me find a release command. I considered switching the feed to the H-Bridge's motor supply pin with a transistor, but it's not ideal, especially as I want to use a single power source, and that cut messes with the voltage and causes errors on the LCD (distance and time are set with pots).
Am I missing an obvious command, or is there another library out there that will do what I want? Or do I need some more hardware to do this?
I really hope someone can help... I've managed to get this far by just searching for solutions, having only started with Arduino at Christmas, but now I'm stumped!
A pic of the project is attached. Not that it'll help with the question, but just thought I'd show what I'm up to.
After running the motor I turn the send a digitalWrite to all four H-Bridge control pins to go low. This seems to work a treat, freeing off the motor and acting as a release.
Checking the current on the supply, it's about 10mA at rest before the code starts, goes up to about 350mA, then drops back down to 10mA after moving.
I can't see anything wrong with doing this, but if this is wrong in some way please shout!
I was also thinking about this. However, I don't want the motor to freewheel so I need some power to keep it from turning. My idea was to run a PWM output to the enable pin of the motor driver. After the motor has moved at full power, set something like analogWrite(pin, 20) or whatever is just enough to hold it in position. Havn't tried it yet, but can't see why it wouldn't work.
That's not a bad idea - you want the PWM frequency to be right for your motor ideally - but it may just work fine with the default Arduino settings (it might whine or hum though).
Stepper motors have their maximum torque performance at stationary so its common practice to use lower currents at a standstill than when moving to reduce power wastage, heating.
Depending on how you driver is wired - you could put a transistor parallel to a resistor on the voltage supply to your driver and turn the transistor on when you are moving and turn it off when you are stopped. The resistor would have to be sized for both the holding current and for the heat it would have to get rid of. You would need a high wattage resistor.