Hopefully I'm on the right subforum. This is task I know nothing about and I would like some knowledge to be shared on the subject.
When it comes to controlling a bunch of motors, the digital outputs often prove scarce, so I wanted to know if there is a way to control a standard DC motor in both directions with only one Digital(PWM) pin?
H-bridges usually require at least two for this task and I can't quite find a way around that.
Some help on the subject would be much appreciated!
I suggest using a board with more IO then.
Maybe one that is Atmega1284P based, for 32 IO. I offer them in several form factors.
Or Atmega2561, for 60+. I offer one type now.
Or Arduino Mega for 70.
Or Atmega2560 based for the full 83. I offer one type now, and have a 2nd on the way. http://www.crossroadsfencing.com/BobuinoRev17/
Browse around, see if anything suits your fancy.
If you use an electronic speed controller (esc)that takes a standard RC servo signal then sure, you can control one motor forward and backward and speed with one wire.
There is a microcontroller on the esc taking that signal and switching the bridge.
If you are going to buy a driver anyway a hobby esc is probably not much more than an hbridge.
spycatcher2k:
To control direction, yes, To control direction and speed (Even on/off) with directional control, no.
But yes, perfectly doable in fact, just PWM the direction pin keeping the enable high (if its a bridge
with a single direction pin - if not an inverter and/or deadtime circuit might be needed). 50% duty
cycle be where the motor is stationary (but consuming some power). The PWM frequency needs to
be high enough to keep current ripple under control.
MarkT:
But yes, perfectly doable in fact, just PWM the direction pin keeping the enable high (if its a bridge
with a single direction pin - if not an inverter and/or deadtime circuit might be needed). 50% duty
cycle be where the motor is stationary (but consuming some power). The PWM frequency needs to
be high enough to keep current ripple under control.
Yes, I thought about an inverter/deatrime circuit as well but I'm somewhat new to this and I would like an example.
Very good to know that it's doable!