330ci EV conversion - E46Fanatics E46 BMW Social Directory E46 FAQ 3-Series Discussion Forums BMW Photo Gallery BMW 3-Series Technical Information E46 Fanatics - The Ultimate BMW Resource BMW Vendors General E46 Forum The Tire Rack's Tire Wheel Forum Forced Induction Forum The Off-Topic The E46 BMW Showroom For Sale, For Trade or Wanting to Buy

Welcome to the E46Fanatics forums. E46Fanatics is the premiere website for BMW 3 series owners around the world with interactive forums, a geographical enthusiast directory, photo galleries, and technical information for BMW enthusiasts.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   E46Fanatics > E46 BMW > The Showroom

The Showroom
This is the place to show off your BMW to other members of the community. Post pictures and videos of your car and the modifications you have done to it. If you need a picture of something on a coupe, sedan, convertible or touring you will probably find it here!

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 04-01-2017, 08:16 PM   #1
BigMouse
Registered User
 
Join Date: Nov 2007
Location: Silicon Valley, CA
Posts: 53
My Ride: 2001 330ci
330ci EV conversion

Hi everyone! I've blogged this conversion start to finish in a few places now, but I thought I'd finally break the ice here and see what sort of reaction it gets. This is my 3rd BMW (second E46), and my first (successful) EV conversion. I believe it's also the first to use OEM components like this, without transplanting the entire drivetrain.

I'll port my build to this forum one post at a time. The build took place over 2 years. Lucky you get to see if go from concept to burnout all at once!

Begin port:
BigMouse is offline   Reply With Quote
Ads by Google

Guests, get your FREE E46Fanatics.com membership to remove this ad.
Old 04-01-2017, 08:17 PM   #2
BigMouse
Registered User
 
Join Date: Nov 2007
Location: Silicon Valley, CA
Posts: 53
My Ride: 2001 330ci
Originally posted 2/24/15

Hi All. Starting a thread for my new EV project!

This one is going to be this 2001 BMW 330ci. I've been wanting to do an BMW coupe conversion for several years now. I've always loved the way they look and feel, they are beefy enough to carry the weight of the batteries, and the coupe body style allows for the rear seat to be re-purposed for battery placement while maintaining good weight distribution.



The transmission is from a 2007 Lexus GS450h. It contains two electric motors and gear reduction. The output shaft is the same configuration as that used on the BMW it's going in and should be easy to adapt. I've calculated the total combined power from both motors to be around 200kW (270hp).



The inverter will be based on the OEM inverter that the transmission was originally coupled with. There will be a fair bit of modification done to allow this to drive both motors at high power levels. This will be the subject of much reverse engineering and custom circuit boards.


Pictured is 32kWh of Chevy Volt batteries (two cars worth). I'll be putting these batteries in series minus a few modules to keep the voltage within the rating of the inverter. I'll end up using about 29kWh worth of these cells for a range of around 110miles. The total pack will have a nominal voltage of around 640vdc.



I used the data provided in the ORNL teardowns of the Camry hybrid and LS600h drivetrains to calculate the expected performance. The combination of these pieces should allow me to build a car that does 0-60mph between 4-5 seconds, gets around 110-120 miles to a charge, seats two, and has unimpeded trunk space.

Everything in this conversion will be used or salvaged parts from other hybrids or EVs, with the exception of the custom electronics needed to make it all work together.

It should be a very nice car to drive.
BigMouse is offline   Reply With Quote
Old 04-01-2017, 08:18 PM   #3
BigMouse
Registered User
 
Join Date: Nov 2007
Location: Silicon Valley, CA
Posts: 53
My Ride: 2001 330ci
Quote:
Originally Posted by favguy View Post
I'm looking forward to watching this with interest

Are you using a main motor mated to the transmission in place of the engine as well? or just the integral transmission mounted motors?
Just the motors inside the transmission. The input shaft will be locked (I need to design some sort of fixture to hold it). This will allow MG1 to act as a motor through a fix reduction. The speed rating of MG1 is the same as MG2 in the Camry hybrid (14k rpm), so this configuration will limit me to 110mph due to MG1 speed. MG2 has two speeds, controlled by clutches and a gearset in the transmission. There's an electric oil pump that allows EV mode in the original transmission. I'm hoping that this pump feeds the same oil circuit as the mechanical pump inside. The mechanical one will never turn as it's coupled to the input shaft. I'll need to make sure that the clutches/solenoids get hydraulic pressure as well as the oil cooling for the stators and lubrication of the bearings. I'm trying to get a second transmission that I can tear down to confirm the operation of the oil pump, but if I have to, I'll tear this one down to make sure. If I need to drive the internal oil pump as well as the electric one, I'll rig up a BLDC motor to drive the pump shaft. But I'm really hoping I can avoid that.
BigMouse is offline   Reply With Quote
Old 04-01-2017, 08:18 PM   #4
BigMouse
Registered User
 
Join Date: Nov 2007
Location: Silicon Valley, CA
Posts: 53
My Ride: 2001 330ci
Here's a schematic of the transmission:

The "ICE" shaft will be locked. The two clutches will be retained and used to control the speed of MG2. The LS600h has the transfer case. The GS450 (mine) goes directly to the output flange.

If I'm going to be driving the two motors independently anyway, I might as well take advantage of that ability. It's not really any harder to control them independently at different speeds than it would be if they were locked together. Still need two inverters, still needs two resolvers. I think Toyota's setup will be the strongest setup. As soon as I start welding on gearing, I'm making it weaker.

The biggest complication to my method will be the two-speed system for MG2. Having the motors separate means that MG1 can continue to provide torque while MG2's gearing is changed.

The biggest reason I'm going with my method is performance. Locking the two motors together and with one gear ratio would cripple the performance of this transmission. MG1 doesn't develop a lot of torque, maybe 150Nm. So it relies on the gearing for that to use its full potential. Similarly with MG2. In the low-speed gear, MG2 will be on a higher ratio than in the high-speed gear. If I lock it in the high-speed one, I lose the acceleration advantage of that gearing. If I lock it in the low-speed one, I'd be speed limited to 45mph. It's a beast of a machine, and I want to take full advantage of that.
BigMouse is offline   Reply With Quote
Old 04-01-2017, 08:19 PM   #5
BigMouse
Registered User
 
Join Date: Nov 2007
Location: Silicon Valley, CA
Posts: 53
My Ride: 2001 330ci
Here's a link to the paper that describes the transmission (mine is the same minus the transfer case). The GS450h inverter from this same generation is identical to the Camry hybrid inverter. There's also a detailed teardown of that from the same folks.

Transmission: http://www.osti.gov/scitech/biblio/947393/
Inverter: http://www.osti.gov/scitech/biblio/928684
BigMouse is offline   Reply With Quote
Old 04-01-2017, 08:20 PM   #6
BigMouse
Registered User
 
Join Date: Nov 2007
Location: Silicon Valley, CA
Posts: 53
My Ride: 2001 330ci


Managed to get the pinouts for the internal connectors figured out. I'm able to drive the inverter with my own signals! I threw together some very simple open-loop code on an Arduino, put 12v on the DC bus, and connected one of the motors on the transmission. The result is seen in the video. It spins!
It spins slowly, but it spins. That's 12v with no real control. 650v with closed loop control will be a very different story.
Very exciting.
I also figured out how to drive the gates on the converter section, but that's not as interesting to show in video.
Moving forward!

Last edited by BigMouse; 04-01-2017 at 10:56 PM.
BigMouse is offline   Reply With Quote
Old 04-01-2017, 08:21 PM   #7
BigMouse
Registered User
 
Join Date: Nov 2007
Location: Silicon Valley, CA
Posts: 53
My Ride: 2001 330ci


Okay, something more exciting to show. I got the charger out of a Chevy Volt working so I quickly hooked it up to my inverter as a power supply to try it out. I set it to its lowest setting (200v). The inverter is still running on the breadboard and Arduino with no current sensing but it does have motor position sensing. If you saw my video from back on the 2nd of this running on 12v, 200v will look a bit more impressive. Again, the final voltage will be 650v.

The LEDs that light up are connected to the oil pressure sensors in the transmission. The input shaft isn't locked yet so it spins with the motor and turns the internal pump. Once the input shaft is locked, I'll have to use the electric oil pump. Interesting fact, the transmission defaults to the high speed gear unless I drive the solenoids to get it do downshift to the low speed gear. This is so that if a solenoid or pump fails at high speed, the transmission won't downshift and overspeed the motor.

Last edited by BigMouse; 04-01-2017 at 10:52 PM.
BigMouse is offline   Reply With Quote
Old 04-01-2017, 08:21 PM   #8
BigMouse
Registered User
 
Join Date: Nov 2007
Location: Silicon Valley, CA
Posts: 53
My Ride: 2001 330ci
Bit of a thrill, my project showed up on Hackaday today: http://hackaday.com/2015/05/27/hacka...8Hack+a+Day%29

Also, finished doing the layout for the new inverter control board. Just have to lay out the silk screen designators and I'll be ready to send it off to Seeed to be made. Hopefully things will start moving more quickly once I have a proper PCB made.

Before:

After:
BigMouse is offline   Reply With Quote
Old 04-01-2017, 08:22 PM   #9
BigMouse
Registered User
 
Join Date: Nov 2007
Location: Silicon Valley, CA
Posts: 53
My Ride: 2001 330ci
PCB design is probably my least favorite thing to do on any of my projects. So tedious. But once I get started and get in the groove I usually enjoy it. It's like solving a puzzle. This one took me 3 solid days of work.

Here's the final version with silk screen.



I'll print it out to scale at work on Monday and verify that the custom footprints I made are actually the right size, then send it off to be made. This version uses a "Teensy 3.1" as the main controller (for ease of programming so I can make quick changes for development), with two smaller ARM microcontrollers to drive each motor. If it works well and I decide to make more, I'll redo the "Teensy" part to be on-board. I'll also change to solderless programming headers at that time. Then the only SMD solder joints will be the connectors.
BigMouse is offline   Reply With Quote
Old 04-01-2017, 08:22 PM   #10
BigMouse
Registered User
 
Join Date: Nov 2007
Location: Silicon Valley, CA
Posts: 53
My Ride: 2001 330ci
Finished populating the new board today. It's sitting on my bench right now with a blinking LED, so that's a good sign! Still got a lot of testing and verification to do, but it's looking good so far. I need to do some programming to really test out the board, so that's where I'm at now.


Pictured below is the new board next to the original Toyota/Lexus board


Here's the new board installed in the inverter. Everything plugs in just like it's supposed to!

BigMouse is offline   Reply With Quote
Old 04-01-2017, 08:23 PM   #11
BigMouse
Registered User
 
Join Date: Nov 2007
Location: Silicon Valley, CA
Posts: 53
My Ride: 2001 330ci
First spins on the new control board happened today. Getting the code tuned in. The motors are making some very fun sounds!

The slow ramp-rate of the motor here is due to the current limited of the charger I'm using as a power supply. I've got it set to 1A @200v for safety. I certainly have to be careful with regen here. I managed to get the bus up over 700v a few times while actively spinning it down to a stop. That'll be fine when there are batteries powering it, but not so good with the charger that's only rated to 430v.

Here's a quick teaser video of it spinning on up one of the motors. Have to hook up the electric oil pump to keep things lubricated and close the clutches, then I can spin MG2 up and have it play along (or against) MG1.




After that, it's just a matter of software tweaking and tuning. Will have to generate a look-up table for each motor at various operating points. Handy that the transmission will work as a dyno by driving the motors against each other.

I've ordered a radiator and some hose so I can get cooling set up, then I'm good to go. That should be ready by next weekend. Good thing too, since it's a long one.

Last edited by BigMouse; 04-01-2017 at 10:53 PM.
BigMouse is offline   Reply With Quote
Old 04-01-2017, 08:23 PM   #12
BigMouse
Registered User
 
Join Date: Nov 2007
Location: Silicon Valley, CA
Posts: 53
My Ride: 2001 330ci
Had a friend help me fabricate the piece that I'll use to lock the input shaft of the transmission.



The splines are from the center piece of a clutch for an old Toyota Celica. It's a 21-tooth 28mm diameter spline. A google search of the spline dimensions brought up the clutch alignment tool for a 70's Celica. You could probably go backward from the clutch alignment tool to find other cars with the same spline. Apparently Toyota used the same size splines on several other vehicles including the Rav4. I find it quite amusing that the clutch from an old Toyota fits perfectly on the input shaft of a 2007 Lexus Hybrid.

The clutch hub was welded to a piece of 3" exhaust pipe which was then welded to a circular plate. I'll drill holes in the plate this weekend and bolt it to a sheet of 6mm aluminum which will also bolt to the bellhousing to lock the shaft from spinning.

All up, it cost me about $30 plus dinner for my friend for the welding and some scrap steel he had laying around.
BigMouse is offline   Reply With Quote
Old 04-01-2017, 08:23 PM   #13
BigMouse
Registered User
 
Join Date: Nov 2007
Location: Silicon Valley, CA
Posts: 53
My Ride: 2001 330ci
Input shaft: LOCKED!




I'm now able to lock the two motors together and drive them against each other as a dyno. Did this briefly today and it worked nicely.
This is an important ability as it lets me tune the offset angle for different speed and torque settings. The IPM motors used in the transmission aren't like simple PMAC or BLDC motors. The IPM motors have a magnetic torque component and a reluctance torque component. This means that I can't just set the current vector to 90 degrees from the rotor magnetic field for maximum torque. I have to set it somewhere in between. I'm not really sure yet whether the optimum angle changes much with speed or torque, but that's what I can find out using this as a dyno.
The tuning process is this:
1. With one of the motors set to zero torque, set the other motor to a certain speed using a speed control loop (torque-producing current as the output).
2. Set a non-zero current setpoint for the first motor.
3. Sweep the offset angle through the expected range and plot the output of the speed control loop.
4. The angle which requires the highest torque from the speed control loop is the optimum angle for that speed and torque operating point.
5. Repeat that for a handful of strategically selected operating points and plot the relationships.
I'll start with a constant offset value for the unknown motor while tuning the other one. Once I've done that for both motors, I just have to put them in to a look-up table that is used while driving so I always have the optimum offset angle for every pedal position.
I'm really looking forward to getting this tuning done so that I can then write the code that implements "throttle" control of the motor torque. This will be fun because it's where I'll set up the framework for tuning the pedal feel. It will also be when I program the gear change required for MG2. That will be an interesting challenge.
BigMouse is offline   Reply With Quote
Old 04-01-2017, 08:24 PM   #14
BigMouse
Registered User
 
Join Date: Nov 2007
Location: Silicon Valley, CA
Posts: 53
My Ride: 2001 330ci
Quote:
Originally Posted by jddcircuit View Post
I presume this equation is what someone would use to maximize the torque per amp once the Ld and Lq are known? If this is correct then determining the Ld and Lq is the experimental goal.
My goal is to maximize torque per amp, yes. My experiment is designed to do so by varying the offset angle and effectively measuring the torque to find the "sweet spot".

I ran one test with an arbitrary load setpoint and the speed set to 1400rpm. This was running on only 200v so I was probably right up against field weakening at this point. Below is a quick plot of the results.



The blue line is the Iq value driven by the speed control loop of the motor acting at the load. As the torque of the driving motor increases, the Iq of the load must increase as well in order to maintain the speed setpoint.

The red line is the offset angle of the opposing (driving) motor.

Instead of using Iq and Id decoupled, Id always has a setpoint of zero and Iq is the only current setpoint used. The offset angle is the value (4095 = 360 degrees) which the dq axis is offset from being aligned with the motor angle (a-axis).

For the example plot above, the sweet spot falls at about -50 (only 4 degrees or so). A small number which makes sense for the low speed and low current conditions (<15A).

Note that the driving motor was actually set to negative torque (trying to slow the load down). This is why the offset of the driving motor is negative (representing positive Id) and the Iq current of the load is positive (representing positive torque). This condition simulates regenerative braking.

My experiments will extract the offset angle appropriate for a given Iq and speed. This will go in to a 2D look-up table. So all I have to do to control torque is convert the throttle input to an Iq setpoint, then that pull the associated offset angle from the LUT. This eliminates a whole set of trig operations that would need to be done in the microcontroller.
BigMouse is offline   Reply With Quote
Old 04-01-2017, 08:25 PM   #15
BigMouse
Registered User
 
Join Date: Nov 2007
Location: Silicon Valley, CA
Posts: 53
My Ride: 2001 330ci
Nothing new to show about the inverter/transmission at the moment. Still working on tuning the control loops and figuring out how to properly generate torque with an IPM. These are tricky beasts, but I'm getting there. I think once I figure out how to handle field weakening (when it should start and how to implement it effectively), I'll be ready to move to the next step.
I spent a little bit of time today weighing the major components that I have. I bought a load-cell based crane scale for this task.
Here's one of my battery modules being weighed, with its future home watching the process.



The 7kWh module weighs 65.4kg. That's 9.3kg/kWh. So and entire Volt pack worth of cells weighs ~150kg (330lbs) without the enclosure or front BMS/contactor section. So my 29kWh pack should weigh 270kg (595lbs). Better than I was expecting!
This, of course, doesn't include the weight of the battery enclosure/supports I'll have to build.
The Lexus transmission weighs 132kg (290lbs). It's a heavy chunk of metal.
I'll be weighing the major components that come out of the car as I remove them (engine, transmission, exhaust). This, combined with the corner weights I got for the car a few weeks back, will allow me to calculate the battery placements/distribution to ensure that I maintain the same front/rear balance. The Volt packs are somewhat reconfigurable, so I'll be able to fine-tune the weight by moving sub-modules around. The only constraint there is that I'm using the original BMS so need to ensure that that can move with the modules. I don't want to be running high voltage wires through the car other than the two big ones that go to the inverter.
BigMouse is offline   Reply With Quote
Old 04-01-2017, 08:26 PM   #16
BigMouse
Registered User
 
Join Date: Nov 2007
Location: Silicon Valley, CA
Posts: 53
My Ride: 2001 330ci
Spent some time over the past week or so developing the BMS ECU. This is the second of three PCBs I'm making for this project. Basically, it handles everything having to do with the battery.
The feature list is:
  • 6 CAN busses
    • Powertrain CAN (to talk to the inverter and other nodes which will utilize high voltage)
    • Pack 1 CAN (for talking to one of the two strings of batteries
    • Pack 2 CAN (for talking to the other one)
    • Charger 1 CAN (for controlling one charger)
    • Charger 2 CAN (for controller the other one)
    • Range Extender CAN (Just in case)
  • Battery current sensing (for state of charge calculation)
  • Contactor control
    • Welded contactor detection
    • Automatic Precharge
  • J1772 (EVSE) Interface for use of public charging stations
  • Charge port RGB LED driver
  • HV safety interlock loop
  • HV isolation monitoring
Individual CAN busses are required for each battery and each charger because each identical item is an identical node and cannot share a bus. Additionally, the chargers and batteries have different speed CAN busses. It makes for a complex product, but it will do the job. Everything will come together and be controlled over the vehicle CAN bus.

The third board I need to design will be the "gateway" ECU. This will be the bridge between the powertrain CAN bus and the rest of the car (gauges, throttle pedal, key switch, etc). The gateway source code will be open source to allow the system to work with other projects in other platforms. It can be a simple Arduino with a CAN shield and a proto shield, or the ECU I will design.
All three ECUs will be based on the Teensy 3.1. I'm really loving this little device!
BigMouse is offline   Reply With Quote
Old 04-01-2017, 08:27 PM   #17
BigMouse
Registered User
 
Join Date: Nov 2007
Location: Silicon Valley, CA
Posts: 53
My Ride: 2001 330ci
I think I have an addiction


Picked up yet another battery.




In the photo I have three Chevy Volt battery packs and a disassembled Nissan Leaf pack. Going to have a go at reverse engineering the Nissan Leaf BMS like I did with the Chevy Volt one.


Once I'm done with that, I'll probably list the cells for sale. Either that or put them in a trailer and use them as a range extender.
BigMouse is offline   Reply With Quote
Old 04-01-2017, 08:27 PM   #18
BigMouse
Registered User
 
Join Date: Nov 2007
Location: Silicon Valley, CA
Posts: 53
My Ride: 2001 330ci
Got my boards from Seeed Studio. They apparently had an issue with my drill file and replaced the slots with pads. That's the OPPOSITE of what I wanted for HV creepage distance. A dremel makes it so that I can at least use the board as a prototype. Assembly has begun. The power supply works and the Teensy LED blinks. Now to populate the other 90% of the components!


Last edited by BigMouse; 04-01-2017 at 10:56 PM.
BigMouse is offline   Reply With Quote
Old 04-01-2017, 08:28 PM   #19
BigMouse
Registered User
 
Join Date: Nov 2007
Location: Silicon Valley, CA
Posts: 53
My Ride: 2001 330ci
The BMS ECU is populated and coding has begun! So far, so good. It even fits in the enclosure I bought for it! If only I still had my CNC Mill (I left it in Australia), I could cut out the holes in the end covers for the connectors to pass through.


Coding this is going to be "fun". I've built most of the framework for it already. I'm using a series of "metro" timers and a state machine. The state machine will call the correct functions at set intervals depending on the state it's in (charging, driving, standby, etc). I've set up the CAN messages to be staggered to help even out CPU load. For example, I have two CAN busses that I need to send a message to at 200ms intervals. I've set the timer to call these functions every 100ms, but it alternates between each of the two busses with each call. Sending the messages is easy, it's the responses that take time. Have to receive and parse up to 96 cells voltages per bus, plus the temperatures. Should be no sweat on these time scales for the Teensy that's doing the work, but I still like to have things staggered.


Here are a few photos:



BigMouse is offline   Reply With Quote
Old 04-01-2017, 08:28 PM   #20
BigMouse
Registered User
 
Join Date: Nov 2007
Location: Silicon Valley, CA
Posts: 53
My Ride: 2001 330ci
The engine is out! Along with the fuel tank, exhaust, and all the emissions equipment. Now the REAL work begins.


BigMouse is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Censor is ON





All times are GMT -5. The time now is 08:15 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
(c) 1999 - VerticalScope Inc. All rights reserved.