Outlander VCU - Rear inverter, Charger and BMS

Mitsubishi hybrid drive unit hacking
tom91
Posts: 1305
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 102 times
Been thanked: 216 times

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by tom91 »

bigdaveakers wrote: Mon Jan 30, 2023 7:48 pm So I see that the charge hysteresis actually defines the where the battery will charge to.
Have a look at the SimpBMS manual for the info. https://github.com/Tom-evnut/SimpBMS/bl ... 0V0.29.pdf
Founder Volt Influx https://www.voltinflux.com/
Webstore: https://citini.com/
bigdaveakers
Posts: 51
Joined: Fri Mar 04, 2022 11:46 am
Has thanked: 5 times
Been thanked: 5 times

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by bigdaveakers »

tom91 wrote: Mon Jan 30, 2023 8:02 pm Have a look at the SimpBMS manual for the info. https://github.com/Tom-evnut/SimpBMS/bl ... 0V0.29.pdf
I did, and while it gives a brief description of the variables it does not fully describe their interactions and effects on the different stages of the process. I wasn't expecting the hysteresis, for example, to influence the process such that the setpoint was unobtainable. Once the voltage per cell reached setpoint-hysteresis the current was basically reduced to a value that stopped charging. This can only be seen by looking at the code.

I suspect there are temperature interactions also that may contribute to not being able to attain the setpoint due to the derate.

Once I have more confidence in what is happening I may write some more detailed notes 8-)
tom91
Posts: 1305
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 102 times
Been thanked: 216 times

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by tom91 »

The software is modified by others to implement the charger and everything is freely configurable so there are so many ways it can be impacted.

lucky most of the control is on the canbus so you can just see what has changed on it with savvy can for example to witness direct results.
Founder Volt Influx https://www.voltinflux.com/
Webstore: https://citini.com/
arber333
Posts: 3261
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 232 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

I have decided throttle matrix is too complex for me and i am looking towards Lebowski polynomal throttle.
There are three coefficients you can set in code that determine the curve. a, b, and c are floats because they can be less then 1.
x is the throttle value and y is the result.
y = a*x + b*x^2 + c*x^3

I will think on how to make those coefficients possible to set in code as well.

@aot93 how would your RWD motor behave if you would apply full torque request? Does it have any sanity buit in or is it just trying to fulfil command?
I am asking because i would probably have to make a terminating factor (multiply by zero) in case of brake input and overspeed protection. I might built it as a dw/dt filter like acceleration limiter
arber333
Posts: 3261
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 232 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

aot93 wrote: Sat Jan 21, 2023 11:18 pm Yes the charger / DC DC should sit on the same bus as the BMS.
I'm not at a pc right not so cant check it.
I do exclude the DCdc id in the code so it should be ok.
I'll look in to and get back
I am not sure if this came up before or on different thread...
Can you advise how to connect ignition signal for inverter. I see that we need to activate a precharge relay and contactor at some point in start. But would we have to activate the internal inverter logic before or after precharge? Can you confirm my assumptions?
1. We have a permanent 12V/GND connection to inverter.
2. We use IGCT signal to activate inverter on precharge by a latching relay triggered by "start" key position which will keep it alive
3. If we need to use emergency off signal we can wire IGCT through normaly closed NC contacts of notaus. That will disable inverter while rest of the car will still function.

I need to setup the succession logic for my inverter.
JamesWLG
Posts: 15
Joined: Thu Oct 28, 2021 9:42 pm
Has thanked: 3 times

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by JamesWLG »

aot93 wrote: Thu Jan 19, 2023 10:04 pm Ive got some updates to push out soon, I'm in the process of adding in chademo and a few other bits, just not got much time at the moment and it's just too bloody cold in the garage!
Hope the garage is warming up, I'm keen to use Chademo myself.

Random question as I study your code prepping for my "I'll get there one day" i-Miev powered Spitfire project. Is the inverter torque command a 10:1 ratio to convert to Nm (after the -10000 that is)?
User avatar
aot93
Posts: 198
Joined: Mon Feb 15, 2021 5:45 pm
Location: UK, West Sussex
Has thanked: 6 times
Been thanked: 43 times

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by aot93 »

arber333 wrote: Tue Feb 28, 2023 6:20 pm I am not sure if this came up before or on different thread...
Can you advise how to connect ignition signal for inverter.
Here is a wiring diagram of my setup that help:
image.png
The logic being the inverter gets +12v via my ignition change over over relay, this relay is NC to the ignition switch and NO to the type 2 socket PP pin.
Inverter RSDN is connected to BMS main contactor out via relay so the BMS can safely shut down the inverter if needed.
The inverter starts up very quickly so there is no need for any delays.
User avatar
aot93
Posts: 198
Joined: Mon Feb 15, 2021 5:45 pm
Location: UK, West Sussex
Has thanked: 6 times
Been thanked: 43 times

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by aot93 »

JamesWLG wrote: Wed Mar 01, 2023 10:21 am Hope the garage is warming up, I'm keen to use Chademo myself.

Random question as I study your code prepping for my "I'll get there one day" i-Miev powered Spitfire project. Is the inverter torque command a 10:1 ratio to convert to Nm (after the -10000 that is)?
Some progress, new boards built and socket contactors and other bits installed some wiring left and of course a lot of code and de-bugging to done!

As for the torque command yes -10000 then divide by 10 for Nm.
Attachments
PXL_20221228_183617391.jpg
PXL_20221228_183601769.jpg
arber333
Posts: 3261
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 232 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

aot93 wrote: Wed Mar 01, 2023 7:02 pm Here is a wiring diagram of my setup that help:

image.png

The logic being the inverter gets +12v via my ignition change over over relay, this relay is NC to the ignition switch and NO to the type 2 socket PP pin.
Inverter RSDN is connected to BMS main contactor out via relay so the BMS can safely shut down the inverter if needed.
The inverter starts up very quickly so there is no need for any delays.
Well that was unexpected. I didnt know RSDN pin is effective when connected to 12V. So i tried a simple code from Damien first and it worked. Damn that motor is responsive.

As a fact i tested motor and inverter that were NOT from the same car. And the test was made on 360Vdc battery.
arber333
Posts: 3261
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 232 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

Ok another question @aot93;
Can you let us know how you inhibit inverter when charging? By which function? I would like to add a physical signal sensing and charging to this main VCU. I would like to use PP signal to detect charge phase. I dont use teensy BMS module and i will make my own interface...any day now :).
I see there is a constant int preparead but i dont see it leading anywhere.
So i will need to replace PP pin sensing and integrate charger command message 0x286 which is important for running motors as well.
Looking through the main VCU code i cant seem to find easy wasy to use a pullup with PP pin. Every input seems to be opto isolated and positive trigger signal. This means i would need to use another VCU in that stead? Do you have a suggestion to transform that particular signal to pullup gnd sensing signal?
User avatar
aot93
Posts: 198
Joined: Mon Feb 15, 2021 5:45 pm
Location: UK, West Sussex
Has thanked: 6 times
Been thanked: 43 times

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by aot93 »

Good job spinning the motor it's nice to have confirmation we can use inverters and motors from different cars

Inverter inhibit is in two ways
1, RSDN is pulled high via the BMS
2, message 0x287 byte 6 is set to 0x00 the inverter will not run if this byte is not 0x03

AS for PP detect i used an AT tiny for this job because at the time the teensy deep sleep was not working so well, the ATtiny is always on in deep sleep waiting for the PP to pull a pin low, this can then switch a relay and power everything else up so no need to turn anything on manually for charging.
I put provision in the code to have PP in there but ended up not using it as my thinking was the BMS should be in control of the state of the VCU, so only allowing drive modes when battery status is good and not charging.

Having said that it would be possible to bypass the opto isolator on an input by adding a jumper wire to the board, of course there would then be no protection to the teensy's fragile inputs!

Removing the BMS dependencies is possible (i have test version with these removed if want) but you will need add the checks in else where.
Integrating the charger should be straight forward, handling of message 0x286 will need to be changed, ideally used as kind of HV interlock which appears to be the OEM application.
arber333
Posts: 3261
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 232 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

aot93 wrote: Thu Mar 02, 2023 11:23 am
Having said that it would be possible to bypass the opto isolator on an input by adding a jumper wire to the board, of course there would then be no protection to the teensy's fragile inputs!

Removing the BMS dependencies is possible (i have test version with these removed if want) but you will need add the checks in else where.
Integrating the charger should be straight forward, handling of message 0x286 will need to be changed, ideally used as kind of HV interlock which appears to be the OEM application.
Can you possibly send (or link) me that code version for testing.

Regarding PP signal i have in mind a simple Mosfet module with precharge resistor on opto which would allways signal ON... untill PP would pull id down and signal OFF. Teensy would in turn signal low when NOT in charge mode :). That should be ok no?

The problem with this setup is i need to depend on PP signal to run other things as coolant pumps and other stuff while charging.
My BMS runs at 250kbaud so i cant talk to it and the chargers on the same bus.

Also can you declare how CAN lines are distributed? If inverter is on CAN2 what you have on CAN1 and CAN3?
My intention is to replicate inverter signals on CAN1 for another inverter and use CAN3 as charger, heater and AC compressor logic. Or could i just use CAN1 for that still?
User avatar
aot93
Posts: 198
Joined: Mon Feb 15, 2021 5:45 pm
Location: UK, West Sussex
Has thanked: 6 times
Been thanked: 43 times

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by aot93 »

I'll send you a link in DM, don't really want test code in the wild!

VCU takes care of cooling pump and DC-DC whilst charging, but if you have other things..I can see your system working fine should be almost no current draw to drain your aux battery whilst no being used.

CAN bus configuration is :
CAN 1 Inverter
CAN 2 BMS + Charger
CAN 3 Dash comms this baud rate could be different, easy to change if you are using the dash module or free to use for another purpose.
arber333
Posts: 3261
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 232 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

aot93 wrote: Thu Mar 02, 2023 1:01 pm I'll send you a link in DM, don't really want test code in the wild!

VCU takes care of cooling pump and DC-DC whilst charging, but if you have other things..I can see your system working fine should be almost no current draw to drain your aux battery whilst no being used.

CAN bus configuration is :
CAN 1 Inverter
CAN 2 BMS + Charger
CAN 3 Dash comms this baud rate could be different, easy to change if you are using the dash module or free to use for another purpose.
Its a deal then! I will repurpose CAN3 for rear inverter
CAN2 will be charger and other auxilliaries
CAN1 front inverter then

As for aux battery I already designed DUE based application which reads DCDC aux battery report and reacts with periodical top-ups even if the car is not powered. This will prevent draining of aux battery and perhaps even allow use of independent HV battery heating/cooling.

On other note i am still in system design phase... do you think it would be possible to operate CAN1 and CAN2 on 500kbaud for car systems and use CAN3 exclusively for BMS communication at 250kbaud. Is it possible to operate teensy wuth asynchronous CAN lines?
User avatar
aot93
Posts: 198
Joined: Mon Feb 15, 2021 5:45 pm
Location: UK, West Sussex
Has thanked: 6 times
Been thanked: 43 times

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by aot93 »

I see no problem with running asynchronous CAN rates, in fact for a reason I can't remember I already run CAN3 at 50k baud.
arber333
Posts: 3261
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 232 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

aot93 wrote: Thu Mar 02, 2023 2:46 pm I see no problem with running asynchronous CAN rates, in fact for a reason I can't remember I already run CAN3 at 50k baud.
For better understanding of the code...
Question1:
I see you reduce torque on some RPM limit

Code: Select all

 if (motorRPM < -2000)
      {
        torqueRequest = 0;
      }
Why -2000? Is this direct RPM value or factored in any way? How would inverter react if i chose -5000?
Also is negative sign -2000 a requirement? Is this because you are running motor in reverse or just some other reason?

tnx
User avatar
aot93
Posts: 198
Joined: Mon Feb 15, 2021 5:45 pm
Location: UK, West Sussex
Has thanked: 6 times
Been thanked: 43 times

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by aot93 »

This particular code is to limit speed in reverse, it's about 15mph with my gearing.
Negative is required as this is what gets reported when the motor is spinning in reverse.

It's a hard cut so not pleasant, but I put in for a bit of safety as wheel spin in reverse would be quite exciting for a limited time!
arber333
Posts: 3261
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 232 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

aot93 wrote: Sat Mar 04, 2023 7:04 pm This particular code is to limit speed in reverse, it's about 15mph with my gearing.
Negative is required as this is what gets reported when the motor is spinning in reverse.

It's a hard cut so not pleasant, but I put in for a bit of safety as wheel spin in reverse would be quite exciting for a limited time!
Ok, so i should add a positive limitation then since i will be testing this with no real load. Something the likes of...

Code: Select all

 if (motorRPM > 5000)
      {
        torqueRequest = 0;
      }
EDIT: Damn! cant seem to get V2 code to compile. PlatformIO cant find Filters.h or somesuch. The first code i have from last year compiles just fine. Any comment where to get Filters.h and code? tnx
royhen99
Posts: 210
Joined: Sun Feb 20, 2022 4:23 am
Location: N. Wiltshire. UK
Has thanked: 16 times
Been thanked: 98 times

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by royhen99 »

User avatar
aot93
Posts: 198
Joined: Mon Feb 15, 2021 5:45 pm
Location: UK, West Sussex
Has thanked: 6 times
Been thanked: 43 times

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by aot93 »

arber333 wrote: Sat Mar 04, 2023 8:41 pm Ok, so i should add a positive limitation then since i will be testing this with no real load.
Just to note you may well get unexpected results with no load on these motors (re-gen will not work etc..) and they spin up to high RPM very quickly with even small torque request.
arber333
Posts: 3261
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 232 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

aot93 wrote: Sun Mar 05, 2023 1:58 pm Just to note you may well get unexpected results with no load on these motors (re-gen will not work etc..) and they spin up to high RPM very quickly with even small torque request.
I will have my hand near the EMGCY button then thanks. 8-)
User avatar
midway
Posts: 78
Joined: Mon Feb 15, 2021 3:52 pm
Location: Ural
Has thanked: 5 times
Been thanked: 8 times

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by midway »

At the moment I modified the code for Hankzor balancers, I use only the main VCU based on Teensy 4.1, without using a separate module to control the balancers and the charger. Additionally connected automatic transmission lever from Mitsubishi outlander PHEW All in one. I can share the code if needed.
arber333
Posts: 3261
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 232 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

midway wrote: Sun Mar 05, 2023 4:51 pm At the moment I modified the code for Hankzor balancers, I use only the main VCU based on Teensy 4.1, without using a separate module to control the balancers and the charger. Additionally connected automatic transmission lever from Mitsubishi outlander PHEW All in one. I can share the code if needed.
Yes please do that as my idea is exactly that. I will only omit the transmission lever as i will use something more analog.

A
arber333
Posts: 3261
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 232 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

Recently i had a lot of back and forth with aot93 because of my ignorance of his VCU system process. I have decided it would benefit all if i write here how the code should work and my experience. Aot93 let me know if i missed something.

I assume the use of only VCU, not BMS or other support boards.
VCU connects to inverter and receives reports about votlage and current, so CAN2 lines are connected to inverter.

Main process streamline is as follows:
1. We provide ignition 12V supply to VCU from the key
2. VCU must be in Drive Neutral or Charging State for contactors to go on
- Negative Contactor OFF
- Negative Contactor goes ON
- 500ms Wait > Precharge and Positive are OFF
- Prechage turns ON
- 1000ms Wait
- Inverter reports Voltage for VCU > BMS_PackVoltage -5v
- Main contactor ON
- Wait 500ms and Check all contactor are ON
- Turn Precharge OFF
4. Provide Forward signal to roll out

To enable neutral mode:
- Start and Brake must be ON
- direction FWD and direction REV must both be OFF
- Start and brake can be relesed as VCU changes to state 3

I might change this so VCU will be allways powered as PP signal will have to be a simple pulldown
DC contactor will be latching so when precharge is done this will be locked and the only way to remove HV will be to turn off 12V from the key.
User avatar
aot93
Posts: 198
Joined: Mon Feb 15, 2021 5:45 pm
Location: UK, West Sussex
Has thanked: 6 times
Been thanked: 43 times

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by aot93 »

Thanks all looks good.
I open the pre-charge as I burnt a few resistors and wanted to try and stop it, turns out it was just super poor quality resistors breaking on their own!
Post Reply