Using a pulse-width modulated signal to possibly reverse polarity

controldc motorpolaritypwmtransistors

I'm trying to help an artist control a simple DC motor using a single signal. The signal is a digital output, 0/5V, and the motor runs with max 36V. The motor needs to run forwards and backwards. There is only 1 digital output available per motor.

I know how to generate a PWM signal, and wire it up to a transistor (with resistor at the base) so that the motor spins slowly or quickly, that much is working. We have a simple circuit for motor speed in one direction.

Also thanks to this site I just learned about H-bridges and found a few good pages on using 4 transistors to switch a motor's polarity.

My thought was to have the output signal be pulse width modulated 0% = full reverse, to 35% = slow reverse, and 65% = slow forward, to 100% = full forward.

To make that control the motor, I think about splitting the signal into two isolated parts. I "smooth" one part and use it as a "direction control" signal, low=reverse, high=forward. The other original PWM signal just modulates the power, for speed control.

I can't get it working in my circuit simulator. First problem is that my "smoother" is a filtered rectifier, and it always produces the same output voltage regardless of the duty cycle, which makes sense, because the diode bridge just converts everything to the same voltage. The second problem I have is how to make the "low" parts of the duty cycle make the motor run "fast" when it is in reverse- pretty sure I can fix that with a NOT gate and another transistor, but it feels like there must be a more elegant way. The fewer parts in this design, the better.

(Main problem is that I'm in over my head. Haven't built any circuits in 20+ years.)

The question is- how would you make this work, using a 36V power supply and some components to convert a 0-100% 5V PWM signal into a -36V to +36V PWM power source?

FYI, We do have the option of just buying a second microcontroller, which would give us more output pins, which would let us use one pin for a "forward" signal, and another for "reverse." It's just frustrating me that I can't make the single-signal idea work.

Best Answer

If you have an H-bridge controller that can switch cleanly at a PWM frequency which is sufficiently fast relative to the motor's inductance (the lower the inductance, the faster the PWM must be), driving it with a waveform that's 60% forward and 40% reverse will be a good way to drive it forward at 20% speed; 40% forward 60% reverse will be a good way to drive it backward at 20% speed. If both conditions above are met, driving a motor in this fashion will give a speed response which is much more linear than PWM'ing between driven and "open-circuit", and will also be more energy-efficient. Additionally, trying to drive the motor at a speed which is somewhat slower than it's presently turning will provide regenerative braking [i.e. allow motor energy to be fed reasonably nicely into the supply].

The important thing to note is that running the PWM too fast for the H-bridge controller may waste energy in the H-bridge controller; running it too slow for the motor inductance will increase the amount of energy wasted in the motor. If the PWM is much too slow, driving the motor at half speed may use many times more energy than trying to run it at full speed. If, however, the motor is driven with a fast PWM and the H-bridge can handle it, efficiency may be very good; a stalled motor driven at 75% forward 25% reverse will have about half the torque as would one driven at 100% forward, but will only take about a quarter of the power [about 75% of the time, it will draw about half as much current from the supply as it would if on 100%, and the other 25% of the time it return that same amount of current].