DIY Electric Car Forums banner
1 - 9 of 9 Posts

·
Registered
Joined
·
111 Posts
So, how do we develop something for the bone stock leaf?


1. I've read that the Leafbox (yeah don't get me started on how overpriced neutral pedal mapping can be so revolutionary) could also increase the Leaf power output from 80kW -> 84kW. So there is maybe some buffer in the pedal signal? Maybe we could hijack this and when the trottle is applied to full, just write the can message to whatever the bit above full throttle is. Might be a lot of work for only 4kW, but potentially doable


2. The second way is to cut the CAN between VCM and Inverter, and modify the key messages. Anyone willing to help out here? I have access to muxsan CAN boards, so should be straightforward to try either #1 or #2
 

·
Registered
Joined
·
111 Posts
Hm... Maybe one could listen with Savycan on CAN bus and reference what the pedal position is and what Leaf brain is commanding inverter to do.

From Ampera (2013 Volt) i know when you apply sport mode you actually dont increase power. What this does is shift throttle curve to provide more torque at lower end of the RPM. The car seems more powerfull that way and in the end you dont need much torque at the 10KRPM to step over 80kW limit.

So there it is your solution for low end power.
1. Put a CAN filter uC on CAN lines between brain and inverter.
2. Filter out the torque demand IDs. Those are published.
3. After filter connect one uC that will read throttle position and calculate what data MSG to output.
4. Test drive!

Maybe you could get away with not cutting the wires. You would just have to time nonsuspecting CAN ID of torque and transmitt the CAN ID with your data just before so inverter decides to listen to yours instead of original. I think there is some requirement how fast throttle signal is transmitted. If you send duplicate ID original will get filtered out as an echo...

Nah, spoofing messages by spamming is not an option. The LEAF has built in error checking in the format of P-RUN messages. In my repo you can see which ones have this on the EV-can for instance. https://github.com/dalathegreat/leaf_can_bus_messages

"PRUN: Detection of frozen data. Message-PRUN-Diag. The transmitting node adds a message counter of 2bits or more to the end of the last data area (or just before the checksum). The value of the counter, which is initially 0, increments by one everytime new data is transmitted, and returned to zero when reaching the max value. The receiving node lets the first message pass without check, but for second next message and following, it check whether the counter number is different from the previous message."

So it's not possible to spam, cut wires and re-calculate is only option.
 

·
Registered
Joined
·
111 Posts
This is great! To what level of completeness has the Leaf protocol been sussed out? I've seen the spreadsheet this is built from, but I'm new to CAN and it doesn't seem like you could, say, control a charger, BMS, or DC-DC converter from the info.

The longass thread on the Leaf forum is pretty dead these days. Where is most Leaf/CAN hacking being discussed? I'm hoping to get to a point where someone could buy an Arduino, install some open-source software, and control Leaf components (thereby saving 10x vs aftermarket parts).

The EV-CAN on 2011-2017 Leafs are very well documented. But as you say, this does not allow you to control DC-DC converter from this info. But it does allow you to do some crazy good things like;
-Install any Nissan battery you want into any Leaf

-Increase charging speed when you have installed a bigger battery
-Make custom stop charging at XX% SOC commands
-Etc.


Most of the CAN discussion is happening on private e-mail chains. This is because people are willing to pay for these features, so everything cannot be freely shared yet. Everything I find out I'm making open-source, but I can't do the same with other peoples findings.


Forget the Arduino, you need a proper CAN-gateway. It's still quite cheap, and once we strap these CAN-bridges onto other busses, there is performance to be had :)
 

·
Registered
Joined
·
111 Posts
Hi Dala!


Let me see if I understand you correctly. You are going to try to modify the CAN message
0x1D4 that is sent to the inverter from the VCM?
I have a a Leaf motor and am chatting with the stock inverter via CAN messages.
see bbitnerblogs.com/e-miata
There is a maximum requested torque in the 1D4 message. Have you seen evidence
that the VCM is not sending the maximum requested torque when you have pressed the acclerator fully? Thanks..

P.S. I wonder if the inverter might perform differently in Diagnostic mode? I know it has
some temperature limits..

Bill Bitner

Yes, the demand message in 0x1D4 is a signed 12-bit value with 0.25 factor. This would put the upper demand limit possible to write as 511.75 Nm


The response message that the inverter sends back is a signed 11-bit value with a 0.5 factor. This would put the highest value it can theoretically send back as 511.5


Please correct my calculations if I'm wrong! I store the findings here https://github.com/dalathegreat/leaf_can_bus_messages


I've been told that the inverter firmware is the limiting factor. How much we will soon see. Oh, and it is possible to increase regen this way!
 

·
Registered
Joined
·
111 Posts
My initial attempts at persuading the inverter to output more power was a failure. Check this screenshot



In this screenshot I added 10Nm to the demand when it went above 253Nm. So it seems like the inverter firmware clamps to some hardcoded value to keep 80kW, which is a damn shame. I might try some other tricks, but it feels like either firmware needs to change (incredibly difficult) or an inverter swap from a newer Leaf (never done afaik)?


I got some additional info from a friend, "The inverter firmware limits torque to 254Nm (EM61) or 225ish (EM57)"
 
1 - 9 of 9 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top