making PWM speed controller for Electric bike

Discussion in 'The Projects Forum' started by CaptainPrice, Aug 12, 2009.

  1. CaptainPrice

    Thread Starter Active Member

    Aug 12, 2009
    49
    0
    Hey I'm trying to figure out how to make a Speed Controller for a DC motor.
    It is a 1200 Watt, 48v motor capable of 27 max continuous amps. I'm powering the motor with (4) 12v 12ah SLA batteries.
    All of the speed controllers I've seen marketed for my setup seem to be pretty expensive 90+ dollars.



    So is it possible to just use a 555 timer to switch on and off a mosfet driving the motor?



    • What would be the ideal frequency? I heard that some frequencies make audible tones??


    • How exactly can I drive the mosfet? Is the 5v output enough to drive a power mosfet? If not how can I amplify it?
     
    Last edited: Aug 12, 2009
  2. jj_alukkas

    Well-Known Member

    Jan 8, 2009
    751
    5
    You could use a 555 but never with 1 MOSFET. Will need some work to figure out what could handle 1200W and 27A + heavy gauge soldering.
     
  3. CaptainPrice

    Thread Starter Active Member

    Aug 12, 2009
    49
    0
    I thought I've seen Mosfets rated for 120v and 50amps?
    does this I could run the mosfet at both 120v and 50amps?
    I'm confused

    what do you suppose I should do?
     
  4. CaptainPrice

    Thread Starter Active Member

    Aug 12, 2009
    49
    0
    or maybe they can't handle that many watts.

    Could I just use say 4 mosfets in parrallel? or more? Or will there be a problem with switching?
     
    Last edited: Aug 13, 2009
  5. jj_alukkas

    Well-Known Member

    Jan 8, 2009
    751
    5
    You can use many MOSFETS if required, but they each should be properly biased. I am no expert in MOSFETS, there are people over here who knows. Wait for them.
     
  6. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Well I'm thinking by the time you wire up a few mosfets, heatsink, PWM driver, fuses, recirculating diodes, 30 amp wiring etc etc that $90 is starting to sound pretty good. :)
     
  7. CaptainPrice

    Thread Starter Active Member

    Aug 12, 2009
    49
    0

    Do you really think:rolleyes:
    I think I could get the Mosfets for under $10
    I would use a 555 timer for PWM $1
    Fuse should be cheap might have one
    IDK about the diodes or wire but that cant cost more than $80 :D
     
  8. jj_alukkas

    Well-Known Member

    Jan 8, 2009
    751
    5
    Only the heavy gauge wiring and soldering will cost you here.
     
  9. CaptainPrice

    Thread Starter Active Member

    Aug 12, 2009
    49
    0
    So does anyone know about driving the MOSFETS??

    can they be be controlled using the output from the 555 ?? assuming i'm using a few power mosfets?
     
  10. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    There is a site on the web where they talk about electric golf carts and the speed control circuits they tried that blew up and some worked well.
     
  11. CaptainPrice

    Thread Starter Active Member

    Aug 12, 2009
    49
    0
    Do you know the site? or have any other hints to how to find it?? thanks
     
  12. jj_alukkas

    Well-Known Member

    Jan 8, 2009
    751
    5
    I too once stumbled upon that golfcart site when searching abt charging lead acid batteries. But I cant find that specific site now though there are 100's of DIY golfcart sites online.

    This link might help you on your project http://www.dnd.utwente.nl/~grit/modelbouw/escs.html
     
  13. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
  14. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
  15. CaptainPrice

    Thread Starter Active Member

    Aug 12, 2009
    49
    0
    thanks for the links!

    So if I stick with using a 555 timer for PWM would a 12v 200ma max output be enough to drive say 3 power mosfets???
     
  16. Amberwolf

    Member

    May 2, 2008
    28
    2
    Probably not. You'd need to see first what MOSFETs you are going to use to drive the motor, then check their spec sheet for the charge required to drive the gate to full-on. Usually 10V is the max they take, and 9V is common as a peak gate output voltage. Some use 5V because it "works", but it wont' charge the gate as fast, or turn it on as "hard", meaning the MOSFET will be in it's linear region longer, and heat up more (and waste more of your battery power).

    Most of the controllers that cost a fair bit of money have at least some reason to do so (though some are probably junk). If it's a good controller, it has protection against a number of problems that are common.

    --Overcurrent in the motor/MOSFET circuit, which can burn the motor or other components up, or melt your wires or even melt the solder off the board and have your MOSFETs or nearby parts fall off!

    --Overvoltage in the back-EMF (BEMF) from the motor, usually as spikes during motor turn-off times, often with negative-going voltage that can be enough to destroy several of the power-output stage components.

    --Overtemperature in MOSFETs, drivers, power capacitor, etc, which can cause early failure (sometimes catastrophic).

    --Undervoltage in battery supply, which can destroy your batteries if you run them down too far. Sometimes battery packs may have built-in BMS (battery management system) that has it's own cutoff like this, but not usually for lead-acid types. For those they expect the controller or the user to monitor this.

    --Overvoltage in the supply, partly because a stack of fully charged batteries are significantly higher in voltage than you'd expect based on their "nominal" rated voltage. A 4-string of 12V SLA batteries is not 48V at full charge, it's more like 55+. And during charging it'll probably have more than 60V across it. That means if you had components in there rated for the 48V nominal voltage, or a bit higher, and had the controller still attached to the battery when you plugged it in, but nothing to divert that extra voltage away, it would damage or destroy parts of your controller.

    --MOSFET failure, because when MOSFETs die, they usually die shorted across Drain and Source, and sometimes Gate. That means that your motor would be suddenly powered at full throttle with no way to shut it off other than disconnect battery from the thing. Some controllers can detect this condition and disconnect the main "contactor" or relay that provides power into the controller, keeping you from being stuck on a runaway bike. If they fail shorted to the gate, too, then other parts besides the MOSFETs blow up, and you end up replacing at least the gate drivers, and if they failed shorted possibly the PWM chip, too.



    A few other considerations:

    --In my experience the 555 type of oscillator is not fully temperature stable, so it will drift in frequency and duty cycle (pulse width) as it warms up and cools down.

    --there are chips out there designed specifically for motor control, which can include handling some of the failure modes listed above. Some are made for BLDC motors, some for brushed motors. You don't say which type your motor is, but as long as it's a brushed motor, most of even the BLDC chips can be used in a different mode to run them, too. If it's a BLDC motor, you won't be able to use the 555 method to run it (at least, not easily, since you'd have to sync up at least three of them to run in phases, with variable frequency controlled by feedback from the motor's Hall Effect position sensors).

    --there are a lot of DIY motor controller designs already out there, proven (or disproven so you know what to avoid doing!). A good web search will turn up quite a few. There are even application notes in most of the motor controller chips's spec sheets from the manufacturers that give basic circuits good enough to run an ebike, if you know enough about MOSFET power stage design to set it up for your own power levels (which are higher than what they usually have in the appnotes).

    --there are also some commercial designs out there that have either been reverse-engineered (with specs probably available from those that did this), or have info on their sites that would lead you to a usable controller. One of these that I learned the most from was the site Audioguru also recommends: http://4qd.co.uk, who has a tech site called http://4qdtec.co.uk with quite a lot of very good info on PWM motor control. I highly recommend reading all of that before you design your controller.

    I ended up not designing my own, but rather using one of their 2QDs, built out of recycled components from junk electronics I have around here on a PCB supplied by 4QD.co.uk.

    It would actually be possible for someone with some time and stubbornness and electronics skills to take the parts layout (which shows PCB traces) they have on the public site, plus the circuit diagrams in the PWM motor control pages, and build a 2QD entirely on your own. I chose not to go that far. :) I can't remember right now, but some of the last parts with the most advanced versions of the 2QD and info might be part of the "subscription" section of the tech site, but even that is cheap for all the info you get there (at least, it is worth it to me, given how little I knew when I started out, and how much I learned there!).

    If I had had the money, I would have just bought a 2QD outright, because they're only about $75 (USD) with the exchange rate as it is right now. Less if you didn't need the 48V version.
    http://zope.4qd.co.uk/prices/lpl?cSymbol=&eRate=1.653&submit=Use+this+currency



    If you do still want to design and build your own, I still recommend first reading all that PWM motor control section on that tech site, then doing some searching for other DIY motor controllers. They're not as easy as you'd think to get a reliable one, and it isn't even always because of obvious reasons.

    I tried quite a few simple ones found around the web before I decided that the failures I was having were because of all the things I learned (via the 4qd tech site) that could kill a controller, or cause wierd things to happen because of voltage feedback and spikes, etc. The simplest one I have that worked reasonably well was one rebuilt from a fried ScootNGo controller, to which I simply added much larger NTY100N10 MOSFETs, driven by some old Motorola JFETs I had laying around (since the dinky transistors already on there wouldn't have driven them hard enough).


    The higher power a load you want to drive with the controller, the harder it is to create a controller that reliably does it's job, because all that extra power creates various kinds of feedback into the circuits that has to be dealt with. There are simple ways to do all of that, but they waste a lot of power, and the more power you're using to drive the motor with, the more heat you end up with because of the wasted power. After a while, you end up with enough heat in the controller to melt things, just because of wasted power!



    If you want to see my own ebikes, and the motors and stuff, go to http://electricle.blogspot.com and browse thru the archives. There's a couple years' worth of my journey to a useful ebike, and I'm not finished yet, even though I've been successful twice. Neither one is good enough for my final version (actually, I'll probably *never* be satisfied, and keep improving it forever!).

    A tiny pic of an intermediate version of my current ebike is used for my avatar.
     
    ajimmym likes this.
  17. pilko

    Senior Member

    Dec 8, 2008
    213
    20
    Amberwolf --- what a great explanation.
     
  18. jj_alukkas

    Well-Known Member

    Jan 8, 2009
    751
    5
    That was well said... Reading all this I feel, its better with an of the shelf product.
     
  19. Tahmid

    Active Member

    Jul 2, 2008
    344
    25
    You can use a 555, and you CAN USE ONE MOSFET: IXTK250N10 (100V, 250A). Don't know how much they cost though. One more thing, driving such a huge MOSFET, you need a good MOSFET driver. Can use a cheap IR2117 or can make your own discrete driver with transistors.

    I have one such motor control circuit. I'll find it and try to post it for you.

    I made one such huge motor control circuit, but that was using PIC as the Pulse-Width-Modulator.

    Tahmid.
     
    Last edited: Aug 16, 2009
  20. Tahmid

    Active Member

    Jul 2, 2008
    344
    25
    hi amberwolf,
    nice explanation.

    Here are some additional info:
    -For back EMF, you can use diode across motor and MOSFET has the internal reverse diode for protection.
    -Overheating of MOSFETs is probably gonna be a drive problem. And there is the usual heating which has to be taken care of by heatsinks and cooling fans.
    -Overvoltage/Undervoltage/MOSFET failure - these can all be protected against with appropriate circuit.
     
Loading...