Outlander VCU - Rear inverter, Charger and BMS
-
- Posts: 331
- Joined: Mon Jul 25, 2022 7:59 pm
- Location: Bicester, Oxfordshire
- Has thanked: 8 times
- Been thanked: 47 times
Re: Outlander VCU - Rear inverter, Charger and BMS
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.
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
Phev rear motor, OEM inverter cabin heater and charger
BMW 9kwh & 12kwh packs
-
- Posts: 3437
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 101 times
- Been thanked: 305 times
- Contact:
Re: Outlander VCU - Rear inverter, Charger and BMS
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
- midway
- Posts: 88
- Joined: Mon Feb 15, 2021 3:52 pm
- Location: Ural
- Has thanked: 6 times
- Been thanked: 10 times
Re: Outlander VCU - Rear inverter, Charger and BMS
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++;
}
}
-
- Posts: 3437
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 101 times
- Been thanked: 305 times
- Contact:
Re: Outlander VCU - Rear inverter, Charger and BMS
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 .
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 .
- EV_Builder
- Posts: 1200
- Joined: Tue Apr 28, 2020 3:50 pm
- Location: The Netherlands
- Has thanked: 17 times
- Been thanked: 35 times
- Contact:
Re: Outlander VCU - Rear inverter, Charger and BMS
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
see http://www.wdrautomatisering.nl for bespoke BMS modules.
-
- Posts: 483
- Joined: Mon Jul 03, 2023 3:17 pm
- Location: CT, central shoreline, USA
- Has thanked: 149 times
- Been thanked: 139 times
Re: Outlander VCU - Rear inverter, Charger and BMS
Is the pulse too wide? How's it compare to the original waveform?
-
- Posts: 3437
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 101 times
- Been thanked: 305 times
- Contact:
Re: Outlander VCU - Rear inverter, Charger and BMS
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.
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.
-
- Posts: 3437
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 101 times
- Been thanked: 305 times
- Contact:
Re: Outlander VCU - Rear inverter, Charger and BMS
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...
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...
-
- Posts: 3437
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 101 times
- Been thanked: 305 times
- Contact:
Re: Outlander VCU - Rear inverter, Charger and BMS
Ya...!
I am a little dissapointed...
I managed to add another module so 8 total ID3 modules in Mazda for 53kWh at 360V 96S.
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.
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.
I am a little dissapointed...
I managed to add another module so 8 total ID3 modules in Mazda for 53kWh at 360V 96S.
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.
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.
-
- Posts: 3437
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 101 times
- Been thanked: 305 times
- Contact:
Re: Outlander VCU - Rear inverter, Charger and BMS
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.
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.
- midway
- Posts: 88
- Joined: Mon Feb 15, 2021 3:52 pm
- Location: Ural
- Has thanked: 6 times
- Been thanked: 10 times
Re: Outlander VCU - Rear inverter, Charger and BMS
I turn on the charging mode when messages appear from the charger about the maximum current on the can bus.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.
Code: Select all
void canRX_38A(const CAN_message_t &msg)
{
// chargerHVbattryVolts = msg.buf[0] * 2; // Charger EVSE Current
chargercurrent = msg.buf[3];
}
-
- Posts: 3437
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 101 times
- Been thanked: 305 times
- Contact:
Re: Outlander VCU - Rear inverter, Charger and BMS
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.
-
- Posts: 3437
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 101 times
- Been thanked: 305 times
- Contact:
Re: Outlander VCU - Rear inverter, Charger and BMS
@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.
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},
};
- aot93
- Posts: 211
- Joined: Mon Feb 15, 2021 5:45 pm
- Location: UK, West Sussex
- Has thanked: 8 times
- Been thanked: 47 times
Re: Outlander VCU - Rear inverter, Charger and BMS
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:
So in drive mode this bit code iterates through until the matching rpm (j) and pedal position (k) are found:
Then we use this to get the value of the offset :
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.
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};
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;
Code: Select all
{
pedal_offset = pedal_map_three[idx_j][idx_k];
break;
}
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.
-
- Posts: 3437
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 101 times
- Been thanked: 305 times
- Contact:
Re: Outlander VCU - Rear inverter, Charger and BMS
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...
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:
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};
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},
};
-
- Posts: 3437
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 101 times
- Been thanked: 305 times
- Contact:
Re: Outlander VCU - Rear inverter, Charger and BMS
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!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},
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},
Any ideas?
- aot93
- Posts: 211
- Joined: Mon Feb 15, 2021 5:45 pm
- Location: UK, West Sussex
- Has thanked: 8 times
- Been thanked: 47 times
Re: Outlander VCU - Rear inverter, Charger and BMS
Could it be that in map 3 the ramping is not used, so you could be getting quite big jumps in torque requests?
-
- Posts: 3437
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 101 times
- Been thanked: 305 times
- Contact:
Re: Outlander VCU - Rear inverter, Charger and BMS
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;
-
- Posts: 3437
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 101 times
- Been thanked: 305 times
- Contact:
Re: Outlander VCU - Rear inverter, Charger and BMS
Beacause of difficulties charging using Tesla Gen2 charger, bulkiness and separate cooling circuit needed, i decided to implement two phase charging that i was thinking of in the beginning.
I will use already established Outlander single phase charger with control from VCU. VCU is set to start precharge and DC contactor immeadiately upon PP pin connection with EVSE. When precharge proces is complete VCU will start charging telegram and provide command to charge from EVSE on its PWM control from Cp pin. On the second phase i will add Eltek charger. I decided to fit 3phase 2.5mm2 cable under the car and connect it with EVSE cable in the trunk. This will allow me to transfer load between phases to calibrate house load.
Eltek charger is mounted to the side of the battey box by M8 bolts. DC connection is provided through solar DC cables 6mm2 and MC4 connectors. The main difference of Eltek charger from Outlander one is that it does not have an output diode. Eltek runs on some form of resonance circuit which can be detrimental in case if there is no load on the output and charger is commanded on. This is why i decided to connect charger permanently to the DC circuit behind the main contactor. There is already a 16A fuse inside the charger.
This way of installing charger is good for me because i will be able to use the same cooliong circuit that i use for the rest of the system and the same header tank and pump. This really makes theinstallation of charger a drop-in.
For AC connection i use Yazaki 7283-7350-30 AC connector from Mitsubishi with both chargers which connect to joint distribution box beside Eltek charger. I had to put new calls to code. I simply call new telegram within function EVSEstart.
I first observe telegram 0x38A from charger and convert data from it into command for DC current.
Then i call telegrams 0x286 and 0x2FF commands to run both chargers
Now when EVSE sends PWM at 25% this will convert to 8.3A command and less proportionally.
I tested this on my DYI EVSE as well as hend held granny cable with different AC current settings before each charge. Every time i plugged in i saw consistent AMP draw on charger DC side. So i can confirm the system can conform to EVSE command when needed.
EDIT: There is a problem! I connected my car to public EVSE and it failed to charge.
At first 3A DC was started and then nothing... I will have to setup some lines in code so parameters of charging will be displayed in serial so as to observe what is happening with chargers.
I will use already established Outlander single phase charger with control from VCU. VCU is set to start precharge and DC contactor immeadiately upon PP pin connection with EVSE. When precharge proces is complete VCU will start charging telegram and provide command to charge from EVSE on its PWM control from Cp pin. On the second phase i will add Eltek charger. I decided to fit 3phase 2.5mm2 cable under the car and connect it with EVSE cable in the trunk. This will allow me to transfer load between phases to calibrate house load.
Eltek charger is mounted to the side of the battey box by M8 bolts. DC connection is provided through solar DC cables 6mm2 and MC4 connectors. The main difference of Eltek charger from Outlander one is that it does not have an output diode. Eltek runs on some form of resonance circuit which can be detrimental in case if there is no load on the output and charger is commanded on. This is why i decided to connect charger permanently to the DC circuit behind the main contactor. There is already a 16A fuse inside the charger.
This way of installing charger is good for me because i will be able to use the same cooliong circuit that i use for the rest of the system and the same header tank and pump. This really makes theinstallation of charger a drop-in.
For AC connection i use Yazaki 7283-7350-30 AC connector from Mitsubishi with both chargers which connect to joint distribution box beside Eltek charger. I had to put new calls to code. I simply call new telegram within function EVSEstart.
I first observe telegram 0x38A from charger and convert data from it into command for DC current.
Code: Select all
// Outlander charger PWM report
void canRX_38A(const CAN_message_t &msg)
{
chargercurrent = msg.buf[3]*10/3; // pwm report * 10 / by 3 to get DC amps
}
Code: Select all
void EvseStart()
{
if (timer500_2.check() == 1)
{
chargerstopLoByte = lowByte(chargerstop*10);
chargerstopHibyte = highByte(chargerstop*10);
// Outlander charger commands
msg.id = 0x286;
msg.len = 8;
msg.buf[0] = 0x10; //voltage 360V
msg.buf[1] = 0x0E;
if ((chargerHVbattryVolts > (chargerstop - 2)) && (chargerHVbattryVolts <= (chargerstop))) { // if charger is at 386V
msg.buf[2] = 0x1E;
}
else if (chargerHVbattryVolts > chargerstop) { // if charger is at 388V
msg.buf[2] = 0x00;
}
else { //any other case
msg.buf[2] = chargercurrent; // Current byte 0x78 = 120; 12A
}
msg.buf[3] = 0x37;
msg.buf[4] = 0x0;
msg.buf[5] = 0x0;
msg.buf[6] = 0x0A;
msg.buf[7] = 0x0;
Can2.write(msg);
// Eltek charger commands
msg.id = 0x2FF;
msg.len = 8;
msg.buf[0] = 0x01;
msg.buf[1] = 0xE8;
msg.buf[2] = 0x03;
msg.buf[3] = chargerstopLoByte; // Voltage byte h
msg.buf[4] = chargerstopHibyte; // Voltage byte h
msg.buf[5] = chargercurrent; // Current byte 0x78 = 120; 12A
msg.buf[6] = 0x00;
msg.buf[7] = 0x00;
Can2.write(msg);
}
}
I tested this on my DYI EVSE as well as hend held granny cable with different AC current settings before each charge. Every time i plugged in i saw consistent AMP draw on charger DC side. So i can confirm the system can conform to EVSE command when needed.
EDIT: There is a problem! I connected my car to public EVSE and it failed to charge.
At first 3A DC was started and then nothing... I will have to setup some lines in code so parameters of charging will be displayed in serial so as to observe what is happening with chargers.
-
- Posts: 3437
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 101 times
- Been thanked: 305 times
- Contact:
Re: Outlander VCU - Rear inverter, Charger and BMS
To inspect what happens when i connect charger to EVSE i have to add some parameters in VCU code.
I declared current requested and value of PWM_signal
uint8_t chargercurrent = 0;
uint8_t PWM_signal = 0;
I add PWM_signal reading to function for current requested
void canRX_38A(const CAN_message_t &msg)
{
PWM_signal = msg.buf[3]; // pwm report
chargercurrent = msg.buf[3]*10/3; // pwm report * 10 / by 3 to get DC amps
}
I added serial reporting in function void showInfo()
Serial.print(" Charger Current: ");
Serial.print(chargercurrent);
Serial.print(" PWM_signal: ");
Serial.print(PWM_signal);
This will let me observe what happens when i connect public EVSE and how much current is requested. It may require for me to set the minimim value for chargercurrent variable.
I declared current requested and value of PWM_signal
uint8_t chargercurrent = 0;
uint8_t PWM_signal = 0;
I add PWM_signal reading to function for current requested
void canRX_38A(const CAN_message_t &msg)
{
PWM_signal = msg.buf[3]; // pwm report
chargercurrent = msg.buf[3]*10/3; // pwm report * 10 / by 3 to get DC amps
}
I added serial reporting in function void showInfo()
Serial.print(" Charger Current: ");
Serial.print(chargercurrent);
Serial.print(" PWM_signal: ");
Serial.print(PWM_signal);
This will let me observe what happens when i connect public EVSE and how much current is requested. It may require for me to set the minimim value for chargercurrent variable.
-
- Posts: 3437
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 101 times
- Been thanked: 305 times
- Contact:
Re: Outlander VCU - Rear inverter, Charger and BMS
Well...
I managed to see what signal EVSE shows to Cp line. And to my surprise it was 56% PWM not 26% as i imagined.
This forced me to add additional variable PWM_sig so that i set limits to my current calculation.
First i read PWM_signal from byte3. Then i check if signal is less than 6% or more than 26%. In that case i set hard limits to current request.
My current limit is 3.3kW per phase, so 26% max.
Code runs good and i managed to set changes to current (via Cp) on my home EVSE directly. I got good real time response from current request to charger.Then i went to public EVSE near my home and tested there. I got good 6kW charging from two phases.
I managed to see what signal EVSE shows to Cp line. And to my surprise it was 56% PWM not 26% as i imagined.
This forced me to add additional variable PWM_sig so that i set limits to my current calculation.
First i read PWM_signal from byte3. Then i check if signal is less than 6% or more than 26%. In that case i set hard limits to current request.
My current limit is 3.3kW per phase, so 26% max.
Code: Select all
PWM_signal = msg.buf[3]; // pwm report
if (PWM_signal >= 26){
PWM_sig = 26;
}
else if (PWM_signal < 10){
PWM_sig = 10;
}
else {
PWM_sig = PWM_signal;
}
chargercurrent = PWM_sig*10/2.7; // pwm report[%] * 10 / by 3 to get DC amps
- midway
- Posts: 88
- Joined: Mon Feb 15, 2021 3:52 pm
- Location: Ural
- Has thanked: 6 times
- Been thanked: 10 times
Re: Outlander VCU - Rear inverter, Charger and BMS
This option works great for mearber333 wrote: ↑Tue May 21, 2024 7:03 pm Well...
I managed to see what signal EVSE shows to Cp line. And to my surprise it was 56% PWM not 26% as i imagined.
This forced me to add additional variable PWM_sig so that i set limits to my current calculation.
First i read PWM_signal from byte3. Then i check if signal is less than 6% or more than 26%. In that case i set hard limits to current request.
My current limit is 3.3kW per phase, so 26% max.
Code runs good and i managed to set changes to current (via Cp) on my home EVSE directly. I got good real time response from current request to charger.Then i went to public EVSE near my home and tested there. I got good 6kW charging from two phases.Code: Select all
PWM_signal = msg.buf[3]; // pwm report if (PWM_signal >= 26){ PWM_sig = 26; } else if (PWM_signal < 10){ PWM_sig = 10; } else { PWM_sig = PWM_signal; } chargercurrent = PWM_sig*10/2.7; // pwm report[%] * 10 / by 3 to get DC amps
Code: Select all
msg.buf[2] = lowByte(map(PWM_signal,13,27,6,12)*10);
-
- Posts: 3437
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 101 times
- Been thanked: 305 times
- Contact:
Re: Outlander VCU - Rear inverter, Charger and BMS
Hm... good idea!midway wrote: ↑Wed May 22, 2024 10:52 am This option works great for meCode: Select all
msg.buf[2] = lowByte(map(PWM_signal,13,27,6,12)*10);
- midway
- Posts: 88
- Joined: Mon Feb 15, 2021 3:52 pm
- Location: Ural
- Has thanked: 6 times
- Been thanked: 10 times
Re: Outlander VCU - Rear inverter, Charger and BMS
Now I am finishing the installation of 3 Outlander chargers for stationary charging of 10 kW in the garage from a 3-phase power supply. And one device is mounted on the car.