Page 18 of 18

Re: Outlander VCU - Rear inverter, Charger and BMS

Posted: Fri May 02, 2025 10:08 pm
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, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8},
    /*2000*/ {0, 0, 3, 3, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8},
    /*2500*/ {0, 0, 3, 3, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8},
    /*3000*/ {0, 0, 3, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8},
    /*3500*/ {0, 0, 3, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8},
    /*4000*/ {0, 0, 3, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8},
    /*4500*/ {0, 0, 3, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8},
    /*5000*/ {0, 0, 3, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8},
    /*5500*/ {0, 0, 3, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8},
    /*6000*/ {0, 0, 3, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8},
    /*6500*/ {0, 0, 3, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8},
    /*7000*/ {0, 0, 3, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8},
    /*7500*/ {0, 0, 3, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8},
    /*8000*/ {0, 0, 3, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8},
    /*10000*/ {0, 0, 3, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 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;
}


Re: Outlander VCU - Rear inverter, Charger and BMS

Posted: Fri May 23, 2025 7:20 pm
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?

Re: Outlander VCU - Rear inverter, Charger and BMS

Posted: Sat May 24, 2025 7:10 am
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.

Re: Outlander VCU - Rear inverter, Charger and BMS

Posted: Wed May 28, 2025 6:37 am
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...

Re: Outlander VCU - Rear inverter, Charger and BMS

Posted: Fri May 30, 2025 3:56 pm
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?

Re: Outlander VCU - Rear inverter, Charger and BMS

Posted: Mon Jun 02, 2025 1:13 pm
by midway
arber333 wrote: Fri May 30, 2025 3:56 pm 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?
Yes, that's right. When you connect the charging plug, the contact pulls the optocoupler LED to ground, the relay is triggered and turns on the power to the vcu and charger.

Re: Outlander VCU - Rear inverter, Charger and BMS

Posted: Sat Jun 07, 2025 12:55 pm
by arber333
midway wrote: Mon Jun 02, 2025 1:13 pm Yes, that's right. When you connect the charging plug, the contact pulls the optocoupler LED to ground, the relay is triggered and turns on the power to the vcu and charger.
I tried to wire one side of the brake switch but i couldnt make it work 100% as the body vcu goes to sleep after some time and my VCU would turn on by itself. The same happens if i use reverse relay....
I am now testing the other side of the brake switch where it gets power from the body ECU. Whenever i unlock the car or open the door after a long time off this ECU starts and provides 12V power. I will use this with one power relay. This will provide power for my VCU and then i will provide signal from START button to go into Neutral and Drive/Reverse mode.
Charging mode will route power from another relay which will turn on VCU from the other side of the relay when EVSE is connected via PP line.
i will post some photos in Megane EV section whwn i can confirm operation...

Re: Outlander VCU - Rear inverter, Charger and BMS

Posted: Tue Jun 17, 2025 8:05 pm
by arber333
UH! I found out alarming fact!
Last year i bought one Outlander inverter P/N 9410A081 in the photo...
o-8ca32155ffdf042e850c1f5b9a9903e7-mitsubishi_outlander_xenon_valdymo_blokas.jpg
I figured it is from 2017 vehicle.

When i was installing it it was in no way different to other rear Outlander inverters.
Now that i have setup VCU and tested throttle i could hear inverter coming online with PWM noise. I see throttle behaving OK.
Screenshot 2025-06-17 202827.png
But i coudnt get it to run in Drive.
So i recorded VCU report:
Screenshot 2025-06-17 202937.png

And when i couldnt get anything more from VCU i connected CAN reader and saw 0x289 telegram as it reports status... I immediately saw B7 was not in range odf 00 - 04 but rather 10 - 14! Could there be other differences in CAN reports between inverters? Anyone seen this?
Screenshot 2025-06-17 205247.png
Next i observed the 0x287 command telegram...
I saw that B6 will come online with 03 value whenever i request direction...OK
Screenshot 2025-06-17 205625.png
I see B3 and B4 show 27 10 value for 0Nm

When i press throttle in REVERSE i get motor spinning
Screenshot 2025-06-17 205733.png
BUT when i tried to do the same in FORWARD i cant get the motor spinning, i only hear PWM hum.
CAN is stuck in 27 10 value!
Screenshot 2025-06-17 210048.png
I suspect this to be a problem with VCU code. But the same code runs in Mazda just perfect. I only used slight differences in transition from drive modes as i dont differentiate between ignition and start inputs, i only have start button.

Any thoughts?