Outlander VCU - Rear inverter, Charger and BMS

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

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

aot93 wrote: Mon Mar 06, 2023 9:23 am 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!
I have my car simulator setup now. Several switches and buttons with a thumb throttle.
I cant seem to get VCU to start generating 0x286 and 0x285 messages.
I can get into VCU state 4. I thought here it starts the drive process.
How is that particular process setup?

Also my throttle is a hall thumb throttle from 1.1V to 3.6V and i get a good effect from it inside debug but there is no response from VCU.
I can see CAN bus telegrams running between CAN1 and CAN2 lines via Canalyst device.
Do you think i should connect DCDC as well? Would that be a requirement? Or i can just connect my Arduino DUE and fake those messages at least for the start...

tnx
Attachments
20230307_170144.jpg
20230307_172035.jpg
20230307_172207.jpg
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 »

The problem is we are not generating a torque request as the Readpedal routine is not generating one.
From the de-bug screen I can see the it's failing the comparison test probably because there is a pot on only one input - ideally you have a dual pot pedal in which one value is 2x the other, (like a VW pedal)

Of course we can modify the code to remove this check for bench testing, but obviously I could not recommend to drive using only a single pot.

for testing modify the readPedal() function to something like this - I've not checked if this works - or even builds!

Code: Select all

void readPedal()

// Sync Analog read
// compare the result

{
  ADC::Sync_result result = adc->analogSyncRead(POT_A, POT_B);
  result.result_adc0 = (uint16_t)result.result_adc0;
  result.result_adc1 = (uint16_t)result.result_adc1;
  //float comparisonResult = ((result.result_adc1 * 1.0) / (result.result_adc0 * 1.0));
  //if (comparisonResult != 0)
  //{
  //  if ((comparisonResult > 1.0) && (comparisonResult < 2.0))
    {
      lowpassFilter.input(result.result_adc0);
      throttlePosition = floor(lowpassFilter.output());

      throttlePosition = map(result.result_adc0, tpslowOffset, tpshighOffset, 0, 100);

      if (throttlePosition < 2)
      {
        throttlePosition = 0;
      }
      if (throttlePosition > 100)
      {
        throttlePosition = 100;
      }
    }
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 233 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

aot93 wrote: Tue Mar 07, 2023 8:09 pm The problem is we are not generating a torque request as the Readpedal routine is not generating one.
From the de-bug screen I can see the it's failing the comparison test probably because there is a pot on only one input - ideally you have a dual pot pedal in which one value is 2x the other, (like a VW pedal)

Of course we can modify the code to remove this check for bench testing, but obviously I could not recommend to drive using only a single pot.
Huh! I actually thought you need 1 to 1 signal so i just connected two inputs on the same throttle.
Before I change code I can actually connect prius pedal inputs. They are two but they are not 2 : 1. More like 1.5 : 1...

I am using single sided throttle from 2013 now and only trouble i got was from pots not hall sensors.

EDIT: Can you advise how to calibrate throttle? Do i just activate 6 and 7 and keep throttle depressed or do i have to input actual values after 6.

Will see if it works...
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 »

POT's can be hard to get a reading from, hall sensor is much more reliable.

Maybe I should expose the ratio as a parameter in the setup menu?

For calibration press 6 with foot off the pedal (or slightly pressed if you want a dead zone) and then press 7 with throttle fully pressed down.

For now the offset is read on ADC1 only not ADC0, you might need to change this for testing, it at line 944ish
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 233 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

aot93 wrote: Tue Mar 07, 2023 9:19 pm POT's can be hard to get a reading from, hall sensor is much more reliable.

Maybe I should expose the ratio as a parameter in the setup menu?

For calibration press 6 with foot off the pedal (or slightly pressed if you want a dead zone) and then press 7 with throttle fully pressed down.

For now the offset is read on ADC1 only not ADC0, you might need to change this for testing, it at line 944ish
Well here are some of the screens for CAN as well as serial. You can clearly see that now as i have dual throttle connected correct telegrams will start. But i still dont get the electronic hum that i get using DUE code. Throttle press wont start anything.
Which pedal pin should be higher ADC1 or ADC0?

tnx
Attachments
VCU state2.jpg
VCU state3.jpg
VCU state4.jpg
VCU pedaltest.jpg
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 »

Still no torque request being generated by the pedal, until that happens inverter is not going to be enable and 0x287 B6 will stay 0x00

ADC1 is should be high and is used to calculate.
It might be worth commenting out the comparison check as I mentioned above it's something that can be tuned later.
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 233 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

OK i just got motion!
I simply comanded a torque map 1 and it started. I thought a default map was already chosen.
Then i got forward jump without throttle and i had to push brake button because motor would want to overspin.
The same behaviour was with my DUE VCU. When i applied a bit of correction to value 2710 motor was able to hold still.
I need to go through your code and put a variable in so we could offset center a bit.

Did you notice that behaviour maybe? It seems torque value is not actually torque but equilibrium from resolver offset position. I guess that way you could zero in any OEM Outlander motor.

I got an idea... using this 2710 value we could use a creep function for simulating ATX.

EDIT: I noticed i can select map3 but not map2 evn though i see the signal clearly. I am sure it is that dreadfull connector. When i assembled it i got a good signal on all relavant input pins. I didnt control the outputs though. Something tells me i should...
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 »

What do you mean by value 2710?
I do not see that kind of behaviour, how ever as said before with no load on them it's very hard to make sense of what's going on.

Regarding the map select it could be a wiring or a noise problem causing the inputs to float, are you using 12v for the map select?
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 233 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

aot93 wrote: Wed Mar 08, 2023 9:18 am What do you mean by value 2710?
I do not see that kind of behaviour, how ever as said before with no load on them it's very hard to make sense of what's going on.

Regarding the map select it could be a wiring or a noise problem causing the inputs to float, are you using 12v for the map select?
Yes i think a pin is loose inside connector. I will have to inspect today...

Here is my "partial sucess"


2710 is the 0NM value (10000) in motor torque control telegram 0x287. While i was using Damiens DUE code i had the same behaviour as here. Motor would ramp up without throttle command even though throttle offset was well determined. I am sure this is because motor and inverter are not from the same car and there are subtle differences in resolver position.

/////////////////////////////////////////////////////
//Torque Command = 0x287
//0x2710=0Nm
//0x2710=10000 decimal
//torque band = +/- 200Nm
//200/10000= 0.02nm/bit
/////////////////////////////////////////////////////

I could remedy this by offseting 2710 (10000) value a bit to the right or left say 2700 (9984) and that calmed the motor somewhat to keep it in equilibrium when throttle was not used.


How i would assert that in your code i am not sure. But for others to benefit i would suggest to put a variable into settings that would offset the motor 0NM position from 2710 to/by appropriate value. And save that to EEPROM.

What do you think, would that be managable?
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 33 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by EV_Builder »

If the resolver isn't correct then the fireing isn't correct.

Did you try this?:

Is the resolver it self programmable?
Is the inverter readable ? UDS? EEPROM?
Is the resolver mounted with slotted holes?
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
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 what you mean now with 2710 value. My suspicion is that this would be a bit of hack, and only really relevant for bench testing with no load on the motor.
It would be quite easy however to make this parameter exposed and saved to EEPROM.

Would be good to see if this is the case where others have know unmatched inverters and motors.

As for adjusting the resolver, the Mitsubishi service manual states that it is factory sealed and should not be touched. The service procedure to replace the inverter or motor makes no reference to any resolver calibration.

Not saying it can't / should not be done, but find it strange that if it needs doing why is not covered in the manual.
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 233 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

aot93 wrote: Wed Mar 08, 2023 12:46 pm I see what you mean now with 2710 value. My suspicion is that this would be a bit of hack, and only really relevant for bench testing with no load on the motor.
It would be quite easy however to make this parameter exposed and saved to EEPROM.

Would be good to see if this is the case where others have know unmatched inverters and motors.

As for adjusting the resolver, the Mitsubishi service manual states that it is factory sealed and should not be touched. The service procedure to replace the inverter or motor makes no reference to any resolver calibration.

Not saying it can't / should not be done, but find it strange that if it needs doing why is not covered in the manual.
NO i wont go near it. Resolver should stay as it is. All i am saying it seems to be a bit of offset in forward direction. Maybe they put it in to have easy creep mode with OEM car. I will go and find out how much offset i need and we can make this parameter value to be entered in settings.
Now where this parameter comes into process... i think after your map is processed.
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 »

line 1119 : torqueRequest += 10000;

It's used in other places for logging etc, but a small offset should not affect it.

For creep function (i personally don't like it..) I did have in mind to use a minimum torque function for this, although i think a function based on a min speed value would be better and it opens up cruise control as possibility.
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 233 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

aot93 wrote: Wed Mar 08, 2023 1:55 pm line 1119 : torqueRequest += 10000;

It's used in other places for logging etc, but a small offset should not affect it.

For creep function (i personally don't like it..) I did have in mind to use a minimum torque function for this, although i think a function based on a min speed value would be better and it opens up cruise control as possibility.
Huh! I made it! Motor spins in full control. Also brake switch will stop any unwanted rotation. I reduced torque for testing to 5Nm.
See the video.

However i didnt managed to program an RPM limit for FWD rotation. Motor would just keep rising RPM and finally trip my 32A auto fuse.
I thied like this...

Code: Select all

      if ((motorRPM < -2000) || (motorRPM > 2000))
      {
        torqueRequest = 0;
      }

There was also one strange thing as well. When i would apply throttle motor would spin forward. But when i removed throttle motor would brake until 0RPM but then would run slowly in reverse. Now that wouldnt be a problem, however during this negative rotation there seems to be no RPM limit whatsoever! Dangerous if there would be no brake pedal... What do you make of that.
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 »

Nice progress.

So the runaways are kind of expected, it seems it's not enough to just send 0 torque when there is no load on these motors, at least that is what I found, tuning the 2710 value you can cause a stop, but maybe this is actually sending a few grams off negative torque (which would explain the run up in reverse also)
A can LOG should show a 0 zero request but the motor still spinning. I can test this with out disconnecting the drive shafts from the motor.

Adding a load made everything behave exactly as expected.

As for the reverse RPM limit in FWD, the case here would be a vehicle rolling backwards while in FWD, this is handled in the throttle map and commands 0 torque, but I guess there would be no harm in a adding a catch for negative rotation in FWD.
Turbopete
Posts: 75
Joined: Mon Aug 30, 2021 8:42 pm

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by Turbopete »

Im looking to use an output from the dash controller to control a couple of relays that will break the connections between the charge port and the vcu. This might be a daft question but what are the MTR pins for? Also are the HC out pins used at all? i cant find anything in the code that refers to either of these?
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 »

Motor pins drive the switech (speedo) motor, they are defined here:

Code: Select all

SwitecX25 Motor(MaxMotorSteps, 6, 5, 4, 3);
HC outs are free for you to use as you require, they are low side FYI and should all support PWM.

Normally you have two high side isolated inputs available too.

There is no code in place for these as they could be used for almost anything, it's an easy add, shout if need some help.

I'm just starting testing on my V2 board which has more io and chademo support.
Turbopete
Posts: 75
Joined: Mon Aug 30, 2021 8:42 pm

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by Turbopete »

Many thanks for that! I’ll be watching the development of your v2 board with interest!
Ctwidle
Posts: 89
Joined: Wed Jan 06, 2021 9:44 pm
Been thanked: 11 times

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by Ctwidle »

Whilst building my HVJB from recycled Outlander parts I noticed that the contactors have tiny + and - signs near the terminals. I believe them to have a built in economiser circuit but is there anything in a contactor that requires polarity to be observed.
Thanks
Chris
User avatar
celeron55
Posts: 776
Joined: Thu Jul 04, 2019 3:04 pm
Location: Finland
Has thanked: 28 times
Been thanked: 110 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by celeron55 »

As I understand the arc suppression stuff or possibly the contacts otherwise have been designed for best performance (=longest lifespan) if you make the current go from the + to the - terminal (in other words, when the contactor is open, the + is at a higher voltage than the -). There also are contactors that are neutral this way. It won't be the end of the world if you for some reason connect it the other way around other than that it won't last as long if you're using it to break power. Generally that's what our contactors do only in emergencies as you risk breaking your inverter if you do it.
Ctwidle
Posts: 89
Joined: Wed Jan 06, 2021 9:44 pm
Been thanked: 11 times

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by Ctwidle »

Perfect thank you. I’m not expecting to get much out of this tired outlander pack so will be looking to upgrade once I have it up and running.
ScottS
Posts: 18
Joined: Sun Mar 08, 2020 11:28 am
Location: Norfolk
Been thanked: 1 time

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by ScottS »

aot93 wrote: Sat Mar 18, 2023 2:29 pm
I'm just starting testing on my V2 board which has more io and chademo support.
Hi aot93,

After doing a lot of the initial research into these components, I struggled to actually get the motor spinning, but finally worked yesterday. Would be really interested in a V2 board if you have any available or going to place an order. Is it still Teensy 4.2 based?
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 to hear you have it spinning!

I have v2 board - this is V2 of the dash controller and I've been adding CHAdeMO to it but have not actually got around to testing it.
This board is t4.2 based.

I also have the VCU boards if you need one.
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 233 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

aot93 wrote: Mon Mar 06, 2023 9:23 am 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!
@aot93, It didnt occur to me at the time you commented.
So you remove precharge resistor from the DC loop? How much time do you allow for precharge then?
Do you simply connect charger and heater to inverter by prearranged OEM connectors?
How do you activate charger then? By a separate charger relay or just DC contactor?

I am asking because i am thinking on how to make/brake precharge while charging. DCDC will be active then and i could actually use the heater while charging as well. I am thinking of using a seperate output to control precharge resistor but i will run out of input pins on ESP32...
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 »

Hi Arber,

I still have pre charge resistor and pre charge contactor - just a better quality one and more checks in the code.
Charger and heater are all connector to the inverter bus bar as OEM, so a precharge sequence is required to use either.

My chademo system uses a second pair of contactors to connect directly to the battery so no pre-charge needed there, again this mostly follows the OEM layout.

In my case an atiny monitors the PP pin and switches a relay to bring up the main VCU and BMS in a charging state if a charge plug is connected.
The wiring diagrams linked in the first post might help explain it (they don't show chademo)
Post Reply