Outlander VCU - Rear inverter, Charger and BMS

Mitsubishi hybrid drive unit hacking
arber333
Posts: 3560
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 134 times
Been thanked: 332 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

I made another small contribution to this VCUs code.

In my code i included undervoltage safety so that car would notify the driver of inverter nearing to low battery voltage. I thought to setup two phases. The first phase is when battery would pass the mark of 3.3V per cell (316Vdc). The second phase is when cells pass the 3V per cell (288Vdc).
I made a mistake of simply turning ON Error and Voltage light for first phase. The second phase would trip inverter into error state.
So for testing i was driving for quite some time under 316Vdc (i removed one battery module for testing) and suddenly at 288Vdc i got to a point where it tripped! This is not a good option as those lights give you false sense of security and that trip in the end comes as a real surprise.

Second iteration works to put the VCU into "Turtle mode". I formed a pedal map 2 so it only provides about 50A worth of torque. That should be something the driver would notice but it would still allow them to drive to nearby EVSE.

Code: Select all

bool turtlemode = false; //turtle mode because of low voltage
....
void turtle_mode(); //declare a function
....
const int pedal_map_two[21][22] = { //pedal map for turtle mode
    // Backup
    // map 2..
    /*250*/ {0, 0, 3, 3, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8},
    /*500*/ {0, 0, 3, 3, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8},
    /*625*/ {0, 0, 3, 3, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8},
    /*750*/ {0, 0, 3, 3, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8},
    /*1000*/ {0, 0, 3, 3, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8},
    /*1250*/ {0, 0, 3, 3, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8},
    /*1500*/ {0, 0, 3, 3, 4, 4, 4, 4, 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, 6, 6, 6, 6, 6, 8, 8},
};
....
void turtle_mode() { // function itself
if (turtlemode == true) { // put the car in turtle mode if active
  active_map = 2; // set the active throttle map to no. 2
  if (timer1000_1.check() == 1) 
  {
    digitalWrite(OUT11, !digitalRead(OUT11)); // Flash the Error LED at 1s interval
  }  
}
}
....
void canRX_389(const CAN_message_t &msg)
{
  chargerHVbattryVolts = msg.buf[0] * 2; // Charger HV Battery Voltage
  chargerACvolts = msg.buf[1];
  chargerHVcurrent = msg.buf[2] * 0.1;
  chargerTempCH = msg.buf[4] - 40;
}
....

void loop() //main function
...
turtle_mode(); // run the function inside main function
...
case driveForward: //when in forward mode you need turtle mode the most
...
 // See if voltage is enough
if (( chargerHVbattryVolts <  316) && (chargerHVbattryVolts >  288) ) { // take information from charger and DCDC to observe HV voltage value
        turtlemode = true; // Turtle mode, alowed motor torque is reduced!
}

else if ( chargerHVbattryVolts <=  288)    { // stop with error if you are pushing it...
  VCUstatusChangeCounter = 0;
  VCUstatus = 7; //Error state ON!
}

else {
  turtlemode = false;
}

arber333
Posts: 3560
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 134 times
Been thanked: 332 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

I started fiddling with the VCU code for my Megane viewtopic.php?t=6114

This car has a "Start" button and it provides 12V to one wire that obviously served as a start signal for bunch of components including starter.
As i reviewed my processes i found a redundant step i cant use since my car doesnt have two position key lock...ignition and start.
Rather it looks like this...
Car is stationary
1. I press the Start button an go to precharge 5. I plug in the charging cable and begin charging
2. Neutral
3. FWD
4. REV
6. Error state

This makes the "Ready" state redundant and looks like i can move from "boot" state directly into active state
Do you think i can manage to use "boot" state as a default state as well as previous "ready" state. This would mean i can effectively move the code from the "ready" function and drop it into "boot".... Would that work?
User avatar
midway
Posts: 91
Joined: Mon Feb 15, 2021 3:52 pm
Location: Ural
Has thanked: 14 times
Been thanked: 14 times

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by midway »

When I press the brake, power is supplied to the VCU, and if I press the "Start" button while the brake is pressed, the relay to support the 12V power supply is turned on and the VCU goes into "READY" mode. If I press the "Start" button when the engine is not rotating, the VCU turns off the power support relay.
arber333
Posts: 3560
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 134 times
Been thanked: 332 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

Not connected with previous post...
Mazda motor broke crossmember to which i welded third motor mount to. It broke diagonaly across some lightening holes which were there from OEM.
Just to be clear, i put 3mm inox plade under the (drawn) formed cross mount and welded it at the farthest points of the box. I guess that was not enough. But it broke diagonaly between welds which looks as torsion damage. I rewelded and strengtened the part as of then.
Now with that done i went for a test drive. Here is what was present before but i ignored it... i think it has to do with VCU and software...

When acceterating hard from say 40km/h to 100km/h i feel vibration that seems like bad shock absorbers across bumpy road. But the road is flat! Well this is amplified if i accelerate into a turn... left or right. Looks like CV joints or tripods are struggling to transfer torque. It is just observation but seems solid one as if i go to Normal mode without regen i see smooth acceleration with not much beatback. Did anyone notice similar behaviour?

To confirm this i will change throttle map upload and test drive... stay tuned...
arber333
Posts: 3560
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 134 times
Been thanked: 332 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

midway wrote: Sat May 24, 2025 7:10 am When I press the brake, power is supplied to the VCU, and if I press the "Start" button while the brake is pressed, the relay to support the 12V power supply is turned on and the VCU goes into "READY" mode. If I press the "Start" button when the engine is not rotating, the VCU turns off the power support relay.
i am trying to built my circuit now....
if i understand correctly your process works like this...
1. you press "brake" to power VCU temporarily
2. you press Start button connected to enable pin
3. VCU commands one relay to latch 12v power to supply itself
4. VCU goes to ready state (or would it be better to go to neutral immediately?)
.......
if you want to turn VCU off you need to have two conditions met...
1. motor is not turning
2. remove 12v from enable pin

or is your system different? how?

edit: what about charging signal. how do you activate VCU when charger is connected?
Post Reply