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.

Oops.

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:

DO NOT TRY THIS AT HOME...OR ANYWHERE.

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.

Thursday, June 18, 2009

Both Wheels Now.

It's time for a new summer project.

In case you haven't been following along, I advise the Edgerton Center Summer Engineering Workshop, which is a relatively ad-hoc group of MIT and HS students bent on producing some of the most unarguably cool vehicles on campus / in the world. It's part research, part education, and part fun, and anyone who has a problem with that can go away. Our fleet currently consists of the DIY Segway, a homemade version of Dean Kamen's self-balancing scooter, and the Cap Kart, a pretty sophisticated electric go-kart with a 110F ultracapacitor regen/boost.

The DIY Segway (2007) and the Cap Kart (2008).

These vehicles, although certainly a lot of fun, are not really very practical. One is inherently unstable and the other weighs 350lbs and has a ground clearance of 3/4"; neither is a sort-of everyday ride. Inspired by this modified Razor scooter made by Charles Guan, we've decided to add a light vehicle to the fleet. I was originally thinking that a simple DC motor and belt drive with excessive amounts of torque would suffice, but apparently I'm boring and unimaginative. So instead, the team has shifted to a new design.

Introducing
THE BWD SCOOTER
Artist's rendition.

This could stand for "Both Wheel Drive" or "Brushless Wheel Drive" depending on who you ask. The idea is that if you're gonna put in the effort to make a custom in-wheel hub motor, you might as well make two. (Also, they are somewhat limited in torque production, so having two might help there.) Anyway, it will be ultra-compact and ultra-light. Some preliminary specs from our first design meetings:

Base: Razor Spark. Really we are only using the front folding / steering thrust bearing mechanism. The wheels, handlebar, and deck will be custom.

Motors: Completely custom in-wheel hub motors (x2). They'll be a bit bigger than normal razor scooter wheels, but not much. The space savings elsewhere will more than make up for it. Basing our design very closely on the one built and tested by Charles Guan (more details). It's a 12-slot, 14-pole brushless DC motor, sometimes called an LRK motor, which provides relatively high torque and low ripple due to the strange slot/pole number.

Deck: Custom aluminum with battery tray underneath.

Batteries: LiFePO4 2.3Ah, 3.3V A123 cells. Pack size TBD. (Mostly limited by space under the deck.)

Control: Well, it'll probably start off with cheap model airplace ESCs, but the ultimate goal is to have a real torque-based controller that can do regenerative braking. That will take some effort.

Much more to come...

Saturday, June 6, 2009

Design Table...err...Table Design

Alex Slocum teaches about how to make design tables in SolidWorks. I never really got it, so I decided to make a table design in SolidWorks instead. I've been wanting to design and build a cool-looking glass table for a while now. Sources of inspiration:

2.009 Green Team Final Project, "Elika"

80/20 Conference Table

I wasn't really looking for something fancy. Just a small kitchen table for my "efficiency apartment" in Cambridge. A place to eat breakfast in the morning, or to work when my desk gets too boring and a need a new place to think. The idea probably would have stayed in my head for a while, if not for a generous donation of a slightly-used glass tabletop. With the heavy lifting done, all the way left was to design a cool aluminum frame. Here's the build, from start to finish:

Like any good engineering project, I started in CAD. I drew up some cool-looking corner brackets that would also hold the glass, which sits on rubber bumpers, in place.


Here's the "before" shot. The corners were cut on a water jet.


Sanding jig.

Oooooh, pretty.

Just before final assembly.

All together, complete with $20 folding chairs. Now I have a place to eat my cereal in the morning!

Tuesday, May 12, 2009

Three Phases of Fun

2.007 is over. For once in my life, I actually don't have any strong opinions on the matter. Everything went as well as could be expected, with roughly the same ratio of working robots to...functionally challenged...robots as usual. I've been doing this class in some form or another since 2006. Although I've all but forgotten what it's like to be a student in this famous course (for a simultaneously hilarious and tragic account from someone with nothing to prove, read this), I am feeling like I need a break from it.

Good thing there are so many other distractions available at the end of the semester. Like finals (lol) and term projects. I'm taking my first ever legitimate electrical engineering course (and actually enjoying it) this year, Introduction to Electric Power Systems, 6.690. It's more focused on grid and transmission topics, but there is a short burst of electric machines (read: MOTERS!) analysis toward the end. So I figured nobody would mind if I squeeze in a term project on motor control, since that's what I seem to do well these days. So, the 3phAC controller is born:

Wait a minute...that looks familiar.

For those of you who are saying, "Gee, Shane, that looks an awful lot like every other motor controller you've built recently, it's got the same parts and the same hack way of mounting transistor to heat sinks that double as bus bars, and the same controller even," I say, "Of course." (Okay, nobody probably even knows what I'm talking about.) But the point is, there isn't much difference, from a hardware standpoint, between a three-phase inverter and a half-bridge like this one. It's just...three. And since I already have a good, working, modular, scalable hardware solution for this, why not use it?

In any case, the interesting part of AC motor control is the...well, the control. You need to generate three PWMs instead of the usual one. And the values of each need to be updated at the switching frequency (16,000 times a second) to push through a sine table. (Forget doing actual trig on a microcontroller.) So that means a lot of crazy interrupt work. It really does push the Wootstick 1.1, a "special" 16-bit MSP430-based development board, to its limit in terms of event timing.

In any case, it works, and in typical Shane-style I put in a nice Visual Basic interface to show the sensor values for voltage and current, as well as the derived phase angle, which I find interesting but nobody else probably cares about. And most astonishingly, it worked on the first try. It was a scarily easy project, well-planned and done on time. That's right, no MOSFETs were harmed in the making of this project. Video:



Forget all the Course 6 stuff I learned...it just sounds really cool. It's very clean. Just like its bigger cousin (third clip). It can already handle about 1kW, but if you know me, you know it's probably only a matter of time before it gets scaled-up.....

For the full project write-up, click here.

Thursday, April 9, 2009

EVER / e-Kart Wrap-Up

Well, I'm back in Cambridge now trying to catch up on a week's worth of work. (It helps that I'm still operating on a slightly shifted time sense; I've been getting up at 6AM and going to sleep at 11PM recently. I realize this is fairly normal...but not at MIT.)

Anyway, I had a great trip that will undoubtedly be one of the most memorable experiences of my higher education. I can't help but think that at some point in my life, when electric cars are at least a common sight, if not prevalent, I will think back to this and bore people with my stories of the early days. What's that? I bore people with my stories already? Well then mission accomplished, I guess.

I already went on about EVER in my last post, so the only real update I have for that is an amazing gallery of pictures:
http://web.mit.edu/scolton/www/EVER_pics
Photo credits: Cam T. (mostly), Max H., Paul P., and myself.

After EVER, I moved on alone to e-Kart, a French electric go-kart competition for schools and universities. It reminded me a lot of FIRST, in the team structure, educational emphasis, and competition environmont. The karts there were decidedly faster than ours, on average, but also a bit lighter I think. (Stupid Americans and our over-sized vehicles.) There was also a lithium-ion kart with an AC motor that I think is the most drool-invoking go-kart I've ever seen (third clip, #77):



The others were also very impressive, in both power and degree of instrumentation. Most were heavily student-built, too. Here is my small gallery from Tours, France, where e-Kart was held this year:
http://web.mit.edu/scolton/www/ekart_pics

I don't know yet what exactly the path I take from here is, but I've seen enough now to know that this is an awesome educational opportunity. Maybe there's a role for me in creating something of an open-source reference for this kind of project. We'll see. I'm looking forward to seeing America's first foray into educational alternative fuel (not just electric) kart challenges this in May: Winston-Salem/Forsyth County School is hosting the Go Green Go-Kart Competition, open to all NC schools. Until then, preparation for 2.007 will probably thoroughly occupy my time!

Wednesday, April 1, 2009

Things I Learned in Monaco

A portion of the Cap Kart team just finished up a trip to Monaco for the EVER '09 conference, and all I can say is "Wow." It really is an amazing place and I can't think of a better venue, especially for automotive enthusiasts. We were awarded "best student paper on ecological vehicles," a wonderful honor which just reaffirms the quality of work that this team can pull off in just a few months. I use this project now as a mental model for how effectively things can get done with the right set of people, skills, ideas, and resources. I know it's unrealistic to expect such good team dynamics in all instances, but it's helped me develop my project organizational skills, at least. Here's a picture of the six team reps, looking sharp for our presentation:

I learned a lot during this conference. It was my first conference of any type, since I have just started my graduate school career, and so I was a bit nervous. But what I found was very comforting: There was certainly some very detailed technical and analytical work presented, but our particular brand of hands-on experimental work was also well-received. And the relative anonymity helped - presenting with a clean slate audience seemed easier to me than talking to MIT faculty/students about it. Besides the scientific conference, there was also an expo and a rally, where I got to see two Tesla Roadsters up close. Here's the blue one:

Speaking of Tesla, I also just saw video of the first public test drive of the Tesla Model S, a "seven" (five) seat sedan with a base price of $50,000 for a 160-mile range. Here's a car being built by a California start-up in a matter of a couple years that is fully-electric and only $10,000 more than the Chevy Volt, a plug-in hybrid with a 40-mile battery range. Oh, and it does 0-60 in 5.5 seconds. An electric sedan. Check out this video. This is the future, tearing up the streets at night with an impromptu police escort and a hand-held camcorder. It reminds me a bit of our kart videos in style...accessible, 21st century, unedited do-it-yourself technology for the YouTube era. No press agents, no corporate public relations highlight reel, just a sick ride shown off by a company without any "bad momentum."

Back to Monaco. The other thing I learned was about Monaco itself. I wasn't surprised that it was a beautiful and extravagant place. Nowhere else in the world could you see a Lamborghini with a Rolls-Royce awning and a palm tree reflected it its perfect clear coat, parked in front of a Porsche dealership...

...or stumble upon one of the most famous and scenic Grand Prix circuits in the world...

...no, none of that really surprised me. What did surprise me was that you can actually go there. No, seriously. You can spend five nights in Monaco, traveling from the US, for less than $1,000. (Not including the money you decide to blow in the casino or renting a Ferrari. But let's pretend for a second that you don't gamble or know how to drive.) This is how to pull it off:
  1. Travel in the off-season. March/April is apparently not tourist season, even though in my opinion the weather is perfect. 60/70s and mostly sunny. A bit cold for beach people, but I am not one of those. Perfect walking/sitting outside weather. And the airfares were dirt cheap, a casualty of the economic recession. Just over $600 r/t on Air France with an easy connection in Paris. From Nice, you can take the bus or train to Monaco along the beautiful coast for less than $10.
  2. Travel with a group and stay in at the Adagio Palais Josephine in Beausoleil, France. This is a hidden treasure. It is a 10-minute walk from the casino and the port, but you immediately cut your hotel expenses by about 75%. An apartment for four, which could easily sleep six, was 128 euro/night ($170/night). That's $42/night per person! For a huge apartment with a balcony, separate bedrooms, a dining room, and a kitchen. The kitchen is the other key:
  3. Cook your own food. While you can find some reasonable deals, such as these delicious 4.50 euro crepes you can eat outside at the harbor...

    ...you can really cut your spending by cooking your own. Example: Simpler, but almost as delicious homemade crepes:

    There is a market right outside the Palais Josephine. You can eat for about $5/person/day. Another reason to go with a group.
And then, with the money you have saved, you should feel free to spend on way overpriced souveniers, helicopter rides, high-stakes blackjack, Ferrari test drives, or whatever else floats your boat. Or you can relax and enjoy a wonderful deal at a place that is, in my opinion, a much nicer trip than Paris or Vegas. It is neither touristy nor exclusive, and for car lovers it is a dream come true. Go. Now.

I am now in Tours, France, to observe a university-level electric kart competition, a good opportunity for me to take some lessons from experts here about what we could be doing to further education in the alternative energy fields. Hopefully, the new enthusiasm for such ventures will open up similar opportunities in the States. Maybe I can help with that. I will continue to accumulate pictures and in a later post will link to the entire gallery from Monaco and Tours.

Au Revoir!

Photo credits: Cam T., Paul P., Max H.