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.
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.
Attachments
-
142.4 KB Views: 30