scratch build 24v electric scooter controller?

Thread Starter

rudyauction8

Joined Jan 27, 2012
250
Looking to use some 150a logic mosfets and a pic microcontroller to scratch build a controller for my electric scooter. Last time I tried this I smoked all of the mosfets within 5 minutes, they were 30a though.

Here's what I will be getting: http://www.ebay.com/itm/251470367485

Last time I just hooked the motor to the fets and drove them direct from a microcontroller. I must have missed something because I had about 120 amps worth of fets yet they burned at about 25 amps. I have plenty of heat sinks, but are there other components that are required to keep them from burning? I didn't use any filter capacitors if that makes a difference.

I realize that these fets are only 30v, but the highest voltage they'll see during normal use is around 28 volts and that will quickly drop to around 22-24 volts.

Forgot to mention: I think the scooter motor will pull around 40-50 amps max while stalled under full power. I don't plan to use any current limiting device, I plan to build the controller to take the full load of the motor.
 

Thread Starter

rudyauction8

Joined Jan 27, 2012
250
Also I heard somewhere you need a diode on the motor wires to absorb the voltage spikes caused by the motor. I didn't know about this the first time I tried to build a controller. Is this required, and could it be the cause of my first failure?
 

Thread Starter

rudyauction8

Joined Jan 27, 2012
250
I'm not very good at schematics, but here's the circuit. My last attempt was the same but without the diode and capacitors. I'll be using all 5 mosfets instead of the 3 shown, it was easier to leave a few out since they're all in parallel.

 

Attachments

Alec_t

Joined Sep 17, 2013
14,330
There's a problem or two with that circuit.
1) As the FETs are N-type they need a gate voltage >> source voltage. You have them arranged as source-followers, so as the max gate voltage is the micro's Vdd the source can never reach Vcc and they won't turn fully on. BANG! Re-arrange the circuit so that the motor connects between Vcc and the FET drains.
2) Each FET should have a respective gate resistor (~10-100 ohms) as close as possible to the gate, to damp any spurious oscillations arising from wire inductance and gate capacitance.
3) If you are using PWM to switch the FETs rapidly then they should have a driver stage between the micro and the gates to provide enough current to charge/discharge the gate capacitance quickly.
4) C1 and C2 slow down the switching.
 

Thread Starter

rudyauction8

Joined Jan 27, 2012
250
There's a problem or two with that circuit.
1) As the FETs are N-type they need a gate voltage >> source voltage. You have them arranged as source-followers, so as the max gate voltage is the micro's Vdd the source can never reach Vcc and they won't turn fully on. BANG! Re-arrange the circuit so that the motor connects between Vcc and the FET drains.

Made a mistake on the schematic, must have been tired.

2) Each FET should have a respective gate resistor (~10-100 ohms) as close as possible to the gate, to damp any spurious oscillations arising from wire inductance and gate capacitance.

Will add to the schematic. I'll attach the resistors directly to the gate pins since I'm not using a circuit board for this project.


3) If you are using PWM to switch the FETs rapidly then they should have a driver stage between the micro and the gates to provide enough current to charge/discharge the gate capacitance quickly.

How would I do this? Transistor driven by microcontroller that then drives mosfets? I plan to keep the frequency at about 1-2khz, and they will be solid on most of the time for full power.

4) C1 and C2 slow down the switching.

I'll remove them. What about the other 2? Are they required or optional?


Thanks for your help.
 

THE_RB

Joined Feb 11, 2008
5,438
...
Forgot to mention: I think the scooter motor will pull around 40-50 amps max while stalled under full power. I don't plan to use any current limiting device, I plan to build the controller to take the full load of the motor.

That's a big mistake in my opinion. You've already burned out one set of FETs.

Putting max current limiting on a DC motor controller is one of the smartest things you can do in the design. Not only will it save the controller and motor from a really bad stall it can also give you some control of max acceleration torque etc and save stripping gears and save people's skin. You can even make the current limit have a couple of settings, to put the vehicle in "beginner" mode for gentle starts etc.
:)
 

Thread Starter

rudyauction8

Joined Jan 27, 2012
250
That's a big mistake in my opinion. You've already burned out one set of FETs.

Putting max current limiting on a DC motor controller is one of the smartest things you can do in the design. Not only will it save the controller and motor from a really bad stall it can also give you some control of max acceleration torque etc and save stripping gears and save people's skin. You can even make the current limit have a couple of settings, to put the vehicle in "beginner" mode for gentle starts etc.
:)
I chose to skip a current limit for a couple reasons. First, I've used this scooter with nothing but a light switch. It triples the acceleration but it's still easily controllable, that's why I'm building this: to lose the low current limit on the stock controller and still have proportional throttle control. Second, the motor stalls at ~50 amps yet each of the 5 fets I'm going to use can control up to 150 amps, giving my controller the ability to handle 750 amps, which is much more than my batteries can supply. If the motor is really stalled, I'll notice and let off the power. Gears aren't an issue, it uses a chain that holds up fine to the full power of the motor.

If I do decide to build a current limit (if I do it'll be around 200 amps), how do I do it without breaking the bank?
 

ronv

Joined Nov 12, 2008
3,770
I think I would use a push pull driver like this one. I worry about the FET voltage being so close to the motor voltage. Twist the power and ground wires from the supply and keep them as short as possible. Same with the motor wires. What diode do you have in mind?
 

Attachments

Thread Starter

rudyauction8

Joined Jan 27, 2012
250
I think I would use a push pull driver like this one. I worry about the FET voltage being so close to the motor voltage. Twist the power and ground wires from the supply and keep them as short as possible. Same with the motor wires. What diode do you have in mind?

Why is the push-pull better? Doesn't the second transistor reduce the voltage going to the fets? Could I just put a pull-down resistor on the gates?

Or could I drive the fets from a transistor and a 12v regulator?
 

panic mode

Joined Oct 10, 2011
2,759
you can use code to control duty cycle and thus current.
you can use low value resistor to measure actual motor current.
push-pull is used to provide low output impedance driver for mosfets - since mosfets have large gate capacitance, you need this to turn them on/off fast. if it is not fast enough, transistors will heat up and burn.
since push-pull pair is in CC configuration, signal voltage is reduced from 5V to 4.5V and this is already low for most mosfets to turn them fully on (usually you need some ~12V, check datasheet). one can add another stage to boost level of control signal before it gets to push-pull.
as the gates typically don't handle more than max 20V, it would be good idea to add some sort of limiting to protect transistors (strategically placed resistor and 15V zener will do).
 

Thread Starter

rudyauction8

Joined Jan 27, 2012
250
you can use code to control duty cycle and thus current.
you can use low value resistor to measure actual motor current.
push-pull is used to provide low output impedance driver for mosfets - since mosfets have large gate capacitance, you need this to turn them on/off fast. if it is not fast enough, transistors will heat up and burn.
since push-pull pair is in CC configuration, signal voltage is reduced from 5V to 4.5V and this is already low for most mosfets to turn them fully on (usually you need some ~12V, check datasheet). one can add another stage to boost level of control signal before it gets to push-pull.
as the gates typically don't handle more than max 20V, it would be good idea to add some sort of limiting to protect transistors (strategically placed resistor and 15V zener will do).

Thanks, I may design a current limiter if I get my hands on a more powerful motor or decide to over-volt this one. What resistor would I use for a motor that draws ~40 amps?

The mosfets I chose are logic level, and turn on fully at 5 volts and still work well at 4.5 volts. I chose them because I don't want to have more stages to get the required voltage.
 

Thread Starter

rudyauction8

Joined Jan 27, 2012
250
Bear in mind that's only for a very brief time and only if the FETS have an excellent heatsink.
I'll be using a large heatsink, about 2x the size of a CPU heatsink split between all of the fets in open air. With that taken into account, about how much would each fet be able to handle continuously? On resistance is about 4.2mOhm at 4.5v gate voltage.
 
Top