crxguy52's golf cart motor controller

crxguy52

1 mW
Joined
Apr 6, 2014
Messages
15
Hello all,

I got started with an arduino uno about a year ago, and after a few projects I wanted to try something more challenging. I began designing a motor controller for a 48V, series wound golf cart, and it's turned out to be a bit more challenging than I thought. I've got most of the details sorted out - it's about 90% complete. I wanted a second set of (more experienced eyes) to take a look at it and see what you all thought. My design specs are:

Target = 48V, 400A
Batteries = 6, 8V golf cart batteries wired in series with 4awg wire
Motor = stock 1988 series wound culb car motor

Power side:
Half H bridge
6x IRLB4030PBF (100V, 4.3mOhm) per side, so 12 total (http://www.digikey.com/product-detail/en/IRLB4030PBF/IRLB4030PBF-ND/2096639)
15x Electrolytic bus caps (100V, 680uF, .027Ohm ESR) (http://www.digikey.com/product-detail/en/100ZLJ680M16X40/1189-1047-ND/3133975)
1x L01Z400S05 Current Sensor (http://www.digikey.com/product-search/en?vendor=0&keywords=L01Z400S05)
2x 80-90V TVS Diode of some sort... haven't picked one out yet
15V Zeners on the gates (MOSFET VGD max is 16v)

Control Side:
Arduino Pro Micro will do all the computing
Gate Drive - IR21844PBF (http://www.digikey.com/product-search/en?vendor=0&keywords=IR21844PBF)
Gate resistors to match the max current of the driver - Req = ~12ohm
Linear regulators to get 5V and 15V

The power board will be stacked on top of the control board and individual wires will be run from the power board down to male headers that will plug into the control board. Two massive heatsinks will line each side of the power board and form two sides of the chassis. Vertical buss bars pulled from an old curtis controller will provide attachment for the batteries\motor (see picture below). I've also attached my EAGLE files, PCB will be 4oz copper from myropcb.com

View attachment 2


Any comments\concerns with this design? This is my first attempt, so be nice if I did something stupid :)
 

Attachments

  • MC_Rev_1.zip
    1.1 MB · Views: 61
A few specific questions I had were:

1. If I break out the trace from the gate output on the driver to the individual pins on the connector, I get a delta of about 4mm between the middle trace length and the end trace length. Is this enough to significantly affect MOSFET turn on\off time? Otherwise I'll have to zig zag the traces to equalize the lengths.

2. Right now I have the gate resistors and pull down resistors on the control board, and the gate zeners on the power board. My fear with putting the gate resistors on the power board was that inductance from the power board's noise could induce voltage in the gate. At the same time, having gate resistors as close as possible to the gates could be beneficial from blocking any noise from making it to the gate. Thoughts?

3. I don't have any experience with switching a lot of current, and the noise that comes from it. My current plan is to use the noise blocking material that was in the curtis controller (think aluminum foil sandwiched between thin pieces of plastic). Is this typically sufficient, or should I look into other options?

Also, please let me know if I'm in the right subforum here. TIA
 
Routed all of the traces this week and mocked up the board (see below for pics). I ran Sparkfun's DRC and made some tweaks based on it, the only thing left to do is meander the traces for the gate drive to make them equal length. I'll hopefully get that done this week and send it off to get made from Myropcb.

uc


uc


uc


uc
 
dnmun said:
is a gate source ceramic cap needed?

The only reason I can think that you'd need one is to maybe damp out some ringing. Otherwise you're adding capacitance, which is opposite of what you want. Less capacitance = faster switching time = lower losses

Sent the PCB out today, should be in by the end of the month. I left a spot for zeners on the gates to cap any ringing, but I'm going to try and fix it with gate resistance first. i'm looking at 2.1 ohm built into the mosfet, a 20 ohm on each (6 in parallel) gate, and ~3.5 in series for a total effective gate resistance of ~9 ohms. My gate drive is 12 volts and the gate drive maxes out at 1.4 amps, so the minimum I should use is 8.5. I had a lot of ringing on my breadboard setup, I'll be interested to see how it'll look with the PCB.

Pictures of the finished design:

Logic Final.JPG

Power final.JPG

Now to order new MOSFETS and bus caps (I originally bought 63V components, I've realized they're not beefy enough for a 48V system), along with some little stuff like zeners. Should all start coming together early may. Stay tuned!
 
There was some discussion recently about gate resistance/capacitance, switching time and efficiency:

http://endless-sphere.com/forums/viewtopic.php?f=30&t=58830
 
Punx0r said:
There was some discussion recently about gate resistance/capacitance, switching time and efficiency:

Thanks, I read through the thread. ZombieSS mentioned he used a TD350E with a boost stage. I'm curious what he meant - a gate drive driving two smaller FETs, which then drives the main FETs? I googled it and didn't come up with anything significant. I am concerned that I've got 1.4 amps to spread over 6 FETs... hopefully switching times aren't too slow. From what I've gathered on the ATmega32u4 in the pro micro, PWM is either like 8kHz or 32kHz.

quickshot23 said:
This is going to sound like a newb question but...

Did you design that PCB and if so, how do you get it custom made?

I don't mind at all - I started learning about all of this stuff about a year ago. I used Eagle to design the PCB (Sparkfun has a ton of great tutorials on how to use it - there is a bit of a learning curve, but it's not impossible). There are a bunch of board houses out there, I used MyroPCB.com. Total cost for my order of 3, 4oz copper boards was ~$130... $35 of which was shipping, and $68 was a setup fee.
 
The PCBs arrived today!One of the legs of my gate driver is shorted to another, but other than that it looks good. My only concern is that I left thermals on for my buss bars - so I'm going to try to push 400A through (5 holes * 4 thermals * width * 4 oz PCB thickness). Getting the buss bars out of the old controller was a pain, so hopefully it will at least make it easier to get them in. Now the fun part begins!

uc


uc


uc


uc
 
Spent most of the day assembling the logic board, and everything is populated. Next time I'm definitely using some better connectors, the pin headers were meant to be used between boards, not to have wires soldered to them. Both linear regulators seem to be doing their jobs correctly, and the basic program I wrote to use the gate driver to drive into nothingness (no MOSFETS) also works.

The power stage still needs to be assembled and everything mounted to the heatsinks\chassis. I received the new 100V caps and MOSFETs, and the caps are pretty big. They give the controller a "don't mess with me" look :lol:. I also have to trim the positive buss bar to fit through the current sensor.

After 6 months of staring at a computer, visual progress is finally being made! Pictures:
 

Attachments

  • IMG_0595 (Medium).JPG
    IMG_0595 (Medium).JPG
    92.1 KB · Views: 2,900
  • IMG_0596 (Medium).JPG
    IMG_0596 (Medium).JPG
    103.1 KB · Views: 2,900
  • IMG_0598 (Medium).JPG
    IMG_0598 (Medium).JPG
    69.1 KB · Views: 2,900
  • IMG_0599 (Medium).JPG
    IMG_0599 (Medium).JPG
    71.5 KB · Views: 2,900
Sunday I soldered in the buss bars, caps, and TVS diodes. One of the buss bars had to be trimmed to fit through my current sensor. If there is a rev 2, I'm definitely to do it how most other people do it and just use big copper bars bolted down to the PCB with some conductive paste. It might make mounting the current sensor a little more difficult, but I won't have to hack up buss bars and they'll end up being mechanically stronger. The buss bars were installed in using an ...innovative method. I cranked my soldering iron up to max and heated up the bottom PCB pad while with the other hand held a lighter on the bus bar. I needed the lighter, otherwise I couldn't get enough heat into it to make a good solder joint

IMG_0603.JPG

IMG_0604.JPG

View attachment 5

I've also been doing some preliminary work on the gate driver IC. Everything works as it should between ~30% and ~70% duty cycle, but out of that range I start to see glitching like the driver is cutting out. Scope traces confirm this, but it's not on a regular interval. Above 70% makes sense - the high side is bootstrapped, so it starts to drain the cap faster than it can recharge it. Below 30% is puzzling, I'm hoping that since I don't have any FETs hooked up it's not drawing enough current through my 12V regulator, thus browning out the driver. I'll do more testing with this once I get everything hooked up, I didn't have the low duty cycle issue on the breadboard.

I also connected the current sensor to the logic board and powered it up. After a few minutes of panicking because I thought I had a short in the PCB (VCC to Gnd on the sensor showed a short, but I was in the mega ohm range and it was just drawing power from the multimeter) Everything was connected and a quick program was written for the arduino to spit out the reading. The current sensor outputs a voltage from 1-4V corresponding to -400A to 400A through the sensor. After a little math I came out with a function relating analog reading to current ( f(10 bit analog reading) = current). There was a ~75A offset since the sensor wasn't centered perfectly, but after that I got a reliable 0 reading from the sensor. I won't be able to verify until I hook the controller up to a load.

IMG_0607.JPG

IMG_0609.JPG

IMG_0614.JPG

The next step is to connect all of the gates and the rest of the wires between logic and power boards. Feel free to comment if you see anything out of the ordinary, or have any insight on my gate driver woes.
 
A clean looking job, I did a brush type motor controller years ago before there were chip type gate drivers, my problem was I could not turn the Mosfet off hard enough and the tail left was causing excessive heat to be generated (gate capacitance), I ended up placing the driver transistors close to the Mosfet gate with a ferrite bead to damp the ringing. (Also the chopping frequency was too low) my 2 cents
 
JEB said:
A clean looking job, I did a brush type motor controller years ago before there were chip type gate drivers, my problem was I could not turn the Mosfet off hard enough and the tail left was causing excessive heat to be generated (gate capacitance), I ended up placing the driver transistors close to the Mosfet gate with a ferrite bead to damp the ringing. (Also the chopping frequency was too low) my 2 cents

Thanks for the input! I may order some SMD ferrite beads on my next Digikey order, there is a small enough gap between the gate wire landing pads and the gate pads to fit a small ferrite bead there. My initial idea was to use zeners to clamp any oscillations to 15V, but if that fails the beads are like ~$0.04 each.

I'm making a list of changes for revision 2, and if it happens it will look drastically different. The layout will be completely different, and the gate driver IC will be on the same board as the power stage (to shorten the runs and avoid wires\connectors between logic and power stages).
 
Hooked up the rest of the connections from the logic board to the power stage today. I also added two of the 63V MOSFETs for testing. I hooked a very small motor up to it when everything was connected and... it ran! I kept a close eye on the gate to ground traces (connecting the high side probe ground to the bottom of the high side MOSFET would have shorted it directly to ground, since I was probing the low side as well). All of the low duty cycle funkiness disappeared once everything was hooked up correctly.

I was drawing... mabye an amp or 2 through the small motor, so I hooked up a 1/10th scale RC car as a larger load. Everything looked great up to about 8 amps, where my power supply started to get upset and drop voltage. Success so far!

I added a scope shot below. The gate turn on\off looks pretty good. I don't have a super sharp turn on for either high or low side, so once I have all of the MOSFETs in there I may decrease the resistance a tad. The good news it that these are logic level MOSFETS, meaning they should be on by 5V. In the scope image below you can see that they get to 5V very quickly, I'm driving them to ~10V there. I need to play with the regulators, but I should be getting around 12V. I need Req of ~9 ohms so I don't overload my gate driver (1.4 amps total), right now I'm probably around 10. The new FETs have a 2.1ohm resistor in series on the gate, so those will turn on even slower.

Overall, a very rewarding day. It was a little over a year ago I started learning about how motor controllers worked, now I have a functional controller sitting on my desk :D

Photo 2014-05-10 05.43.24 PM (Medium).jpg

IMG_0620 (Medium).JPG

IMG_0622 (Medium).JPG

 
I was reviewing the scope trace I posted yesterday, and noticed that the low side gate drive has a spike in it exactly when the high side turns on (red is high gate and yellow is low gate):

20131104_445423.JPG

So I adjusted the dead time to see if it was shoot through, or if it followed the high side gate. Turns out it follows the gate, and was not shoot through:

20131104_445509.JPG

This concerns me, since a voltage spike at the gate could cause it to turn on (even partially), and cause shoot through. The magnitude of the spike is ~1.75V normally, with occasional spikes up to 2.75V:

20131104_465728.JPG


Next I compared the M+ bar (between high and low side FETs) to the low side gate, to see if the spike was causing the low FET to conduct and cause shoot through (thus lowering the voltage available to the motor):

20131104_470632.JPG

Low side gate is in yellow, +M is in red. It doesn't look like it's dropping the voltage available to the motor, so it must not be conducting much? The real way to tell would be to have a very fast current sensing probe. Looking closer at the motor versus gate voltage, there is some oscillations in the motor voltage but the frequency doesn't match and the edge is still somewhat sharp:

View attachment 2

Looks like the FETs are switching at 160ns - pretty fast! I went hunting for the source of the spike, so I made my way back from the gate to the driver. The spike was at full magnitude immediately after the gate resistor on the logic board (ruling out the wiring between it and the FET), but dropped to ~0.5V BEFORE the gate resistor... huh? In order for there to be a positive voltage at the gate, across the gate resistor, would mean that current would be flowing OUT of the gate, even after it's off.

Could the driver ground be going negative relative to the source? I checked the source on the low side FET, and the voltage is stable. I also checked the low side ground on the gate driver, and it was the same story as before the gate resistor - ~.5V variation. In fact, I probed everywhere on the gate drive IC, and the only place I see the spike is after the parallel gate resistor. Maybe the resistor is picking up noise from the power stage? That's the only explanation I can think of. Either that, or there is some drain-gate leakage voltage (voltage bumps on the gate when drain to source voltage spikes). If you have any insight, let me know.

I also measured the high side switching times. It's a bit longer at 290ns, which is understandable since it's bootstrapped and has to reach a higher voltage than the low side. It looks like the high side FET turns on fully when the gate reaches ~10V - perfect, since all of the miller plateauing happens after that:

20131104_444702.JPG

20131104_462802.JPG

I'm not sure what to do about the voltage spike on the low side FET gate, so moving forward I'm just going to keep an eye on it. The next step is to finalize all of the mechanical stuff - drill and tap the heatsinks for the FETs and regulators, install final standoffs, and add RF shielding between logic and power stages. I should get a package this week with all of the stuff I'll need, so hopefully by next Saturday I'll have it to the point where I can test it on the cart.

In an unrelated note, the current sensor has a fair amount of drift in it - It should read 2.5V at rest, and it fluctuates around 2.87V. I wonder if it has to do with the supply voltage fluctuating - I grabbed a 0-200k pot for the 5V regulator instead of a 0-10k, which means it's very sensitive to small changes in pot position.
 
Made good progress on the mechanical stuff this week. Drilled and tapped he holes for the MOSFETs, voltage regulators, and added holes for the thermistors and bottom plate. Today I made the bottom plate that all the boards and heatsinks mount to. Aside from barely punching through the heatsinks on the voltage regulator holes, everything went together as planned. I'll fill those with RTV when everything goes together for the final time so water doesn't get in.

On the electrical front I had a pulldown resistor on the high side gate, but instead of going to the source for those FETs (M+ out) I had it going to my logic ground. I corrected that today, and I'm going to try to add pulldown resistors at the gates on the low side and see if it helps the voltage spike when the high gate turns on. I know it's a bandaid, but I'm not sure what's causing it.

Wheels up test tomorrow! Hopefully I'll have a video with no flames in it.

IMG_0642 (Medium).JPG

IMG_0643 (Medium).JPG
 
They say you lean the most from your failures…

Started the day off by cleaning (sanding the oxide layer off) the heatsinks and applying the thermally-conductive-but-electrically-insulated pads. Old FETs were then desoldered and two of the final ones added. the first thing I did was check install a 10k pull down resistor on the low side gate to see if it would help with the voltage spike when the high side turned on:

img_0645-medium.jpg


output_gnuwk9.gif


Nope. Next step was to check the gate rise times with the new FETs. The new FETs are supposed to have 2.1 Ohm resistors built into the gates, so the rise time should be slower:

output_odlohb.gif


Slightly. Which is good, since I liked how fast they were switching without ringing. Since everything checked out, it was time to solder in the remaining FETs:

img_0649-medium.jpg


img_0652-medium.jpg


Looks pretty sweet, right? It was kind of a pain, since I had to install the heatsinks, “tack” solder the gates in to hold them where they were, then take everything apart and finish solder it. Not surprisingly the gate turn switching time increased by quite a bit, since I multiplied the gate capacitance by 6. Below shows the gate, then the M+ out traces. The M+ now has a discernible curvature to it on the rising and falling edges due to the longer switching time:

20131111_502736.jpg


20131111_502959.jpg


I had to increase the dead time to ~3/4 of the pot’s adjustable range, adding quite a bit of dead time. It was interesting to play with the dead time and hear the speed of the motor go up as the dead time went down. Enough testing, let’s move something a little bigger!

img_0654-medium.jpg


img_0655-medium.jpg


I tested the logic side first. The voltage regulators were doing their jobs well, keeping the 5 and 12V busses where they should be. The 5V regulator was getting quite hot, which after doing some mental math, was dissipating 11W of heat. I had a TO-247 heatsink laying around so I slapped it on there and it kept the regulator to a reasonable temp. Hooking up the batteries to the controller was… exciting, to say the least. All of those caps acted like a short for the 1000+ amp voltage source that were the batteries. I got a nice POP as they charged. The final system will have a precharge resistor so I don’t cook the contactor when that happens. Also, next time I hook it up I need to precharge them so I don’t, you know, weld the cable to the controller.

With the power and motor hooked up it was time to test the the controller on something a little more it’s own size. I assumed I had left the ground connected to the logic, and went to connect the logic power. I was greeted with a loud POP and a bright flash as the batteries arced to the logic power…. uhh.

It turns out I hadn’t connected the logic ground, and in doing so there was no current flowing through the regulators. Resistors, which the linear regulators I’m using essentially are, can’t drop a voltage if there isn’t any current. Logic supply voltage must have flown up to 48V, cooked the FET driver, and caused the FETs to momentarily shoot through. I’m pretty sure it cooked my bootstrap diode too, because even after I replaced the driver IC I’m just getting positive supply voltage on the high side gate output. At that point I gave up for the day, and I’m going to take a few days to step back and take a breath.

The arduino survived though, so at least I have that going for me.
 
Back
Top