Showing posts with label RC. Show all posts
Showing posts with label RC. Show all posts

Monday, May 17, 2010

Pirate Radio Control: HK123's and Field Weakening

It's nice out, and I'm done with finals, so I took out the RC car again and made a few improvements. Then I crashed it and undid some of those, but don't worry it's not too bad!

First, I changed the batteries. I had been using A123 26650 cells. These are LiFePO4 cells that are most abundantly found in 36V DeWalt drill batteries. In fact, since they are virtually unavailable to the general public, the cheapest way to get them is actually to take them out of drill batteries. I'm sure there are significantly more 36V DeWalt drills than there are batteries for them at this point. Each pack contains 10 cells, and can be found on eBay for roughly $100, so about $10 per cell. Wasteful...and still expensive.

A less expensive solution is lithium polymer. Sites like Hobby King sell these pouch-like batteries for more like $5 per cell, for an equivalent capacity. They're 3.7V nominal, instead of 3.3V, and they come in prismatic packs, so overall they have a higher energy density than LiFePO4. The 30-40C discharge versions are comparable in power density as well. The one downside is that they tend to burst into flames when abused...

A compromise, then. Hobby King also makes LiFePO4 prismatic batteries. (We call them HK123s now.)


For $70, you get 12 cells. That's just under $6 per cell. Now, these packs are decidedly hit-or-miss, based on the reviews. They might arrive with one or more cells completely dead. In fact, the one I ordered had two dead cells. :( But since I was going to cut it open anyway, I wasn't too upset. Taking the packs apart is a real pain, but I don't imagine it is significantly harder than taking apart a DeWalt battery. One snag I ran into was that the positive terminals are aluminum crimped to nickel tabs. I ripped off the nickel, not realizing its importance, and had to resort to aluminum soldering to connect the cells. (Yes, you can solder aluminum.)

Questionable soldering job.

I rearranged the cells into 6S1P, same as the old RC car pack. Putting it together is easier than putting together cylindrical cells, which almost makes up for the difficulty of taking it apart. All the balance and power leads come out of the same side, and it makes a nice compact package that is easy to heat shrink. Or, if you don't have any heat shrink, caution tape...

Notice the size difference.

The cells themselves are almost the same weight as A123 cells. (They should be, being the same chemistry and capacity.) So I only saved 122 grams (6% of the total car weight), mostly in packaging. But since they are prismatic, they stack nicely and take up much less volume. I measured their internal resistance to be about 13mΩ, which is a little higher than an A123 cell but not much. I fully expected it to be able to handle the 40A peak current on the car. Here's what it looks like on the car:

 
 
Step two in the RC car upgrade was implementing field weakening control. Setting up the full explanation of field weakening would take one or two whole posts, so here I will just get straight to the point. The car uses half of my 3ph Duo brushless ESC, which is a fully functional AC controller that treats everything as a vector in the rotor frame of reference. The voltages applied to the motor are balanced three-phase sine waves, which leaves only two degrees of freedom: magnitude and phase

Under normal operating conditions, the controller sets the phase wherever it has to to place the current vector right between the magnets, using feedback control. This is the point of optimum torque production, the least amount of current for the most amount of torque, and varies with speed and load due to inductance. The magnitude then just sets the magnitude of torque.

In field weakening, the controller sets the phase ahead of the normal operating point. There are many ways to think about what this does. In one way of thinking, part of the current vector is now opposing the permanent magnets a little, weakening the field that the other part of the current vector interacts with to produce torque. This reduces the back EMF of the motor, allowing it to spin faster at a given voltage magnitude, but with less torque. It effectively changes the motor constant, almost like an overdrive gear. Hey now, where have I seen this before?

I wish I could provide a more thorough analysis of the field weakening capabilities of this controller, but in all honesty it gets a little messy. For one, the unit frequency that the controller uses to do all its calculations is the PWM frequency, which is 14.5kHz. With the motor now spinning at 45,000rpm, or 750Hz, the resolution of everything is shot. Furthermore, lag in the measurements starts to become significant and the rotor frame may not even be in the right place anymore. This controller was designed for direct-drive scooter motors that spin at 1,000rpm...so I'm happy if it doesn't go unstable at this speed.

Time for testing! Here's the baseline, a normal "full-throttle" acceleration with no field weakening:


It gets from 0-30mph in 1.9 seconds, pushing about 34A (peak) to the motor. The top speed is 34mph and the peak power output (to the ground, m*a*v) is about 200W. Notice that by the time the motor has hit top speed, the voltage phase is a full 42º ahead of where it would be at no load. This keeps the current right between the magnets, lined up with the back EMF, for optimum torque. At this phase angle, the power in to the terminals of the motor is about 330W. So from the motor terminals to the ground, a system efficiency of 61% at peak load.

Now with field weakening:


The acceleration profile up to 30mph is identical, taking about 1.9s. Then, at 30mph I hit the "boost" button. The controller tries to put some current on the axis that fights the magnets (negative d-axis). It does so by advancing the phase to 75º, sacrificing current on the q-axis (torque producing current) to get there. So, the acceleration slows, but it can get to a higher top speed of 44mph. Maybe you just need to see it:

 

That ant-looking thing is the car. The sound is probably the more useful measure. With this kind of motor, field weakening is fairly limited, but a 30% increase in top speed without changing anything other than software is still much appreciated. That is...until you hit a pebble at 42mph...

Unfortunately, I do not have video of the crash, but I do have the car's last transmission:

Black box.

Clearly I had half a second to attempt to slow down and regain control. I probably needed another half second to do so, though, because it still hit the curb at 27mph. This time, something happened to the radio before the battery came out. (You can tell because the voltage never drops.)

Yep, antenna got ripped out. 

 That might be fixable with some solder. The brand new battery did indeed fly out as well, landing several feet away. Here's the aftermath:

Not right.

But even the bashed-in cell is okay.

That's a big check in the durability box for the HK123's, if you ask me. The only thing that really broke was a tab on one of the cells. And it wasn't the aluminum solder joint; the tab just sheared off completely. Good thing I have four spare cells from the original pack.

The car itself was totally fine.
So in summary:
  • HK123s are a viable and fairly rugged LiFePO4 solution, if you don't mind disassembling and reassembling a pack. More compact and less expensive than A123.
  • Field weakening is cool, until you hit a rock.
  • I should find a wider test location.

Friday, April 2, 2010

Rookie vs. the RC Car (...in slow motion.)



Rookie likes to chase squirrels.

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, January 19, 2010

Arrrrr, see?

Pirate radio...control.

I've been wanting to get my hands on a serious RC vehicle for some time now. Here it is:


It's a Team Associated TC4, 1/1oth scale 4WD remote-controlled car. Ignore the absurd-looking battery pack; I have no idea where that came from. I was lucky enough to get some drive time on the one nice day of weather we've had in the Boston area in the last two months. Conclusion: This thing is fun. I have literally zero RC experience (although I have driven robots) , but this seemed to be fairly easy to get the hang of, at least up to moderate speeds. Maybe it's the 4WD.

The car itself is mind-bogglingly impressive in mechanical detail. It's a shaft-driven 4WD with two ball differentials. There is no center differential, but the front and rear can be adjusted for more or less slip. It's got four-wheel independent suspension with adjustable springs and shocks. Lots of tiny screws, ball joints, linkages, all with tweakable settings. I don't even know where to start...

...Oh wait, yes I do: the motor.


This is the stock motor, a Reedy Radon brushed DC motor which has but one spec: 30,000 RPM. Thanks a lot. If there's one thing I hate about RC components it's the downright lack of real documentation. Coming from the world of robotic and electric vehicle components, it bothers me a lot to have a motor with no specs. So in case anyone else in the whole wide web is wondering, I decided to go ahead and measure the Reedy Radon using standard DC motor specifications: torque constant, back EMF constant, and winding resistance. Here ya go:
  • Motor: Reedy Radon
  • Type: Brushed DC
  • Turns: 17
  • Winding Resistance: ~69mΩ
  • Torque Constant: 0.00262 N-m/A
  • Back EMF Constant: 0.00262 V/(rad/s)
  • "kV": 3,650 RPM/V
(The resistance is only approximate because brushed motor resistance is sort-of hard to nail down. It depends a good deal on the brushes.)

And yes, if you use a fully-charged 7.2V NiCad battery pack, this nets you about 30,000RPM, which with the stock gearing is about 30mph. If you use a 9.9V A123 26650 pack, then you are just insane. And yes, this is quite a lot of punch for a three-pound car:


Cue gratuitous use of high-speed cameras.

It would be hard, then, for me to say something bad about this motor. In fact, I love brushed motors and for $23 this seems like a terrific option with plenty of power. But seriously do you think I could live with myself if I didn't at least try putting a brushless motor in it? The problem is, brushless motors for RC cars are expensive. Here are just a few examples:

CMS 36-4600 (Castle Creations, $100)
Velineon 3500 (Traxxas, $75)
Reedy 5000kV (Team Associated, $50)

Also, they are all specified by the wonderfully inverted "kV" rating. Higher kV means more RPM per Volt, so they go faster, right? Well...not really. That's only true if you're stuck with the voltage you're given. I'll take a low kV motor and a higher voltage any day. Conventional motor wisdom says this is almost always more efficient. In the age of lithium batteries, a 20V RC car is not unreasonable.

But still, I'm not paying $50-$100 for a motor that's easier to manufacture than the brushed one. And don't even get me started on controllers....RC controllers are amazing devices with unparalleled power density, but some of them are way overpriced. Interestingly, we live in a global economy and there are Inexpensive Chinese Brushless Motors (ICBMs, © 2010 Charles Guan, used without permission) on the market. I snagged this one for $15.95, minus my $2.99 Hobby King store credit (which I got for browsing but never buying anything). So what exactly does a $13 brushless motor look like?

Like this.

You're probably saying: "It has a reflective purple sticker and says 'HIGH TECH SUPER' on it. It must be a piece of garbage compared to those other motors." Well I don't know anything about those other motors because the RC companies don't publish any useful information about them. At least this motor is cheap enough for me to buy, ship, and test. Most importantly, I would like to know the torque constant and winding resistance so I can compare it to the stock motor. So I hooked it up to a dynamometer:

Yep.

Actually, I later figured out that 3.2mm motor shafts fit nicely into a 1/8" dremel collet, so I could do some higher-speed testing. The procedure is really simple: spin motor, measure back EMF on oscilloscope.


It's definitely not a trapezoid (ideal BLDC) or a sinusoid (ideal BLAC). It's more like a sinusoid with fifth harmonic added in. Try it. It's a two-pole motor with who-knows-what-kind-of-magnetization, so the odd shape is not surprising. Rather than fret about it, I chose instead to just use the RMS measure and pretend it was a sine wave. Using some motor math tricks, I can get a decent torque constant estimate this way. I can also measure the resistance very easily. Here are the results:
  • Motor: Hobby King 13.5T RC Car Motor
  • Type: Sensored BLDC
  • Turns: 13.5
  • Phase Resistance: 16mΩ
  • Torque Constant: 0.00314 N-m/A
  • Back EMF Constant: 0.00314 V/(rad/s)
Okay, 16mΩ is low. I'm pretty much sold on that spec alone. That's where motor heating (I²R losses) comes from, so the lower the better. And the torque constant? That's for sinusoidal drive, and it's higher than the stocked brushed motor. More torque per Amp and less I²R in the same size means better motor.

What about kV, though? I didn't list it because it has no clear meaning in sinusoidal drive. But I can say that I think it's significantly lower than the stated value of 3,150 RPM/V. Meaning, more torque, but higher voltage required for high speed. That's fine for me, since I wouldn't mind using a 6s (19.8V) A123 26650 pack. And my controller won't even run below 18V.

Oh, right, I forgot to mention the other important difference. Unlike the three more expensive brushless motors of the same size, this one is sensored. It has integrated Hall effect sensors that detect the position of the rotor, same as the scooter motors and the majority of small EV BLDC motors. Not only does that work perfectly with my controller, but it will give better starting torque.

This is one insane deal of a motor for $13. As long as it doesn't explode or something. I know you won't believe me until I actually put it in the car and demonstrate, so I should get on that. Hopefully by then the snow will melt and I can drive again.