Sunday, October 25, 2009

Updates: 3ph Duo and Epic Axial Motor

Being midway through the fall semester means starting to make preparations for 2.007, the annual MIT MechE robotics class/contest that happens in the spring term. While this involves a lot of manual labor in the form of building the contest tables, I can't actually show any pictures of that because it would give away the game. Besides the woodwork, there are also some more boring but necessary tasks to be done, such as testing new batteries:

What? Don't give me that look.

I'm not a very good multitasker, but if one of the tasks is watching a battery heat up a cup of water, I can do it. So here are some project updates and pictures in the meantime:

The 3ph Duo controller, the latest in my line of increasingly functional motor controllers, is finished. As in done, built, tested, working as planned. Here are a few pictures from the assembly, which, though not perfect, went pretty well:

The IXYS GWM 100-01X1, a wonderful 100V, "90A" three-phase MOSFET bridge package, was the key to this new controller, enabling two-channel, 1kW per channel BLDC control in a small form factor. Unfortunately, they only seem to be available from one place (Arrow) and only in the straight lead "-SL" version. This required some interesting bending, cutting, forcing, and soldering to get the chip to fit on my new circuit board:

It's not quite through-hole. Consider it...semi-surface mount. Same goes for the current sensors, which are designed to be through-hole but have their leads cut to length so they can sit flush with the sensor opposite the IXYS package. Not the cleanest assembly procedure ever, but it works. The IXYS package heat tab gets thermal pasted to a heat sink, and 5mm plastic stand-offs set the height correctly.

All of the other IC components (HCPL-3120 optocoupled gate drivers, DCP021212 isolated high-side power supplies, LM2575 switching regulator, MC7805 linear regulator, OPA2340 R2R op-amps, and 74HC04 hex inverter) are now surface mount. The capacitors are still through-hole because I hate surface mount caps. But at least they are in the right place now.

The bus bar / heat sinks are gone and instead the power wires get soldered directly to surface-mount-style pads the board. This is something I saw in another ultra-thin controller. The signal connectors are still the same (Molex 0.1" R/A keyed).

These are all mostly form factor changes, but there were a few significant functional improvements as well. First, both motors now run on a single MSP430 microcontroller. Turns out this 16-bit, 16MHz chip can output enough PWMs on enough pins to pull this off. It processes twice the number of hall-effect interrupts as before, but some testing shows that even with two motors, the main loop execution breaks down at 1.6 million electrical RPM (228,000 mechanical RPM, or Mach 4.5, for the scooter). Basically, it makes the Arduino look silly.

Second, the current sensors now sense phase current, through a convoluted single-sensor synchronous measurement method that I wish I had never thought of. (It is a real pain to code, and is relatively noisy compared to sensing DC-link current, but at least it is a direct measure of actual motor current.) The current data looks a little noisy (about +/-4A noise on top of a 20A signal), so I've been working on software filtering mostly to clean it up even more for analysis, but the actual torque control feels smooth enough. The other data acquisition functions (all wireless) work great. Here's a cool test of the different motor constants measured cleanly at no-load:

This definitely shows the difference between the front motor (blue) with 60 windings per phase and the rear motor (green) with 90 windings per phase. Other interesting things I've done with the data acquisition: measured motor resistance (0.275-Ohm front, 0.355-Ohm rear) measured battery internal resistance (~0.075-Ohm for a 10S2P A123 26650 pack), measured top speed (~18mph), tested PI control of current (not very much benefit).

Oh, and most importantly, it fits in the deck:

So there. Everyone who asked why the original version was so big can be quiet now. I will be testing and writing this controller up very thoroughly, since it's in a state now to which few of my projects ever get. I'm not sure how useful it will be, since there is still a lot of "custom" in it, especially on the microcontroller side, but hopefully people find the bits and pieces useful at least. Somebody can design an Arduino adaptor for the power stage... For now, here is a link to the schematic, board files, source code, and other random bits and pieces for anyone who is interested.

Next up, the Epic Axial Motor. This is the beast. Although just 4" wide and 9" diameter, it will produce multiple tens of kW. I'd estimate it at around one horsepower per pound, minimum. Well, the simulation says so anyway.


But I don't know, I don't really trust simulations yet. Although it did very well for the scooter motors. The goal here is to build the motor in stages, testing along the way to double-check or refine the simulation. The axial-flux design with two rotors and separable tapered roller bearings lends itself to "easy" assembly and disassembly for prototyping. "Easy" if you can safely accommodate for the 500 lbs or so of finger-nomming axial force. So anyway it's time to build.

Yes, I actually went into the machine shop and fabricated a metal part. Aren't you proud of me? I've been doing EE-type projects for so long that I forgot what it's like to go home with aluminum shaving in my hair. What's that? There are waterjet-cut parts in the background? Nonsense. I made those by hand. Okay fine, I got those from Big Blue Saw, which now has a low-taper waterjet! As for the rotor, Mike "Master of the EZ-Trak" Nawrot is going to produce the spinning magnets of doom. (It would take me a month...)

After that, it's on to winding a test set of stator segments. And by winding, I really mean folding, or something, since we are using concentric layers of 15-mil copper shim stock for massive current-carrying capability. I'm actually fairly excited to see how this works. It could have significant advantages over large-gauge magnet wire...or it could be a total failure. We'll see.

Next week = SMMA Fall Technical Conference in Chicago where I get to meet the pros.

Sunday, October 18, 2009

Last-In, First-Out: Charger / Balancer

I normally don't wrap-up projects in reverse order from when I start them, but the charger/balancer is going to be an exception for a few reasons. One: It works okay as-designed, since it's really simple. Two: It is still annoying to use and in all honestly I probably won't.

The point was to solve two problems with charging a medium-sized lithium iron phosphate battery pack. The biggest problem is the lack of small, inexpensive constant-current/constant-voltage power supplies that also plug into the wall. (Think laptop adapter size.) Thanks to the wonderfully cheap Meanwell PLC-series LED supplies, this was easy to solve. I got a 100W version, which can put out 2.65A (regulated to this current at anywhere from 30-36V), or about 0.6C for my battery pack. This means a < 2-hour charge, which is pretty good for a very portable charger that plugs straight into the wall. There's just one small problem:

Why are my ears ringing at night?

For whatever reason (cheap electronics) the Meanwell LED supply goes into a very noisy switching routine in constant-current mode, and the frequency of switching happens to be about 1,700Hz. Fun fact: The human ear is most sensitive to frequencies around 2kHz and three times more sensitive to this frequency than to middle C (262Hz). Basically, if I wanted to torture someone with a particular tone, this would be it. The good news is that you can tell when it switches over to constant-voltage mode, because the 1,700Hz fades away leaving only a faint and relatively pleasant high-frequency voltage regulation circuit.

The second part of this project was the balancer. The balancer was a very cool idea. It used the LTC-1440, a comparator with a built in voltage reference, to detect overvoltage and trigger a power draining transistor. Said power transistors were 44H11s, which are very solid NPN transistors with h of well over 100. The base circuit is described in more detail in my last post. And, well, it works just fine:

What would I do without MATLAB?

The current starts to flow through the transistor at about 3.55V and reaches a peak value (set by a resistor) at about 3.60V. The peak value in this case was set to just about 2.2A, which is what the Meanwell supply was to be set to. At such a current, the transitor would be required to dissipaye 2.2A*3.6V=7.9W. That's a lot, but not unreasonable with a heat sink and fan:

Baby heat sinks.

The boards stack nicely and a modestly powerful 120mm case fan blows air across them. Tested at 2.2A for over 30 minutes, the steady-state temperature of the transistor's tab settled at about 55ºC. That suggests it could be pushed a bit harder, probably all the way to the 2.65A limit on the Meanwell supply. This would just require changing the 220-ohm base resistor to something a bit smaller.

So what's the problem? (There must be one.) Well for one, something is killing the LTC-1440s. My best guess is it's the fan or the 12V switching regulator that powers the fan, or some combination of the two. With the fan disconnected or running from a separate 12V supply, the problem does not present itself, even after multiple connect-disconnect cycles. The symptoms are: only the circuits connected to the top three or bottom two cells fail, and they stop producing a reference voltage or an output after some small number of connect-disconnects. Could be momentary overvoltage, made possible somehow by the switching regulator connected across the whole cell stack and depending on which side (high or low) makes contact first.

I really don't know. Normally that would bother me, but as I was testing this thing I realized that I also don't care. The biggest problem is that it's too damn big. The whole portability aspect is gone, and forget about taking it through an airport (or out in public in Boston) with all the circuitry and wires. Not much I can do about that...a cell balancer needs as many wires as there are cells (plus one). And the transistors definitely need heat sinks and a fan to balance at any reasonable current. So forget it! For now anyway, I can live without it.

"But how do you keep the cells balanced?" I don't. Every once in a while I might drain or charge ones that are way off with a power supply.

"But how do you keep the cells from overcharging?" I feel like if I explain the method, somebody will try it and blow up their cells... It involves setting the charger CV so that, worst-case, no single cell can exceed a certain voltage. For example, if the pack is at 33.50V, and the highest cell is at 3.37V (measured), I set the charger to 33.50 + (4.20V - 3.37V) = 34.33V. This is more than enough voltage overhead to put it into CC mode, where it sits happily for a long time before I have to readjust the CV based on a new worst-case measurement. If none of that made sense to you, you should probably invest in a user-friendly charger/balancer. :)

Anyway, back to other things:

Going to the SMMA 2009 Fall Technical Conference in two weeks. Mildly frightening, but I am looking forward to the immersive motor experience. Definitely a post in the works after that.

The 3ph Duo controller is DONE and WORKING and I am starting the long process of writing it up. An extensive post will follow.

The Epic Axial Motor progress.

Thursday, October 1, 2009

What's Next: Charger / Balancer

Not ideal.

Charging LiXX batteries is an annoying, time-consuming process and can easily result in a dead battery pack, or in the case of Lithium Polymer batteries, massive destruction. There are two main problems:
  1. They need a constant-current, constant-voltage (CC/CV) supply. You can't just hook them up to an AC adaptor or a variable-voltage power supply. The internal resistance is so low that even a small difference in voltage between the supply and the pack will cause a large current to flow.
  2. Cells need to be protected from overcharging on an individual basis. Unlike lead-acid, they will not self-balance and are not tolerant of temporary overcharing. The voltage of every cell should be kept below a certain value at all times.
There are plenty of solutions to Problem 1. Most lead-acid battery chargers have a CC/CV strategy of some sort. Unfortunately, they only make them in increments of 12V (14V cutoff). So for my target application of a 33V pack with a 36V cutoff, I'm out of luck.

The more expensive option is an adjustable charger such as the Astroflight 109. This is basically a lab-style power supply in a small package. It will automatically monitor and adjust voltage and current, taking whichever hits a limit first as its operating point. So for a fully dischaged, 30V pack, it may only need to put out 31-32V to supply 5A. But as the pack voltage rises, it will adjust its own voltage to maintain 5A until the upper limit of 36V is reached. Fancy. But it also has problems. The biggest of which is that it runs on a 12V supply with no provisions for plugging into the wall. So for $120, you still need an AC adaptor. And it still doesn't do balancing.

Under ordinary circumstances this frustrating lack of good options would be the cue for me to build something from scratch. One idea I had was to use a Dell notebook adaptor as the front-end, since I carry one (or two) of those around on a regular basis anyway. But that still means I would have the build the CC/CV stage AND the balancer. And I don't want to make a big project out of this...I just need something convenient. So I started looking for hybrid off-the-shelf/custom solution and stubled upon this:

It means well.

The Mean Well PLC-100 is a 100W power supply module "suitable for LED lighting and moving sign applications." Clearly, exactly what you need for charging batteries... But actually LED drivers tend to be current-controlled devices, and in fact this power supply does have a constant-current output from 75% to 100% of its voltage rating. So the 36V version can provide a stable, adjustable current of about 2-2.65A from 27-36V. Perfect for a 33V battery pack, which should rarely drop below 27V anyway. 100W will charge the pack in under two hours. The cut-off voltage is also adjustable to between 85-100% of the rating. So the 36V version can be adjusted from 30.6-36V. For different-sized packs, there are versions for 12, 15, 20, 24, 27, 36, and 48V, all with a similar 85-100% trim range.

That takes care of the front-end supply. Now all that's left is the monitoring and balancing part. It would be excellent if this part didn't require a microcontroller or any programming. It would be even more excellent if each cell had its own, independent, floating circuit that handled balancing. Turns out this isn't actually that hard:

The monomer, if you will. (Click for a clearer picture.)

This circuit runs entirely off the voltage of a single battery cell. The core is a voltage comparator, the LTC1440, which has a built-in 1.182V reference and optional hysteresis setting (not used in the circuit above). The comparator check the voltage of the cell, through a 1% resistor divider. When the cell voltage reaches 3.6, it will turn on its output. The output drives an indicator LED and a transistor which bleeds away power. If the transistor can bleed away more current than the charger can supply, it can even be used to balance and the end of a charge. In this case, that would mean a transistor that can sink 3.6V*2A=7.2W. That's a pretty beefy heat sink, but not unheard of.

The boards will look something like this:

Don't ask why it only has five cells.

You can chain them together indefinitely, or use only a fraction of a board. No programming. No extra power supplies. Very simple.

When combined with the Meanwell front-end, the whole thing will be small enough to fit in a backpack and comparable in price to a Li+ charger/balancer/AC adapter combo. I'm doing it more for the convenience of not having to look around for power supplies, but I never can pass up the opportunity to use things for other-than-their-intended purposes.