Motor speed control with PWMPAL
Reagent X
Posts: 9
Hi,
I am using a BS2pe and a PWMPAL to control a 12VDC gearmotor (http://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_155821_-1?CID=PDF). My goal is to control the speed over as wide a range of RPM's as possible. I have the motor working, and I am using the output of the PWMPAL to control the "enable" input of an L293D motor controller (H-bridge IC).
I am wondering how to optimize the ability to lower the speed as much as possible, while avoiding risk of stalling the motor or otherwise jerky or unreproducible performance. Currently, I can lower the speed to about 40% of max, but not any lower. I am using the same code as in the PWMPAL docs. The motor makes humming noises, but the shaft doesn’t turn. Seems I should be able to go down lower, like to 25% as in the PWMPAL documentation. Any suggestions on how I can get a bigger range of speeds? Thanks!
-Ron
East Bay, CA
Edit: oops - I meant L293d. corrected above.
I am using a BS2pe and a PWMPAL to control a 12VDC gearmotor (http://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_155821_-1?CID=PDF). My goal is to control the speed over as wide a range of RPM's as possible. I have the motor working, and I am using the output of the PWMPAL to control the "enable" input of an L293D motor controller (H-bridge IC).
I am wondering how to optimize the ability to lower the speed as much as possible, while avoiding risk of stalling the motor or otherwise jerky or unreproducible performance. Currently, I can lower the speed to about 40% of max, but not any lower. I am using the same code as in the PWMPAL docs. The motor makes humming noises, but the shaft doesn’t turn. Seems I should be able to go down lower, like to 25% as in the PWMPAL documentation. Any suggestions on how I can get a bigger range of speeds? Thanks!
-Ron
East Bay, CA
Edit: oops - I meant L293d. corrected above.
Comments
Looks intriguing and quite simple. Can anyone please point me toward so more examples to get a wide range of speeds out of a DC motor? There is so much information about motor control, but I can't find any guidance on what kind of dynamic range one can expect or how to go about optimizing a circuit. Anyone have any ideas?
Change R2 to 1k
make R5 a digipot controlled by the BS2, and make R4 and R6 adjustable to dial in 0-100% PWM
Feed the output of the 339 into the enable of the motor driver. (you can ditch the transistor and LED) Keep the 10k pullup though.
Many speed controls have the dreaded "dead zone" you mention: when the motor is hopelessly, torquelessly stalled at an intermediate speed. That's no better performance than you can get with a 1930's rheostat. With PWM, you should have full control down to zero speed. I don't understand what passes for motor controllers these days. Most show a sizeable voltage drop. And personally I think their multi-kHz pulse rate is too high by a factor of 500.
One of my very first electronics projects WAY back in 1983 was a homegrown motor speed controller using a 556 dual timer. Forest Mimms' yellow Radio Shack book saved me there. It worked great, sending slow (~4-5 hz) PWM signals to a transistor switch. I could dial the speed down to zero, it would rotate a small toy motor about 1/8 turn per pulse with 100% torque. It looked like a stepper motor; you could easily see the motor shaft turning forcefully in small steps. I'll try to dig that up and post a circuit.
You can experiment on your own with a Stamp, a switching transistor, and your motor. Send a string a pulses to the transistor at various frequencies and duty cycles to see what works. Simple code: "high, pause, low, pause, loop" kind of code. Within 10 minutes, you'll achieve better results than your PWMPAL and L293 can deliver. Once you find your preferred frequency, you could make a 556 circuit controlled by a digipot to PWM your motor.
Which I also have a schematic for here.
Change R1 to 2.2k or you will burn the pot up.
change the digipot to a 100k version
and change the timing cap to .01uF
that should net around 2-98%
also this circuit will suffer from frequency change. I also couldn't use this circuit with the parallax PING sensor because as I changed speed there was harmonic noise coming from somewhere that would change with duty cycle because the hz was changing also. And it would cause the PING to false detect.
The cool thing about the first circuit I posted is it's frequency stability and 0-100% duty cycle and one 555 for multiple channels. 4 channels of PWM with the LM339 (or CMOS version)
http://www.youtube.com/watch?v=GcWttdSQ-jM
That's a pretty cool little motor and it performs the same with both a 2N3904 (npn) and a 2N7000 (mos).
I was reading some basic info on motor speed control in the book "Practical Electronics for Inventors" by Paul Scherz. In the book they say that motors tend to stall when they applied voltage drops to about 50% of the specified operating voltage. They also say you can safely run a motor at a voltage about 30% higher than the operating voltage.
This seems to support my observation that my motor stalls when the duty cycle of my PWM signal drops below 40%.
Here's a question: what advantage do these other circuits have over the PWMPAL? The PWMPAL may not be the cheapest solution, but isn't the output signal as good as you can get? Shouldn't it be flexible to meet my needs?
http://www.robotroom.com/PWM5.html