Trying to control the leaf inverter (Gen2 (EM57, 80kW)) via CAN. Are using celeron55 information,
http://productions.8dromeda.net/c55-lea ... tocol.html
as well as Damiens SW for Leaf Inverter Controller,
https://github.com/damienmaguire/Nissan ... Controller
and Stm32 VCU,
https://github.com/damienmaguire/Stm32-vcu.
My question is how do I implement reverse?
Only changing byte0 in 0x11A from 4E to 2E is not enough.
In Damiens sw it looks like he is always using 0x4E and only changing the sign of the requested torque?
Do I need to change byte5 of 0x1D4 to 0x42 (0x44) as well when selecting gear?
Controlling Leaf inverter via CAN-bus
- johu
- Site Admin
- Posts: 6618
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 342 times
- Been thanked: 1485 times
- Contact:
Re: Controlling Leaf inverter via CAN-bus
Happened to work on that part
yes just reverse the sign. Same a regen. If you don't do anything about it, when you regen to a stop it will then take off in reverse 


Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
-
- Posts: 3554
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 131 times
- Been thanked: 330 times
- Contact:
Re: Controlling Leaf inverter via CAN-bus
You should listen to inverter report for RPM. When it gets close to 60RPM or similar your torque command then should go to 0 or switch to the other side. Regen should also be 0 there. You also need to have a loop to ignore reverse command in case RPM is still above 60RPM.
- johu
- Site Admin
- Posts: 6618
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 342 times
- Been thanked: 1485 times
- Contact:
Re: Controlling Leaf inverter via CAN-bus
yes, yes, that's what we did in Zombieverter. Much like in the openinverter-inverter. It ramps down towards 0.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- bexander
- Posts: 866
- Joined: Tue Jun 16, 2020 6:00 pm
- Location: Gothenburg, Sweden
- Has thanked: 71 times
- Been thanked: 97 times
Re: Controlling Leaf inverter via CAN-bus
Thank you gentlemen!
Summary:
Keep 0x4E all the time, and only change sign on torque command for reverse.
Only allow "gear change" below 60rpm.
Stop regen below 60rpm.
Summary:
Keep 0x4E all the time, and only change sign on torque command for reverse.
Only allow "gear change" below 60rpm.
Stop regen below 60rpm.
- johu
- Site Admin
- Posts: 6618
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 342 times
- Been thanked: 1485 times
- Contact:
Re: Controlling Leaf inverter via CAN-bus
That'll oscillate. Check here
https://github.com/damienmaguire/Stm32- ... u.cpp#L396
and here
https://github.com/damienmaguire/Stm32- ... e.cpp#L252
@Damien: didn't you modify that last part?
https://github.com/damienmaguire/Stm32- ... u.cpp#L396
and here
https://github.com/damienmaguire/Stm32- ... e.cpp#L252
@Damien: didn't you modify that last part?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- bexander
- Posts: 866
- Joined: Tue Jun 16, 2020 6:00 pm
- Location: Gothenburg, Sweden
- Has thanked: 71 times
- Been thanked: 97 times
Re: Controlling Leaf inverter via CAN-bus
Thats great! I haven't started with the regen part yet as I have an issue when I'm in reverse (negative torque request) and at standstill (or very low speed). I can't get much torque. I only can get the inverter to pull 0,5A from the battery (360V) no matter how much torque I request. When in forward (positive torque request), no problem, I get the torque I command.
Have you experienced anything similar to this?
EDIT: Found and solved my issue by sending the correct byte0 and byte1 for ID 0x1D4, both 0x6E and not 0x7F & 0x07...
Have you experienced anything similar to this?
EDIT: Found and solved my issue by sending the correct byte0 and byte1 for ID 0x1D4, both 0x6E and not 0x7F & 0x07...
- Jack Bauer
- Posts: 3638
- Joined: Wed Dec 12, 2018 5:24 pm
- Location: Ireland
- Has thanked: 9 times
- Been thanked: 272 times
- Contact:
Re: Controlling Leaf inverter via CAN-bus
Yeah regen cuttoff rpm is raised in proportion to the % of regen selected. Works great.
I'm going to need a hacksaw