Monday, March 29, 2010

FOC/mSCR PPT FTW

Now that it's been running for a few months (not continuously O_o) and seems to work with at least four different motors (scooter, scooter, LEAF, RC car), I'm more confident in pitching the simplified/streamlined field-oriented control setup at work in the 3ph Duo controller. But I totally understand that very few people will want to read the poorly-written, incomplete-and-yet-overly-detailed 78-page draft documentation for the controller itself.

For a quick intro, you can check out these two posts:
3ph Duo Wrap-Up Part 1: Field Oriented
3ph Duo Wrap-Up Part 2: Control

Recently, I consolidated the important part, plus some new data, into a set of much more palatable PowerPoint slides (a la Balance Filter) which I'm hoping will find their way through the internet and into the hands of some motor control-types who would rather see the big picture than a detailed discussion of one particular implementation. It covers field-oriented control in general, the "standard" method, called the synchronous current regulator, and some modifications to the standard method that make it possible to run with Hall-effect sensored motors and on relatively slow fixed-point processors. It doesn't go into any detail on the software, just lays out enough that a competent embedded controls person could probably pull it off on an Arduino or something.

Consider that a challenge.

Friday, March 19, 2010

Pirate Radio Control

I have a new favorite thing ever:


The string of unbelievably nice weather (following four days of hostile rain) motivated me to take the pile of parts that had accumulated on my desk all winter and finish turning it into a brushless-powered RC car. Now the original car (a Team Associated TC4 RTR) was already pretty good, and a lot of fun to drive. But I wanted to add some of my own style to it. Here's the outline:
  • Switch the brushed, 7.2V motor out for a brushless 14.8V motor.
  • Add a 19.8V LiFePO4 battery.
  • Add my own brushless controller and 2.4GHz RC system.
Like many of my projects, it starts with the motor. The original (brushed) motor was actually not that bad. (I characterized it in this post.) But I just had to put a brushless motor in it. I just didn't want to spend the $50-$100 that seems to be the going rate for even sensorless brushless RC car motors. So I went to one of my new favorite sites, Hobby King, and found the cheapest motor I could find. For $16, minus my $3 store credit, I got a "High Performance" BL540ST sensored motor with 13.5 turns, 3150Kv. Sensored. For $13.

I love this motor. Sure, it doesn't quite fit in the motor mount that came with the car, but that's what we have machine tools for:

Operation 1: Carefully turn down bearing cap and...oh crap it broke off.

Operation B: Luckily the bearing itself is 0.500" so it fits
 in the largest bore you could possibly make in the motor mounting
block anyway. Mounting block becomes new bearing cap. Win.

Machining disaster aside, the motor fits nicely into the existing mounting structure and, when combined with comically-oversized wire, looks pretty intimidating in-system. In addition to having a much lower resistance than the brushed motor, this motor is rated for 4S LiPo (14.8V) operation. So I'll go ahead and run it with 6S A123 (19.8V). What? It'll be fine.

The new battery pack, which you can see in the image at the top of this post, is rated for 70A continuous discharge. (That's 1,386W available...) Since I don't expect to ever need that much, I have a 30A fuse on the whole thing right now. I chose to run 19.8V instead of 13.2V or 16.5V for a couple of reasons. One, my controller won't even turn on with anything less than 18V. Two, I think the motor Kv is actually lower than it says (which I argue is a good thing). I'll also be running sinusoidal control. These both mean less speed per Volt of battery, so to make up for it I'm using a higher voltage.

The controller is the 3ph Duo, except with just one side built (so, 3ph Uno?). But it's still got all the bells and whistles of the Duo, including field-oriented sinusoidal control, current (torque) limiting, and built-in two-way 2.4GHz digital radio communication, courtesy of XBees. The Duo was designed for a 33V/20A motor (two, actually). This system is lower voltage, but potentially higher current. So, I made some modifications:


Specifically, the traces got some reinforcement, the capacitors have more capacitance, and the current sensors have been bypassed by an equivalent resistor to effectively halve their gain. I also used a different IXYS six-FET module, this one rated at 40V/180A instead of 100V/90A as in the original design. As it turns out, none of this was probably necessary because the car spins its wheels at 20A anyway. But...overkill isn't necessarily a bad thing.

Just a few more modifications to make! An antenna mount:

Can't screw that up.

And finally I need to make a heat sink / controller mount. Oh wait, I found this random block of aluminum that happens to already by exactly the right size. It even has a relief for the sensor wires in exactly the right place:

See how well it fits?
This never happens.

A bit of programming later, and I have an RC car again. Time to take it for a test drive at my favorite RC test drive site: the top of the MIT North Garage:

It's absurdly nice out and there's something about an empty parking garage roof that makes me happy inside. However, the North Garage also offers one of the most shocking opportunities for epic RC fail:

See the ledge there? Yeah, the one with no railing at the ground?

 This is what's on the other side.

But luckily the RC system works reliably and the XBee radios get plenty of range with the nice antennas. Using the built-in data acquisition system, I was able to record a top speed of 35mph on the garage. I'd like to say that was limited by my fear of driving off the side, but based on the data I think that is very close to the top speed with this setup. (I would guess 37-40mph.) It's not power-limited, though, so I can tweak either the gear ratio or the motor timing to go even faster. As for the acceleration, it goes 0-30mph in 3 seconds:


The motor current is set conservatively to 20A now. (It's current/torque controlled, so it has a very nice TCS/launch control feel to it.) But for utter minimum 0-whatever time, I could definitely afford to up the current a bit. After 15 minutes of driving with the current settings, I would call the motor "warm" and the controller "not even a little warm." I am very pleased with all the components and how well they work together. Things aren't supposed to work this well.

(Edit: With the motor current set to 27A, it now does 0-30mph in 2.2 seconds...)

Lastly, some video! The garage video is a bit boring so I clipped in some messing around at street level as well. If it looks like fun...it is.



Tuesday, March 16, 2010

LEAF Motor: Spin-Up

The Less Epic Axial Flux motor, a thought exercise a bit over five weeks ago, is now a spinning physical prototype. (Okay, I cheated a little since the rotor disks were already made for the original Epic Axial Flux motor.) Most of what remained to be fabricated was the new coreless stator. Although the entire motor did get a bit of a redesign. Here is the exploded view of the latest design:

Click for full-res.

And, the collapsed version:

  Click for full-res.

The only new thing since last post is the "outrunner outrigger." It connects the mounting structure to one side of the motor shaft, which is not rotating. This completes a structural loop, giving the shaft more stiffness than if it were just connected to the central stator structure. The extra weight it adds is offset by the ability to take significantly more abuse from the chain load on that side of the rotor. This is a minor design change, though. What about the windings?

There's the first six, done in about three hours.

Compared to the ones in the scooter motors, these windings are a breeze to make, for a number of reasons. First, the flat magnet wire is absolutely wonderful. It packs nicely and stays where you put it. But, it only really works because I can remove individual winding inserts and wind in free space. This means instead of looping wire through slots, I simply spin the entire insert, spooling wire onto it under tension. It's not trivial, but it's not very hard either. I would place that in the "win" category for this motor.

All the windings, a two-day job.

With all 12 windings in place, and plenty of room in the center of the stator for interconnections, the job is easily finished. I decided to connect all four winding sets (12 divided by 3-phase) in parallel, and to wire the parallel sets in delta. This will give the lowest-voltage, highest-current motor possible with these windings. Before you yell at me for that being the most inefficient configuration: To first order, it can produce the same power per unit dissipation in the copper. And even in this lowest-voltage configuration, the motor still takes about 50V to get to 3,000RPM. When I get a controller that can handle more than 48V, I'll re-wire it. For now, I'm eager to get on with testing, so I put it together:

Kit Bot FTW. I'll replace the outrigger later.

It's not set up for sensored control yet, so I needed to borrow a high-current sensorless controller. Luckily, I know exactly where to find one. Cold Arbor, a combat robot with a brushless cold saw, happens to live nearby and also happened to have pre-cut and stripped wires courtesy of a particularly violent match. So, with a kick-start to get the sensorless controller going, it spins up:


This test went to 1,500rpm. (Not 3,000 as the tachometer seems to say.) That's at 22V using BLDC (square wave) control. This falls right into the expected range for the delta-wound, 40-turn, 4-in-parallel winding set. It seems to draw a good deal of no-load current at this speed (15A). I think it's too early to say whether this is a function of circulating current in the delta winding, eddy currents, bearing losses (and in what proportions). The next step will be to set it up on my sinusoidal controller with rotor position sensors and see how it fares then. Since this is the target control scheme anyway, I will defer judgment for now and move on to smaller and better things...

Thursday, March 4, 2010

LEAF Motor: Assembly Box of Doom + Back EMF

If you're just tuning in, the LEAF (Less Epic Axial Flux) Motor is the end result of a long and unnecessarily complicated process that started when I decided I would buy a set of 16 neodymium iron boron wedge magnets for $74, figuring I would make a motor out of them some day.

Well now I have two sets of 16 magnets, and I want to put them together with less than 3/4" between them. This translates to roughly 500lbs of force trying to smash them, and anything between them, together. This calls for the fabrication of a very strong box from which to make a giant motor puller. Here's the bottom of the box:


It's only purpose in this world is to hold the lower rotor disk securely. The top of the box is much more interesting:


This is the "puller," with three 5/16"-18 threaded rods that screw into the top rotor hub. The rods in tension do the work of lifting or holding against the axial force, sending it to the side of the box in compression. All together, it looks something like this:


The motor puller box is designed with about a 3x safety factor on all the forces, but along with the box, there are some rules. Rule Number One is never put appendages between the disks. They are always separated by the puller and then the entire top of the box is removed by lifting from the sides before any work is done on either disk. Rule Number Two: whenever the disks are separated, a block of wood between them acts as a failsafe in case the box or rotor disk breaks.


So that takes care of one of the things over which I was losing sleep. The other, winding, turns out to be not that hard at all with the flat magnet wire I picked up from Alpha-Core. Now all I need is a few solid free hours in which to do it. (Actually, probably like a full free day.) But anyway, I managed to do a single winding. I basically half-ass the 40-turn winding, then force it to be the right shape with my winding press:

Patent Pending.

Okay, I will put a little more effort into the real winding. But for now I just wanted to get to the magical single-winding back EMF test that I have so many times claimed is actually a useful thing to do. This time, I'm sure it's legit. With a coreless motor, there is no incomplete magnetic circuit to worry about. The no-load B-field between the disk looks the same with or without the windings. So with one winding's measured back EMF, I can extrapolate the performance of the entire motor. (You probably still don't believe me...I don't blame you.)

Anyway, I put the winding in the stator and put the stator in the box:

(Notice the nice new countersunk non-magnetic stainless screws?)

And stupidly I did not take any pictures of the whole thing together. But to my great relief it actually spins, the magnets no longer grind against the screws, it is centered, and the gap is...well it's not very uniform. It sort-of favors one side. I think it might need a little persuasion toward the other side. But it doesn't seem like the 1/r^2 problem...the dual bearings on each rotor disk seem to take care of that. But anyway mechanical stuff can be poked and shimmed and squeezed into compliance. What about the fundamental premise that this thing can actually transform power?

This time, I didn't need the go-kart to spin it up. (No cogging torque, and no violent shaking of the entire test bench.) I used a smaller but equally unorthodox prime mover: a cordless drill with a hole saw attached to it. The hole saw dug into the rotor hub nicely and got it up to about 600rpm, plenty fast enough to capture a back EMF waveform on the scope:

Oooooooooo...shiny.

That is much more sinusoidal compared to the steel core version. Why? It's still a concentrated winding with non-skewed magnets. Well, probably a few reasons: The magnetic interaction is more distributed, not focused to the edges of the stator teeth by steel. It's also interacting with field that is relatively far away from the magnets, where it starts to blend together smoothly from North to South instead of having sharp transitions.

As for the fundamental motor constant, the amplitude of the back EMF as a function of frequency (speed), I get about 9.5V(rms) per 1,000RPM. Since four of these windings would be in parallel, that is essentially the phase voltage of the motor. That's a fairly nice number, since in the practical speed range for a home-built motor (3,000RPM?) it falls into the 72V battery category. Through the magic of power conservation, I can come up with a torque constant for the motor as well: 0.27Nm/A(rms). This is...well it's all pretty much dead on with the predictions. (Wow, even the shape of the back EMF is correct...)

Lastly, I measured the winding resistance for a single 40-turn winding to be 0.127Ω. Since there would be four in parallel, the phase resistance is actually one quarter of that, or 0.032Ω. This starts to give me a feel for the thermal performance of the motor. Altogether, the motor constant and resistance are fairly similar to the array of small EV motors (Etek, Mars PMAC, PERM, etc.). The LEAF, which is the only coreless motor in this lot, will likely have a slightly higher torque constant, but also a higher resistance and lower thermal mass for heat sinking. So we'll see how it compares in continuous and peak ratings. As always, it will depend a lot on the cooling solution.

More winding ahead!