Sunday, September 12, 2010

Motor Controller Youtube Video

Great success!

I have determined why my mosfets were failing and found a solution.

Thanks to the friendly people over at ecomodder.com.
Permalink to my forum thread: http://ecomodder.com/forum/showthread.php/why-my-homebrew-controller-blowing-mosfets-solved-13805-2.html#post183057

There's a fair bit of detail covering a few weeks of work on the project there. Pretty pictures of my oscilloscope, too.

The reason my mosfets were failing was a large voltage spike on the drain (M- buss bar) causing a high voltage V_DS across the fet. This particular fet (IRLS4030-7PPBF) has a breakdown V_DS (aka V_(BR)DSS) of 100V. Now some sources I have read say this may not kill the fet. Since it seems to be the direct cause, I tend to disagree.

To reiterate, the failure mode is a direct short across drain and source. Once, the gate also shorted to the other two blowing the mosfet driver in turn.

The voltage spike is simply caused by V = L * di/dt. The inductance should be fairly low; the circuit is built with heavy wires and huge buss bars. As it turns out though, you need only a small inductance to generate huge voltages when large currents are involved.

Historically I have been switching 380 amps in 30ns to 50ns, or 12.6A/ns to 7.6A/ns.
I have read that a good buss bar system will have 10nH per inch of bar. Even with just one inch of bar I would get a spike of (12.6A/ns*10nH) = 126V.

To reduce the voltage spike, the answer is simple - reduce dt - by slowing down the mosfet switching.
I put a 100ohm pot between the mosfet driver and the mosfet's gate. Using an oscilloscope to watch the fall time of the drain terminal I could see exactly how fast the mosfet was turning on.
(Turning on the mosfet shorts M- to B- thus powering the motor. This is why the drain terminal falls when the mosfet turns on)
I tuned the pot to get a falltime of 200ns. This gives a di/dt of 1.9A/ns.

It is important to note that I needed to perform this tuning with the starter motor connected! Remember before, turning the controller on with the starter connected would fry the mosfet. I needed to be able to make tiny tiny pulses of power to the motor, so I replaced the microcontroller software with a test program! Instead of outputting PWM to the mosfet, I drove the line high, performed 'x' "nop" opcodes to make a short delay, and drove the line low again, then going to an infinite while loop with the line held low.
This allowed me to pulse the motor, and ensure I was not going to hit a spike high enough to fry the fet.
The initial experiments were only microseconds long, not even enough time for the motor current to be established - preventing me from getting the full brunt of di/dt since the current was too small :)

Eventually I worked my way slowly increasing 'x' for longer pulses of power, all the way to 6 milliseconds. The motor would rotate slightly with this long of a pulse, so I then tried 6ms on, 6ms off, 6ms on again. Long story short, I verified that no pulse would (probably) fry the mosfet, so I reprogrammed my motor controller application to the uC.

Lo and behold, the motor worked first try! At 20% duty cycle the motor begins to turn, and it runs merrily all the way up to full speed at 100%, screaming like a fury :)



At this point I still have only one mosfet installed, which will provide 120A continuous. However the fet is capable of handling much higher currents as long as the duration is short. That's why I'm able to start a motor that draws 380A under locked-rotor conditions (i.e. starting from stationary) When it is turning full speed only draws 70A. The fet would fry and probably explode if I actually locked the rotor before turning the power on. Now I need to add the remaining parts - two mosfets and one diode.

The B+ and M- rails were noticably warmer after running the starter for 30 seconds or so. I'll have to watch for overheating and possibly add forced air :(

Friday, July 9, 2010

Controller Part 6

My apologies for leaving the blog for so long. I've spent some time at the summer cottage with family and might be spending some more.

I have had some minor successes but regular failures with the mosfet in the controller.
I decided to turn to the community for help because I no longer have any ideas on how to proceed.

So far they have been helpful in confirming my suspicions and I'm hoping their expertise will lead me to a solution.

No point in rewriting things in two places, so for now look here for updates:
http://ecomodder.com/forum/showthread.php/why-my-homebrew-controller-blowing-mosfets-13805.html

I will return to the blog once the mosfet problem has been resolved. :)
Catch you on the flipside

Thursday, June 17, 2010

Controller Part 5




Made my #6 cables today and attached the copper pipe terminals I made earlier.






















This is starting to scare me just a little! It's a tiny battery though, as batteries go I guess. . .

Colour scheme: red is positive, black is negative, and white is M-, which is pulled to ground by the mosfet.


Below are the results: two blown mosfet drivers :(

I blew the first one. I replaced it, thinking the driver was the only thing broken.
The driver output looked weird, so I pulled off the connection to the gate lead.
A short time later, it turned cherry red and cracked open.

Thankfully I had moved the e-stop to be the driver's power supply (the wall wart) after the first driver went, and I had to run around the table to shut it off - not fun at all.

Very strange that this driver blew with no real load on it, just picofarads of wire. Perhaps it was weakened by the abuse of driving a shorted mosfet for some time before hand :P


So further troubleshooting shows that there is no resistance between any of the three leads of the mosfet.  Lesson learned: Videotape the oscilloscope, to see what the heck happens!
Since I wasn't watching the scope, I didn't see the failure. The starter motor spun up quickly, then slowed down over several seconds. A few seconds after it stopped turning, the driver let it's smoke out.

Either the inductance of the starter is causing spikes on the drain that are not being absorbed by the freewheeling diode, or my gate input has large spikes which directly fried the gate insulation.

Usually mosfets fail short gate-drain, but I haven't heard of them failing short across all the terminals before!

I graduate tomorrow! Yay! I was hoping to have something useful to show off to my classmates, but such is life.



One last thing: that silver epoxy I used? totally useless. It couldn't even hold the components down, and certainly not maintain an electrical connection. I scraped it off, and soldered the components down with real solder and a blowtorch. Now I get to do it again, to remove the mosfet, sigh.

Wednesday, June 16, 2010

Controller Part 4

I had a busy day today on the project. I made up a single sided PCB to hold my controller capacitors.
3 x 10mF 63V electrolytic capacitors. Quite a bit of capacitance for such a small volume.
3 x 4.7uF 200V metallized polypropylene capacitors, with a low ESR and more importantly a high ripple current rating. One of the three is not installed, it's on my driver board for the moment (see a previous entry).
Making the traces for this board was a huge pain. I don't have PCB etchant, or PCB tinning solution. I tried cutting out traces with a box cutter, but they didn't peel off the PCB well, and heating the thin strip with an iron didn't release the strip as nicely as it does to small pads (when you don't want it to!)
So I resorted to using a small grinding wheel in the drill press. I then tried tinning the board with my iron. Even my trusty Weller isn't up to soldering pads this big.. so I used a blow torch. This board can't repel firepower of that magnitude!  (hehe Admiral Ackbar)
Flux for copper pipes worked well in allowing the solder to flow, I got all sorts of nasty fingerprints on this board that not even alcohol could remove. (the triple distilled kind, not the isopropyl kind lol)
And as you can see in the first picture I tinned the buss bars as well. Just the top where the components will be mounted. I used a *lot* of propane today.


Today I also used my "silver epoxy" to mount one diode and one mosfet to the buss bars. That epoxy is remarkably hard to work with, it does not flow - at all. Nasty looking joints but they should be solid. The capacitor PCB is also epoxied to the buss bars, though that looks respectable.


The kapton tape is under the Gate lead (there are 5 source leads) and I wired that to the mosfet driver from before. The 'scope trace is below.


10ns rise and fall times with this mosfet is pretty respectable, I was expecting a lot more. And this is with haphazardly strung wires that are waay too long.

Rehashing my dV/dt calculation from before, we have 12V rise in 10 billionths of a second.
12/10 billionths = 1.2 billion volts per second (1,200,000,000 V/s)
I recently realized that I lost a few zeroes last time, whoops!



Testing:

Safety note: When you have large capacitors in a circuit like this controller, you have to remember that it now poses a safety risk even when unplugged from the power source. Currently this is 12V, so it is totally safe. Even with wet fingers it's not going to do much to you. In the end it will be a 48V controller, which is apparently still safe to touch (according to a random person in telecom I read on the internet - take with a grain of salt). But if you are working on a 60V+ system, it is a recipe for death.

I precharged the controller with some wire wound resistors I bought for the 48V system.
3 x 125 ohm 13W resistors. So in parallel, that's 41.2 ohms, 39W.
Power dissipation at 48V is V^2 / R or 48*48/41.2 = 55.9W
Yes, they are undersized, but this is a very intermittent load. I could have gotten away with a smaller wattage rating but I've read a great way to test is running your motor with the precharge resistors *not* bypassed as you would in typical use. This limits the maximum current to a sane value. They may be too small to work in this application, we shall see.


So I attached the small test motor to the buss bars, and it worked first try! yay!
One thing I noticed immediately was that the motor squealed much more than with the junky mosfet. I am still not sure why. I've changed from Phase Correct PWM , 10 bit to the 8 bit equivalent. So I have 256 duty cycle options now, at 16kHz (rather than 1024 at 4kHz). I can still hear it, but it is extremely faint.

The best news so far: The copper buss bars haven't heated up at all (that my fingers are capable of resolving, anyways).

To do:
Interface current sensor
Make leads for the starter motor and battery
Speed control a starter motor!!!!!

Friday, June 11, 2010

Controller Part 3




Here's a mockup of my controller layout. In all these pictures I only have 1 transistor unpackaged since I don't want to ESD damage them! A quarter shown is for scale. The blue box on the buss bar is the LEM current sensor (hall effect).

And here is the real thing, mounted with 5/16" bolts near the cable attachment points and a pair of 3/16" bolts at the far end. My copper was too short so I kept extra space by using smaller bolts :P


I've left the bolts longer than necessary until I pin down the final arrangement. Measure a thousand times, cut once!



Here it is with components placed for reference. Note only one diode's leads are bent correctly. From another angle:



So the biggest problem I see is one of heat dissipation, apparently copper is very bad at it. I didn't really grasp that until I felt >100°C copper. Very cool with your hand nearby, very painful to actually touch. So these heat sinks I have may be invaluable. Instead of the placement in the picture, I am debating putting them between the copper and acrylic, then making slits in the acrylic to place an 80mm fan underneath to help dissipate heat. Perhaps I should buy other heatsinks, these are slightly too tall to fit, and would require a lot of bending. Anyways I plan on testing it out, seeing how hot the bars get, and going from there.


Next steps:

1. Epoxy one diode and one mosfet to the bars, after using copper pipe flux to clean them.
2. Mount a capacitor bank. This will ride a piece of copper clad, extending out from the 3/16" bolts, mechanically connected to all three bars (electrically only between the outer two).
3. Connect the driver circuit to the mosfet and test with the tiny motor.

Shopping on the cheap

Today my Dad and I went to an old place that him and his dad went 20 years ago.
Called Triple-M Services
http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=triple+m+near+canfield+ontario&sll=41.504464,-81.070862&sspn=1.308199,2.158813&ie=UTF8&hq=triple+m&hnear=Canfield,+Haldimand-Norfolk+Regional+Municipality,+Ontario,+Canada&ll=42.994949,-79.759369&spn=0.019963,0.050082&z=15&iwloc=A
it's a scrap yard for all sorts of interesting things. Lots of big stuff (2000 pounds and up) and small stuff too. 20 acres of scrap; everything under the sun.

In the end,  I didn't walk away with very much. What I did get though was a very good deal.


Yes ladies and gentlemen, that is 3/0 gauge cable, aka 000. Tables of ampacity indicate this stuff is rated for 260A continuous. My motor is only 80A continuous, so I'm well in the clear.

This was my other great steal! It's from an industrial panel, manufactured by AB. Looks like a DPDT switch though I haven't verified that with my meter. Yay safety! Still need a contactor to make the e-stop useful, but I needed it anyways.


Now you ask, what did this heavy cable and handsome e-stop cost?
Twenty five dollars. I nearly fell over! I'd have paid $40 to this guy without blinking. 

Maybe I don't know what reasonable prices are?? Anyways, I was happy with the deal :) 

Readers: Where do you get your surplus supplies?