Control a 24VDC 350W motor with PWM?

Hi everyone,

I want to control the speed of a 24V DC motor, 350W which equates to ~14.5A load. Rather than getting a motor control shield, which can't control such a large motor...I am thinking I can do this easy enough using a transistor and PWM pin from the Arduino. I'll actually only run it up to 10A, because this is the maximum I can draw from my batteries.

Question is...is this transistor capable of this task? http://www.onsemi.com/pub_link/Collateral/MJH6284-D.PDF

(I think) I am opting for a transistor capable of 20A continuous, to give it some 'room to breathe' and to allow for minor manufacturing differences etc. I'm slightly concerned however because of this: "Total Device Dissipation @ TC = 25 deg C...160W". What does that mean?

Hope you've had a great Christmas, Hanukkah, Kwanzaa, Boxing Day, Bodhi Day, Las Posadas, Muharram, Festivus, some other holiday, or nothing at all [smiley=laugh.gif]

Cheers,
Scott

Or what about this MOSFET? I have never used one, but I've read it's an alternative...

The maximum power dissipation of a transistor (160W in this case) is usually only a factor when the part is used in an analog circuit. In a PWM application, the transistor should be either fully "off" (no current flowing) or fully "on" (saturated, full current flowing). The power dissipation is given by the current multiplied by the voltage drop, just as in a resistor. So when "off", there's no power dissipated. When fully "on", the power is the current (10A) times the voltage drop (collector to emitter, 1V or so). There's actually a parameter, Vce(sat), that shows that the maximum voltage drop when saturated and carrying maximum current is 3.0V. So you should be OK as long as you switch the transistor fully "on" and "off" quickly with your PWM waveform.

That doesn't mean that you can get away with not fitting a heatsink! There will still be 20W or so of heat produced at the transistor, which will need to be removed. Also, remember to use large enough PCB tracks and wiring to handle your motor current. And do fit a large enough back-EMF diode to protect the transistor from voltage spikes.

The MOSFET should be OK, too. You can put MOSFETs in parallel to increase current capacity, but you can't do that easily with bipolar transistors.

Hi Scott;

Well first you need to define the motor application a little further. Do you want the motor to be able to reverse turning direction or will always be rotating in just one direction.

The best choise is a logic level N channel power MOSFET transistor. Most MOSFETs require a 10vdc gate turn-on voltage to fully saturate the transistor on which is the key to keeping it within it's max heat dissapation ratings. A logic level MOSFET will saturate on with as little as 4-5vdc and therefore can be directly driven by a Arduino output pin. You should probably also have a pull-down resistor, say 5K, to make sure the device stays off if the Ardunio is powered off but the 24vdc motor voltage is still on. The source lead of the mosfet will wire to ground and the drain lead will wire to one motor lead and the other motor lead will wire to +24vdc. Simple no muss, no fuss. However if you need bi-directional rotatation of the motor then you need to look at H-drive circuits and their power transistor requirements.

Lefty

So keep looking for the best logic level N channel

@ Anachrocomputer:

That doesn't mean that you can get away with not fitting a heatsink! There will still be 20W or so of heat produced at the transistor, which will need to be removed. Also, remember to use large enough PCB tracks and wiring to handle your motor current. And do fit a large enough back-EMF diode to protect the transistor from voltage spikes.

Thanks for the info. I was considering using the metal body (of the electric scooter) as a heatsink because there's no airflow for a standard heatsink. There'll be plenty of metal to dissipate the heat generated by the transistor.

And thanks for the reminder about the diode. I'd forgotten that one...

@Lefty:

Well first you need to define the motor application a little further. Do you want the motor to be able to reverse turning direction or will always be rotating in just one direction.

Just one direction, being a scooter with only 2 collinear wheels...backwards could be a real challenge! I'm glad that simplifies things...

The best choise is a logic level N channel power MOSFET transistor. Most MOSFETs require a 10vdc gate turn-on voltage to fully saturate the transistor on which is the key to keeping it within it's max heat dissapation ratings. A logic level MOSFET will saturate on with as little as 4-5vdc and therefore can be directly driven by a Arduino output pin.

Are you referring to two different MOSFETs in this sentence? Or are you simply saying that I can saturate with as little as 4-5VDC, but it'd be better with more voltage, say at least 10VDC? Either way I guess the solution is, saturate with more voltage to get better heat dissipation! Please correct me if I'm wrong...

The scooter is running from a 24VDC source. I will have a 12V rail using a voltage regulator IC (I've definitely learned something in the past couple of months!) that I will use to power the Arduino and I can use that 12V rail to switch the gate of the MOSFET (providing 12V is within the limits of the gate turn-on voltage). Sounds like the plan. Or, I could use the 24-28V straight from the battery. Which would be better, or am I splitting hairs?

You should probably also have a pull-down resistor, say 5K, to make sure the device stays off if the Ardunio is powered off but the 24vdc motor voltage is still on.

I'll do this too, even though one can't run without the other, it seems like a good practice to get into. I assume you mean a pull-down resistor on the gate pin of the MOSFET to ensure the gate is pulled to ground when there is no PWM pulse?

Thanks for the help Lefty. I'll keep digging and double check with you when I find something else...

How about this one Lefty?

Minimum gate-source voltage of 1V with a maximum of 18V (so I can use the 12 easily).
Drain Current (pulsed) is 120A or ~30A continuous.

http://au.farnell.com/stmicroelectronics/stp36nf06l/mosfet-n-logic-to-220/dp/9935614
Data sheet: http://www.farnell.com/datasheets/66152.pdf

And as for the diode, I'm eying off this one:
http://au.farnell.com/vishay-formerly-international-rectifier/20tq045pbf/diode-schottky-20a-45v-to-220ac/dp/8647860

It looks okay to me, but I'm not very au fait with this stuff. Any thoughts?

Scott;

That MOSFET you linked to looks like a winner for your applications. The reason to use a logic level FET is because it then can be simply wired to an Arduino PWM output pin. If you elect to use +12 to switch the gate terminal then you will need a intermediate switching transistor between the Arduino output pin and the MOSFET gate. Either will work but I would keep it simple and just use 5vdc logic level voltage to control the gate. Be sure to heat sink the MOSFET for this kind of application.

I guess the diode is to mount across the motor terminals as a 'freewheeling' diode to clamp turn off transients? If so I would like to see you use one with a higher reverse voltage ratings as the spike can approach X4 of the applied 24vdc when it collapses. Look for at least 100v PIV rating or better 150-200v. It doesn't need to have a forward current rating equal to the motor current as the diode is normally off and only turning on for the brief spikes mentioned above.

Good luck

Lefty

That MOSFET you linked to looks like a winner for your applications.

Woohoo! Finally I'm getting somewhere. I will definitely try to use the 5V logic level voltage. I can always add the intermediate transistor if need be. Thanks...

If so I would like to see you use one with a higher reverse voltage ratings as the spike can approach X4 of the applied 24vdc when it collapses.

Excellent suggestion. I'm glad you pointed that out! What I think I am doing with this diode is as per page 34 on this booklet: http://www.arduino.cc/playground/uploads/Main/arduino_notebook_v1-1.pdf. Am I on the right path?

I originally chose a schottky diode as I read on Wikipedia they are the most efficient for this application. After your comments I looked through the TVS diodes and found this one. It's 200V: http://au.farnell.com/fairchild-semiconductor/1v5ke200a/diode-tvs-200v-1500w/dp/1017610

Data sheet: Intelligent Power and Sensing Technologies | onsemi

Thanks again for the help Lefty. I'll definitely put your name in the credits :wink:

Cheers,
Scott.

If you're interested in large PWM motor controllers, try doing a search on: Open Source Motor Controller. There's also an OSMC group on Yahoo Groups. Might be bigger than you need, and I think it's an H-bridge (capable of reversing), but you may get some suggestions about what FETs to use!

Scott;

TVS diodes are good for some applications but not for yours. They are designed to wire from ground to a point you wish to protect from voltages exceeding the 'breakdown" value of the TVS, thus shunting the transient voltage to ground. In your case the diode is across the motor winding and needs to suppress negative transients by short circuiting the motor for negative voltages. The values you need in the diode are high PRV value and fast switching time. A Schottky diode is nice and fast, you just need one rated for around 200vdc PIV and maybe 3-5 amps. I tried using that search selection tool on your vendors link, but it doesn't seem to like me.

"as per page 34 on this booklet: Arduino Playground - HomePage. Am I on the right path?"

Yes, the diode is protecting the power MOSFET from seeing high negative voltage spikes that could damage it.

Lefty

It doesn't like anyone! Thanks for the additional info, I'll have another painful search!

This one has to be it!

2 x 10A
200V
Frequencies from 250 kHz to 5.0 MHz

http://au.farnell.com/on-semiconductor/mbr20200ctg/diode-schottky-2x10a-200v/dp/9556222
Data sheet: http://skory.gylcomp.hu/alkatresz/mbr20200ct-d.pdf

With this one, am I better off using both Terminals on Pin 1 and Pin 3, to get 20A? Or is this not a recommended practice?

"am I better off using both Terminals on Pin 1 and Pin 3, to get 20A? Or is this not a recommended practice? "

I see no harm in using both diodes in parallel, plus that would double the current rating over a single element. It's not like you aren't paying for both halves :wink: Speaking of price I think it says you have to buy 5 at a time? Be sure to wire it in the proper direction, do it wrong and when the MOSFET turns on there will be a direct short from +24vdc to ground, heat, maybe flash and most important not even a darn 1 MPH out of the motor.

The key to effective transient suppression is to mount the diode as close to the motor terminals as practicable. Mounted anywhere in the circuit is better then nothing but close to the coil will help eliminate EMI interference and possibly ET's as well :wink:

Hey Lefty,

Yep, the minimum buy qty is a killer sometimes. I'm wondering if I can run two of these in parallel instead? I'm trying to steer way from the TO-220 package. These axial leaded versions are easier to work with IMO.

http://au.farnell.com/taiwan-semiconductor/sr110/diode-schottky-do-41-1a-100v/dp/4085132

I'll definitely double triple check the setup with the multimeter and some basic testing before hooking up the motor. I'm not a huge fan of doing things twice!

Thanks again!

Should work OK. The MOSFET has a protection diode built inside it so this external diode is just a back-up and mostly to try and keep large noise spikes from going all over and possibly upsetting the Arduino causing program resets, etc.

In the worst case noise enviroments one might consider driving a optical isolator between the Arduino and the power mosfet and not connect the Arduino ground to the +24v ground, but that would be like a plan B only if needed.

Lefty

Well, I've ordered all the gear I need for this thing. I'll let you know how I get on with it. Thanks again for all your time and effort Lefty, you're a champ.

Cheers,
Scott

Hey Lefty,

Well, I got the motor wired up here on the table but I've already blown the two MOSFETs I got.

Not sure where I am going wrong with it. They haven't been cooked (heat) by over driving them, they weren't even getting warm at all. I'm beginning to wonder if I had the diodes hooked up in the wrong direction or something else equally as stupid. I had the diode's cathode on the positive wire of the battery and the anode of the negative wire. Is that right? I thought it was when looking at that Arduino PDF I referred to earlier.

Something I noticed before it all went belly up: If I measured the voltage between the negative of the battery and the negative pole on the motor (where the diode's anode was terminated), I was getting a positive voltage of say about 18V? From a 24V battery. I would have expected to get nothing, given it was GND to GND? I really have no idea.

The first one I'm pretty sure blew when I was wiring up the motor and when I put the blade fuse into the fuse holder, there was a considerable arc and it must have given the MOSFET a pretty big crack. So I wrote that one off to my stupidity for not having a switch on the motor and checking the setup thoroughly first.

The second one though was working fine, I could pulse it between 0 and 100%...driving the motor as hard as it'll go (no load)...working sweet. Then I uploaded a new sketch to the Arduino and next second the motor was running it's head off and the second MOSFET had given up the ghost.

Any suggestions as to where I might have messed up?

Cheers,
Scott

Can you post some pictures and a wiring diagram?

That way we can try to figure out what's wrong :slight_smile:

Wow smoke and flames, too bad.

I can't say for sure yet what might have happened but a full drawing would give us something to talk about. You might consider first testing the setup with a different smaller load rather then the motor. Say a auto headlamp or lamp as the load and a +12volt power source, something that draws just a few amps. Then you can make some static load measurements with the device on and off. The diode wiring sounds correct.

It sounds like you might have had the second FET working until you uploaded a new sketch. That requires a momentary Arduino reset and puts all Arduino I/O pins into input mode until your sketch runs and can then setup the I/O pin as a output pin. That's why it's recommened to have a pull down resistor at the FET gate to FET ground (source pin) to insure it turns off if the Arduino resets. Did you remember the pull down resistor?

Lefty

Thanks for the response guys. I'll post some pictures and try to rustle up a wiring diagram in Eagle. It'll probably end up being tomorrow though.

@Lefty: I didn't have a pull down resistor directly from the FET gate to FET ground, but there was a 5K resistor from the gate wire to the common ground. Is that the same thing?