Outlander VCU - Rear inverter, Charger and BMS

Mitsubishi hybrid drive unit hacking
FFMan
Posts: 321
Joined: Mon Jul 25, 2022 7:59 pm
Location: Bicester, Oxfordshire
Has thanked: 8 times
Been thanked: 46 times

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by FFMan »

I'm interested in what have been doing with the pedal mapping.

I have my outlander inverter vcu running as very simple code on a Teensy 4.0 It receives data from the main Teensy 4.1 such as what gear the car is in and a regen parameter for each gear the user can modify. My aim was to keep the mission critical stuff away from the dash/display stuff in case of performance issues or crashes. The number of can messages flying about is staggering and keeps a 4.1 pretty busy. The inverter seems very chatty, i see 1500 msgs/sec on that channel and approx 400/sec on the other 2 channels. I need to apply some filtering other than in code really as much of it is of no interest and maintaining 10 msec update on the 285 is a challenge with the dash update. The vcu shares a less busy can channel with the 4.1

In the first instance I coded in a direct map between the usable pedal range and 0-2000 for the torque request. I had intended to added mapping and 3 options later but now i have it working i can't see see the value in doing so. If i plant my foot, the code requests maximum torque and the inverter sorts it out and the car pulls cleanly away. If i pootling about, i don't plant my foot. The weight of the car irons out any jolts there might be, but i suspect there are none due to logic in the inverter rather than my code.

the only outstanding item for me is to ramp off the regen when the driver comes off the brakes. The ramp on over 1500 msec works well and allows for high regen values, currently around 600 of the 2000 available.

I like this combo for adequate performance.
E46 touring
Phev rear motor, OEM inverter cabin heater and charger
BMW 9kwh & 12kwh packs
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

FFMan wrote: Thu Feb 22, 2024 12:55 pm I need to apply some filtering other than in code really as much of it is of no interest and maintaining 10 msec update on the 285 is a challenge with the dash update
True. I am slowly leaning towards using a separate BMS with 2 CAN bus lines. One would drive JK BMS modules at 250kbaud and the other would be connected to 500kbaud CAN of inverter and other peripherals. This would then be responsible to put 0x285 telegram out at 10ms with options for changing its bytes according to modes of operation.

EDIT: I remember i posted Lebowski equasion for throttle response function. Maybe you could use that with serial menu
viewtopic.php?p=53586#p53586
User avatar
midway
Posts: 79
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 »

Improved code for JK BMS

Code: Select all

int BMS_id = 1; //BMS counter
int BMS_nom = 4;//Number of BMS

Code: Select all

void BMS_Stat()
{
 if (timer1000_3.check() == 1)
 {
    if (BMS_id > BMS_nom) 
   {
BMS_id = 1;
 BMS_max = 0;
  BMS_min = 5;
  // BMS_avgvolt = 0;
  // BMS_avgtmp = 0;
BMS_packvoltage = 0.00;  
 for(unsigned int i=0; i<sizeof(BMS_Volt)/sizeof(int);i++)
 {
    
  
 if (BMS_Volt[i] > 0)
  {
   
    BMS_max = max(BMS_Volt[i],BMS_max);
  BMS_min = min(BMS_Volt[i],BMS_min);
BMS_packvoltage = BMS_packvoltage+BMS_Volt[i];
 
    }
 }
 memset(BMS_Volt, 0, sizeof(BMS_Volt)); 
if (BMS_min == 5)
  {
  BMS_min = 0;
  }
   }
    msg.id  = BMS_id;
    msg.len = 1;
    msg.buf[0] = 0xFF;
    Can1.write(msg);
   
    BMS_id++; 

 
 }
}

Code: Select all

void canRX_001(const CAN_message_t &msg)
{
if (msg.buf[0] == 1)
  {
   BMS_avgvolt = msg.buf[5] / 1000.0 * 256 + msg.buf[6] / 1000.0; 
     BMS_avgtmp = (msg.buf[2] + msg.buf[1]) + 6;
  }

  if (msg.buf[0] == 4)
  {
  if (msg.buf[1] < 19)

  {
    if (msg.id == 0x01)
  {
      //BMS_avgtmp4=0;
    //BMS_packvoltage4 = 0;
    BMS_Volt[msg.buf[1]] = (((msg.buf[2] / 1000.0) * 256) + (msg.buf[3] / 1000.0));
    BMS_Volt[msg.buf[1] + 1] = (((msg.buf[4] / 1000.0) * 256) + (msg.buf[5] / 1000.0));
    BMS_Volt[msg.buf[1] + 2] = (((msg.buf[6] / 1000.0) * 256) + (msg.buf[7] / 1000.0));
  }
  if (msg.id == 0x02)
  {
      //BMS_avgtmp4=0;
    //BMS_packvoltage4 = 0;
    BMS_Volt[msg.buf[1] + 13] = (((msg.buf[2] / 1000.0) * 256) + (msg.buf[3] / 1000.0));
    BMS_Volt[msg.buf[1] + 14] = (((msg.buf[4] / 1000.0) * 256) + (msg.buf[5] / 1000.0));
    BMS_Volt[msg.buf[1] + 15] = (((msg.buf[6] / 1000.0) * 256) + (msg.buf[7] / 1000.0));
  }
  if (msg.id == 0x03)
  {
      //BMS_avgtmp4=0;
    //BMS_packvoltage4 = 0;
    BMS_Volt[msg.buf[1] + 25] = (((msg.buf[2] / 1000.0) * 256) + (msg.buf[3] / 1000.0));
    BMS_Volt[msg.buf[1] + 26] = (((msg.buf[4] / 1000.0) * 256) + (msg.buf[5] / 1000.0));
    BMS_Volt[msg.buf[1] + 27] = (((msg.buf[6] / 1000.0) * 256) + (msg.buf[7] / 1000.0));
  }
  if (msg.id == 0x04)
  {
         //BMS_avgtmp4=0;
    //BMS_packvoltage4 = 0;
    BMS_Volt[msg.buf[1] + 37] = (((msg.buf[2] / 1000.0) * 256) + (msg.buf[3] / 1000.0));
    BMS_Volt[msg.buf[1] + 38] = (((msg.buf[4] / 1000.0) * 256) + (msg.buf[5] / 1000.0));
    BMS_Volt[msg.buf[1] + 39] = (((msg.buf[6] / 1000.0) * 256) + (msg.buf[7] / 1000.0));
  }

      if (msg.id == 0x05)
  {
         //BMS_avgtmp4=0;
    //BMS_packvoltage4 = 0;
    BMS_Volt[msg.buf[1] + 49] = (((msg.buf[2] / 1000.0) * 256) + (msg.buf[3] / 1000.0));
    BMS_Volt[msg.buf[1] + 50] = (((msg.buf[4] / 1000.0) * 256) + (msg.buf[5] / 1000.0));
    BMS_Volt[msg.buf[1] + 52] = (((msg.buf[6] / 1000.0) * 256) + (msg.buf[7] / 1000.0));
  }

   if (msg.id == 0x06)
  {
         //BMS_avgtmp4=0;
    //BMS_packvoltage4 = 0;
    BMS_Volt[msg.buf[1] + 61] = (((msg.buf[2] / 1000.0) * 256) + (msg.buf[3] / 1000.0));
    BMS_Volt[msg.buf[1] + 62] = (((msg.buf[4] / 1000.0) * 256) + (msg.buf[5] / 1000.0));
    BMS_Volt[msg.buf[1] + 63] = (((msg.buf[6] / 1000.0) * 256) + (msg.buf[7] / 1000.0));
  }   

  if (msg.id == 0x07)
  {
         
    BMS_Volt[msg.buf[1] + 73] = (((msg.buf[2] / 1000.0) * 256) + (msg.buf[3] / 1000.0));
    BMS_Volt[msg.buf[1] + 74] = (((msg.buf[4] / 1000.0) * 256) + (msg.buf[5] / 1000.0));
    BMS_Volt[msg.buf[1] + 75] = (((msg.buf[6] / 1000.0) * 256) + (msg.buf[7] / 1000.0));
  }
    
  }
   }

 

  BMS_SOC = ((msg.buf[1] * 256) + msg.buf[0]);
 

  if (BMS_Status == 5)
  {
    if (VCUstatusChangeCounter > VCUstatusChangeThreshold)

      VCUstatusChangeCounter = 0;
    VCUstatus = 7;
  }
  else
  {
    VCUstatusChangeCounter++;
  }
}
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

I used PWM code for speedo dial and it responded with dial jumping...
Then i put the speedo function after the inverter RPM report function. This is what i get:
Seems like it would want to keep the beat with radio :).
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 »

🤣
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
jrbe
Posts: 287
Joined: Mon Jul 03, 2023 3:17 pm
Location: CT, central shoreline, USA
Has thanked: 99 times
Been thanked: 75 times

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by jrbe »

Is the pulse too wide? How's it compare to the original waveform?
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

I am back.
I made a new wiring for the front elements CAN bus and separated 12V power supply in case that would help with any noise on the line. It didnt!
Heater still wouldnt start and i could see speedo jumping at speed.
This frustrated me greatly, but l simply turned to sorting some ancillaries such as roof window seal, top cabin lights and 3phase L2 charging port installation.
After i was done there i calmed down a bit and went into the code and deleted all references to other CAN transcievers. I only kept CAN2 line in code.

It looks like this helped as i got fully working system now. I guess multiple CAN lines at once is too much for Teensy. New code now lacks BMS and Dash functionality so i will have to add my own system for BMS.
I think i will use my existing ESP32 VCU design which uses 2 CAN modules. One line i will use for BMS 250kbaud line and second CAN will transmitt 0x285 message as well as some translated info about battery from JK BMS modules. I think this may further release main VCU for more processing power to vital functions.
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

After some serious driving with Outlander VCU, for more than 200km stretch... i may share some thought about this VCU.
Teensy works really well when it works inside its loop. That means when VCU is activated and car is in FWD or RWD mode drive is very smooth, no jumps or glitches. Torque is somewhat precise and fairly strong for such a small motor. At lower RPM motor is a bit sluggish but when upwards from 2000rpm i can get off the ramp really quick. I am surprised motor provides great acceleration torque up to 10000rpm.
Regen is marginal (-15A) up to 2000rpm, Good (-35A) up to 8000rpm and really humongous (-70A) upwards of 8000RPM!
I am really pleased with reliable CAN commands while driving. DC cables go really close to CAN lines and once i solved that MCU interrupt overload no such problems occured. Motor - inverter - charger - heater combo tested at 160km/h speed and up to 78kW electrical power.
I still want to install additional battery module for full 96S - 360Vdc nominal. I expect at least 85kW if not closed to 100kW!

There some downsides however...
1. After lengthy VCU inactivity CAN bus comes out of sync and causes all kinds of rock and roll on starting. To resolve this i need to cut the 12V power (disconnect cable harness) and then VCU starts a new. I tried to use WDT reset function and it didnt work. Only hard power reset helped with this.
My plan to resolve this is to change VCU wiring so ignition will provide power to VCU when only when active and a separate relay will turn VCU on when charger is connected. Some work to do still.

EDIT: On the 1st point it seems now if i cycle the direction switch in F N R and then R N F direction for several times, then i come to FWD the VCU would be in sync again. I still have to confirm this by multiple confirmed instances though.
EDIT2: Nope! I still get twitches from keeping VCU connected and at idle for extended time. I will have to implement VCU ignition starting.

2. I noticed motor does not provide much torque at driveoff from 0km/h. its late for about 0.5s even if i floor it. Like a giant rubber string. I dont know what the issue is but this happens no matter how i set up throttle map.

3. Flimsy Teensy :). Really delicate Teensy pins really require care when assembling and inpurs need to be secured by opto coupler. I had to replace analog input to different pin as i caused damage from 5V input. To combat this i use resistor divider and 3.6V zener diode reversed towards GND so if more than 3.6V shows it is drained to GND. Throttle pedal is 5V and its signals can go up to 4.2V...

4. Trouble with PP signal and charger activation. I am using PP signal from L2 EVSE port which is pulled down inside cable by 680R or 220R resistor to PE. This allowed me to attach 2K7 resistor from 5V to opto input. This means that in code PP pin is signalled as active when nothing is connected and will be seen as inactive if i connect EVSE. I had to invert PP reading for CAN to transmitt and VCU to disable the car when charging. I think for this to work propperly it would require a change of VCU board. If i do this i will also add a buzzer and use its function in case of errors.

5. I seem to leak gearbox oil from LH driveshaft socket, but that seems to be my bad, probably i damaged the seal on that side, have to investigate...
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

Ya...!
I am a little dissapointed... :(

I managed to add another module so 8 total ID3 modules in Mazda for 53kWh at 360V 96S.
20240308_224630.jpg
20240308_224644.jpg
20240308_224655.jpg

Then i went on and calibrated my display and tested the power of the beast :).
Together 53kWh makes up for about 290km range conservatively on the highway... 185W/km i think.

Screenshot_20240308-230315_Dragger.jpg
It looks like Outlander inverter has a power limiter! Not amp limiter, but power limiter. When i had 84S battery inverter would let 230A go through which at 320V means 73kW. In the video i show steady acceleration and max current draw of 192A at 360V which makes about 70kW power from Outlander RWD motor. This means i will have to try to up the torque by software but the power will probably remain constant.
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

I redid my VCU wiring so that i use ignition to allways start VCU power together with VCU logic. Now VCU allways starts in sync.
This means step 2 and the shutoff loop are redundant. But i will leave it in in case if i come to a different solution. This is in no way perfect. Let me explain the wiring...

Driving loop
1. I turn the key to 1st position - "ignition" gives power to VCU and signals "ignition on".
2. I turn the key to "start" position - VCU starts precharge and turns DC contactor ON
3. I select direction to drive...

Charging loop
1. When i connect cable - PP line is pulled low. I connected PP line to trigger two relays. First relay will bring power to VCU so it will be powered ON
2. Other relay will show active signal on pin_8 and activate charging process.
This one is tricky as it will also power hydro pump of the power steering. A bit annoying to hear this with charging...
I will have to think about how to use a single relay to sense PP and command charging and second relay to start PSU only when driving.
User avatar
midway
Posts: 79
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 »

arber333 wrote: Fri Mar 15, 2024 2:45 pm 2. Other relay will show active signal on pin_8 and activate charging process.
This one is tricky as it will also power hydro pump of the power steering. A bit annoying to hear this with charging...
I will have to think about how to use a single relay to sense PP and command charging and second relay to start PSU only when driving.
I turn on the charging mode when messages appear from the charger about the maximum current on the can bus.

Code: Select all

void canRX_38A(const CAN_message_t &msg)
{
 // chargerHVbattryVolts = msg.buf[0] * 2; // Charger EVSE Current
  chargercurrent = msg.buf[3];
}
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

midway wrote: Sat Mar 16, 2024 7:18 am I turn on the charging mode when messages appear from the charger about the maximum current on the can bus.
Ok but i need to turn on DC contactor first so i can let the charging process to go on.

In any case i decided to put in Tesla gen2 charger and use its outputs to signal inverter immobilization in case someone would decide to start the car while on evse.
GEN2 charger is totally self sustained and connected directly to battery behind main contactor. So i dont need to start the VCU while charging.
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

@aot93; I tried to adapt regen more to single throttle way and i didnt quite managed to get to where i wanted. I would ask for explanation on how regen uses the matrix please...
To first explain my target;
I modified the matrix for map3 to target value of regen at the beginning of matrix AND i changed the 2nd column from 0 to negative value approximately halfh way between 0 and full regen. 3rd column is now 0 value. Idea was to have partial regen when i hold throttle and full regen when i let go.
It seems i managed to effect the 2nd columen but when i release throttle nothing changes to more regen!
My throttle is set to active from 1600 to 4000 value, but i see throttle signal to go from 1400 to 4090. Is that significant?
Should i calibrate throttle closer to live values?

Can you please explain how VCU reads those regen values? TNX.

Code: Select all

const int pedal_map_three[21][22] = {
    // Sport
    // map 3..
    /*250*/ {0, 0, 0, 3, 6, 10, 12, 10, 10, 10, 10, 10, 10, 10, 10, 12, 12, 12, 12, 18, 24},
    /*500*/ {-50, -30, 0, 3, 6, 10, 12, 10, 10, 10, 10, 10, 10, 10, 10, 12, 12, 12, 16, 18, 24},
    /*625*/ {-90, -60, 0, 3, 8, 12, 12, 10, 10, 10, 10, 10, 10, 10, 10, 12, 12, 12, 16, 18, 24},
    /*750*/ {-90, -60, 0, 4, 10, 16, 16, 10, 9, 9, 9, 9, 9, 10, 10, 10, 10, 12, 14, 16, 24},
    /*1000*/ {-120, -90, 0, 4, 10, 16, 16, 10, 9, 9, 9, 9, 9, 10, 10, 10, 10, 12, 14, 16, 24},
    /*1250*/ {-120, -90, 0, 4, 10, 12, 16, 10, 9, 9, 9, 9, 9, 10, 10, 10, 10, 12, 14, 16, 24},
    /*1500*/ {-160, -90, 0, 4, 8, 10, 12, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 12, 14, 16, 24},
    /*2000*/ {-160, -90, 0, 4, 8, 10, 10, 8, 8, 8, 8, 9, 9, 10, 10, 10, 10, 12, 14, 16, 24},
    /*2500*/ {-180, -90, 0, 4, 8, 10, 10, 8, 8, 8, 8, 9, 9, 10, 10, 10, 10, 12, 14, 16, 24},
    /*3000*/ {-180, -90, 0, 4, 8, 10, 10, 8, 8, 8, 8, 9, 9, 10, 10, 10, 10, 12, 14, 16, 24},
    /*3500*/ {-180, -90, 0, 4, 8, 10, 10, 8, 8, 8, 8, 9, 9, 10, 10, 10, 10, 12, 14, 16, 24},
    /*4000*/ {-180, -90, 0, 4, 8, 10, 10, 8, 8, 8, 8, 8, 9, 10, 10, 10, 10, 12, 14, 16, 24},
    /*4500*/ {-230, -120, 0, 4, 6, 8, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 12, 14, 16, 24},
    /*5000*/ {-230, -120, 0, 4, 5, 6, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 12, 14, 16, 24},
    /*5500*/ {-230, -120, 0, 4, 5, 6, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 12, 14, 16, 24},
    /*6000*/ {-230, -120, 0, 4, 5, 6, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 12, 14, 16, 24},
    /*6500*/ {-230, -120, 0, 4, 5, 6, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 12, 12, 14, 16},
    /*7000*/ {-230, -120, 0, 4, 5, 6, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 12, 12, 14, 16},
    /*7500*/ {-260, -120, 0, 4, 5, 6, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 12, 12, 14, 16},
    /*8000*/ {-260, -120, 0, 4, 5, 5, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 12, 12, 14, 16},
    /*10000*/ {-260, -120, 0, 4, 5, 5, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 12, 14},
};
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 »

Ok I will try to explain:
The idea is based on how a basic ignition map works in an ice, - return an advance value based on input of speed and load.
The maps act like a spread sheet for us to look up and return a value based on 2 inputs;

for the x axis (columns) this is the throttle position as read by the vcu ADC, and y axis (rows) are the motor RPM as reported from the inverter via CAN.

The number of rows and columns and the pedal position / RPM each bin or cell relates to are defined here:

Code: Select all

const int tpsbins[21] = {0, 3, 5, 8, 10, 13, 18, 20, 23, 25, 28, 32, 34, 40, 50, 60, 70, 80, 90, 100, 101};

const int rpmbins[num_rpm_bins] = {
    250, 500, 625, 750, 1000, 1250, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000, 5500, 6000, 6500, 7000, 7500, 8000, 10000};
So in drive mode this bit code iterates through until the matching rpm (j) and pedal position (k) are found:

Code: Select all

    byte j = 0; // index of RPM bins
    byte k = 0; // index of throttle pos
    while (throttlePosition > tpsbins[k])
    {
      k++;
    }
    while (motorRPM > rpmbins[j] && j <= num_rpm_bins - 1)
    {
      j++;
    }
    if (j > num_rpm_bins - 1)
    {
      j = num_rpm_bins - 1;
    };
    idx_k = k;
    idx_j = j;
Then we use this to get the value of the offset :

Code: Select all

 {
      pedal_offset = pedal_map_three[idx_j][idx_k];
      break;
    }
This offset is used to calculate the the torque request value to be sent to the inverter using this basic formula:

if pedal offset is a positive number:

targetTorque = (throttlePosition * pedal_offset) * 2

We multiply by 2 as we are assuming a max limit of 200nm for the motor and our scale is 0 - 100

If the pedal offset is a negative number i.e a re-gen request :

regenTarget = pedal_offset * 2;

so we don't take the actual pedal position into account here, instead using the value from the cell directly.

There is further logic in the code to allow for ramping up and down of the values to smooth things out, in the mini i get results very similar to how my leaf drives using the 'e-pedal'

In your case i suspect the tps bins might be a little close together 0% and 3% pedal position, unless you have changed them already so the difference might not be noticeable.
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

Thank you for explanation.
Question 1: Would tpsbins[21] mean pedal position from 0 to 3% and then 3% to 5%? Is your intention in the lower part of the throttle to be really accurate with pedal position? So if i would change your pedal map to...

Code: Select all

const int tpsbins[21] = {0, 5, 10, 12, 14, 20, 24, 28, 32, 36, 40, 46, 52, 58, 64, 70, 78, 85, 90, 100, 101};
Should i get larger gaps between values at the start?

Question 2: I have made a really good pedal map setup for me i think. The only thing i am bothered with is fast torque transition when i am already rolling, maybe between 250rpm and 500rpm. There is a weird shaking there but then it becomes smooth as i go through the rpm. What would that be? Are there three 0 points too fine?

My current pedal map:

Code: Select all

const int pedal_map_three[21][22] = {
    // Sport
    // map 3..
    /*250*/ {0, 0, 0, 3, 4, 6, 8, 10, 10, 14, 14, 14, 16, 16, 16, 18, 18, 18, 20, 20, 24},
    /*500*/ {-50, -30, 0, 3, 4, 6, 8, 10, 10, 14, 14, 14, 16, 16, 16, 16, 18, 18, 20, 20, 24},
    /*625*/ {-90, -60, 0, 3, 4, 6, 8, 10, 10, 14, 14, 14, 16, 16, 16, 16, 18, 18, 20, 20, 24},
    /*750*/ {-90, -60, 0, 3, 4, 6, 8, 10, 10, 14, 14, 14, 16, 16, 16, 16, 18, 18, 20, 20, 24},
    /*1000*/ {-120, -90, 0, 3, 4, 6, 8, 10, 10, 10, 10, 10, 10, 12, 12, 12, 14, 14, 16, 18, 24},
    /*1250*/ {-120, -90, 0, 3, 4, 6, 8, 8, 10, 10, 10, 10, 10, 12, 12, 12, 12, 14, 16, 18, 24},
    /*1500*/ {-160, -90, 0, 3, 4, 6, 8, 8, 10, 10, 10, 10, 10, 12, 12, 12, 12, 14, 16, 18, 24},
    /*2000*/ {-160, -90, 0, 3, 4, 6, 8, 8, 10, 10, 10, 10, 10, 12, 12, 12, 12, 14, 16, 18, 24},
    /*2500*/ {-180, -90, 0, 3, 4, 6, 8, 8, 9, 9, 9, 10, 10, 12, 12, 12, 12, 14, 16, 18, 24},
    /*3000*/ {-180, -90, 0, 3, 4, 6, 8, 8, 9, 9, 9, 10, 10, 12, 12, 12, 12, 14, 16, 18, 24},
    /*3500*/ {-180, -90, 0, 3, 4, 6, 8, 8, 9, 9, 9, 9, 10, 12, 12, 12, 12, 14, 16, 18, 24},
    /*4000*/ {-180, -90, 0, 3, 4, 6, 8, 8, 9, 9, 9, 9, 10, 12, 12, 12, 12, 14, 16, 18, 24},
    /*4500*/ {-230, -120, 0, 3, 4, 6, 8, 8, 9, 9, 9, 9, 9, 10, 10, 12, 12, 14, 14, 14, 18, 24},
    /*5000*/ {-230, -120, 0, 3, 4, 6, 8, 8, 9, 9, 9, 9, 9, 10, 10, 12, 12, 14, 14, 14, 18, 24},
    /*5500*/ {-230, -120, 0, 3, 4, 6, 8, 8, 9, 9, 9, 9, 9, 10, 10, 12, 12, 14, 14, 14, 18, 24},
    /*6000*/ {-230, -120, 0, 3, 4, 6, 8, 8, 9, 9, 9, 9, 9, 10, 10, 12, 12, 14, 14, 14, 18, 24},
    /*6500*/ {-230, -120, 0, 3, 4, 6, 8, 8, 9, 9, 9, 9, 9, 10, 10, 12, 12, 12, 14, 14, 18, 24},
    /*7000*/ {-230, -120, 0, 3, 4, 6, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 12, 12, 14, 18, 24},
    /*7500*/ {-260, -120, 0, 3, 4, 6, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 12, 14},
    /*8000*/ {-260, -120, 0, 3, 4, 5, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 12, 14},
    /*10000*/ {-260, -120, 0, 3, 4, 5, 8, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 12, 14},
};
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

arber333 wrote: Sun Mar 24, 2024 8:17 pm Question 2: I have made a really good pedal map setup for me i think. The only thing i am bothered with is fast torque transition when i am already rolling, maybe between 250rpm and 500rpm. There is a weird shaking there but then it becomes smooth as i go through the rpm. What would that be? Are there three 0 points too fine?

My current pedal map3:

Code: Select all

    /*250*/ {0, 0, 0, 3, 4, 6, 8, 10, 10, 14, 14, 14, 16, 16, 16, 18, 18, 18, 20, 20, 24},
    /*500*/ {-50, -30, 0, 3, 4, 6, 8, 10, 10, 14, 14, 14, 16, 16, 16, 16, 18, 18, 20, 20, 24},
    /*625*/ {-90, -60, 0, 3, 4, 6, 8, 10, 10, 14, 14, 14, 16, 16, 16, 16, 18, 18, 20, 20, 24},
    /*750*/ {-90, -60, 0, 3, 4, 6, 8, 10, 10, 14, 14, 14, 16, 16, 16, 16, 18, 18, 20, 20, 24},
    /*1000*/ {-120, -90, 0, 3, 4, 6, 8, 10, 10, 10, 10, 10, 10, 12, 12, 12, 14, 14, 16, 18, 24},
    /*1250*/ {-120, -90, 0, 3, 4, 6, 8, 8, 10, 10, 10, 10, 10, 12, 12, 12, 12, 14, 16, 18, 24},
    /*1500*/ {-160, -90, 0, 3, 4, 6, 8, 8, 10, 10, 10, 10, 10, 12, 12, 12, 12, 14, 16, 18, 24},
After some driving in around town and in the city this induced vibration is really annoying. Particulary in the city with stop and go driving!
Vibration happens around 20km/h which is 155RPM for a 24" wheel and by my calculation for 7 : 1 final drive is 1200RPM of motor.
I tested this with pedal map3 and later on with pedal map1. Lo and behold!! Map1 did not have any such problems

My current pedal map1:

Code: Select all

    /*250*/ {0, 3, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 8, 10},
    /*500*/ {0, 3, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 8, 10},
    /*625*/ {0, 3, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 8, 10},
    /*750*/ {0, 3, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 8, 10},
    /*1000*/ {0, 3, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 8, 10},
    /*1250*/ {0, 3, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 8, 10},
    /*1500*/ {0, 3, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 8, 10},
So there must be something in the first 30% pedal travel and at 1200Rpm for Map3.
Any ideas?
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 »

Could it be that in map 3 the ramping is not used, so you could be getting quite big jumps in torque requests?
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: Outlander VCU - Rear inverter, Charger and BMS

Post by arber333 »

aot93 wrote: Wed Mar 27, 2024 6:34 pm Could it be that in map 3 the ramping is not used, so you could be getting quite big jumps in torque requests?
I resolved this by going through values in the array. I made some jumps in values where throttle would be held, but RPMs increased. This resulted in values jumping up and down and then settling as motor accelerated to required RPM. I changed the values to ramp up by 3 points diffeerence max and it solved the issue.

In other news i found out the hard way that 6 or 8 value in reverse equasion is just to little to take off into a hill in reverse.

Code: Select all

   case driveReverse:
........ 
 if (throttlePosition > 5)
    {
      torqueRequest = throttlePosition * -6; // lets make the pedal less responsive
      inverterFunction = 0x03;
I had to increase that value to 12. Now car gives proper pull when i need to reverse into some hill.
Post Reply