loading

Electric cars are the future, and are beginning to take off today. However, they are still pretty expensive. A 3 phase AC motor is the absolute standard for car companies when they make an electric vehicle. The Tesla Roadster, Nissan Leaf, etc... All of the big boys use AC. It has a number of advantages over DC. An AC motor can last almost forever. You get regenerative braking for free, so that the energy you used to get your car moving can be captured and put back into your battery pack. This also makes the brakes last almost forever! There are almost no parts that get any wear in an AC motor except for the ball bearings, which are typically very durable.

The market is literally flooded with 3 phase industrial AC motors, so you can get them CHEAP if they are used. Yet, almost all DIY electric vehicle conversions are done using a DC motor. Why is that? One big reason is that the motor controller is typically very expensive. For example, a 211kW Brusa AC motor controller for use in an electic car will run you $21,000:

http://www.metricmind.com/price-list/

I'm going to walk you through the process of building your own 200kW (268 HP!!) AC motor controller for around $1000. It can be less than that if you get a few good deals on Ebay, or are content with less power.

I wrote the field oriented control software that goes on the dsPIC30F4011 microcontroller, and am making it freely available to do with as you please. If you want to modify it, MPLab is free:

http://www.microchip.com/pagehandler/en-us/family/...

Also, I made the PCB used for the control and driver section, and am making the schematic and pcb artwork available for you to modify to your heart's content. They were made in DesignSpark, which is also completely free to download:

http://www.rs-online.com/designspark/electronics/e...

So, if you want to modify the board, you can, and then can get your own board made at the PCB manufacturer of your choice.

Soldering skills are helpful for the PCB. There will be some aluminum drilling required, but it can be done with a hand drill if we get creative. Let's get started!

Step 1: Gather the Parts

Here's a list of parts you will need:

1. 12" x 15" x 3/8" aluminum plate:

http://www.onlinemetals.com/merchant.cfm?pid=21082...

1a) Instead of an aluminum plate, you could use this heat sink. You would need it to be 15" long. But then you would have to drill AND tap the holes:

http://www.heatsinkusa.com/12-000-wide-extruded-al...

2. 20.5" x 15" x 0.063" aluminum sheet for the enclosure:

https://www.onlinemetals.com/merchant.cfm?pid=1242...

3. 5 feet of 2 gauge welding cable, and 10 #2 lugs with 1/4" or 5/16" eye holes.

http://www.ebay.com/itm/10-2-GAUGE-2-AWG-X-5-16-in...

http://www.ebay.com/itm/Welding-Cable-Red-Black-2-...

4. 12" x 24" x 16 mil copper sheet:

http://basiccopper.com/copper-sheet-16mil-12in-24i...

5. 12" x 12" x 20 mil Nomex sheet for insulating the 2 copper sheets. The link below is enough for 6 controllers, but it's the smallest piece I could find. It's part number NMX4102001:

http://www.eis-inc.com/search/results/productdetai...

6. 5 feet x 1" x 1mil of Kapton tape (Ebay has a ton of this. It doesn't have to be 1" wide). Even electrical tape would probably be OK.

http://www.ebay.com/itm/20mm-100ft-Gold-High-Tempe...

7. Screws & mounting hardware. Note: The links below are just for reference. They generally come in packs of 100, but you will only need a few of most of these. So, maybe a trip to the local hardware store would be cheaper. Also, instead of the 12mm x M4 nylon, 20mm x M4 zinc, and 30mm nylon standoffs, you can use #8 x 1/2" nylon, #8 x 3/4" zinc, and a #8 x 1.25" threaded nylon standoff. It's just that ebay had the metric versions cheaper:

http://www.tacomascrew.com/s.nl/it.A/id.21078/.f 1/4" x 3/4" flat head x24

http://www.tacomascrew.com/s.nl/it.A/id.22534/.f #8 x 1/2" nylon pan head x4

http://www.tacomascrew.com/Products/Machine-Screws... #8 x 3/4" zinc flat head x8

http://www.ebay.com/itm/Metric-Thread-M3-M4-M5-M6-... 12mm x M4 pan head nylon machine screws x4

http://www.tacomascrew.com/s.nl/it.A/id.23078/.f 20mm x M4 flat head zinc machine screws x4

http://www.ebay.com/itm/10pcs-30mm-1-18-Black-Nylo... 30mm x M4 nylon threaded standoffs x4

http://www.tacomascrew.com/Products/Flat-Washers/0... 3/16" flat washers x24

http://www.tacomascrew.com/s.nl/it.A/id.7193/.f M5 x 8mm hex head machine screws x16

http://www.tacomascrew.com/s.nl/it.A/id.22695/.f M3 x 6mm pan head machine screws x2

8. Control/Driver board:

https://pandspowerelectronics.ecwid.com/

9. Bill of Materials for the the control/driver board:

Email me at PandSPowerElectronics@gmail.com to get the BOM.

10. Power Capacitor (there are a number of fine choices for this. The link below is for the one I used:

http://www.sbelectronics.com/product/700d348-power...

11. Three IGBT half bridges. There are a bunch of types that would work fine. I just list 2 options below. You can often find very good deals for these on Ebay:

http://www.mouser.com/ProductDetail/Littelfuse/MG0... (this would allow for 100kW)

http://theelectrostore.com/shopsite_sc/store/html/... (This would allow for 200kW)

12. Three current sensors (you really only need 2, but the 3rd is for extra safety if you want it):

http://www.digikey.com/product-detail/en/HASS%2020...

13. 5 feet of 20 gauge red, black, white, and yellow wire. Make sure it's rated for at least 300v. (It doesn't have to be those colors)

http://www.mcmaster.com/#8054T24

14. Thermal paste (there are millions of choices. Just about anything would be fine):

http://www.amazon.com/Banggood-Thermal-Compound-Si...

15: 0.11" female quick disconnect noninsulated x12. This goes on the PCB, but isn't a standard PCB part, so I'm not listing it in the bill of materials. It also works if you get insulated ones, and just pull off the insulation:

http://www.mcmaster.com/#69525K11

16. 600 grit sand paper:

http://www.lowes.com/pd_283311-98-5921ES_0__?produ...

Step 2: Drill and Sand the Base Plate

Get the 15" x 12" x 3/8" aluminum plate ready.

The IGBT hole locations are based on the assumption that you are using one of these types of IGBTs:

http://www.pwrx.com/Product/CM600DY-12NF or http://www.pwrx.com/Product/CM600DY-24S

If you use smaller 400amp (or less) IGBTs, the IGBT mounting holes will need to be adjusted:

All hole locations on the picture are given relative to the upper left corner of the base plate. You will need a 3/16" drill bit, a 1/8" drill bit, a 1/4" drill bit, and a 1/2" countersinking bit. If you have a way to precisely drill the holes, go drill them and move on to the next step! If you don't have a super fancy mill, don't lose heart. It can still be done. These next steps are for those who only have a hand drill...

  1. Use the UNSOLDERED control/driver board to mark the 4 PCB mounting holes on the aluminum plate. Drill those 3/16" holes first.
  2. With the PCB mounted with the 30mm spacers, place the IGBTs so that the 12 big holes across the top of the PCB (see the notes in the pictures) line up with the 12 male connectors on the 3 IGBTs. Now, mark the IGBT holes. Drill them with a 0.25" drill bit if you are really confident in your accuracy. Drill them with a 5/16" drill bit if you are less accurate. The bigger holes will allow for some error. Bolt all 3 IGBTs to the aluminum base plate.
  3. Having verified that the IGBTs can be plugged into the PCB later, remove the PCB and IGBTs.
  4. Now, drill the LEFT-MOST hole for each current sensor (see the notes in the first picture above). It doesn't have to be perfect at all. Just use the coordinates in the picture to get close. Use a 1/8" drill bit.
  5. Take a current sensor, and put the little plastic round centering thing at the bottom of it in the hole you just drilled. Mark the other hole now. The other hole should be to the RIGHT of the first hole. Drill the 2nd hole with a 1/8" drill bit. See the picture of the blue current sensor to get a visual on what I mean.
  6. Now, for the enclosure mounting holes. Make a line along the 15 inch long edge about 0.3 inches from the top and bottom. Drill the holes along the line. The spacing doesn't have to be accurate. And you can drill as many holes as you want. I picked 5 holes per side.
  7. Flip the base plate over, and countersink all the holes so that the screw heads lay below the surface.

The base plate is officially drilled! Now, flip it back over and sand the area where the IGBTs get mounted, using 600 or 800 grit very fine sand paper. Notice in the picture of the base plate above how it's nice and smooth where it was sanded? Now, make sure there are no shards of aluminum raised up around the holes on the top and bottom side. If there are any, lightly drill the hole with the countersink bit to knock off the raised aluminum.

Step 3: Drill the Enclosure Holes

For those with a precise way to drill holes based on (x,y) coordinates, see the picture for notes on all the coordinates and diameters of the holes, and drill all of them!

For the rest of us, with only a lowly hand drill:

  1. Lay the drilled base plate (countersunk side down) on top of the enclosure (defined as the enclosure's OUTSIDE), so one of the 15" sides of the enclosure is square with one of the the 15" sides of the base plate, and drill the edge holes in the enclosure by using the holes in the base plate. I would make a note on the enclosure about which is the OUTSIDE. Stay consistent. Don't flip the enclosure over when drilling the other mounting holes.
  2. Slide the base plate so that its other 15" side matches up with the undrilled 15" side of the enclosure. Now drill the other enclosure mounting holes.
  3. The 4 capacitor mounting holes, and the DC-DC converter holes (see the notes in the picture) will be drilled later.

Step 4: Drill the Copper and Nomex Sheets

For those of you who have the ability to drill precise holes based on (x,y) coordinates, these 2 steps are for you!:

  1. For each of the three sheets (nomex, B+, and B-), start with a larger piece (say, 12 inch x 12 inch), and drill the holes according to the coordinates in the pictures (and coordinates below for B+). Some of the holes are for providing an outline for cutting it out. For drilling the larger holes (1 1/8 inch, 1.25 inch), I suggest drilling a precise 1/8 inch pilot hole, and then drill a larger hole with a spade drill bit. Run the spade bit in reverse, and it will cut nice round holes and won't catch.
  2. Now, for each of the 3 sheets, draw a line with a permanent marker, connecting one outside drill hole to the next, all around the perimeter. Then cut out each of the 3 sheets with scissors, freeing them from their 12 inch x 12 inch sheet. Make sure you leave half of the 1/8 inch outside drill holes when cutting around the border. Some of those holes will later be used for marking where to bend the 3 sheets.

For the B+ sheet, the holes are pretty close together, so it's a little awkward to add the notes in the picture to indicate the coordinates. I'll just list them here:

  • The 8 outline perimeter holes are all diameter 1/8 inch, and their coordinates are (0,0), (9.105, 0), (10.06, 0), (10.685, 0), (10.685, -8.88), (10.06, -8.88), (9.105, -8.88), and (0, -8.88).
  • The 8 big holes that form a ring are all diameter 1.25 inches, and their coordinates are (2.77, -0.4), (6.115, -0.4), (8.48, -2.765), (8.48, -6.115), (6.115, -8.48), (2.765, -8.48), (0.4, -6.115), and (0.4, -2.77).
  • The 8 small holes that form a ring are all diameter 7/32 inches, and their coordinates are (3.125, -1.27), (5.755, -1.265), (7.615, -3.125), (7.615, -5.755), (5.755, -7.615), (3.125, -7.615), (1.265, -5.755), and (1.265, -3.125).
  • Finally, the 3 holes that mount to the IGBTs are all diameter 0.25 inches, and their coordinates are (10.39, -1.04), (10.39, -4.44), and (10.39, -7.84).

For those who only have a hand drill:

  • Only drill the 8 outside 1/8 inch diameter holes, as best you can. You could use a punch or a nail. The 8 holes that make the perimeter lie on a rectangle, so you just need to keep it rectangular, and get close with the hole locations above.
  • I suggest laying a 1/8 inch thick clear lexan (polycarbonate) sheet on top of the 16 capacitor tabs, and mark the holes with a permanent marker on the lexan. Then, drill a 7/32 inch hole where all those permanent marker spots are. Then, you can use the lexan sheet as a template later for drilling the holes in the 3 sheets.

Step 5: Solder the Control/Driver Board

First, let's talk a little about what the control/driver board is. It has all of the safety circuits, as well as the brains for controlling the motor. There's a dsPIC30F4011 microcontroller, which simultaneously samples 2 of the 3 phase currents, throttle position, and base plate temperature, and then based on that information, sets 6 pulse width modulation duties, which control the 6 IGBTs. Those 6 IGBTs power the 3 phases of the motor. The board also has several comparators, and some NAND and AND gates. So, if any current measured from the current sensors goes out of bounds, or the 24v or 5v power supply voltages go out of bounds, the controller shuts down the IGBTs in about 2 millionths of a second.

Each IGBT has it's own dedicated 24v power supply, as well as it's own driver to turn it on and off FAST. That helps to keep the IGBTs cool.

Let's start soldering! Solder the surface mount capacitors and resistors first. The easiest way to do that is to get solder paste:

http://www.amazon.com/MG-Chemicals-4860P-35G-Solde...

and put some on each capacitor and resistor surface mount pad. The surface mount pads are the ones that have no holes through the board. And they are labeled Cxxx and Rxxx, where xxx is a number. For example, C21 or R15. Once the pads have a little dollop of solder paste on it, place the components on the pads. The paste should hold them in place. If you have a hot air soldering rework station, just hit them all with some hot air, and they will all solder into place nicely. Otherwise, hold each part down with a toothpick, and touch each pad with a soldering iron until it's good to go. These surface mount parts are very big as far as surface mount parts go (1206 and 1210 packages), so it shouldn't be too bad.

Next, solder all of the through-hole resistors and capacitors. YouTube has tons of soldering tutorials if it's new for you. The resistors have no polarity. The only 2 capacitors on the board with a polarity are the electrolytic "can" type.

Next, add all the diodes. Those parts on the board start with a D. For example, D5. Pay careful attention to the band on the diode! Make sure it is put in with the same orientation as the picture on the board (called "silkscreen").

Now, go ahead and do the SOIC parts (part number FOD8316). There are good videos on youtube for explaining how to solder SOIC parts. It's not too bad.

Now solder all of the other components. Make sure you have grounded yourself before touching all of the things that came in the static shielding bags. Basically, don't walk around dragging your feet on carpet before touching those components. I have a piece of sheet metal that's by my soldering station. The sheet metal is connected to the ground outside through a wire. I touch the sheet metal before I touch the static sensitive components. That way, any potential zapping that I would do is drained away to the earth. Be sure to program the ATTiny25 before soldering it in! It can be found here:

https://github.com/MPaulHolmes/ATTiny25DC-DC

Also, the hex file is called DC-DC-Converter.hex, and is attached to this step. You will need an AVRISP MK2 to program it, or some sort of avr programmer. Also, you will need something like AVR Studio, which is free.

Debug the control board before proceeding!! If you have a bench supply, try giving it 23.5v-24.0v at the 24v supply (see picture above). Program the microcontroller with this debugging code, and measure the voltage between each pair of the 0.11" female quick disconnects. See the picture above for the notes on this:

https://github.com/MPaulHolmes/ACControlBoardDebug...

Step 6: Bending the B+, B-, and Nomex Sheets

Bend the 3 sheets where the half drill holes are along the edge (remember when you kept half of the perimeter drill holes when you cut the sheets out?!). You can use a piece of wood and just fold the copper and nomex down. It should look like the pictures above when you are done. Also, with the B+ sheet, you need to solder 3 wires to it as you can see in the picture. It will take a heavy duty soldering gun. Only do the soldering on B+ while the nomex isn't right next to it. The PCB needs the B+ voltage, and this is how I did it. You could run wires from where the IGBTs bolt to the B+ sheet if you are unable to solder the wires to the B+ sheet like this.

Put all 3 sheets together like in the picture, with the nomex sandwiched in the middle. In the picture, it shows the holes already drilled in the 3 sheets. (Notice that the nomex in the picture has rectangular holes. That was annoying to do. Don't bother! Circular holes work just fine.) If you already have your holes drilled, move on to the next step. You are done here! But for the poor people with only a hand drill, stick around. This next part is for you:

If you are using a hand drill, once you have made your nomex sandwich, flip the sandwich so that the B+ sheet is facing up. Tuck the lip of it under a piece of plywood, so that the sandwich can lay flat without squashing the 2 right angle bends. Lay the lexan sheet with the capacitor holes on top of the sandwich. Sort of try to place the holes like they look in the picture above, but it's not important to be very close. Now, using the lexan holes as your guide, drill all 16 holes through all 3 sheets at the same time, using the 7/32 inch drill bit. Now, pull the 3 sheets apart, and go back to the "Drill The Copper And Nomex Sheets" step. Pay attention to the correct size of each of the capacitor holes, depending on which sheet you are working with. Using the 7/32 inch holes as pilot holes, drill the correct size capacitor holes where they need to be in each of the 3 sheets.

Step 7: Attach the Sandwich to the Capacitor

Put some kapton tape on the B- tabs of the capacitor as is shown in the picture above. Make sure you cut a 5/8 inch circle out of each piece of tape, so you will still get good contact between the tabs and the B- sheet. You need to add that tape so as to prevent the B+ sheet from shorting to the B- tabs. Attach "the sandwich" to the capacitor. Add the 3 pieces of kapton tape as shown in the 4th picture above. That prevents the IGBT B+ bolts from getting too close to the B- sheet.

Step 8: Bolt on the IGBTs and Current Sensors

First attach the thermistor (the temperature probe). Then, add a very very thin layer of thermal paste to both the base plate and the 3 IGBTs. A credit card works well for this. Then, bolt them down using the 1" x 0.25" flat head machine screws, a lock washer, and a nut for each hole. Torque them at diagonals. For example, if the corners were labeled clockwise as 1, 2, 3, 4, torque them down as 1, 3, 2, 4. Make sure the 4 quick disconnect tabs on each of the IGBTs are facing down like in the picture.

For the people who already drilled their IGBT mounting holes because they had access to a mill or whatever, you are done with this step! Move on!

For those people using a hand drill, I just want to say I am sorry for what you are about to have to do:

Now that the IGBTs are locked down forever, you can use an unused portion of that lexan sheet to mark the hole positions for the 3 B+ and the 3 B- tabs. Drill some 0.25 inch diameter holes in the lexan at the spots where you marked your B+ and B- holes. Now, transfer those 6 holes to the 3 sheets that are still bolted on to the capacitor. CAREFULLY drill the 6 holes with the capacitor still attached. Then, (you are going to hate me) take the capacitor off, unbend the B- sheet (sorry) and enlarge the 3 B+ holes to a diameter of 1.25 inches. See the "Drill The Copper And Nomex Sheets" step if you are confused about which 3 holes to enlarge on the B- sheet. Now, rebend the B- sheet as before, put the sandwich back together, reattach the capacitor, and we are ready to go! Don't you wish you owned a CNC mill now? haha.

Step 9: Add the Three Phase Cables

You will first have to build your cables. That will require a way to crimp the lugs onto the cable. We're using 2 gauge cable, which BARELY fits through the current sensor window if you squash it down first. Notice the picture of it slightly flattened. You could use 2 pieces of wood and a vice to flatten it a bit (or 2 pieces of wood and a hammer?) It will take some bending to get the lug to mount right at the IGBT tab. Use a lug with a 0.25" or 5/16" eye. Add the heatshrink tubing AFTER you squashed the cable down. Otherwise, you will smash the heck out of the heatshrink and it will get damaged.

Step 10: Attach the Control/Driver Board to the IGBTs

OK, this step might take a bit of cajoling, but it should go on. Don't try to force it all the way down. If the tabs are pressed in pretty well, so that you know there is good contact, then that's OK! Enough is as good as a feast, as my mom used to say. Feel free to bend the tabs a bit if you need to so they all go in to the female connectors.

Once the PCB is attached to the IGBTs, for each of the 4 PCB mounting holes, add the M4 x 12mm metal screw through the bottom, then a #8 washer or 2 over the metal screw, and then the M4 x 30mm threaded nylon spacer, and then the nylon M4 x 12mm screw that clamps the PCB down against the spacer.

Go ahead and plug in the temperature sensor, as well as the 3 current sensors to the control board. See page 3 of the attached current sensor datasheet for the pinout of the current sensors. You will only need 3 of the 4 pins from each current sensor (Vref is unused), which means you need to build the cables using 3 wires. I usually use shielded 3 wire cable, but you could also twist 3 wires together. Make sure the cable is either shielded or twisted! This is a high noise environment.

Step 11: Attach the Capacitor and 3 Sheets to the IGBTs

To attach the capacitor/nomex sandwich to the IGBTs, you will have to bend the sheets a bit. Once you get the screws in the IGBT holes, things go pretty smoothly. If for some reason things don't line up, just enlarge the problem IGBT mounting hole a bit.on the copper sheet.

Once the capacitor is mounted, plug the 3 wires that were soldered onto the B+ sheet into the 3 orange wires on the control board. It may not be a bad idea to glue down the wires so they don't flap all over the place, and not make them so stinking long, like I did. haha.

Step 12: Add the B+ and B- Cables

One way to attach the B+ and B- cables is see the above picture. Notice that the B- cable attaches at one corner, and the B+ attaches at the other corner.

Step 13: Bend the Enclosure, and Attach It

I use a sheet metal brake for bending aluminum, but if you don't have that, you can make one cheap! Just do a search for cheap sheet metal bender on youtube, and you will get lots of ideas.

OK, get your 20.5 inch x 15 inch x 0.063 inch piece of aluminum ready to go. See the attached picture for directions on the bends. Now, mount the enclosure to the controller. The capacitor BASE is going to mount to the enclosure upside down. If you had the holes drilled already, just screw in the capacitor base to the enclosure. Also wire the DC-DC up and attach it to the enclosure, but first read the notes on the DC-DC picture above. You professional people are done! Go to the next step!

Hand drilling people: Bolt the edges of the enclosure to the base plate. Then, lift the capacitor inside until it bumps against the enclosure. Now, mark the 4 capacitor mounting holes on the enclosure with some paint, or a marker, or a pencil. Remove the enclosure, and drill the 4 holes.

Also, lay the DC-DC converter against the inside of the enclosure and mark the 2 mounting holes. See the notes on the DC-DC converter picture above. Before bolting the DC-DC permanently on the enclosure, make sure the capacitor is attached, and make sure the DC-DC is wired.

Step 14: Making the End Plates

We can't leave it open on both ends like that! I don't have any pictures of it, as I never add end plates (I'm always in the testing phase, and leave it to my beta testers to seal it up), but what they have told me is to cut out ABS in the shape of each end of the controller, and use ABS cement and a heat gun, and form a lip all the way around the ABS end plate. Then, just glue both ends to the enclosure, after cutting holes for the wires to come through, of course. Something like this has worked well:

http://www.amazon.com/ABS-Sheet-Thick-Black-Nomina...

Step 15: Hooking Up the Low Voltage Wiring on the Controller

  • See the notes in the picture for the pin-out of the low voltage section


The 5 pin encoder cable also needs to plug into the encoder, which will be attached to the motor. It is critical in the field oriented control code to have access to the motor's RPM. The microcontroller counts pulses from the encoder, and can deduce the motor RPM from them.

Here's an example of an encoder that I have used:

http://usdigital.com/products/encoders/incremental...

And here's a specific part number that I picked:

E6-512-1000-NE-S-D-T-3

512 ticks per revolution, 1 inch diameter motor post, no index pulse (that's only useful for permanent magnet AC motors), and single ended, which means no hole in the encoder for the motor post to stick through. This is good when you have a short post at the back of the motor barely protruding out. It's a good clean way to keep out dust. It's no big deal if you have to get one where the motor post goes all the way through the encoder case though. The adhesive back option also was selected, so that the encoder just glues onto the back face of the motor. Also, I selected a centering tool, spacer tool, and a hex wrench to be included. They also sell the shielded 5 wire cable already built for the encoder connector.

You can either use a hall effect throttle or a potentiometer throttle. The controller is programmable through the serial port. Here's an example of a hall effect throttle that I've used:

http://www.evwest.com/catalog/product_info.php?pro...

You will most likely need a USB to serial adapter for the serial communications (unless your computer's nickname is Methusela):

http://www.officedepot.com/a/products/797491/Sabre...

Step 16: Hooking Up the High Voltage Section

Connecting the motor is the easy part. You just hook up the 3 phase cables that passed through the 3 current sensors to the 3 leads of the motor. If the motor is spinning the wrong way, just swap any 2 of the 3 motor leads. Here are the rest of the connections:

Battery Pack POSITIVE ------ Precharge Resistor ------- Precharge Relay --------- B+ sheet on controller.

Battery Pack POSITIVE -------------- FUSE -------------- CONTACTOR #1 ------------ B+ sheet on controller.

Battery Pack NEGATIVE ------------ CONTACTOR #2 ---------------- B- sheet on controller.

This is a good choice for an inexpensive contactor. You don't have to use 2. It's just safer (I never did! haha):

http://www.mouser.com/Search/ProductDetail.aspx?R=...

This is a good precharge resistor:

http://www.mouser.com/Search/ProductDetail.aspx?R=...

The precharge relay must be able to handle a few DC amps at hundreds of DC volts! Do not use an automotive relay!! I've used this in the past, and it works fine. It says it's a 6v coil, but there are 2 coils, so you just wire them in series to make a 12v coil:

http://www.mouser.com/Search/ProductDetail.aspx?R=...

Step 17: Software and Testing

This assumes that you have debugged the control/driver board already. OK, let's use a 48v bus voltage for this process. Go program your microcontroller using a pickit3 or something similar, using this software:

AC controller software

Once it's programmed, type the following in Realterm:

run-pi-test

"run-pi-test" will find the best Proportional and integral constants, and save them to the EEProm automatically.

If you are using an AC INDUCTION motor, do the following additional procedure:

Getting a 3 phase motor to run with field oriented control requires that you know some obscure facts about the motor that are not available on the name plate. For example, you need the rotor time constant, which requires the rotor resistance and rotor inductance. Of course none of these things will be available! So, instead we are going to do a trick to find it. Type the following command in Realterm, making sure that the motor post can spin freely:

run-rotor-test

It will hunt for the ideal rotor time constant. It takes a couple minutes for it to run. What it's doing during that time is seeing which rotor time constant candidate spins the motor the fastest.

Step 18: Driving an AC Motor

I have tested the controller and software on both an AC induction motor and a permanent magnet AC motor. Here's a video of a quick test with a permanent magnet AC motor. This test was with a 48v DC bus:

And here's a video of a test with an AC induction motor. This was with a 6.6kW motor rated for 480VAC. The test was done with a 72v DC bus, which works out to about 51VAC:

Here's an example of using the serial communications:

I have 2 beta testers. The first controller will be tested in Canada. He will really put it through the paces. There will be high voltage and high current tests of both regen and non-regen. The 2nd controller is going to a friend in Australia. That's the one I assembled for this instructable.

<p>This is of huge historical meaning:</p><p>It's easily underestimated, <br> but this is a tremendous, huge, giant, epic, crazily complicated <br>project to develop. Many people have failed, even experts have failed <br>creating just 10KW inverters. And even those 10KW designs were quite <br>hidden.</p><p>It seemed our open source, green energy, better world movement'd just been doomed to stay insignificant forever.</p><p>This <br> is over now. Paul has stopped the 2nd class citizenship. There's a <br>sophisticated state of the art solution available as open source now, to <br> make this a more environmental friendly world!</p><p>---</p><p>How I found this amazing news if Paul and Sabrina &amp; son's breakthrough unexpectedly (not really searching for it): <br></p><p>Have <br> tracked ecomodders and endlesssphere colleagues over years. Thought AC <br>controller by you had been abandoned. Then I wanted to order these 7 <br>stepper motors for my new low-cost 2m x 2m diagonal universal <br>multimachine design (why so big? for printing out the statue of rhodes <br>of course ;)). Almost bought, invested these 400 bucks, then thought oh <br>dear this stepper motor has parts that are not need for the indoor mill. <br> So why not build your own steppers? It must be way cheaper. -&gt; <br>searched for 'create your own high power stepper motor' .... and WHAT ? <br> MPHolmes motor controller? AC? HOLY COW! HOW I MISSED THAT? Thought <br>that'd be abandoned. <br></p><p>When even Tony failed (or not shared?) <br>with the 100KW open source inverter, my last hope essentially had been <br>gone. <br> <br>http://eet.etec.wwu.edu/ahmanna/project/docs/Prodject%20description.pdf </p><p>Have <br> even tried to design my own ... but my skills are not at all as great <br>as those of Paul. This project only has succeeded due to his &amp; <br>consorts outmost sacrifices and steady and continuous effort to drive <br>this project forward. Thanks, Paul &amp; his beloved ones! For a better <br>world.</p><p>(P.S. If we continue to raise living standards across the world, then we might not fail to prevent next <br>world wars or whatever crisis. Innocent children still starving, are <br>exploited or abused and I'll not stop before this world stops this and <br>also other nonsense like nationalism and &quot;my belief is the only right <br>one&quot; and &quot;I'm better than you&quot; nonsense. I live to create a better <br>world. And I want to create it for others, not for me. I don't live for <br>me, I live for those that I love. Thanks Paul for making this world a <br>better place.)</p>
<p>Thank you so much for the kind comments!!!! It was extremely satisfying to get this thing working. </p>
Do you have one for sale?
<p>I saw the huge power rating - 200kW - and I thought, &quot;Crap, that's huge. I can only think of one guy who's made one that powerful.&quot; </p><p> Then I saw your name on it. Duh.</p>
<p>haha Thanks!</p>
<p>The only thing more awesome would be a diy worm-hole generator, best project on instructables ever. High power lo-cost gate drivers, &quot;laminated&quot; bus bar, Induction motor Field Oriented control, this is just amazing! Methinks we are gonna be seeing a lot more &quot;beer-budget&quot; DIY Teslas soon (or converted Porsches or???), and that is awesome!</p>
<p>This comment really made me smile. It's nice when someone appreciates all the stuff I'm the most proud of!</p>
<p>can you put out the specs on this amazing controller? . Max voltage, max current, ( peak current say 10 seconds ). Waveforms generated for PMAC motor? You have done an incredible job , thank you. Themotorman..</p>
<p>can i have the program for the microcontroller?</p>
By far one of my favorite instructables to date, not because its something i see myself doing, but because its awesome to see such detail in this big a** project of an instructable. Kudos my freind
<p>Thanks Ian! </p>
<p>Hi, can anyone pass me the list of components, circuit diagrams and PCBs.</p><div><p>My email: JELN84@MSN.COM</p><p>Thank you.</p></div>
Hi, I've just registered specially to contact MPaulHolmes. I'm an electric wheelchair user. I only became reliant on it in the last couple years. I'll try to keep things short. Powerchairs are so expensive and pretty much unusable out of the box, even with some reprogramming they're still inefficient. There are many problems including under powered, badly made, no torque weak short life lead batteries etc, etc. The reason I've contacted you is whilst browsing I came across your AC motor controller piece and wondered if this might be incorporated into a wheelchair (powerchair) set up? Not to be confused with mobility scooters. I'm thinking it would be fantastic if it were possible to fit high powered AC motors with your controller to work with a joystick set up. My goal would to to get up to 15-20 mph and have a massive range between charging also plenty of torque for claiming hills and kerbs. I have no knowledge on AC motors or controllers so I was wondering what your thoughts might be on looking into it. I've adapted my own chair to take extra wide lawn tyres, I've moved the centre of gravity back over the rear wheels to make the front end light enough to wheelie up kerbs and not get the front caster wheels stuck in mud etc. So I'm up for a challenge, I just don't have the know how to see if AC could work for Powerchairs, hopefully you could point me in the right direction?
<p>This is a 200KW speed-controlling inverter. That is about 268HP with the right motor and batteries! For a wheel-chair 2KW/2.68HP would be more than enough and you wouldn't need the &quot;Regenative braking&quot; either so you could happily go for DC motors. There are lots of off-the-shelf solutions for low powered stuff. What makes <a href="https://www.instructables.com/member/MPaulHolmes/" rel="nofollow">MPaulHolmes</a> project great is that now there is a feasible solution for converting a car to electric where before it was cost prohibitive.</p>
<p>Paul,</p><p>Awesome job on the controller. I am very interested in your instructable. My DIY EV car has a DC motor (no regen) and operates at 120 Volts off a modified Chevy Volt battery. It has dismal low end torque (0-60 in 30 seconds!!!) and have been looking at AC as a possible fix. I want to try your controller but I don't see the PCB and components listed. Is it possible to buy that component from you? </p>
<p>can I pay you to make one for me for 400kw 360v </p>
<p>Hello Paul,</p><p>please I have got a silly question.</p><p>Is Your design capable of hi frequences, for example 150-200Hz, or more,</p><p>so I could use motor with hi revs?</p>
<p>Yes you can use high frequency.</p>
<p>Cheers Paul to an impressive project.</p><p>Do you have a spec for the maximum rpm the design can realize?</p><p>It is probably dependant on the PIC-capabilities and I need much more than the 200 rpm asked for above.</p>
<p>Hi, I would like to make controller like that one but i can't see anyhing from the pictures above. Do you have scheme or better quality pictures of this control board?</p>
<p>Good !!!</p>
<p>I'm curious because those half-bridges are so expensive, could you build the half-bridges out of individual IGBTs like this one: http://www.mouser.com/ProductDetail/Fairchild-Semiconductor/FGPF4633TU/?qs=sGAEpiMZZMv4z0HnGdrLjg2lSZBYbkWPL4w9lb0h0yc%3d . So you would theoretically 6 IGBTs to make three half-bridges right? I'm asking because it would drastically reduce the total cost if this were the case. </p>
<p>Hello,this controller is a great project ,I am with you ,but my AC motor is 96 V,144 V,can directly use it ?If not,what should I change hardware and code</p>
<p>The controller doesn't care what voltage you use. It will do anything from 0v up to about 400v.</p>
<p>What actually limits the controller to 400v? Both the igbts you linked are 600vdc max. What else is limiting the max voltage?</p>
This is a great project as all the parts are replaceable if they break unlike the commercially available ones. Is it possible to integrate a charger into the design or would that require large inductors and more components? Because in europe we have 43kw 3-phase ac fast chargers and it would be good to reuse the controller as a charger to save weight and components.
<p>if you're interested in integrating charger and motor controller you should see this; </p><p>http://webfiles.portal.chalmers.se/et/Lic/SaeidHaghbin%20Lic.pdf</p>
<p>Pretty amazing pdf.</p>
<p>Yes I think you could. </p>
<p><em>&quot;Because in Europe we have 43KW 3-phase AC fast chargers and it would be good to reuse the controller as a charger to save weight and components.&quot; </em></p><p>How this can be done? Could be a theme to resolve... I am in Europe too, and am interested. Thanks! </p>
<p>I don't think it would be worth it, as without inductors the voltage limit of the charger would be lower than the the input voltage, 400v rms on 3-phase so a peak voltage would be 565v which is fine for almost all battery packs, but on single phase the peak would be around 315v, too low for lots of battery packs, however I think the motor can be used as an inductor so it may be possible but it is probably easier to build two circuits, a large charger and controller in one box. </p>
<p>Hello, this controller looks great. But I have a couple questions as I haven't had the time to go through thoroughly. I am working on a similar project myself. the only main difference is that I am working with a 12 pole motor of my own design. and am going with Beefier IGBTs as I plan to go as high as 600v-750v and higher amperage. Also, I am trying to do without an encoder as my motor has a 6&quot; hollow shaft, and I have yet to find one to fit. And latter work on connecting 2 or more of these controllers together to control multiple motors.</p><p> I was wondering if you were able to build in Regen? I am trying to figure the best way to make it variable. so that the harder the brake is applied the more regen is fed back to the batteries. And of course if it goes out of limits to dump the rest via resistor. Also I am trying to figure out how to add a reverse switch. So that just as in a regular car you can have a drive position and accelerate with the throttle. Use the regen braking to stop, &quot;shift&quot; to reverse and use the same throttle control to accelerate in reverse. And of course I would probably add a limit to the max reverse speed.</p>
<p> <br>Hi there... Love this projeckt <br>Where can i get bill of material for pc board and the layout ? </p>
<p>Hi i am wery interested in this projeckt where can i find partslist for the Control/Driver board and the motherboard for that ? (plate)<br></p>
<p>Amazing project! Been looking for a open source foc ev controller for a few years, even found your ecomodder thread but didnt really thought it was gonna bevome something finished. Started to plan a build together with a few friends here in sweden (magnus who recently orderd pcb's is one), we're gonna build 2 controllers. Ran into some things that might be useful for you to know, first is a few errors (i think) in the bom list;</p><p>c72 row 53 4,7uf instead of 0,1uf<br><br><br>r31 row 243 1,5k instead of x<br><br><br>r32 row 256 3k instead of x<br><br><br>r33 row 254 2k instead of x<br><br><br>r60 row 317 470 instead of 1k<br><br><br>r53 row 319 470 instead of x<br><br><br>r51 row 253 2k instead of 100k<br><br><br>r61 row 252 2k instead of 4,7k</p><p>An other thing is that 2 files got removed from git-repo 27 july that needs to make the code compile, maybe just deleted by accident?</p><p>I rearranged the bom list a bit to easier evaluate the parts, here is the link; </p><p>https://drive.google.com/open?id=11t-cFtDKCFCDDljHgyV-5V9UQfLH2I2Px3KxmH8qnDg</p>
<p>Ya, I've never used github before. I think I did delete those bymistake. I have been going through so many changes while testing the code with someone up in canada, that I figured it would be easier to just wait a little while longer until it's ready. But now it autotunes the PI loop, and searching for the rotor time constant is automated too. I just want to add a datastream option before uploading it. I don't know of an easy way to download and compile, so I've just been using github as more of a place to store the .c and .h files rather than how it's supposed to be used. As for BOM corrections:<br><br>R31, R32, R33 can be left out. Someone was going to do a raspberry PI thing, but they never finished it. Those resistors were to create a divider for 3.3v interface. </p><p>C72 can be either 0.1uF or 4.7uF. The time constant is longer with 4.7uF, but it's just the throttle, so it's still plenty fast either way.</p><p>For R60, I was going to recalibrate the thermistor, since I had been using an expensive 10k, but there were lots of other options that were cheaper. And I think I had found a 4.7k that was inexpensive. You can even use nothing for R60 (just a jumper). At the moment, I'm not even using the temperature feedback. I mean, I read it in the A/D interrupt, but was focused on other things.</p><p>Don't use R53 (leave it open) if you are using a hall effect 0-5v throttle. At the moment I'm using a 0-5v hall effect and hadn't bothered to see what 0 to max throttle corresponded to assuming a pot. I think I was trying to make similar dividers for the throttle and temperature. </p><p>Make sure R51 is 100k, and not 2k. 100k works fine, and most hall effect throttles can only handle a couple milliamps. I think 2k would be pulling it down too harshly.</p><p>R61 can be either one. I think if you want absolute standard that has been used on my 500amp controller, it would be +5v ----- 1k ------- 10k thermistor -------- 4.7k ----- ground.</p><p>I'll get the github files updated with compileable code in the next few days.</p>
<p>Ok, nice! Almost received all parts for our builds now, mostly from farnell and rs to avoid taxes and fee's for oversea deliveries. So if you hear of anyone else that want to build your controller in Europe we are happy to share the order list. First assembly session tomorrow, yeah!</p>
<p>I am also from Europe and would highly appreciate if you could share your latest version of the BOM. Can't find a source for the Power Capacitor here in Europe. Would like to know where you ordered from.</p>
<p>Hello, I really like the way you organized the BOM in the excel file above. By any chance do have the original file I would like to compare. Thanks</p>
<p>thanks, you should be abel to use the file button, <br>top left, and then 'download as' and be able to choose from a bunch of <br>formats to download even if your not logged in.</p><p>get back if it doesn't work, this document is a bit more updated;</p><p><a href="https://drive.google.com/open?id=1PdIOW26b40gDJ1hC4Kf61zIDARi1iy0nytxTrA-5v-E" rel="nofollow">https://drive.google.com/open?id=1PdIOW26b40gDJ1hC...</a></p><p>are you in europe as well?</p>
<p>Thanks. I'd like to hear more about your progress on this project. No, not in Europe, in the US.</p>
<p>nice, we are documenting our build here; </p><p><a href="http://elbil.forum24.se/elbil-about6094.html" rel="nofollow">http://elbil.forum24.se/elbil-about6094.html</a></p><p>only swedish though but, at least some pics and links</p>
<p>Hi, my wife has a much loved Toyota Rav 4 of 1997 vintage, sadly with a damaged auto box which is horrible money to replace now. So why not convert to an EV. Its relativity lightweight and would be great as a run-around in our French village. Yours is one of the few examples to do this and understand what your doing. Making it from the board up would be more interesting for me as well. Time to start planning I think before its Controle Technique later this year.</p>
<p>Hi Paul. Great instructable with lots of usefull links. I was wondering how you would have changed the design if you could not get hold of the power ring film cap. My problem is that it is not sold in my country, Any other way of doing this?</p>
<p>So did anyone make one of these but then decide they weren't going to use it or wanted to build a different one? It's way beyond my ability to build, but I would buy yours.<br><br>Thanks!</p>
<p>Paul, What is the part number and source for this giant capacitor? What might be suitable replacements for it? </p><p>When do you think you will get a chance to upload the pc board files and bom?</p><p>Thanks,</p><p>Tom</p>
<p>I cant see the 4shared links, did you mannage to upload it? Have you tried google drive?</p><p>I really wanted the part list</p>
Wow! Impressive open source design. Thanks for sharing! One question: what would you do differently next time?
I would change the control/driver board some. Actually, I've made several different versions, but haven't sent it in yet. One change would be to add an A/D input for the brake, so that you could use regen based on a brake pressure switch, and not just from the throttle.
Dear Paul<br>This controller cqn use 24v 200ah battery?

About This Instructable

110,885views

361favorites

License:

More by MPaulHolmes:200kW AC Motor Controller for Electric Car Homemade 100 HP Motor Controller for an Electric Car 
Add instructable to: