scratch build 24v electric scooter controller?

Discussion in 'The Projects Forum' started by rudyauction8, May 10, 2014.

  1. rudyauction8

    Thread Starter Member

    Jan 27, 2012
    252
    2
    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.
     
  2. rudyauction8

    Thread Starter Member

    Jan 27, 2012
    252
    2
    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?
     
  3. shortbus

    AAC Fanatic!

    Sep 30, 2009
    4,004
    1,525
    Easier to answer if you post a schematic of what your doing.
     
  4. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,776
    1,103
    Almost certainly. Another common cause is FETs switched too slowly, or not being turned on fully.
     
  5. rudyauction8

    Thread Starter Member

    Jan 27, 2012
    252
    2
    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.

    [​IMG]
     
  6. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,776
    1,103
    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.
     
  7. rudyauction8

    Thread Starter Member

    Jan 27, 2012
    252
    2


    Thanks for your help.
     
  8. rudyauction8

    Thread Starter Member

    Jan 27, 2012
    252
    2
    I modified the schematic.


    [​IMG]
     
  9. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305

    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.
    :)
     
  10. rudyauction8

    Thread Starter Member

    Jan 27, 2012
    252
    2
    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?
     
  11. ronv

    AAC Fanatic!

    Nov 12, 2008
    3,282
    1,234
    What is the voltage to the micro. Five volts or 3.3 volts?
     
  12. rudyauction8

    Thread Starter Member

    Jan 27, 2012
    252
    2
    5 volts, motor runs on 24 volts.
     
  13. ronv

    AAC Fanatic!

    Nov 12, 2008
    3,282
    1,234
    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?
     
  14. rudyauction8

    Thread Starter Member

    Jan 27, 2012
    252
    2

    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?
     
  15. panic mode

    Senior Member

    Oct 10, 2011
    1,319
    304
    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).
     
  16. rudyauction8

    Thread Starter Member

    Jan 27, 2012
    252
    2

    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.
     
  17. rudyauction8

    Thread Starter Member

    Jan 27, 2012
    252
    2
    Here's an updated schematic. Also, in the push pull diagram posted earlier, what's the function of C2?



    [​IMG]
     
  18. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,776
    1,103
    Bear in mind that's only for a very brief time and only if the FETS have an excellent heatsink.
     
  19. ronv

    AAC Fanatic!

    Nov 12, 2008
    3,282
    1,234
    Q5 is upside down.
    C2 helps suppress brush noise.
     
  20. rudyauction8

    Thread Starter Member

    Jan 27, 2012
    252
    2
    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.
     
Loading...