Sunday, November 25, 2012

Motor Controller Part 3: Building and Testing

I've been really busy lately working on the motor controller.  Here's what I've been up to.  I need a way to mount the IGBT drivers so I cut out some holes in a sheet of aluminum.  It's very important that nothing on these driver boards touch anything metal or you run the possibility of having the battery pack connecting to the chassis of the car.  My solution was these complex holes.


Joe drew up these PCB designs and had half a dozen of them made.  Here you can see one fitted onto its mount.  I put some rubber grommets in the holes as an extra measure of precaution even though the holes shouldn't conduct.


Here you can see the driver mount attached in the controller along with the control board.


And another side view of how everything is going to line up.


Next I had to make the bus bars.  The bus bars are 3/4 x 3/8 bars of solid copper with a couple holes drilled in them.  Two of these bars need to be connected to the capacitors, so there are thin sheets of copper that are soldered to the sides of them, then bolted to the caps.  You can see all that assembled in this next picture.  You can also see I've soldered in the parts for one of the IGBT drivers, and I've drilled and tapped a pair of pipe thread holes to pump water through the cooling plate.


Today was an exciting day for me.  I got the controller together enough to actually get to test it!  Joe came over to help out and we started the afternoon by hooking the laptop up to the control board to program the microcontroller.  Here's a look at the mess I made of the dining room table.


To do that you have to give it power, so I cross my fingers and plug in the 12 volt supply.  And to my delight, the green power LED turns on and no smoke comes out.  The programmer identifies the microcontroller, so that's a good indication I didn't damage it while soldering it in place.  There is one more yellow "status" LED that turns on after the controller is programmed.  This one blinks to tell you something is wrong or stays steady if everything is ready.  I got a cheap potentiometer to mimic the throttle pot and hooked that up and I get the steady "system ready" signal!  Joe has an oscilloscope that he brought over and we hooked it up to the output signal.  We should expect a signal between 0 and 5 volts and it should look like a square wave form if the potentiometer is in the right spot.  Amazingly that works too!  Here's a shot of the 15.6 kHz square wave as the controller tries to drive the commanded current.


There's also a serial port connection on the controller that you can hook up to a computer.  There's a program you can run to monitor certain parameters of the controller and all seems to be working.  I can turn the potentiometer and see the throttle position go up and down and the current command cycle back and forth from 0 to 511, and the thermistor reads a constant 73 °F.  I'm a bit amazed that out of hundreds of solder connections I haven't screwed anything up (yet).

My next task is to hook up the IGBT drivers and see if I can get a 0-15v PWM signal out of there.  If that goes well I can hook that output to a single IGBT and see if I can drive a load into a resistor or small motor. We've run out of time for the day, but it's been a satisfying holiday weekend.

Sunday, October 28, 2012

Motor Controller Part 2

If you like to look at pictures more than hear me ramble on and on about "science" then this is your lucky day!  (Edit: I lied, there's always going to be some amount of rambling)  I'm playing a little catch up from the last few weeks of work on the controller, but here it is.  The motor controller has two basic parts to it.  There is a control board, which is like the brain, and there is a power section that does the real work.  The brain comes from the printed circuit board below that I bought from a guy online named Paul.  He conceived of the idea to get a community of people online to help design and develop a low cost do it yourself motor controller that costs a fraction of what a commercially made one does, and had the drive to make it a reality.  My friend, Joe, has one of the beta controllers in his electric car and it's been running great for about three years now.  There is a wiki with a list of all the parts you need to buy to put it together, and I've got all those parts now.  Let's condense a 2 cubic foot box full of parts into an 8 x 3 x 0.7 inch circuit board!


Here's my setup.  I decided to splurge on a nice temp controlled soldering station to put it all together.  Way better than the cheap pencil iron I've been using for the last decade.  I apparently never took a picture of the board done, but trust me.  Okay, may you shouldn't trust me.  I never took a picture of it completed because it turns out I was missing two pieces that I'll have to order later!  I also soldered one of the parts in the wrong orientation, and two pieces I put in the wrong place.  Luckily I know someone who knows how to fix this all too well who brought their desoldering iron over.



Ok, control board is done (mostly).  Next up is the power section.  The official DIY controller uses 10 MOSFETS rated for 50 amps and 200 volts a piece to get up to 500 amps of continuous output safe with a battery pack about 150 volts nominal.  In order to get more torque, I want to pump more current through it, and to get more power I want to put a higher voltage in there.  To do that I've traded the MOSFETS for 3 IGBTs that are rated for 400 amps and 600 volts a piece.  By changing out the current sensor I can trick the controller into delivering 833 amps without reprogramming it.  If I do reprogram it, I'll be limited by how well I can balance the load on the IGBTs, but let's not get ahead of ourselves...  The control board basically tells the IGBTs to turn on and off, and the percentage of time spent on determines how much power gets to the motor.  Each time the IGBTs turn on or off, there is some waste heat generated, and if you don't get rid of it they'll eventually burn up.  To take care of this, I'll be mounting them directly to a liquid cooled water plate.  Lucky for me, I have a super nice friend at work who offered to make me one on his CNC mill (actually a router).  All I had to do was model it and get him a block of aluminum.  A couple weeks ago he brought this test run machined in foam!  Pretty cool huh?  Water flows in on the left and out on the right.


Last week I he came in to work with a present for me!  Here's the real thing after about 3 hours on his CNC router.  I just had to finish it up by drilling and tapping about 50 holes.  Oh, and see that funny little groove in the middle (in the yellowish light reflection)?  That's a channel to let me route the wires for a temperature probe.  It tells the controller how hot things are getting and it'll pull back on the power if it's getting out of hand.


After a few hours of making holes, I started mounting stuff to it to see how it fits.  Here you can see  the three IGBTs on bottom and three really big capacitors mounted on a plate above them.  Soon I'll put the bus bars across the IGBTs and link them to the capacitor using some parallel sheets of copper.  Looking good!  I'm excited, are you?


In the above picture, you can see a couple sharpie lines.  I won't get into why, but I have more machining to do to help mount other stuff and make it lighter.  My first friend's CNC router is relatively small and takes a fair amount of time to remove material, so taking out a lot, like I'm planning, would take him a long time.  Lucky for me, I have ANOTHER great friend with a mill!  This one is a lot bigger.  I took the water plate over to his place and made it even lighter.  While I was working on it, my buddy snapped a few photos.  I look a little manic in this one.


Now I'm really working.  You can tell cause I'm using both hands.  You can see the blue tub of Bo Lube, which is some kind of paste that Boeing developed.  A lot nicer and cleaner than spraying WD-40 or cutting oil all over the place.


There, 5 or 6 cubic inches of aluminum turned to sawdust...er, aluminum dust.


Since then I've been working on the enclosure for the controller and mounting the control board, but no pics so far.  I also have some bad news regarding the car.  Apparently I did NOT win the war with the spiders...


AAAAAAHHHHHHHHHHHHH!!!!!!!


Monday, October 8, 2012

Where's it all gonna go?

This post is mostly about me looking at piles of parts wondering how it's all gonna go together, but we're gonna get started with the latest news on the war...

I'm making major progress in the war with the black widows but I'm not sure if it's over.  I killed 12  of them and one egg sac with brake cleaner a stick and one brick, but that was getting me nowhere.  So two days ago I cleared out all the webs and soaked the car with Suspend SC (designed to kill scorpions - yeah, been there).  The next morning, no new webs, though this evening I was taking a closer look and found a few hidden ones.  I'm hoping I just missed those during the initial sweep, but if they're back tomorrow it's time for another round of spray.  Enough with the critters, let's see some pictures!

I finished the duct that feeds air from the blower fan into the motor and it looks sweet!  Check out that rivet job!  The motor will be keeping cool just in time for the cool weather...

Ok, now I've hit a major decision point.  I have a massive and growing pile of boxes of stuff that's gonna go in the car, but just about all of it can fit in the left over nooks and crannies.  It's time to decide where to put the batteries.  I mentioned it before, but there is a new variant of the CALB cell that came on the market a few months back.  Supposed to be better efficiency, lower voltage sag, more cycle life, more more more better.  It's all perfect except they don't come in the cell size I was planning on.  But they have one close, so I think I'm going to opt for the higher pack voltage.  The components in the power section are rated for 600 volts and my pack should have a max charge of 3.65 x 70 = 255 volts.  Should be plenty of headroom for any spikes.  The only thing I have to keep an eye on is to make sure the voltage at the motor is less than 170 volts at all times.  I've got a plan for that, so let's do it!

Ok, so where are they gonna go?  Let's start with weight.  Each cell is about 2 kg, so the full pack will weigh 140 kg or 309 lb.  Interesting enough, the "equivalent" pack of the other cells was supposed to be 340 lb, so maybe these cells are lighter per kWh that the others?  Way back when I took everything out, I weighed it all so I'd know how much needed to go back in to get the distribution right.  It turns out I need about 120-130 lb of batteries under the hood to match the old weight.  That comes out to 40% of the pack, or 28 cells.  Yikes, that's a lot to fit in there!  Time to see where they're gonna fit.  After a LOT of measuring, I think I have an answer.  I made some cardboard boxes that are as close as possible to the actual size of the motor controller and the batteries and dropped them in place.  I should just be able to close the hood with these 9 inch tall batteries above the motor.


I think there's actually enough room for another row here, so I can probably fit a block of 16 on top.  Then if I take the end row (on the left in the upper picture or closest to you in the lower picture) I can fit another 4 toward the front of the car for a total of 20.  If I move the motor controller somewhere else, I can fit at least 24 batteries above the motor, but then where does the controller go?  It can go on the driver's side of the blower fan, but it doesn't fit that well over there.  It could also go where the battery currently is (upper left in the upper picture).


Another potential spot for the batteries is between the motor and A/C condenser, but then you have even hotter air blowing on those cells in the summer.  Gah!!! so many options!  I think I'm gonna need more cardboard!

My head hurts, let's talk about something else.  I've compiled a huge pile of stuff to build the motor controller, and here they are!


In the front you can see the 6 x 10 x 1 inch block of aluminum that my friend, Steve, will hopefully mill into a water plate in the next week.  On top of that are the three 400 amp IGBTs.  Behind them you can see the 3/4 x 3/8 x 42 inch bar of copper for the bus bars.  Next is the printed circuit board (PCB) that I bought from Paul and Sabrina's store.  Behind that are the three whopping 150 uF film capacitors (most expensive parts in this picture).  Then all around you can see scattered the over 100 parts that will be soldered to the PCB and the IGBT driver boards (not shown).  My goal is to have all these pieces 90% assembled by two weeks from now.  Wish me luck!

Tuesday, September 25, 2012

Starting to fill the engine compartment

The motor is in the car and I actually spun the rear wheels with a 12 volt battery!  The other good news is I think I'm winning the war with black widows since I took out 4 females and 2 males last night (shudder).  It's amazing I didn't have nightmares last night considering they're the basis for all my childhood fears.  

With the motor in, it's time to start filling the extra space under the hood.  The A/C compressor basically only has one place it can go unless I get all new hoses.  It needs to go to the right of the motor if you're looking from the front of the car.  I got a 1/4 inch plate of aluminum to mount to the front of the motor.  While I'm at it I was figuring out how to mount the blower fan.  Since I plan to run the A/C off the main motor, when I idle at a stop light it'll be going about 700 rpm.  The motor wants to go 1500-2500 rpm to properly cool, so it'll need some help.  I got this 12 volt blower fan and mounted it to the aluminum plate blowing through a hole in it.  

You can see the hole here.  I just have to make an angled duct to turn the airflow down into the motor and cover up all the extra inlet holes.

Here's the bracket I'm working on for the compressor.  I took the old compressor mount and chopped off a bunch of features I don't need.  Then I welded some angle iron to it so it can mount flush to the aluminum plate.  There's an extra "foot" that you can see on the right side.  That'll attach to the motor mount to stiffen the whole thing up a bit.


Fits perfectly!  And even better, the A/C hoses still reach the fittings.  


Pulleys line up? Check
For future reference, I'm thinking of a row of 8-9 batteries in front of the motor and behind the AC condenser, which is kind of below the fan in this pic.  Gotta clear the sway bar too.  So many things to think about!


Belt going to clear the fan?  Check


Next up I've made some cardboard boxes the shape of what I think my batteries will look like.  The original plan was to use 60 of the 70 Ah Calb cells (SE70) and put about 26 of them in the front for weight distribution.  Well, they just a few months ago came out with the CA line of batteries that are supposed to be superior.  Only down side is they don't come in the 70 Ah size!  Well maybe 192 volts wasn't enough and I should go for 70 of the 60 Ah SE cells for a nominal pack voltage of 224.

Either way, I'd like to fit 140 lb of batteries up front, and that will take a surprising about of space.  I'm starting to think I can only get about 20-21 cells in there (~100 lb) without really cluttering things up, but that'll probably be okay.

Next up I'll be making the inlet duct to route the fan air into the motor.  I'm also preparing to buy about 400 parts from mouser and digikey to build the controller board and IGBT drivers.  More on that later...

Thursday, September 20, 2012

Motor Controller Part 1: Design

In order to get power from the batteries to the motor without using a big on-off switch, you need a motor controller.  Since I'm using a higher than "average" battery pack voltage, I need a high voltage controller.  I could just buy one, but what's the fun in that?  Plus I get the chance to save a few bucks since the HV controllers start around $2500.  The concept of building your own controller comes from my friend Joe who's already built his car and controller.  Actually, it goes back earlier than that.  There's a couple called Paul and Sabrina who sell a kit that they've developed over a number of years, and that'll be be backbone for my controller.  "Unfortunately," I've taken the high voltage path, so the kit won't work for me as is.  It needs to be modified with high voltage parts and while I'm at it, might as well throw in some higher current capability, right?  I'm not sure who to give the credit to, but Joe started on this path a while back and already figured out a combination of IGBTs and capacitors that should do the trick.  I'm going to use these high power parts with the control board that Paul and Sabrina have developed to make a higher power version.  (If you want to skip the boring lecture of the day, this is a good spot to skip down to the pretty pictures...)

So what is an IGBT you ask?  It's a high power switch, kind of like a transistor if you know what that is.  To control the power going to the motor, the IGBTs are turned on and off really fast so the motor only sees some fraction of the voltage available from the batteries.  The pulses are sent at a specific frequency, and the time on and time off are varied to change the apparent voltage to the motor.  For example, if it takes 1 millisecond to turn on and off and it spends 70% of the time on, the motor will see an apparent DC voltage of about 70% of the battery pack voltage.

These IGBTs are rated for 400 amps a piece and I'm using three of them.  The IGBTs don't share the load perfectly, so I wouldn't be able to drive 1200 amps without blowing something up.  The reason for this is that the resistance of each IGBT isn't exactly the same and they're run in parallel.  So if you ask for 1200 amps, you might get 350 amps through one, 400 amps through the second, and the third blows up with 450 amps.  There are a few other factors that affect how well they share the load that I won't get into, and my design is going to be far from perfect, so I'm tentatively planning to limit the max current to 833 amps.  There's another reason for that odd number.  The controller is designed to do 500 amps max, and it has a current sensor that it uses to narrow in on the current you are commanding.  By changing the sensor with another part number, the controller will think it's driving 500 amps when it's really driving 833.  That way I don't have to reprogram the microcontroller.

Okay, enough of the boring stuff.  Here are some pictures!  This is basically what it'll look like when it's done.  The big green things are huge capacitors.  The yellow things are the IGBTs.  The orange bars are copper bus bars that the big cables will connect to from the motor and battery pack.  The dark blue thing is a the current sensor.  The light blue block is the main controller board.  The red things are the IGBT drivers.
The capacitors connect to the bus bars using some sheets of copper.  The sheets need to be parallel to each other like that to reduce "stray inductance" (bad).  Having the posts of the capacitors up and down, and having an array of capacitors (instead of one big one) further reduces stray inductance.  The reason you don't want high inductance is that this causes voltage spikes.  Voltage spikes (if too large) will fry the electronics.  These capacitors and IGBTs are rated for 600 volts, so I'm hoping ~200 volts plus spikes are okay.

The IGBT drivers (red) have to be really close to the IGBTs.  If they have mismatched lengths, the IGBTs could turn on and off out of sync, which is really bad.  If one of them stays on longer than the others, it will sink the entire commanded current!  That's bad.


The plate on the bottom that the IGBTs are mounted to is a custom water plate.  The IGBTs aren't 100% efficient, so they create heat while they work.  I'm going to plumb liquid coolant through this block of aluminum to take that heat away.  A friend from work has a CNC mill who is going to help me machine it.  He's already got it coded, so I just need to get some time to go over there.  You can see a funny slot in the middle.  There's a temperature sensor that will fit in there and feed a signal back to the control board.  If, for some reason, it gets too hot, the microcontroller will back off on the power until it cools down.


The guy helping me mill out this water plate keeps telling me I'm going way overkill on the liquid cooling.  He happens to have built an electric car himself about 15 years ago out of an old Ford Fiesta.  His was significantly lower power/voltage than mine, so his controller was passively cooled (no fans).  All of the controllers on the market with this kind of power rating are liquid cooled, so that's what I'm going with.

I've got a lot of the pieces, so I'm hopefully going to start on the fabrication of all that structure you see in the pictures really soon.  I still need to order a control board kit and learn to solder, but that's for a post another day.

Wednesday, September 19, 2012

Dashboard Repair Part 2

We were treated to an unseasonably cool day a week ago (high of 80°) so I took the opportunity to work on my dashboard.  I hadn't finished this because it involves epoxying the edges of the vinyl cloth down to the dashboard and it smells too bad to do it inside and it's been way to hot to do outside (epoxy cures really fast).  But today was perfect.  I started on the windshield side that's hard to notice if I screw up.  I've got 4 small clamps, so I'm limited to about a foot at a time.


That worked out well so I started on the front side.  I'm using small balsa sticks to help distribute the load.


It's 8 minute epoxy so after 2 hours or so of going in and out, this is the final product!  Looks pretty good huh?  I'm not sure you can see, but there are two patches that need to be spliced in that I'll do another day.  I also have to cut out the defrost holes.  Soon I can put the interior back together!




Thursday, September 6, 2012

Good News and Bad News

The good news is the motor is finally installed in the Porsche and supported on it's own brackets!  Bad news is that something I hoped never would happen has happened.  During the monsoon season, a batalion of black widow spiders have moved in to lay claim to the undercarriage of the car.  I managed to blast a few with brake cleaner and clear out all the webs, but I'll have to check back soon to see who made it through the first assault.

I didn't realize how long it was going to take to make this motor bracket.  The biggest issue is it involved putting the motor in and out and in and out to constantly keep checking dimensions, tacking parts together, etc.  Here it is installed in the car before I painted it.  You can see how careful I had to be of clearing the steering shaft, but I think I have at least 3/8 inch.


The next project was to finish up that flywheel adapter.  I never got around to making a pilot bushing, so now's the time since I can't put the motor in until that's done.  I bought a slug of phosphor bronze off ebay for a couple bucks and tackled it with the mini-lathe.  This is the perfect job for this little lathe.  I didn't realize that bronze turns to dust when you machine it, compared with curling off of aluminum or steel.  It's a lot easier to sweep up, you just have to try not to breathe it.


Here are the parts.  On the left is the flywheel adapter, in the middle is the bronze slug, and on the right is a tool I made to mimic the transmission input shaft.  


Here I've got it all chucked up and squared off.  I figured the ID would be the toughest part to do so I did that first.  As it turns out, the OD was a little harder.  It's supposed to be a light press fit into the coupler, and since an inner diameter is difficult to measure accurately without special tools, you're left to doing a lot of checking.  A good way to do it is to cut a short distance off the front until the part it fits in just barely slips over, then you know the rest needs to be slightly bigger.


Ok, the tool fits pretty good now.  I wasn't sure how loose or tight to make it.  You want it to do its job piloting the input shaft, but you also don't want it impossible to put the motor in.  Someone online was suggesting 1/32nd inch diametral clearance, but 0.032 inches seemed too much.  I think I ended with about 0.012 inches diametral clearance.  0.006 inches off center ought to be okay I think, and it was not easy or impossible to get the motor in later...just right.


The first try turned out to be a bust.  I must not have been paying attention and when I checked the fit in the flywheel adapter and it just barely slid in, but I'd machined the whole length of the bushing..  Since it's supposed to be a press fit, I'm hosed and have to try again.  Luckily I ordered enough bronze to get two tries out of it and I now I have a better starting point for the OD.  After slicing the end off, I machined the next one 0.0015 inches larger than the last and it was just right.  Here it is pressed into the adapter.


After this was done I mounted it on the motor and attached the flywheel.  A while back I'd rotated it around until I got the least vibration and marked it so I wouldn't forget later.  I also noticed it wasn't quite spinning flat, so now's the time to figure out what the problem is.  I bought a depth gauge and set it up to check the runout on the face of the flywheel.  If you don't know what that is, the total runout is how far up and down the surface goes when you spin it around (think of a warped record).  It turns out there was a 0.018 inch wobble from the highest to lowest spot.  Some quick action math tells me I need to put a 0.004 inch shim behind two of the bolt holes to fix it.  



Unfortunately, precision shims cost a whopping $25 for a pack of 10!  My 7 year old daughter reminded me that a soda can is like paper thin metal so I cut one up and found it's 0.0035 inches thick.  A lot cheaper, and I don't have to wait a few days for shipping.  I shave one to shape and fit it in there and now the runout is reduced to only 0.004 inches.  Good enough for me.  Next I hook up the pressure plate and see how the balance is.  It has three piloting pins, so three position options and there's definitely a preferred position.  I was surprised to see that some of the screws that were missing lockwashers were causing noticeable vibration.  With all the right pieces in place it hardly shakes at all!  Time to tear it all down, add loctite, lockwashers, and new fasteners to everything and put it all back together with the clutch disc.  A final spin up and I'm ready to put the motor in the car (hopefully for good).  It's a little more shaky after the rebuild, but it's not significant and hopefully it's just due to an imperfectly centered clutch disc.


I'm sure there will be plenty of time for a picture of the motor sitting in the car, and since I don't have on at the moment, that's all for now!  Next up will be making the clutch cable bracket and mounting the air conditioning compressor.  After that I need to make a shopping list of all the relays, contactors, potentiometers, fuses, shunts, DC-DC converters, etc. that will need to start filling the engine bay and get them on order.