# Nissan Leaf Motor & Inverter



## DaveBlack (Oct 31, 2018)

Hay all - for anyone looking for a cheap way to build a reasonable EV car - I have just successfully got my Leaf motor to spin with the original inverter.

So no need for expensive aftermarket add-ons. 

I know there are a smattering of others out there that have achieved this but I hope to publish my Arduino code when I install this in my RX8 (upgrading my EV from its rather slow 15kw motor!)

Really hope to provide the EV community with the ability to put Leaf motors into whatever they want, and as they are pretty cheap to pick up gives a lot of opportunities. The BMS from the leaf is easy to use also. Just working on the charger atm...

Quick video of me being excited about this part of the project!





Dave


----------



## Tremelune (Dec 8, 2009)

You can't hear me, but I'm cheering. This would have saved me like two grand.

The charger would be huge, 'cause the 6.6kW Leaf charger is like two grand cheaper than anything comparable...Even the 3.3kW charger is great bang-for-buck.


----------



## DaveBlack (Oct 31, 2018)

Shame I have arrived a bit late for you! I am working on the charger at the moment - fingers crossed!!!


----------



## Gigawatts (Aug 8, 2013)

Good job, that is awesome! I just got a 2011 Leaf motor and I've been combing over the available options. I will be following this with great interest and trying to replicate what you have done. Your video on reading car canbus is great! Really dives into the meat of what people want to know and explains it well. 

I thought on most EVs the accelerator pedal was communicating directly to the inverter, but I guess that is not the case with OEMs. Seems on the Leaf, the pedal is providing signal to a TCU (Throttle Control Unit) and the TCU is creating canbus torque commands that the inverter picks up.


----------



## Tremelune (Dec 8, 2009)

While you're in there, the DC-DC converter would be pretty rockin'...That's another two grand...EVERYTHING IS TWO GRAND AND I ALREADY HAVE ONE I CAN'T USE!

This is a pretty exciting time for EV conversions...Used OEM offerings are _plummeting_ in cost, and the controllers only need to be hacked/open-sourced once...Once you can buy a Leaf and drop in the whole thing (or some _Ford_, or _Chevy_)...EV swaps will overtake LS swaps in a decade...$5-10k in parts for a conversion in all these tiny classics...Fun stuff.


----------



## Scotty274 (Jul 1, 2020)

Watching with excitement, although LEAF's (Leaves?) are not as common down here, that's what I picked up at auction and is what I plan to work with, so your Arduino code will be indispensable when you are done. I'm normally watching your videos within minutes of them going up now, ,uch to the wife's chagrin at the time it is here when they have gone up.


----------



## DaveBlack (Oct 31, 2018)

Hay Scotty274, glad the videos are helpful, I really hope I can get all the Leaf gear working with just one Arduino and Canbus running. Thats the plan and so far ive not seen anything that looks like it wont be possible.


----------



## Scotty274 (Jul 1, 2020)

DaveBlack said:


> Hay Scotty274, glad the videos are helpful, I really hope I can get all the Leaf gear working with just one Arduino and Canbus running. Thats the plan and so far ive not seen anything that looks like it wont be possible.


Yeah mate absolutely!

I've been scratching my head trying to figure out how to get it all going, and at the moment I was looking to be transplanting the entire LEAF loom into the VW to be able to get it working and needing to do some funky things with wheel hub speed sensors and stuff to keep ABS, TCS, and the other fun parts working (A legal requirement here in Australia)

I mean, I think I have A solution, but it might not be THE solution.

This is what my roundabout arse about solution was going to be.

However if your solution looks better, and will do what it needs to do, then I'll just copy you.


----------



## DaveBlack (Oct 31, 2018)

Oh my is all I can say - thats a very comprehensive approach. I am all in favour of biting these things off in smaller chunks! You are going to have a lot of signal translations to handle between the two systems, and will need to code a lot of fault tolerances. 

Be interesting to see how you get on.

Dave


----------



## Scotty274 (Jul 1, 2020)

DaveBlack said:


> Oh my is all I can say - thats a very comprehensive approach. I am all in favour of biting these things off in smaller chunks! You are going to have a lot of signal translations to handle between the two systems, and will need to code a lot of fault tolerances.
> 
> Be interesting to see how you get on.
> 
> Dave


Me too mate, I mean, it seems simple in theory, and if I could crack it, it could be a solution that could be more "Plug and Play" for some people, however it is a lot to take on.

Even if maybe I scan all the BUS data off both cars and see about hiring a programmer on Fiverr or something to see if they could code something up.

As you said, there's going to have to be a lot of redundancy coded in. Not sure what it's like over there, but here they'll even go to the effort of plugging in a scan tool and checking faults, whether they cause a CEL or not, if so much as my "Ignition tining" is out, whether it is relevant or not, they fail you.

Problem I've found so far is the VW recipient has all the safety gear hard coded into the ECU and BCM, which I can't really bypass or replicate, nor would I feel comfortable writing code, or testing code, for airbags or seat belt tensioners or any of that stuff.


----------



## Tremelune (Dec 8, 2009)

Dunno if this is helpful, but Damien Maguire has open-sourced some code, though it doesn't seem to working yet:









GitHub - damienmaguire/Nissan-Leaf-Inverter-Controller: OpenSource Control Unit for the Nissan Leaf Gen 1 and Gen 2 inverter


OpenSource Control Unit for the Nissan Leaf Gen 1 and Gen 2 inverter - GitHub - damienmaguire/Nissan-Leaf-Inverter-Controller: OpenSource Control Unit for the Nissan Leaf Gen 1 and Gen 2 inverter




github.com


----------



## DaveBlack (Oct 31, 2018)

Yes I have seen that, not sure how far it got along in the end, pretty much hoping just an Arduino and CanBus interface will all that will be required with my approach. In fact, that is all that is required as I have it working lol!!


----------



## Scotty274 (Jul 1, 2020)

DaveBlack said:


> Yes I have seen that, not sure how far it got along in the end, pretty much hoping just an Arduino and CanBus interface will all that will be required with my approach. In fact, that is all that is required as I have it working lol!!


Exactly, it's very exciting that at the end of the day, the stuff that makes them tick is just a handful of simple commands once you break it down.

What some people term as black voodoo magic is really not that bad once you understand the fundamentals.


----------



## scottherrington (Jul 3, 2020)

The issues you guys are having is one of the main reasons I have completely changed course with my build.
I was going to convert a 2001 Ford Cougar but am no specialist in how to integrate the electronics.
So now I'm converting a classic mini which will make things a lot easier.
Really interested in following how you get on with the Leaf hacking.

Sent from my LG-M250 using Tapatalk


----------



## Scotty274 (Jul 1, 2020)

scottherrington said:


> The issues you guys are having is one of the main reasons I have completely changed course with my build.
> I was going to convert a 2001 Ford Cougar but am no specialist in how to integrate the electronics.
> So now I'm converting a classic mini which will make things a lot easier.
> Really interested in following how you get on with the Leaf hacking.
> ...


Eh mate, don't get disheartened with it though, you can always use an old car as your starter, and then progress up and up and up to new things as you learn more.

Dave did the same with his build, he got the bare minimum out of his RX8 to get the lights off, and then realised he wanted more than his little 15kW could provide.

I've played a little with electronics, but after a 10 year stint in the Army driving trucks, I want more out of life than changing gears and steering until I retire, so I thought I might jump into the coolest industry around these days. Nothing like going in headfirst in my opinion, but it may not be everyones cup of tea.


----------



## Tremelune (Dec 8, 2009)

scottherrington said:


> I was going to convert a 2001 Ford Cougar but am no specialist in how to integrate the electronics. So now I'm converting a classic mini which will make things a lot easier.


I cannot overstate how good a decision this was...and not really because of CAN integration...


----------



## DaveBlack (Oct 31, 2018)

Just got the Dc-Dc converter working on the Leaf Charger ;o) well chuffed! (sorry to hijack lol)

Dave


----------



## scottherrington (Jul 3, 2020)

Excellent news, this could be a real game changer for ev conversions, can't wait to see the end result

Sent from my LG-M250 using Tapatalk


----------



## DaveBlack (Oct 31, 2018)

Made a quick demo video, got the charger and dc-dc working...






Thanks

Dave


----------



## Tremelune (Dec 8, 2009)

Say what?? Is DC-DC really just...powering it up?? I wonder to what extent that board could be extracted from the giant PDC box...

It is fantastic to see the aggregation and distillation culminating in working parts! Any idea what would be the minimum wiring for getting the DC-DC converter to light up?


----------



## DaveBlack (Oct 31, 2018)

Yeah it really does appear that simple, weird eh! There might be some controls on voltage levels I guess, or being able to turn it on and off, but heck it can sit at 14 volts all day for all I need!

Follow my channel as I will be publishing data as I firm things up - its all on the back of *** packets at the moment!


----------



## Scotty274 (Jul 1, 2020)

DaveBlack said:


> Made a quick demo video, got the charger and dc-dc working...
> 
> Thanks
> 
> Dave


Thanks Dave, makes me much more hopeful that I'll be able to get things going on my project without a huge amount of issues.

Though the wife has had a pivot, though maybe not for the right reasons, she doesn't think if I can get it benched running, that I'll be in and out, 20 minute adventure, and she doesn't want to drive my Ute to work.

So we're now on the lookout for a nicer older Audi that doesn't have CANBUS, and then it can be straight in with the Leaf stuff running all the LEAF CAN.

Either way, I normally watch your videos straight up, this one took me a couple days because the wife was like "Not that whinging Pom again!"

Honey, that "Whinging Pom" will get your car electrified, I'm learning so much Dave. Legend.

At some point I'll have to find out where your local Bottle-O is and shout you a box of beers.


----------



## DaveBlack (Oct 31, 2018)

Hay Scotty, "Whinging Pom' haha, don't tell my kids as that will become my nickname! I accept all forms of liquid payment ;o) A chap wanted the container that held all the Leaf HV gear out of my donor vehicle - I had no idea what it was worth, so 48 cans of cider was ample payment lol!!! I am thinking I am going to attach the Leaf EV Can to the RX8's Can, no reason they cannot live together, non of the codes appear to collide.


----------



## Scotty274 (Jul 1, 2020)

I'm hoping that's the sane with mine mate.

Just gotta wait for the CANBUS Logger to arrive now


----------



## DaveBlack (Oct 31, 2018)

This is what I use, Leonardo CAN BUS board | L-CANBUS | HobbyTronics obviously requires programming but really flexible.


----------



## wjbitner (Apr 5, 2010)

DaveBlack said:


> Made a quick demo video, got the charger and dc-dc working...
> 
> 
> 
> ...


Very nice! I assuming that you are also using the Leaf battery pack. That is all these components came out of the same Leaf. Dala, who's been quite active and finding lots of great information showed that Nissan Leaf packs have their own "ID" that is sent as part of the CAN info from the BMS. Without this ID, people have struggled to get the charger working. I'm guessing that yours works because its all from the same Leaf.


----------



## DaveBlack (Oct 31, 2018)

Yeah I have read about this ID feature, however I don't have the charger and battery pack connected to each other (ignoring the obvious HV leads). So they are not communicating on the canbus, but still charging. I am wondering if that ID was for the Gen1 Leafs?


----------



## scottherrington (Jul 3, 2020)

When you say they are not communicating on the canbus does that mean when installed in the Rx8 there will be a canbus for the car and a seperate canbus for the ev parts? 

Sent from my LG-M250 using Tapatalk


----------



## DaveBlack (Oct 31, 2018)

Hi - So what I meant was on the bench at the moment they are not connected by CanBus (the BMS and Charger) but the Charger appears to work.

However when I install them in the RX8 the plan is to have everything running on the HighSpeed CanBus (Rx8, BMS, Charger and Inverter) with one Arduino giving out the commands required to keep both the Rx8 and Leaf kit happy!


----------



## wjbitner (Apr 5, 2010)

DaveBlack said:


> Yeah I have read about this ID feature, however I don't have the charger and battery pack connected to each other (ignoring the obvious HV leads). So they are not communicating on the canbus, but still charging. I am wondering if that ID was for the Gen1 Leafs?


Wow! I'm quite surprised by this. If you write a little program on your arduino to run the motor full tilt (using only 100 as the torque) one direction, then full speed in reverse, this will drain the battery some and you can see if it will charge without hooking up the BMS can. I subscribed and will be following your progress. I'm putting a Leaf motor in a Miata. No YouTubes yet.. just plain old text and some pictures at bbitnerblogs.com/e-miata.


----------



## DaveBlack (Oct 31, 2018)

Currently I have given the motor, gearbox, adapter plate design and spline requirements to a local machine shop. So no more testing until I get them back!


----------



## Scotty274 (Jul 1, 2020)

Definitely much keener following this now Dave, as my project has been stalled entirely in red tape now, so a new project is on the cards


----------



## DaveBlack (Oct 31, 2018)

Aww man that sucks, is 'Red Tape' = 'The Wife' ? hehehe. I have suddenly got a bit of a dead line over here - we are looking at moving house, one reason is so I can have a proper workshop, but it means that big lump of RX8 that wont move needs finishing!


----------



## Scotty274 (Jul 1, 2020)

DaveBlack said:


> Aww man that sucks, is 'Red Tape' = 'The Wife' ?


Nah mate, if I interface 2 X CANBUS systems with safety features, they want me to prove the safety features in the VW continue to work.

So if I crash the car, the airbags deploy, and prove that a stray signal from the Leaf system won't wind its way through and cause a failure or unexpected activation of a safety feature in the VW systems.


----------



## DaveBlack (Oct 31, 2018)

Hmm hard to prove without wrecking your car! That does suck. Whats the new plan then!


----------



## Scotty274 (Jul 1, 2020)

New plan is find something else. It will go in something. It's just deciding what that something is.

However it's nailed home why there are so few CANBUS cars in Australia that are doing it.

I did toy briefly with the idea of just chopping the eNV into a ute, as the damage on her doesn't go past the C-Pillar. However a bit of back and forth with QLD transport and they agree with my idea in theory, however there is zero recourse or appeals in the legislation to bring a write off back from the dead. I am in the <0.01% category of people who:

Have a car that is able to be salvaged in this manner
Will be doing a conversion that will not affect any other vehicle systems as they sit
The aim of this was to have a car that either me or the wife could drive to work to get the fuel bills down, as well as be a cool little zippy project. So yes I could build it out of what I have, however if I have something I can only take to the track (And it would be a ripper little beasty to take to the track or to car shows and get heads turning), I don't need a toy.

If I was going to build an electric toy to throw around the track it would be a Cascadia Motion DSG setup and it would end up at Summernats, probably in the back of an old Holden One Tonner Ute or something. So that's not what I'm going for with THIS build.

So really, I'm thinking if I can grab an old Holden HQ ute, which came with a 176 Inline 6 Motor producing a whopping 88kW through a High Compression setup and getting that to the ground with a manual 3 Speed, I'll be able to ute the much smaller eNV motor with it's whopping 80kW and make that work.

Though I have heard you can trick the leaf motor into a whopping 120kW of output, which puts me into the realm of the old 4.2l V8 that they came with (130kW) so I'll be punching V8 power with something that weighs about as much as a box of beers.

As you replied I am having a talk with Muxsan over getting one of their computers so that I can then grab a whole bucketload of Leaf modules and see just how much range we can trick this setup into having. I'm at 24kWh, see if I can get me one or two more complete packs and load the Tonner (Well, it can haul a tonne after all) up with a further 600 odd kg of batteries (As the old Holdens with their Steel trays and stuff were so morbidly obese that I could probably come in at parity with my current setup using the eNV pack, the motor, Inverter and Charger) which should net me around 24kWh x 3 or 72kWh if we can make it work. But I'm literally typing this as we speak, so I don't even know if Muxsan will be able to support this, but I think they are keen for the idea.

Using calculations I found online, I'm looking at around the 400Wh per mile range, so 72kWh = 72,000Wh which means I'm looking at 180 Miles, or as I'm in a country that doesn't use archaic measurements based on grain, around 300km, which is I think pretty reasonable range to do things. At the least that's a solid week of driving to work and back for me without a charge.


----------



## DaveBlack (Oct 31, 2018)

I believe the Leaf motor has been pushed as far as 300kw! It really depends on how much you want to spend on the inverter. The new Leaf E+ is 150kw out the factory. So I think the motor is going to get pushed hard by the EV community.


----------



## scottherrington (Jul 3, 2020)

So can you install everything as standard then upgrade the inverter at a later date to increase power?

Sent from my LG-M250 using Tapatalk


----------



## DaveBlack (Oct 31, 2018)

I believe so, but dont hold me to that as it is not something I have done...


----------



## GeorgeC (Aug 4, 2020)

How do you run the Leaf motor in reverse? 
I have built a controller based on an Arduino Mega2560 to send CAN messages to the Leaf inverter, which works reasonbly well - I can control the speed with a pot and monitor speed, torque, temps etc, but I can't see any way of running the motor in reverse - does anyone have any info on this please?
I'm using a 12v lead acid battery and a mains inverter + rectifier as the power source as I don't have a full battery yet, so only enough to run off load.


----------



## DaveBlack (Oct 31, 2018)

I believe the Torque request is a signed 16 bit value, I have not tested myself but I would suspect inverting the binary and adding 1 (twos compliment) would give you the inverse torque request.

Dave


----------



## GeorgeC (Aug 4, 2020)

Thanks, Dave - That was my first thought too, I tried that some time ago but it didn't work, although I was being very cautious with power input as the motor in not secured in any way.


----------



## DaveBlack (Oct 31, 2018)

Hmm, mine is in pieces again at the moment, but I do have reverse in the gearbox to use! Let me know if you find out.


----------



## GeorgeC (Aug 4, 2020)

Mine's not setup either at the moment, as I'm in the process of mounting it into my Lotus Esprit S3, but as soon as it is mounted properly, I can try again.
I'm using the Leaf transaxle, so don't have that option of gearbox reverse.


----------



## wjbitner (Apr 5, 2010)

GeorgeC said:


> How do you run the Leaf motor in reverse?
> I have built a controller based on an Arduino Mega2560 to send CAN messages to the Leaf inverter, which works reasonbly well - I can control the speed with a pot and monitor speed, torque, temps etc, but I can't see any way of running the motor in reverse - does anyone have any info on this please?
> I'm using a 12v lead acid battery and a mains inverter + rectifier as the power source as I don't have a full battery yet, so only enough to run off load.


You send the same torque command, but use a negative value for the torque. The motor will only go to 3500 RPMS in reverse (with the stock inverter) If you exceed 3500 RPMS the inverter will ignore further commands until the RPM drops below 3500. Apparently, Nissan doesn't want the leaf going that fast in reverse.


----------



## GeorgeC (Aug 4, 2020)

Thank you for the info - I did try negative torque values, but just blew the low value fuse in the power line - I'll try again when it's installed as I clearly got something wrong.


----------



## wjbitner (Apr 5, 2010)

GeorgeC said:


> Thank you for the info - I did try negative torque values, but just blew the low value fuse in the power line - I'll try again when it's installed as I clearly got something wrong.


You're welcome! You can see if your software is set up correctly by spinning the motor by hand in either direction. The sign for the RPM should change..  
I had the 'blow the fuse' issue too when using a power supply. Solved when I used batteries and could handle regen currents..
Blog Archives


----------



## Timma001 (Jan 3, 2021)

scottherrington said:


> The issues you guys are having is one of the main reasons I have completely changed course with my build.
> I was going to convert a 2001 Ford Cougar but am no specialist in how to integrate the electronics.
> So now I'm converting a classic mini which will make things a lot easier.
> Really interested in following how you get on with the Leaf hacking.
> ...


Hi Scott, what are you using for the Nissan Leaf for your mini conversion?
(Www.chargeheads.co.uk)


----------



## scottherrington (Jul 3, 2020)

Timma001 said:


> Hi Scott, what are you using for the Nissan Leaf for your mini conversion?
> (Www.chargeheads.co.uk)


I've decided against using a Leaf now and am using an i3

Sent from my moto g(8) power lite using Tapatalk


----------



## Timma001 (Jan 3, 2021)

DaveBlack said:


> Made a quick demo video, got the charger and dc-dc working...
> 
> 
> 
> ...





scottherrington said:


> I've decided against using a Leaf now and am using an i3
> 
> Sent from my moto g(8) power lite using Tapatalk


Just the batteor


scottherrington said:


> I've decided against using a Leaf now and am using an i3
> 
> Sent from my moto g(8) power lite using Tapatalk


----------



## Timma001 (Jan 3, 2021)

Kind of in keeping it its a newer shape mini. What bits are you using from the i3?


----------



## scottherrington (Jul 3, 2020)

Timma001 said:


> Kind of in keeping it its a newer shape mini. What bits are you using from the i3?


I don't want to steal Dave's thread so here's a link to my build.
https://r.tapatalk.com/shareLink/to...&share_fid=33831&share_type=t&link_source=app[/URL]

Sent from my moto g(8) power lite using Tapatalk


----------



## Toretto (11 mo ago)

Dave, will you be updating progress here or only on your YouTube channel?


----------



## DaveBlack (Oct 31, 2018)

Hay, everything is on my You Tube Channel, latest video 




MOT tomorrow!!!


----------

