Nissan Leaf Gen3 inverter

Nissan Leaf/e-NV200 drive stack topics
Kelju
Posts: 128
Joined: Sat Aug 22, 2020 6:54 pm
Location: Finland
Has thanked: 8 times
Been thanked: 5 times

Re: Nissan Leaf Gen3 inverter

Post by Kelju »

It spins!

Apparently something broke down in the V3 mainboard as I now have another unit and this one got the motor spinning.
Also, the new board has the latest v4.96.R FW.
Some findings/questions about the new FW:
There is no respolepairs parameter anymore visible in the web interface. It is correct as the motor spins smooth, but where is the parameter?
My inverter heat sink temperature reading and motor temperature reading are way off. How can I calibrate those?

I am super happy that the motor finally spins. I only had a single module connected so voltage was only 40V.
Is there any drawback in using such a low voltage level for syncofs tuning?
After frying one of these inverters, I would like to be extra carefull.
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Nissan Leaf Gen3 inverter

Post by johu »

I probably flashed the Gen2 parameter set which hides a number of parameters that mustn't be changed. To bring them back type "flag <name> !hidden" in custom command.
For temperature what sensors did you select with your old board? You might need to un-hide snshs an snsm also.

I assume 40V for syncofs is fine as you don't need much voltage to generate current at standstill.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Kelju
Posts: 128
Joined: Sat Aug 22, 2020 6:54 pm
Location: Finland
Has thanked: 8 times
Been thanked: 5 times

Re: Nissan Leaf Gen3 inverter

Post by Kelju »

It turns out that upon startup into manual mode, the inverter always stops at over current if I do not have series resistance in the supply.
I used 3.3 Ohm, because this was the lowest value that my electronics load worked with without going into overload fault on startup.
I really hope that this kind of glitch at startup is only a feature of the manual mode and normal run mode ramps up the PWM smoothly.
Here is some pictures of what is happening after syncofs tuning and id=0.1A and iq=1A:
This first picture shows the motor angle feedback. The blue arrow points the glitch, when the inverter would go into current limit fault without the series resistance.
Angle capture iq_1_id_0.1_3.JPG
This second picture shows the UDC voltage. The large dip down to 20VDC is due to the glitch, after which the voltage gradually ramps up. With the second attempt to start, the motor starts to spin smoothly and the UDC settles around 43VDC as there is a voltage drop over the series resistance.
The stepping up of UDC voltage in the end is due to me by passing the series resistor with a high current main switch.
UDC capture iq_1_id_0.1_mainSW.JPG
This third picture shows the currents i_L1, i_L2, id and iq. I do not know how these should look like. The glitch is not so evident here, but apparently the phase currents would exceed 100A without the series resistance. The ramping down of the currents are in line with the UDC voltage behavior. I am wondering if the id and iq currents are okay. They seem not to be regulated to the set values of id=0.1A and iq=1A. Anyway, once the motor starts, it runs very smoothly even though the currents seem to be all over the place...
Currents capture iq_1_id_0.1.JPG
I thought I'd try normal run mode next and see if the motor starts smooth without the initial glitch and a high current peak.
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Nissan Leaf Gen3 inverter

Post by johu »

Not sure what causes the glitch. Currents will be pretty random at such low values because the current sensors are too coarse.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Kelju
Posts: 128
Joined: Sat Aug 22, 2020 6:54 pm
Location: Finland
Has thanked: 8 times
Been thanked: 5 times

Re: Nissan Leaf Gen3 inverter

Post by Kelju »

I tested this evening with normal running mode in forward direction with a simple potentiometer in input throttle1.
The motor will not start with the syncofs that I previously tuned in manual mode. From time to time it makes a small move (and I mean bearly visible) and halts with around 12 amps current draw from the battery as this is at what the active load regulates the current by the constant resistance setting. I did not dare to test with directly connecter battery.
If I set the syncofs to a value considerably far from the tuned value, the motor starts to rotate in response to the throttle command, but just spins at a steady speed and will not stop even if throttle command is brought back to zero.
Kelju
Posts: 128
Joined: Sat Aug 22, 2020 6:54 pm
Location: Finland
Has thanked: 8 times
Been thanked: 5 times

Re: Nissan Leaf Gen3 inverter

Post by Kelju »

Is there somebody out there who knows his way around the FOC mode PWM generation well enough to explain the startup behavior?
At least in sensorless control of some inverters or ESCs, the start is done "blind folded" and once you have movement, you have position feedback and firing angle advance control can commence.
I assumed that since the sin/cos signal gives the absolute position, this kind of "jump to the unknown" would not be needed.
Still, based on my measurements and finding the very noticeable glitch, it seems like the inverter does not know which pattern to apply at the very beginnig.
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Nissan Leaf Gen3 inverter

Post by johu »

There is indeed no jump to unknown phase. Upon start up the resolver is clocked and is expected to deliver a stable signal after 500ms. Then the PWM is activated and the PI regulators start running. I really don't know what is going wrong as FOC works for me an many others without the glitch. But it wouldn't be the first bug that just occurs under certain conditions.

Are you comfortable going over the code? pwmgeneration_foc.cpp would be a good start.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Kelju
Posts: 128
Joined: Sat Aug 22, 2020 6:54 pm
Location: Finland
Has thanked: 8 times
Been thanked: 5 times

Re: Nissan Leaf Gen3 inverter

Post by Kelju »

I noticed that in Damien's video, the angle feedback is going from high to low angle as the motor is turned clockwise and Damien is saying in the video that this is exactly what "we" want to see.
I also noted that my angle feedback is going from low angle to high.
I went ahead and swapped SIN and COS in the hopes that it would resolve the issues - for my big dissapoinment, it did not.
With this setting, the motor would not turn at all, no matter what the syncofs.
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Nissan Leaf Gen3 inverter

Post by johu »

Hmm, so you tuned syncofs in manual mode until you had no movement with "manualiD" set to like 50A? With that done you did get a spinning motor when setting "manualiQ" to some non-zero value?

I'm not exactly sure which resolver wires to swap when angle turns the wrong way. But if you get steady movement don't worry about it for now.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Kelju
Posts: 128
Joined: Sat Aug 22, 2020 6:54 pm
Location: Finland
Has thanked: 8 times
Been thanked: 5 times

Re: Nissan Leaf Gen3 inverter

Post by Kelju »

Yes I tuned the syncofs so that 50A and even more caused no spinning. After this 0,1 id and e.g. 1 iQ gets the motor spinning. This all happens when my angle feedback values are rising in clockwise rotation.
When I switched the SIN and COS, I verified that the angle was indeed decreasing on clockwise rotation, but with this setting I was not able to get any rotation no matter what the settings of syncofs and id.
I will investigate the source of the startup glitch further.
I also noticed, that the glitch exists even if I start again with an already turning rotor. That is, I first start from halt and there is always this first glitch followed by a smooth start. As the motor is rotating steadily I stop the inverter and the motor starts to coast down. Then I start again before the motor has come to a halt and at this point the glitch is also noticeable.
Haapala
Posts: 3
Joined: Mon Dec 07, 2020 7:28 am

Re: Nissan Leaf Gen3 inverter

Post by Haapala »

Nice work! I am also from Finland and considering a electric swap with 2018 leaf system. For my use a drop in board would be the way. So I am in the line to purchase one, if you can make it happen. :)
m.art.y
Posts: 550
Joined: Sat Jun 06, 2020 6:54 pm
Location: UK
Has thanked: 24 times
Been thanked: 17 times

Re: Nissan Leaf Gen3 inverter

Post by m.art.y »

johu wrote: Sun Nov 01, 2020 5:09 pm It is kindof hard to run synchronous motors with sine firmware.
I have a desperate need to use sine for synchronous motor. All I need is top speed of around 20-30 km/h and I need to drive few hundred meters at least. I can reach that speed if I put fslipspnt to 30-40 hz in testing section. However when I put inverter in run mode it can't reach that speed anymore. I can get smooth enough throttle control. Obviously I don't yet know how the car would behave under load yet but at the moment seems to run ok. Have you ever tried running synchronous motor sine to a drivable degree at slow speeds? I think you have mentioned that in one of your Touran conversion videos. Now I tried all sorts of settings and the only one that seems to increase speed is fslipmax but it is limited to 10 Hz. Have you got any ideas how I could make it run a bit faster. I only need ~5-10 km/h faster. Fweak setting does not seem to be effective. If I try lowering it too much it starts drawing 300-600 A current according to current sensor plot but speed remains unchanged. Do you have a firmware version where I could add more fslipmax to try out? Or any other way to increase it a bit? Thanks
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 1 time
Contact:

Re: Nissan Leaf Gen3 inverter

Post by Isaac96 »

What is fmax set to? It could be too low, limiting your speed, and IIRC it doesn't apply in manual mode (I've had this conversation before).
m.art.y
Posts: 550
Joined: Sat Jun 06, 2020 6:54 pm
Location: UK
Has thanked: 24 times
Been thanked: 17 times

Re: Nissan Leaf Gen3 inverter

Post by m.art.y »

Isaac96 wrote: Tue Dec 15, 2020 6:06 pm What is fmax set to? It could be too low, limiting your speed, and IIRC it doesn't apply in manual mode (I've had this conversation before).
Thanks. Fmax is still default 200 Hz I have not tried changing it but I am going to try now. What is IIRC?
Kelju
Posts: 128
Joined: Sat Aug 22, 2020 6:54 pm
Location: Finland
Has thanked: 8 times
Been thanked: 5 times

Re: Nissan Leaf Gen3 inverter

Post by Kelju »

As it turns out, I have not gotten around to check the code.
I did, however, make a small program on an Arduino board.
The target was to blank the glitch.
There is a separate pin on the IGBT board for 5V supply to the input diode pullup. In my blanking test setup, this supply is initially off. The Arduino board triggers an interrupt upon rising edge of phase 1 high side drive. After this, a delay timer is set and once it expires, the 5V supply to the diode pullup is turned on. There is also another timer that switches the output off again, if no new pulses are detected fast enough. This is to secure that the 5V is off to account for another start attemp and keeps it on if the motor is running.
Apparently this arrangement work whenever the PWM happens to start with Phase 1 and the motor starts relatively smooth. Whenever it starts from some other phase, the glitch happens.
I should trigger an interrupt from all three phases to check how that works.
Here are some pictures of the glitch in blue and delayed 5V in yellow. Especially the first capture is quite strange. Definitely no soft start with that lenght of pulse.
20201215_222511208.jpeg
20201215_222444297.jpeg
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Nissan Leaf Gen3 inverter

Post by johu »

Reminds me of an ancient bug in active low mode, where during initialization of the timer all 6 pins went low (=on). But that is long fixed.
Is it only in manual mode? What if you set direction neutral, then manual mode, then direction forward?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Kelju
Posts: 128
Joined: Sat Aug 22, 2020 6:54 pm
Location: Finland
Has thanked: 8 times
Been thanked: 5 times

Re: Nissan Leaf Gen3 inverter

Post by Kelju »

You seem to be on to something here Johu.
When I start the manual mode in neutral and set direction forward, the motor starts smoothly. Syncofs is atleast very close as the motor always rotates to the clockwise direction.
Thank you for the tip!
With the exact same settings, I still cannot get the motor to spin when starting in normal mode and using a potentiometer. My setting is single regen.
Mostly the motor will not start at all and sometimes it start rough and spins very roughly to the counterclockwise direction.
It also will not stop if pot is rotated back to zero.
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Nissan Leaf Gen3 inverter

Post by johu »

Must be something with syncofs still. I still don't fully grasp it but there seem to be two possible values.
The difference between manual and normal mode: in manual mode you specify id and iq yourself, in normal mode you just specify total current via pot and the MTPA algo splits it up in id and iq.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Kelju
Posts: 128
Joined: Sat Aug 22, 2020 6:54 pm
Location: Finland
Has thanked: 8 times
Been thanked: 5 times

Re: Nissan Leaf Gen3 inverter

Post by Kelju »

I also tried with the other possible syncofs value, but with that one, the motor will not spin even in manual mode. It seems it starts oscillating around a pole.
I also modified the extra board to trigger an interrupt for all phases, but the glitch remains in manual mode.
I think I can drop the extra board, since it does not seem to help anyway and at least I can start the motor now in manual mode without the glitch with the new instruction.
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Nissan Leaf Gen3 inverter

Post by johu »

I might get a Gen3 inverter soon. So if you have a spare adapter board you could send it and I will assist in debugging.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Kelju
Posts: 128
Joined: Sat Aug 22, 2020 6:54 pm
Location: Finland
Has thanked: 8 times
Been thanked: 5 times

Re: Nissan Leaf Gen3 inverter

Post by Kelju »

That would be great!
I only have two adapter boards, but I could send the otherone to you.
Will you also get the OEM external wiring harness and connector to the inverter?
If not. I can also supply a 3D printed connector+pigtale harness.
User avatar
janosch
Posts: 306
Joined: Tue Jun 30, 2020 9:23 am
Location: London, UK
Has thanked: 67 times
Been thanked: 54 times
Contact:

Re: Nissan Leaf Gen3 inverter

Post by janosch »

3rd Gen inverter is in the post to Johu.
Attachments
bye_inv.jpg
parcel_inv.jpg
side_by_side_inv.jpg
magelan
Posts: 4
Joined: Wed Jan 20, 2021 9:46 pm

Re: Nissan Leaf Gen3 inverter

Post by magelan »

Is this inverter used on both 40KWh and 62KWh ie 110KW and 130KW models ? or ze1 drive trains have different power heads depending on power delivery ?
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Nissan Leaf Gen3 inverter

Post by johu »

Inverter arrived today. I was charged customs even though it was a gift. Thanks Brexiteers.

First challenge was to get it running from the board Kelju had sent. I thought the inverter chip was broken because all outputs were 0 when the inputs were also 0. Anyway, I removed it and bridged inputs to outputs, then set control board to active low mode. Which didn't work either. Then I found that the original control board outputs 5V on two pins where there was no 5V on the adapter board. So simply added a wire. Now the drivers came alive and sat at 5V. And 3.8V with the control board connected. I'll never understand the concept of those "5V tolerant" pins.

So, some first observations, I think they match with Keljus. When run with the same parameters as the Gen2 inverter (deadtime 78, pwmfrq 8.8) it pulls an insane 2.5A from my 60V power supply. Also the output waveform looks unhealthy. Also tried 128 where idle current is 400mA but the output still rings.

At 255 deadtime (15us) it still pulls 100mA so I'm thinking that is not shoot through but some other gate drive draw or something. The shortest dead time that still yield 100mA draw is 160 or 2.6 us. The output looks good also. At that sort of slow switching I wonder if the inverter better be run at 4.4 kHz. At 8.8 kHz we are loosing almost 5% amplitude to deadtime.

At 4.4 kHz the total draw from 12V is 0.75A, at 8.8 kHz 1 A and at 17.6 kHz 1.8A. Also the driver chips start evaporating their conformal coating, so thats definitely too much :)
Also 4.4 kHz is much quieter than at 8.8 which is unusual.

Next up is actually running a motor.
Attachments
good switching.png
shoothrough.png
logic drive signals.png
IMG_20210127_172442.jpg
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
johu
Site Admin
Posts: 5682
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Nissan Leaf Gen3 inverter

Post by johu »

I also swapped the heat sink temperature pull down resistor to 3k3. With 15k it was sitting at 3.75V and with the original Leaf board (19k) at 3.85V. I set snshs to "Semikron" for now which shows something plausible and has the correct coefficient.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Post Reply