Zombieverter Nissan Leaf 160kW
-
- Posts: 35
- Joined: Fri Jun 19, 2020 10:24 pm
- Location: Ulverston UK Lakedistrict
- Has thanked: 12 times
- Been thanked: 20 times
- Contact:
Zombieverter Nissan Leaf 160kW
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?
// 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?
-
- Posts: 1830
- Joined: Fri Mar 01, 2019 9:15 pm
- Location: Bristol
- Has thanked: 153 times
- Been thanked: 375 times
Re: Zombieverter Nissan Leaf 160kW
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.
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.
-
- Posts: 1830
- Joined: Fri Mar 01, 2019 9:15 pm
- Location: Bristol
- Has thanked: 153 times
- Been thanked: 375 times
Re: Zombieverter Nissan Leaf 160kW
Here is a a log from a 62kwh car
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.
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
}
-
- Posts: 1830
- Joined: Fri Mar 01, 2019 9:15 pm
- Location: Bristol
- Has thanked: 153 times
- Been thanked: 375 times
Re: Zombieverter Nissan Leaf 160kW
Probally want to update the 0x1DC limits to the ones form a gen 3 log like below.
These values are currently hardcoded in the Zombie code
These values are currently hardcoded in the Zombie code
-
- Posts: 1830
- Joined: Fri Mar 01, 2019 9:15 pm
- Location: Bristol
- Has thanked: 153 times
- Been thanked: 375 times
Re: Zombieverter Nissan Leaf 160kW
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.
Re: Zombieverter Nissan Leaf 160kW
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?
-
- Posts: 1830
- Joined: Fri Mar 01, 2019 9:15 pm
- Location: Bristol
- Has thanked: 153 times
- Been thanked: 375 times
Re: Zombieverter Nissan Leaf 160kW
Exactly why I am asking for logs, so I can review the request and the response from the inverter.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?
-
- Posts: 35
- Joined: Fri Jun 19, 2020 10:24 pm
- Location: Ulverston UK Lakedistrict
- Has thanked: 12 times
- Been thanked: 20 times
- Contact:
Re: Zombieverter Nissan Leaf 160kW
thanks for the help, Ill get a can logger and run a scan on the bus...
-
- Posts: 35
- Joined: Fri Jun 19, 2020 10:24 pm
- Location: Ulverston UK Lakedistrict
- Has thanked: 12 times
- Been thanked: 20 times
- Contact:
Re: Zombieverter Nissan Leaf 160kW
Im Hoping to get some logs this weekend but in the mean time im going to change 0x1dc as suggested- is it just byte [1] I need to change or [1] & [2]? I cannot quite figure out the cryptic message in the .cpp comments
-
- Posts: 1830
- Joined: Fri Mar 01, 2019 9:15 pm
- Location: Bristol
- Has thanked: 153 times
- Been thanked: 375 times
Re: Zombieverter Nissan Leaf 160kW
"cryptic" because its just copy paste from a log.
Here is the format of the values.
So you the 10bit discharge limit is: 0x1B8 440d. The scaling is 0.25kW per bit, luckily its hex and if you shift it back 2 positions you are dividing by 4.
The discharge limits thus is 0x6E which is 110d kW
So what value do we want to try, lets say 150kW 0x69. Then shift this left 2 you get 0x258 or 600d.
bytes[0]=0x6E;
bytes[1]=0x0A;
Becomes
bytes[0]=0x96;
bytes[1]=0x0A;
-
- Posts: 35
- Joined: Fri Jun 19, 2020 10:24 pm
- Location: Ulverston UK Lakedistrict
- Has thanked: 12 times
- Been thanked: 20 times
- Contact:
Re: Zombieverter Nissan Leaf 160kW
Well I can confirm that with your advice and insight @tom91 on reading our recent logs the peak request I see is for 511nm. At that point the MG_EffectiveTorque is showing 270mn and the shunt is telling me 493amps @ 330v - so pretty much exactly the 160kw rating.tom91 wrote: ↑Sat Jan 06, 2024 8:15 pm 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 }
Gotta be a big thumbs up for the Zombie VCU
Im still getting a thermal limp though after a couple of mins of running - it would appear that there is still some work to do labelling 0x55a is anyone has any further insight?
-
- Posts: 1830
- Joined: Fri Mar 01, 2019 9:15 pm
- Location: Bristol
- Has thanked: 153 times
- Been thanked: 375 times
Re: Zombieverter Nissan Leaf 160kW
Did you do any code changes on the limits as per my previous post?
Thermal limit, why would that be linked to CAN decoding?!? Zombie does not do anything with the thermal data received? It is very possible the inverter has a limited operating time for the peak power.
You are saying you are doing a couple of minutes, this is not what the leaf itself is designed to do.
-
- Posts: 35
- Joined: Fri Jun 19, 2020 10:24 pm
- Location: Ulverston UK Lakedistrict
- Has thanked: 12 times
- Been thanked: 20 times
- Contact:
Re: Zombieverter Nissan Leaf 160kW
Code wise, yes. I made sure 0x1dc[0]=A0 as that appears to be the documented max for my twinned BMW hybrid packs - the numbers do show that side of things are functioning as expected.
I didnt mess with anything to do with the throttle following your sage mentoring and a good session with ChatGPT getting Ai to explain bit shifting and other C related insights. Its a very patient teacher.
Thermal wise I do understand that the 'fault' isn't to do with the code per se its more my understanding of the decode on the log notwithstanding I made a couple of hardware modifications before getting the log that may be skewing the view somewhat.
No doubt I am taking things beyond their design concept in a way that is difficult to achieve in a road car. Im sure nobody drives their Leaf round at 95mph for very long.
I havn't tried soft pedalling for a few mins with the logger on yet but may be able to do so over the weekend as well be able to test again. I have my suspicions on this but more testing is required.
I do have a 44mb can log if anyone would like a copy? - PM and Ill get one across
I didnt mess with anything to do with the throttle following your sage mentoring and a good session with ChatGPT getting Ai to explain bit shifting and other C related insights. Its a very patient teacher.
Thermal wise I do understand that the 'fault' isn't to do with the code per se its more my understanding of the decode on the log notwithstanding I made a couple of hardware modifications before getting the log that may be skewing the view somewhat.
No doubt I am taking things beyond their design concept in a way that is difficult to achieve in a road car. Im sure nobody drives their Leaf round at 95mph for very long.
I havn't tried soft pedalling for a few mins with the logger on yet but may be able to do so over the weekend as well be able to test again. I have my suspicions on this but more testing is required.
I do have a 44mb can log if anyone would like a copy? - PM and Ill get one across
-
- Posts: 1830
- Joined: Fri Mar 01, 2019 9:15 pm
- Location: Bristol
- Has thanked: 153 times
- Been thanked: 375 times
-
- Posts: 35
- Joined: Fri Jun 19, 2020 10:24 pm
- Location: Ulverston UK Lakedistrict
- Has thanked: 12 times
- Been thanked: 20 times
- Contact:
Re: Zombieverter Nissan Leaf 160kW
For @tom91 (& those others who are interested in staring at other peoples data) Im attaching a can log of my first outing from this years 2024 Coniston Records week. If you'd like any more insight just ask away!
logged is a full power 1km run south a slow-ish turn and a full power return through the measured kilo.
If any knows how to rinse more RPM out of the Leaf E+ 160kw then Im all ears. Does anyone know if there is a programmable value for MAX_RPM or alike?
logged is a full power 1km run south a slow-ish turn and a full power return through the measured kilo.
If any knows how to rinse more RPM out of the Leaf E+ 160kw then Im all ears. Does anyone know if there is a programmable value for MAX_RPM or alike?
- Attachments
-
- 0000051.TXT
- (9.5 MiB) Downloaded 30 times
-
- Posts: 1830
- Joined: Fri Mar 01, 2019 9:15 pm
- Location: Bristol
- Has thanked: 153 times
- Been thanked: 375 times
Re: Zombieverter Nissan Leaf 160kW
Since you have constant power (160kW), rpm will depend on prop pitch. It would likely be best to change the rpm to maximize inverter/motor efficiency. I don't know the most efficient rpm for EM57/160kW inverter, it maybe more or less than the 6000rpm you are seeing.
-
- Posts: 1830
- Joined: Fri Mar 01, 2019 9:15 pm
- Location: Bristol
- Has thanked: 153 times
- Been thanked: 375 times
Re: Zombieverter Nissan Leaf 160kW
Reveiwing the CAN log with a Leaf ZE1 dbc.
You can see we request more torque yet the inverter refuses to give it to us.
The battery info reported during the run.
As you can see we are just maxing out the inverter. The average power of the two flat bits are 150-160kw give or take
One option to try, increase the power limit in message 0x1DC slightly if you are confident nothing in the battery setup gets hot.
It is possible the inverter will draw more, or it will also have its own internal limit.
You can see we request more torque yet the inverter refuses to give it to us.
The battery info reported during the run.
As you can see we are just maxing out the inverter. The average power of the two flat bits are 150-160kw give or take
One option to try, increase the power limit in message 0x1DC slightly if you are confident nothing in the battery setup gets hot.
It is possible the inverter will draw more, or it will also have its own internal limit.
-
- Posts: 35
- Joined: Fri Jun 19, 2020 10:24 pm
- Location: Ulverston UK Lakedistrict
- Has thanked: 12 times
- Been thanked: 20 times
- Contact:
Re: Zombieverter Nissan Leaf 160kW
@tom91 thats great, thanks for the feedback - after looking at it Im interested as to what is actually going on here....
The actual and requested follow very nicely until about 260NM when there is a big departure. Is this because we run over the set KW limit or because the requested value at that point departs from an MAX_NM setting? either way Im assuming the resultant 'fuzzing' is some internal management algorithm trying to keep things on the straight and narrow.
as a question for all then, would it be best to keep the requested torque value underneath the 260NM 'limit' in code and get a smoother delivery or increase the KW value to try and raise the point at which the fuzzing comes in?
The actual and requested follow very nicely until about 260NM when there is a big departure. Is this because we run over the set KW limit or because the requested value at that point departs from an MAX_NM setting? either way Im assuming the resultant 'fuzzing' is some internal management algorithm trying to keep things on the straight and narrow.
as a question for all then, would it be best to keep the requested torque value underneath the 260NM 'limit' in code and get a smoother delivery or increase the KW value to try and raise the point at which the fuzzing comes in?
-
- Posts: 1830
- Joined: Fri Mar 01, 2019 9:15 pm
- Location: Bristol
- Has thanked: 153 times
- Been thanked: 375 times
-
- Posts: 35
- Joined: Fri Jun 19, 2020 10:24 pm
- Location: Ulverston UK Lakedistrict
- Has thanked: 12 times
- Been thanked: 20 times
- Contact:
Re: Zombieverter Nissan Leaf 160kW
This is a trio of later logs. I held the total torque request (throtmax) back to 60% in an attempt to get a smoother delivery as I struggled to get the power delivery under control and that was making it difficult to drive. it sorta helped but Id changed the propeller and that didn't.
our best performance incidentally was when I accidentally limited the VCU to 500a (idcmax) and it did not like that one bit, performance was very unpredictable on the throttle as Im guessing there isn't much in the way of request smoothing going on but once the requests started to come within manageable numbers this smoothed out and we got our best run.
Im assuming from the data that the inverter is now the bottle neck and Im not going to get much further with the standard management board as it has a lot of limits and timers programmed into it that will ultimately hold performance back, Here's to hoping Johannes and crew can pull it out of the bag
our best performance incidentally was when I accidentally limited the VCU to 500a (idcmax) and it did not like that one bit, performance was very unpredictable on the throttle as Im guessing there isn't much in the way of request smoothing going on but once the requests started to come within manageable numbers this smoothed out and we got our best run.
Im assuming from the data that the inverter is now the bottle neck and Im not going to get much further with the standard management board as it has a lot of limits and timers programmed into it that will ultimately hold performance back, Here's to hoping Johannes and crew can pull it out of the bag
- Attachments
-
- 0000060.TXT
- (10.9 MiB) Downloaded 19 times
-
- 0000059.TXT
- (14.6 MiB) Downloaded 20 times
-
- 0000057.TXT
- (12.8 MiB) Downloaded 19 times