Zombieverter Leaf throttle code

Nissan Leaf/e-NV200 drive stack topics
Post Reply
ted.walsh
Posts: 9
Joined: Fri Jun 19, 2020 10:24 pm
Location: Ulverston UK Lakedistrict
Has thanked: 6 times
Been thanked: 6 times
Contact:

Zombieverter Leaf throttle code

Post by ted.walsh »

code help required for wringing the most out of the 160kw inverter...



// Requested torque (signed 12-bit value + always 0x0 in low nibble)
if(final_torque_request >= -2048 && final_torque_request <= 2047)

this is a snippet from the Zombieverter repository that is compiled into the current live version for the VCU, it appears to limit the maximum torque request to a value below 2047 and be a hangover from the V1 hardware days as the same value is used there. notwithstanding V2.x doesn't have specific support for the 110 and 160 inverters yet, has anyone tried monkeying with the value? Ive looked at the Dala code for his middleware solution and it doesn't seem to do anything other that multiply the final value by 1.47 (up to 1.6!) on the 160 and 1.32 on the 110.

Any thoughts or better still real world experience by anybody?
tom91
Posts: 1308
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 103 times
Been thanked: 216 times

Re: Zombieverter Leaf throttle code

Post by tom91 »

Do you have a setup with a Gen 3 drivetrain that runs to test on? I will dig a bit in the DBCs to see what limits are listed there.

You are looking at the wrong point buddy. It is a 12bit value thus 4095 dec max and then half that because its signed gives you the value limits listed in the code.
Founder Volt Influx https://www.voltinflux.com/
Webstore: https://citini.com/
tom91
Posts: 1308
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 103 times
Been thanked: 216 times

Re: Zombieverter Leaf throttle code

Post by tom91 »

Here is a a log from a 62kwh car
image.png
The way the torque gets requested is a bit strange.

So it scales from 0-100 as torque percentage then multiplies by 2047. Given the motor torque is scaled at 0.25 bit/Nm and its a 12bit value.

This would mean 2047*0.25 = 511.75Nm which sounds like quite alot.

Code: Select all

void LeafINV::SetTorque(float torquePercent)
{
   final_torque_request = (torquePercent * 2047) / 100.0f;

   Param::SetInt(Param::torque,final_torque_request);//post processed final torque value sent to inv to web interface
}
Founder Volt Influx https://www.voltinflux.com/
Webstore: https://citini.com/
tom91
Posts: 1308
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 103 times
Been thanked: 216 times

Re: Zombieverter Leaf throttle code

Post by tom91 »

Probally want to update the 0x1DC limits to the ones form a gen 3 log like below.
image.png
These values are currently hardcoded in the Zombie code
image.png
Founder Volt Influx https://www.voltinflux.com/
Webstore: https://citini.com/
tom91
Posts: 1308
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 103 times
Been thanked: 216 times

Re: Zombieverter Leaf throttle code

Post by tom91 »

If anyone one could please provide a CAN log of a Zombie controlling a Nissan Leaf inverter, I would like to see a log with the throttle flat requesting 100%. Please provide the Zombie settings with the log.
Founder Volt Influx https://www.voltinflux.com/
Webstore: https://citini.com/
Aragorn
Posts: 127
Joined: Wed Jan 04, 2023 10:23 am
Has thanked: 5 times
Been thanked: 53 times

Re: Zombieverter Leaf throttle code

Post by Aragorn »

I'm sure dala ran some tests where if you request more torque than the inverter allows, the inverter will just follow the programmed curve. Perhaps Zombie really is requesting 500nm? That must give weird throttle control though, as it will reach max torque at 50-60% pedal?
tom91
Posts: 1308
Joined: Fri Mar 01, 2019 9:15 pm
Location: Bristol
Has thanked: 103 times
Been thanked: 216 times

Re: Zombieverter Leaf throttle code

Post by tom91 »

Aragorn wrote: Mon Jan 08, 2024 12:01 pm I'm sure dala ran some tests where if you request more torque than the inverter allows, the inverter will just follow the programmed curve. Perhaps Zombie really is requesting 500nm? That must give weird throttle control though, as it will reach max torque at 50-60% pedal?
Exactly why I am asking for logs, so I can review the request and the response from the inverter.
Founder Volt Influx https://www.voltinflux.com/
Webstore: https://citini.com/
ted.walsh
Posts: 9
Joined: Fri Jun 19, 2020 10:24 pm
Location: Ulverston UK Lakedistrict
Has thanked: 6 times
Been thanked: 6 times
Contact:

Re: Zombieverter Leaf throttle code

Post by ted.walsh »

thanks for the help, Ill get a can logger and run a scan on the bus...
Post Reply