it works great and we actually save some ergs by moving some of warm sunroom air into the main living room.
Now i want to use the same transisitor, TIP120 in to-220 package to control a pump motor. It is DC 0 - 12 VDC 4 amps max, (rated at 8 V). I have run this pump at 12 volts with no overheating and even when pushing a head of say 30 psi it only draws about 2 amps (FMI Lab Pump Model QB, 0-576 ml/min range).
I would like to control the speed using PWM (pin 9, Uno). My question is: Should I use some sort of RC smoothing or even an op amp to condition the pulse signal from the PWM pin before it goes to the transistor base (NPN type)?
It seems likely to draw a lot of power if it is switching on/off at whatever frequency the arduino outputs...do you know what that is...I've read conflicting values.
I do not think this is a good idea. The Due has DAC, a much better way... The variable voltage smoothed can control a heat-sinked FET to control the DC motor.
Of course, you can use an RC network to bring PWM into a variable DC voltage, but it will require more than one stage of filtering. Use an online tool to calculate the best RC values... http://www.falstad.com/circuit/
If the motor uses fluid passage to cool it, be careful of lowering the flow rate too low.
It seems likely to draw a lot of power if it is switching on/off at whatever frequency the arduino outputs...
What? How are you measuring that "power"?
My question is: Should I use some sort of RC smoothing or even an op amp to condition the pulse signal from the PWM pin before it goes to the transistor base (NPN type)?
Probably not. But, maybe so if the pump is not working correctly with PWM.
The advantage of PWM is that it switches the transistor completely-on or completely off, so there is either voltage across the transistor with very little current, or current through the transistor with very little voltage across it. Since you don't have voltage and current at the same time, the transistor doesn't have to dissipate power and heat (Power = Voltage x Current). If you instead operate the transistor "linearly" it will tend to get hot and you might even burn it out (especially if the heatsink isn't large enough).
For the same reasons, I disagree with Ray's suggestion of using a MOSFET linearly with a DAC. A MOSFET in the switching mode can be more efficient (and run cooler) than a transistor because there is less voltage drop across it when it's fully-on. But in linear mode, it will have to dissipate the same amount of power & heat as a transistor.
Default PWM is at something like 490 Hz. Is the pump showing problems?
The advantage of PWM is that it switches the transistor completely-on or completely off, so there is either voltage across the transistor with very little current, or current through the transistor with very little voltage across it.
I still get lost trying to choose a resistor for a transistor.
So digital switching is far more efficient than analog valving. Buck converters use that.
Right Ray, I should have bought a Due. Although I am still not sure...That LINK is a big help. I even have a bag of the right caps. I'll set up and borrow a scope.
DVDDoug, I should have said current instead of power, sorry. The TIP120 seems to vary load current proportionally to bias. That is what the fan control project was about...the Pulse width varies directly with temperature to control motor speed
GoForSmoke (cool name that has become my motto!) - If 490 Hz is default, does that imply that I can reset that?
to choose a resistor I use an equation a friend gave me many moons ago:
R=(I/O pin volts minus diode drop)/(load current/hfe)
In my case this works out to R= 2000 ohm = (5-1.2)/(2/1000)
I have not powered this up yet. I just can't get my head around powering a DC motor with a current that alternates at 500 Hz. I have destroyed other things, like peltier plates using the wrong DC supply. This pump is valuable. Old but a goodie, like me.
I wish I started this thread with the title "What is the best way to control a permanent magnet brush motor using an Arduino Uno". I did try googling that but ended up here confused. An encoder give feedback control but the pulse is still there. Doesn't the field collapse at 490 Hz every time the PWM signal goes to zero v?
Hi, PWM although pulsed DC is effected by the inductance of the motor like AC is.
This inductance will help with its response to pulsed DC.
Don't go out and get a DUE, use what you have suggested, don't try and filter with caps.
PWM is very efficient, most DC motors these days are controlled this way.
Its is very rare for a motor to have problems with PWM, 490Hz should be fine.
Have you got a fuse in your motor circuit? I find a lot of OP don't bother an if a fault occurs, more than just a resistor lets the smoke out especially if the supply is SLA or Lipo.
Tom, thanks for the go ahead. I was being too careful. After i read your post i connected pin 9 to base via 1000ohm and it is working just as I had hoped. I'm reading a pot through 5V/Pin A0 and mapped the pulse to it according to Tom Igore's example....so I have speed control with a potentiometer.
The current draw is only .7 amp at 12 v with no load. Even with load it is about 2 amps.
One curious thing...when I first hooked it up, I could stop the motor by reducing the Pulse to zero. but after playing with it for a while it kept running slowly and I measured 0.02 amp through the motor. I even pulled the base out of the PWM pin and put it into GND. Still the motor runs very slowly. I wonder if Ive somehow killed the transistor?
Nope I don't think I have ever used a fuse...but i do have some inline holders in my junk box. How should I determine the right value of the fuse? I am hoping to run at 12 volts 2 amp. max.
Hi, sounds like it, you need to put a diode across the motor, cathode to positive side of motor and anode to negative side of motor.
The diode is what is called a freewheeling diode, it stops any back EMF from the motor causing problems.
Any 1N4001 thru to 1N4007 will do.
Yep, I was using without the diode. I swapped the TIP120 for a new one and also put a diode accros the motor. I read that this needs to be as close to the motor as possible. the diode that is. That is not convenient...can the diode mount in the development area of the UNO?
Am I right to imagine the induced field of the motor coil as acting like a RC smoothing stage? At some 500 Hz I am guessing that there is not much loss to field collapse per cycle.
There has to be enough collapse for speed control through pulse width modification.
100% PWM needs to deliver more speed than 50%.
And with the collapse comes current flow which is what the diode is there to protect against.
I thought I should wrap it up in case others are thinking about trying this.
I ended up using a simple arrangement. PWM (pin 9) to 1k resistor to base (TIP120). It controls the motor speed (using the pot/analog input example) and there is no undue heating of the transistor on a hefty heat sink) or the motor. It really seems to run just fine, at least for the few days I've been using it.
This application is outside to fill our water tank...we have roof collection but these days we need to suppliment from a spring, so the little pump trickles from the spring into the tank. next project is to fashion a float switch for the tank and I can forget about the whole system for a while.
I have come here several times now and get such good advice. I am deeply grateful for the help. As I learn more I am moved to paraphase some greek guy... "Give me an arduino and a relay and I'll control the werld". heh