Sunday, July 26, 2009

Silence of the Cows

I was just thinking about how boring it would be to have a website that just exhibits a bunch of working projects, no matter how cool those projects are. Not very many of my projects make it to a working state in one shot, but one that came frighteningly close is my 3-phase motor controller. Version 0.0 was built as a term project for 6.690/6.061 (Intro. to Electric Power Systems). It was built in a week and worked with no problems on a small (200W is small around these parts...) induction motor, running a simple V/f control. I commented then that it was only a matter of time before it got scaled up...

So I made it smaller. Scaling up doesn't always mean it has to be bigger. What I call v1.0 is just a tad over 80mm x 100mm x 40mm. (This is the maximum board size in the free version of Eagle...) It's got six IRFreakingBig3207 MOSFETs on board right underneath a tiny (60mm x 10mm) but strong fan. As usual, I have already gotten my fingers owned by said fan. The heat sinks are not that great, just slivers of aluminum soldered to the circuit board. (Yes, you can solder aluminum.) But based on my previous experience with these FETs, I sort-of expected that they could do the job.

The job.

The job, by the way, is full torque control of a brushless DC motor built into the hub of a Razor scooter wheel, a la Charles Guan. It's the Summer Engineering Workshop '09 project, which means two things: 1) It will be cool. and 2) I will spend a lot of time making electronics for it. Sigh. Although unlike last year, we could actually buy a controller that does exactly what we want. Granted, this is pretty much the only one in existence and the manual refers to a color called "Reddle", which I suspect probably means orange, but it is still cheaper than making one. But when has that ever stopped me?

But wait, what about all those tiny RC plane controllers that can handle 100A? Well, first of all there aren't many that can run higher than 24V, and with these insane neodymium magnets the backEMF is going to be huge. But more importantly, they are not torque controlled. You set the throttle and they adjust the PWM to give you a proportion of the full voltage. This works fine for airplane propellors, which see increasing torque with increasing speed in a nice drag-based relationship. Electric vehicles, on the other hand, see max torque when they are sitting still. This means no forced-air cooling of the controller, and quite possibly if it is completely stalled two phases will take all of the load, so the current ratings would be much lower.

The key to torque control is the ability to measure and control current, which means putting a current sensor on the controller. In fact, it should mean putting TWO current sensors on the controller, since only two of three phases are active at any given time and you need at least two sensors to be guaranteed a measurement of an active phase. I manage with only one. I wish I could say it was clever design that allowed this, but instead it was just stupidity. I put the current sensor on the DC link...before the power gets inverted and sent to the motor.


So there is mistake #1. I'm glad there was at least one...because otherwise I'd just have to write about how it works. The fix for mistake #1 is somewhat of a hack. In software, I can estimate the current going to the motor based on the PWM and the DC link current. There is a horrible divide-by-zero condition inherent in this, though. (Imagine the motor is spinning full speed and then the PWM goes to zero, shorting all the phases together.) So, something to think about for v2.0 is repositioning the current sensors to a place that makes sense.

But does that mean that v1.0 actually works without any wire hacks, any desoldering, any exploded FETs, any melted Zener diodes?! I think I would actually be sad if it did. Only load testing can tell. At 20A, no problems:

Even on a huge Etek motor, it effectively regulates the current in both directions. (Yes, it can do controlled regenerative braking.) This is actually a great demonstration of the torque control, because if you hooked up an RC controller to an Etek and went full throttle, there's a good chance it wouldn't survive, since it would apply the full voltage regardless of the N-hundred amps the Etek wants to draw. And 20A is about what we can put through the scooter motor before the windings start to heat up too much. But come on! I need to at least be competitive with the Kelly controller current ratings. Bring on the CIM-battle load test:

Mmmmm...ex-FIRST equipment.

These are wonderful 1/2-horsepower CIM motors from an old FIRST Robotics kit, in a nice cast-aluminum gearbox. They are meant to turn with each other for double the torque, but I prefer to make them fight each other by hooking red to black, black to red, and driving them with a single phase of the 3ph controller. If a single phase can handle the load, three phases sharing it should have no problem. So this should make a great worst-case scenario test. Let's try 50A!

Uh oh! At anything above 30A, it seems the controller has a tendency to produce a sound that I can only describe as "mooing." Yes, like a cow. It still works, but some low-frequency noise is coming in somewhere that makes the motors sound like they are ready to be milked. I originally thought it was some digital instability introduced by my current sensor hack, but after changing the gains and seeing no difference, I concluded that it was a real hardware problem! Hooray! There is something wrong with the design that isn't just a "no big deal I'll fix it in version 2.0." I actually get to troubleshoot something significant and fix it!

Well, that was easy. The 15V DC/DC converter which powers...everything on the board...needs an input capacitor closer to its...input. I thought the main caps would be sufficient but since they are on the opposite side of the high-side bus bar, all their effort goes into keeping the MOSFETs happy and they can't really help the DC/DC all that much. In power electronics, where you put things is almost more important than what you put. I should probably know that by now. But at least I have something to write about now.

The rest of the load testing went as expected. 50A for 60 seconds no problem. 75A for 45 seconds and then a shower of sparks as the heat sink melted through the high side input line which happened to be resting on it.

Not good.

A repeat of the 75A test almost made it to 60 seeconds, but then the MOSFETs started desoldering themselves. (They do that before they fail...amazingly.) So that's about the upper limit...for one phase. Call it 100A peak, 65A for one minute, 40A continuous. (I just made that up.) With all three phases running, I suspect this goes up at least by a factor of 1.5 or 2. Although at that point our scooter motor would be quite destroyed and our batteries would be dead.

So, the mooing has stopped, the controller works, and things look good for motor testing in the next week or so. But it wasn't easy. It shouldn't be. I hope it never is. Here is the v1.0 schematic and design files for anyone who might find it useful.

Wednesday, July 1, 2009

The epic journey of the spinning disks of doom.

Well, maybe not epic, but at least humorous. The spinning disks of doom were five "steel" plates I ordered from Big Blue Saw because they were cheaper than material + machining time at MIT even though we have six abrasive waterjets. Go figure. I say "steel" because the first set I got was aluminum. I had actually figured out this mistake before they arrived because the shipping weight was off by exactly the ratio of densities. Anyway, I eventually got the steel plates and installed them for motor testing:


This was an incredibly bad idea. 55lbs of steel dangling off the edge of a motor shaft with no other bearings and no enclosure is a disaster waiting to happen. It happened to be very well balanced due to the fact that the waterjet cuts the ID and OD at the same time, and it ran very quietly, but NO NO NO DO NOT DO IT. It stores as much energy as 500 lbs moving at 40mph. This makeshift inertial dynamometer provided some invaluable testing data for the kart regen system, and then I decided it must be destroyed. It was the most dangerous thing I've ever built, and I decided this while standing next to a 110F ultracapacitor on an electric go-kart...

So where do flywheels go to die? When I got involved with the MIT Electric Vehicle Team outreach project, they were looking to make a tabletop demonstration of regenerative braking. Sounds familiar. Turns out they had enough time to do it the right way...bearings, hubs, enclosure, etc. It was also much smaller...8" instead of 14" diameter disks. So, I gave them the plates and they produced a mini-flywheel out of the insides:

Much more sane.

So that takes care of the donut holes, but then what do you do with a bunch of 1/4" steel donuts? Pretty useless, right? Not if you believe in conservation of usefulness. After looking around for a microwave transformer or something to smooth out some extremely high battery charging current, also for an EVT project, I remembered these donuts. Toroidal inductor core!

Also surprisingly less dangerous than the previous usage.

Yes, I know this is not a great inductor, as a lot of field is wasted in the excessively-large steel ring. But according to some maths it is >200uH, which is good enough for the job. The job, btw, is insane-charging a motorcycle Li-Ion battery pack. (4-6C charge rates.) This will smooth out the 100A charge to about a 5A or 10A ripple current. Hopefully...

In any case, the spinning disks of doom have found new homes.