-
Locking the input shaft (Part 2)
07/04/2015 at 05:47 • 0 commentsInput 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.
-
Testing the dyno configuration
07/10/2015 at 23:09 • 0 commentsI 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 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 if I tried to control the angle by breaking it in to an Id vs Iq relationship.
If the relationship ends up being linear (or very close to it), I could just use a simple scaling and offset equation with no divides. Even better than a LUT, but I'm doubtful it'll be that simple.
This experiment is intended to get the confidence I need that it's all going to work before committing to tearing in to my car and doing the conversion. It should give me enough to make it driveable and give me most of the performance it'll be capable of. I might fine-tune it on a vehicle dyno someday depending on what operating points I can hit with the transmission alone. I'll be limited to the capability of MG1 which is somewhere around half of MG2. So I won't be able to fully characterize MG2 with this method, but hopefully I can extrapolate based on MG1's results. Time will tell. -
Weights and balances
08/01/2015 at 19:57 • 0 commentsNothing 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.
-
BMS ECU PCB (And other fun acronyms)
09/08/2015 at 00:56 • 0 commentsSpent 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!
- 6 CAN busses
-
Preparing for PCB tedium
09/27/2015 at 02:53 • 0 commentsThis microscope is new addition to my home electronics workbench. This will help with very small pick-and-place of surface mount components, as well as inspection after reflow and very small reworks. In the spirit of the project (and saving money), I picked it up used from my local HSC electronics surplus store.
The BMS ECU circuit boards are scheduled to arrive Monday. Next weekend with either involve me finishing up assembly of them and beginning programming and testing, or pulling the engine from the BMW. Depends on the availability of shop space at the home of the person who will be helping me with the fabrication/mounting of components in the car.
-
Measuring used EV battery capacity
09/27/2015 at 03:54 • 0 commentsI am selling the extra Nissan Leaf battery pack I have since I need to fund this project as things start really moving ahead.
A used battery is worthless unless people have some sort of assurance of its health and capacity. This one has a bit over 24,000 miles on it, so a capacity test was in order.
My test setup is shown below. It's a 150W electronic load and the Mooshimeter I won during the earlier stages of the HaD Prize. I played with the dual-channel capability of this cool little device while I was charging the cell module in preparation for the capacity test. I found that at the currents I was charging at (6A) I had enough drop across the wiring and internal shunt that I really needed some kelvin sense lead to get an accurate voltage. The shared common (-) terminal was a bit of a handicap here, but it was fun to play with and it did work. I was able to calculate the resistance of the leads using a second meter and correct for it in the logged data based on the measured current (which I know is accurate due to Mr Kirchoff).
Since the discharge test was performed at constant current, I didn't use the dual channel capability of the Mooshimeter for the actual capacity check.
The capacity of the cell is measure in Amp Hours (Ah) and is simply the integral of the current over time, with the voltage kept within the operating window of the cell.
The module has two cells in series, so my operating window was 8.4v to 5v (4.2v to 2.5v per cell). The test took 3.82 hours to bring the module from 8.37v to 5v, so the capacity is 57.3Ah.
Still a very beefy and capable cell!
Now I need to charge the module back up to where it started so I can put it back in the series string without worrying about it being out of balance with the rest of the pack.
-
BMS ECU boards arrived
09/29/2015 at 04:46 • 0 commentsGot 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!
-
BMS ECU populated
10/10/2015 at 05:35 • 0 commentsThe 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:
-
Engine is out!
10/20/2015 at 03:38 • 0 commentsThe engine is out! Along with the fuel tank, exhaust, and all the emissions equipment. Now the REAL work begins.
-
Transmissions side-by-side
10/23/2015 at 05:49 • 0 commentsGotta make the one on the left fit in the space left by the one on the right. This might be more difficult that I originally thought. The Lexus transmission is a fair bit bulkier (bigger diameter) than the BMW one.
Thankfully the guy that's helping me out is very handy with metalwork. Should be able to get by with a few well placed blows with a big hammer and some stiff mounts if more room is needed though.