Leaf Gen 2 inverter/motor as a generator using VCU v1

Nissan Leaf/e-NV200 drive stack topics
Post Reply
PoloLbricolo
Posts: 78
Joined: Wed Apr 10, 2019 2:32 pm
Location: France
Been thanked: 1 time

Leaf Gen 2 inverter/motor as a generator using VCU v1

Post by PoloLbricolo »

Hi all,
I've built a crazy thing : I've coupled a smart motor ( 700CC turbo inline 3 gasoline) to a leaf motor.
I've had to swap the phases and the encoder so the inverter thinks that it's spining forward, as regen is only present in forward.
At the moment the inverter is original and has not been modified. i've been using thunderstruck VCU and Damian's leaf VCU code ported to a gen3 tesla charger board ( yes, i try to do with what i have).

I've succesfully run everything and produced about 12kw constant.
My question is how can i have more regen ?
I thought the leaf was suposed to make aroubd 30kw regen from the midrange onward.

https://youtube.com/shorts/xcXTglRDiaA

I'm using a potentionmeter and not an accelerator pedal and it was calibrated properly, i just don't know why I don't have more power.
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Leaf Gen 2 inverter/motor as a generator using VCU v1

Post by Pete9008 »

Absolutely crazy, but in a good way :)

But suspicious about your resolver offset, doesn't the Leaf need the offset programming into the inverter to match the motor?

Swapping phases and resolver connections is likely to have changed the offset and that could be the cause of the reduced power?

Curious about why you chose the Smart engine? I've been thinking of doing similar but with a HSG instead but only because I'm going to end up with a spare Smart engine once my conversion is done. Are you using the standard engine ECU complete with SAM and immobiliser and have you kept the turbo?
PoloLbricolo
Posts: 78
Joined: Wed Apr 10, 2019 2:32 pm
Location: France
Been thanked: 1 time

Re: Leaf Gen 2 inverter/motor as a generator using VCU v1

Post by PoloLbricolo »

I don't know about this resolver offset effect. Apparently a guy on the internet did it on his porsche 924 or 944 and drove for more than 4000km and if it on the internet it must be true.

Well I now have 2 smart engines, I've converted my car 3 years ago and the motor sat in storage at a freind house. Te conversion got out of hand starting with a leaf setup at the very early days of the firmware for FOC, it had outlander phev batteries. but the power was not enough so after the covid thing, i decided to bring back the car to where I lived ( change location in the midle of the project) and go the SDU route with some lithium golfcar batteries. So yeah now I have a 200kw capable smart roadster with race seats and big brakes... and 2 more smart roadsters, one for parts one to drive with the petrol engine.

On the generator i have a full car wiring harness, fuel tank gear shift, gearbod ... so SAM is happy and let me start the engine.
This is very much a proff of concept at the moment, the goal is to be able to make more power with this setup before moving to bigger, maybe more potent engine and motor combo ( 100kW peak ? 60kW continuous ?)
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Leaf Gen 2 inverter/motor as a generator using VCU v1

Post by Pete9008 »

PoloLbricolo wrote: Tue Feb 14, 2023 1:16 pm I don't know about this resolver offset effect. Apparently a guy on the internet did it on his porsche 924 or 944 and drove for more than 4000km and if it on the internet it must be true.
No idea, maybe he got lucky with the offsets?
PoloLbricolo wrote: Tue Feb 14, 2023 1:16 pm Well I now have 2 smart engines, I've converted my car 3 years ago and the motor sat in storage at a freind house. Te conversion got out of hand starting with a leaf setup at the very early days of the firmware for FOC, it had outlander phev batteries. but the power was not enough so after the covid thing, i decided to bring back the car to where I lived ( change location in the midle of the project) and go the SDU route with some lithium golfcar batteries. So yeah now I have a 200kw capable smart roadster with race seats and big brakes... and 2 more smart roadsters, one for parts one to drive with the petrol engine.
Just found your old build thread, looks good! Any chance of an update, and a few more pictures :)
PoloLbricolo
Posts: 78
Joined: Wed Apr 10, 2019 2:32 pm
Location: France
Been thanked: 1 time

Re: Leaf Gen 2 inverter/motor as a generator using VCU v1

Post by PoloLbricolo »

Okay, so i've found my old V3 board + leaf adaptor, to put in the inverter and hopefully to have more control over the motor.

I have big troubles tuning the damn thing as it is an older board i have to have pinswap to 4 ( swap pwm 1 and 3 i think) i found that from the parameters i used previously.

i've tried to follow the software setup here https://openinverter.org/wiki/Using_FOC_Software
including downgrading to 4.97R but i can't hear the PWM doing anything. as oposed to runing in standard mode when i can kinda get the motor spining with some trial and error offsets. but the torque is very poor and can't turn the smart engine. i'm using the parameters from here
https://openinverter.org/parameters/ and tune for my throttle potentiometer.

I'm out of ideas for now, i may try to seprate the leaf and smart engine as the engine puts a lot of drag on the leaf motor.
Any guesses on what i could try next ?
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Leaf Gen 2 inverter/motor as a generator using VCU v1

Post by Pete9008 »

Fairly sure you will need to separate the engine and motor to get a good syncofs setting, and you need to get that set accurately for the motor to run properly.

Afraid I can't help with how to use the sin software but there are other posts detailing which version to use and how to do it.

Edit - see https://openinverter.org/forum/view ... ?t=3345

Edit2 - sorry, ignore me on the sin software bit, you're past the test spin point so its not needed :oops:

Edit3 - the parameters from here may be a better starting point when using the latest code too https://openinverter.org/forum/vi ... 4#p52814
PoloLbricolo
Posts: 78
Joined: Wed Apr 10, 2019 2:32 pm
Location: France
Been thanked: 1 time

Re: Leaf Gen 2 inverter/motor as a generator using VCU v1

Post by PoloLbricolo »

Thanks Pete,

I've separated the motor and engine i'm following the same testing procedure as stated previously, the settings you sent me are a little improvement but still not up and running.
I can get the PWM noise but motor never spins i have some occasional movements but that's it, even when manualid is set to 400A with syncofs set to 0. I've seen some posts that mention that it may be current sensor that are reversed, but looks like it is not the case as when i pinswapp in the software, i don't have any PWM noise.

That is the testing procedure i'm followng https://openinverter.org/wiki/Using_FOC_Software

The calculation method does not seem to work, the motor i have is offset 7C following the calculation found here viewtopic.php?p=3244#p3244
that yeilds an offset of -2392 or 63144 so it fits in the parameter syncofs.

At this point i've tried every possibility for syncofs in 1000 increments, in normal mode and seen what works, i've been able to make the motor spin but the speed goes to infinity enven when thortle is 0.

I'm not sure what i'm doing wrong here
PoloLbricolo
Posts: 78
Joined: Wed Apr 10, 2019 2:32 pm
Location: France
Been thanked: 1 time

Re: Leaf Gen 2 inverter/motor as a generator using VCU v1

Post by PoloLbricolo »

Update !
I've got good news, i got the damn thing to spin, the fix was to set "FWcurmax" to 0 with the latest firmare version.
The calculated ofset worked well enough .
My motor is 7c so (0x7C -0x80) x 256 = -1024 so syncofs was set to 64000 and that seems to be close enough.

after re coupling the 2 motors, i got to make 35kW and the inveter stopped from over current error ( about 100A DC) could that "FWcurmax" be why it stopped ? I did set it to 100 for testing, i see that in the other parameter from the parameter page it is quite a bit higher.

Might test that tomorrow. and we may get close to the rated power from the smart engine anyways 60kW from factory.


So to have that much regen in reverse, i simply put the motor in forward and push the accelerator while the engine is spining up. the dirchrpm was bumped to 2000 so i don't have to stop the engine to do a test.

next step more power !?
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Leaf Gen 2 inverter/motor as a generator using VCU v1

Post by Pete9008 »

Great news :)

Just in case you're not aware fwcurmax won't have any effect unless you are going above base frequency and into field weakening. Also it should be negative not positive, for the Leaf motor it should be of the order of -450A. A positive value could give some very odd results as you enter field weakening and an over current would be fairly likely.
User avatar
celeron55
Posts: 774
Joined: Thu Jul 04, 2019 3:04 pm
Location: Finland
Has thanked: 27 times
Been thanked: 110 times
Contact:

Re: Leaf Gen 2 inverter/motor as a generator using VCU v1

Post by celeron55 »

Next, make into a Chademo charger, install someplace and list it on the internet. Imagine the surprise of the unsuspecting green motorists when the charger's engine starts and revs up
Post Reply