Electric scooter problem continue

Discussion in 'The Projects Forum' started by cl10Greg, Oct 12, 2012.

  1. cl10Greg

    Thread Starter Active Member

    Jan 28, 2010
    49
    0
    Hi everyone,

    So I am designing my own scooter with the following parameters (I have posted on here about it previously but this is a new issue).
    3x 12V SLA AGM batteries (2x in series for motor and 1 for controller)
    24V, 500W motor, 2700 RPM, 27A rated.

    I am designing my own controller based on an arduino. I have a picture attached below (terrible version done in visio).

    So let me walk through the application first. First off I have a throttle box that I designed. It has three switches that includes a key switch for turning the 12V on and off, a push button switch for turning the 24V relay on and off (estop), a push button to turn to the controller on and off (reset). I have a spring loaded potentiometer in the same project box on the handle bars. I calibrated the potentiometer using arduino readings to determine its analoginput. If the input is within range the controller powers on a BJT that activates the relay. I set the range for converting the analoginput to a output using the map function and writing the map to the PWM port (9). The PWM signal is sent to an H-bridge. The H-bridge is always enable with 5 volts and is reading the PWM signal (there is a pull down to make sure it is off when it is suppose to be). The PWM signal drives the driver output of the h-bridge. I have scoped this and most of the time it is consistant but some times it doesn't work right (Problem flag number 1). The output of the H-bridge is sent to the TTL FETs (I use TTLs because I was having trouble controlling them with the arduino and I wanted to protect it). The FETs PWM control the motor and has a timeout state. The timeout state waits 10 seconds to make sure that there is no more throttle then turns the relay off. This reduces the number of switches done by the relay. That is the ideal use of this application.

    So here is what is happening. Sometimes when the key switch is turned on, the H-bridge LED doesn't light up, this means that no voltage is powering the H-bridge. I observe that messing with the switch wire works on this. This makes me suspicious of the key switch but why would the voltage regulators LEDs never wavier? I am thinking I might need a simple resistor to the enable pin to limit the current. Any thought on this or what value?

    So if that problem is solved then I am able to activate the controller and relay no problem. The next problem is sporadic FET usage. What usually happens is that as soon as the relay activates and the PWM is turned on (the PWM motor LED turns on) the relay is cut off and the controller is reset (I have LEDs on the controller to examine what state it is in). The controller resets (shuts off) and goes back to idle. The H-bridge LED as turns off. This could yield a couple possibilities. Over drawing of arduino power. Should I put a resistor on the PWM out of the controller, if so I would set this to 20mA? The BJT is already regulated to 20mA and not hot. I could try swapping this out in case this was an issue. The FETs are overheating or are damaged. The FETS are not hot at all (heatsinked as well) so I am assuming that this isn't the problem (also in some error modes the motor turns on full tilt but is no longer PWM controlled). So this leads me to believe that maybe the PWM is having trouble altering the FET states (getting out of linear mode fast) but it has plenty of current to charge the capacitance from the H-bridge. The relay is rated for 30A at 24V so that should conduct fine (the relay is always under no load when switching so no damage). So this covers two issues, why the controller resets and why the PWM is not consistant (could be the same problem).

    I have tried adding caps to all lines. The signals look smooth. The relay activates fine sometimes and sometimes it misfires. I have tried this under load and no load. This makes me suspect that the switches may have a problem. They are just push buttons and a key switch that are rated for 1A. I don't think they should ever see that (relay is 75mA, arduino and H-bridge are tiny as far as I know) but it could be an issue or an internal problem with them. I can try to jumper around them to see the response.

    The overall usage is not consistent and I am running into problems left and right. I am in the home stretch of the design but it just needs that final kick. Sorry for the huge post but I would like some more sets of eyes on this issue if possible and fast. Thanks everyone!

    Summary problems:
    1.) H-bridge/PWM. The voltage is verified to be linear from the pot and read as linear. The output is suspicious, sometimes it works perfectly (if i ease into full throttle) but sometimes it doesn't (quick on sometimes messes it up). This makes me think that I may need to ramp up or delay the PWM signal.

    2.) Why does the LED on the H-bridge not always come on, what is causing this? The regulator is heat sinked and not hot at all. Wiggling incoming wires results in works again. Continuity has been checked. maybe a resistor to limit H-bridge power consumption (what size)?

    3.) FET control/controller reset. Why does the controller get reset when it turns on the relay and drives the PWM? It is isolated behind a BJT and H-bridge to the loads. Maybe I need to regulate the amount out to the drivers though?

    4.) Switches are suspect. Too much current or maybe internal issues. Continuity shows good for push buttons but the key switch could be a problem. The key switch sees all the power but I already tried to jumper around that and I still had the same issue.
     
  2. cl10Greg

    Thread Starter Active Member

    Jan 28, 2010
    49
    0
    Reading up a little more (from http://ruggedcircuits.com/html/ancp01.html) gave me some more possibilities also. So I think I may need to add a diode for the 12V power supply going to the regulator. This will block reverse flow to the rest of things connected to the 12V branch. I will probably not apply that to the relay coil becaue it could drop the voltage to much to activate it. Again it brings up making sure to check how much power it is sourcing so I need to regulate the output ports better. I need to do some measurements to all my inputs and outputs to see what they are running at and reading.
     
  3. shortbus

    AAC Fanatic!

    Sep 30, 2009
    4,015
    1,531
    Why are you using the SN754410? What is its function in the circuit? The PWM from the Ardino should go to a mosfet driver the the driver outputs to the mosfet gates.
     
  4. cl10Greg

    Thread Starter Active Member

    Jan 28, 2010
    49
    0
    Hello shortbus,

    Sorry for the late response, i was out the whole weekend. I am implementing the H-bridge to drive the MOSFET gates. This allows for more current draw for the gates during charging and it isolates the arduino from any damage from the MOSFETs. I didn't have any MOSFET drivers so I just went with the H-bridge that I had already. I think in theory it should work fine but if you see something wrong then please let me know.
     
  5. shortbus

    AAC Fanatic!

    Sep 30, 2009
    4,015
    1,531
    I hate to keep saying the same thing every time you post about this project. Using a micro to do this is to me a bad idea. Everything your trying to do can be done easier with other IC's. There are so many little problems in the schematic that will blow your micro, I don't know where to start.

    You have no "free wheel" diodes on the motor or relays, that is the biggest thing that will kill the micro. The SN754410 will probably work as a driver, but not as good as a real driver. Plus it needs to have the heat sink area shown in the application notes or it will over heat and let the smoke out. It also drops a couple of volts internally.

    In the end it's still your project so do it the way you want. :)
     
  6. cl10Greg

    Thread Starter Active Member

    Jan 28, 2010
    49
    0
    Me and my stubborn ways :). I thought I put those little buggers in my drawing. I do have flyback diodes for both the motor and relay. I didn't realize there was a voltage drop from the H-bridge, that I will have to look into. At this point I have learned tons about this circuit and debugging so that is a plus. If I had to do it again I would stick to smaller micro interaction and more dedicated components (FET drivers, optoisolators, etc...) I do appreciate all of the help and feedback though.
     
Loading...