# Increasing my Nissan Leaf performance?



## Duncan (Dec 8, 2008)

Hi Craig
Forget the ultracapacitor - what you need is a new "brain board" 

Nissan parts will give 100 hp for 200,000 miles with low warranty failures

If you are willing to drop the reliability then all you need is the brain board to tell the Nissan bits to go for it a bit more

https://pandspowerelectronics.ecwid.com/#!/P&S-Circuit-Boards/c/16287307/offset=0&sort=normal


----------



## EVmattyP (May 12, 2019)

Duncan said:


> Hi Craig
> Forget the ultracapacitor - what you need is a new "brain board"
> 
> Nissan parts will give 100 hp for 200,000 miles with low warranty failures
> ...


looks like the store is closed. Any other vendors selling anything along these lines or links to where I can read up more on them?


----------



## arber333 (Dec 13, 2010)

EVmattyP said:


> looks like the store is closed. Any other vendors selling anything along these lines or links to where I can read up more on them?


I am not sure Paul supports field weakening. This is essential for high revs. But if you want to use transmission up to 7000rpm then you are good with his power stage. 

Check out Arlos power stage
https://endless-sphere.com/forums/viewtopic.php?f=30&t=63982&p=963227#p963227

And Johannes hijacking of original Leaf inverter AND other inverters with his brain...
https://openinverter.org/forum/viewtopic.php?f=4&t=138&start=60


----------



## skyguy_6153 (Jul 15, 2017)

EVmattyP said:


> looks like the store is closed. Any other vendors selling anything along these lines or links to where I can read up more on them?


The site is back up! 

Sent from my G3223 using Tapatalk


----------



## Dala (Jan 10, 2018)

What about modifying the CAN message that the VCM sends to the Inverter? It should be really easy to do with say a Muxsan CAN-bridge?


----------



## skyguy_6153 (Jul 15, 2017)

Honestly, you would make a heap of power with the Leaf Inverter stock as the IGBTs are rated for 600 Volts and 600 Amps. That's 360 kW, or 482 HP. But I wouldn't even think of straining the Inverter like that unless I had some cooling. Me personally 280-300 HP (209-224 kW) is what I'm aiming for with my Leaf motor. Hopefully I can achieve that with just CAN control. Never done SMD soldering until I started working on Damien's VCM board, but I feel I'm getting better with each component I solder on. 

Sent from my G3223 using Tapatalk
View attachment 114525


----------



## Emyr (Oct 27, 2016)

skyguy_6153 said:


> the IGBTs are rated for 600 Volts and 600 Amps. That's 360 kW,


If the IGBTs are rated 600V and 600A, that's peak voltage and peak current, not RMS. I don't think just multiplying them gives an actual theoretical maximum.


----------



## Tremelune (Dec 8, 2009)

I'm pretty sure the Leaf's power output is limited by the batteries. Whether that's due to heat or chemistry, I dunno...I haven't been able to find specs on how much current the motor draws at full throttle and how much current each module can deliver.


----------



## arber333 (Dec 13, 2010)

Tremelune said:


> I'm pretty sure the Leaf's power output is limited by the batteries. Whether that's due to heat or chemistry, I dunno...I haven't been able to find specs on how much current the motor draws at full throttle and how much current each module can deliver.


Yes after 2500rpm inverter starts reducing torque to remain in the 80kw power limit. I also think this is mostly because of battery motor power declaration. Legal... I think battery can safely withstand 300A. 

If you keep max torque 280Nm up to 4000rpm you would get 115kW which is also the power limit of the new 2019 leaf. 

Then if you keep 280Nm up to 7000rpm which is approx the motor voltage limit without field weakening you would get 200kW. Now that is a lot of power and incidentally some 360V 600A limit on transistors. I think 200kW is a good bet for max power on this motor, but for only a 30s burst on most controllers. Not that motor would complain, transistors inside inverter need to be cooled.


----------



## Dala (Jan 10, 2018)

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


----------



## arber333 (Dec 13, 2010)

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...


----------



## Dala (Jan 10, 2018)

arber333 said:


> 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.
> 
> ...



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.


----------



## Tremelune (Dec 8, 2009)

Dala said:


> In my repo you can see which ones have this on the EV-can for instance.


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).


----------



## Dala (Jan 10, 2018)

Tremelune said:


> 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


----------



## wjbitner (Apr 5, 2010)

Hi Dala!

I'm currently playing around with leaf motors (see bbitnerblogs.com/e-miata)
and have found that http://productions.8dromeda.net/c55-leaf-inverter-protocol.html
seems to have pretty accurate information. I believe that there may be two typo's
in that document. 1, minimum voltage is 240, not 140. This is backed up by the 
Nissan fault codes. 2, I think msg 1DA is 2 volts per increment. Not sure about RPM's
yet. We will also be open-sourcing our software to make this run. Currently, I don't have
a big enough power supply to spin the motor, but I"m building batteries and looking into how to make the leaf charger do the job (from a hardware perspective, not CAN messages).


----------



## Tremelune (Dec 8, 2009)

wjbitner said:


> minimum voltage is 240, not 140.


The Nissan Leaf motor requires greater than 240v to operate? I'm planning on using a Leaf motor, but my pack is 216-240v. Might you have a source for this info?


----------



## wjbitner (Apr 5, 2010)

Hi Tremelune!

The motor itself does not. In fact, I think I saw someone run the motor on 12 volts using 
Johannes Hubner's (https://openinverter.org/docs/index.html?en_home,3.html) logic board and using the leaf inverters power stage. What I'm talking about is using the
factory inverter with no modifications. As far as documentation for the 240 volts, it is
in the service manual as a trouble code. I can look it up if you need it. I seem to recall that you modified the inverter by replacing the logic board, so you won't have that restriction.


----------



## Tremelune (Dec 8, 2009)

Oof, I did not! I'm using Thunderstruck's controller, but that just talks to the inverter, so it sounds like I'm under the same constraint. I might have to add another 6 modules!

Off to research...


----------



## wjbitner (Apr 5, 2010)

The information from Nissan is in the tms.pdf file (don't remember where I got that) on page 24, where they state the normal operating voltage is 240-403. It can go as high as 500 while in regen, but shouldn't go higher. I don't know anything about the thunderstruck board. I hope it works out ok for you.. Best of luck.


----------



## Dala (Jan 10, 2018)

The Muxsan CAN Man-in-the-middle board is now available to the public. If you are looking for an easy way to modify CAN messages, this is it!

https://www.tindie.com/products/muxsan/can-mitm-bridge-3-port-rev-25


----------



## Dala (Jan 10, 2018)

I am soon gonna try going after the Nm demand messages with a CAN-bridge










Anyone ever tried this?
http://www.japtoys.net/forum/viewto...58b163fa0e3dabd2d7fc270aeb16b&start=90#p71600


----------



## kennybobby (Aug 10, 2012)

What was the motor current at the wide open throttle at peak torque?


----------



## Dala (Jan 10, 2018)

kennybobby said:


> What was the motor current at the wide open throttle at peak torque?



At low SOC (<20%), BatteryCurrent at 300A (293V*300A=87,9kW)


----------



## wjbitner (Apr 5, 2010)

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


----------



## Dala (Jan 10, 2018)

wjbitner said:


> Hi Dala!
> 
> 
> Let me see if I understand you correctly. You are going to try to modify the CAN message
> ...



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!


----------



## wjbitner (Apr 5, 2010)

Dala said:


> 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
> ...


Hi Dala! This is great information. When you perform your experiments, I would pay close attention to the inverter voltage. As you say, you can increase the regen. However, this may either charge the batteries with more current than they are rated for or increase the inverter voltage past the 403 volt limit, which causes the inverter to fault. If the VCM is not commanding full torque in some cases, it may be because increasing the torque will cause the inverter voltage to go down lower than 240, where again the inverter will fault. Both of those faults are not permanent, but I'm not sure how they can be reset other than removing power from the inverter, or most likely, clearing them with a diagnostic code reader.. I look forward to hearing more about your experiments.. 

Bill Bitner


----------



## Dala (Jan 10, 2018)

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)"


----------



## wjbitner (Apr 5, 2010)

Hi Dala!

I think swapping the inverter from a new leaf would be quite a challenge. There are some values from the resolver (on the motor) that have to be entered into the new inverter to make it work properly. If you are skilled enough to do that, altering the firmware may be the next step.. I'd be much more inclined to put a different logic board in the inverter to
get more power. If you did that, the next challenge would likely be keeping the inverter cool.
Have fun and keep up the great work.

Bill Bitner


----------



## kennybobby (Aug 10, 2012)

Do you have the throttle position and motor RPM that you could also plot with the torque demand and torque generated?

Is there a current limit in the inverter that might be holding the generated torque?


----------

