[DRIVING] VW Touran powered by Nissan Leaf  [FINISHED]

Tell us about the project you do with the open inverter
arber333
Posts: 3562
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 134 times
Been thanked: 335 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by arber333 »

Hm... did you observe correct deadtime for your IGBTs?
I noticed high discrepancy in FOC measurement with Lebowski controler if i chose too low deadtime.
And i used 1.6us, now i use 3.1us just to be safe.

A
Stephen Darbey
Posts: 77
Joined: Tue Jan 15, 2019 10:49 pm
Location: Ireland
Been thanked: 3 times

Re: VW Touran powered by Nissan Leaf

Post by Stephen Darbey »

johu wrote: Fri May 10, 2019 6:00 pm We have liftoff :D
Connected my trusty 32V Sinopoly pack.
Drove some 5m up and down the driveway. There is not a lot of torque but still enough to pull against the handbrake in 3rd gear.
I took quite a liking of CAN today. I "wired up" the various control signals like key switch, throttle, brake via just mapping them on the CAN bus. So much easier then finding all that stuff in some convoluted wire harness. So there are just 4 wires connecting the Nissan to the VW world.

I've likely found the source of the airbag error. I had connected some "front bumper sensor" (whatever it senses) to the reverse switch of the transmission. They have the same plug. Stupid.
But I think the error must be deleted for the light to go out. Can that be done with Savvycan? Whats the cheapest way otherwise?
You will need to rid the code with a good diagnostic app. I remember leaving a connector off an airbag when replacing a VW Passat door once. The airbag light came on and stayed on. The code will not go out even when resetting the error codes in the normal way. You have to go deeper. I never did it again !! I used a VCDS unit.
Regards and keep going. The end is near.
SDev
User avatar
johu
Site Admin
Posts: 6709
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1536 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Yes will see what software is included with the Chinese adapter.
The culprit is the most probably the front airbag sensor. It must be close to the starter motor. I'm afraid I sold it with the motor? If anyone knows a part number, let me know.

Latest video:
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: 6709
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1536 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Have done some more testing today.
I tried different syncofs values between 55000 and 0 (equivalent to 65536). The motor did develop more torque but I think I must have operated in the field weakening region. With only 50% sine amplitude it would spin up to 8500rpm, so probably it would have been 17000 at full amplitude?
The torque is not very convincing yet. I can barely climb our 12% grade in 2nd gear.

Finally the precharge resistor died. When the DC switch driver burned out yesterday I ran the inverter via the precharge resistor. Very smelly. So today it gave up the ghost and is now cracked. Replacement ordered.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Jack Bauer
Posts: 3661
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 10 times
Been thanked: 334 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by Jack Bauer »

Same thing happened me on the Tesla board in the Panzer ages back. I upgraded to these babies :
https://www.onsemi.com/pub/Collateral/NCV8401-D.PDF
I'm going to need a hacksaw
User avatar
johu
Site Admin
Posts: 6709
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1536 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

While waiting for the precharge resistor I decided to fix some miscellaneous problems:
  • Oil pressure warning: pulling low oil pressure switch depending on speed. Speed read from CAN
  • Burned DC switch driver: using custom ECU with DIP relay driver and flyback diode connected. It closes DC switch depending on opmode of inverter that is also read from CAN
To round it off I will try to obtain the counterparts of the two plugs shown below.

Will post the ECU code on github
Attachments
CAN mapping. Collecting various bits from VW CAN bus. Throttle is read from analog pins
CAN mapping. Collecting various bits from VW CAN bus. Throttle is read from analog pins
Radiator
Radiator
Overall view
Overall view
4 wires from ECU end up here - handy
4 wires from ECU end up here - handy
Oil pressure signal
Oil pressure signal
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: 6709
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1536 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Today I replaced the burned precharge resistor and put in a Meanwell 62A PSU as DC/DC converter. Works well off 370V.

So now I set about tuning the motor. I tried all syncofs values from 0-59000. Put the car in 3rd and handbrake on and tried to quantify how deeps it's pulled into the springs

0-4000 - little torque
4000-7000 - no torque at all
From 8000 - spins in reverse
From 12000 - little torque
19000 - possibly maximum torque
24000 - little torque
37000-41000 - no torque
42000 - starts spinning forward
56000 - possible maximum
57000 - declining torque

So indeed the no-torque offsets are 180° apart from each other and the maximum torque is about 90°onwards. Thats a bit of a surprise because I expected the offset between no torque and full torque to be only 45° on an IPM.
I also used the idle speed regulator to keep the motor at 1000rpm while changing syncofs. Indeed between 55000-56000 idling happens at around 4A phase current. Take it towards 58000 (10° more) and it increases to 50A. So that must be field weakening current.

So far so good, but the car is barely moving as soon as I put it in gear. It barely gets me up my driveway even though rms current quickly reaches 200A and sooner or later it trips out. Since others have been more successful I'm starting to wonder if something is broken. Checked:
  • 2 phase currents: perfect sine waves, no asymmetries
  • 3 phase voltages at 1000rpm: 29V
  • Drive train: car rolls smoothly when inverter is off, no friction.
  • DC current 8A when pulling against hand brake
I added a parameter syncadvance that increases syncofs with increasing speed (dig/Hz). So say you set it to 10 then at 100Hz your syncofs will increase by 1000 digits (5°). With that set to 20 I can spin crazy high until the inverter trips out.

Any ideas what else to try? Any good reads on IPM control?

EDIT: some other things I noticed
  • At a given parameter set, when I push the throttle all the way, the achieved idle speed is lower than when I gradually increase throttle
  • I can spin up to 3000rpm with a certain amount of throttle at say 40A phase current. Adding more throttle does not increase speed, but current increases up to 150A with not effect
  • If I set a high value (say, 25) for syncadvance The motor seems to pick up more force once it spins past 5000rpm. It reaches a value above 8000rpm (instrument cluster only displays 8000) and then trips. At 5000rpm/333Hz effective syncofs increased by 45° (64300). Hmm, that give sme an idea :idea:
Attachments
stm32_sine.zip
(25.02 KiB) Downloaded 363 times
Leaf 2019-05-18.json
(1.16 KiB) Downloaded 372 times
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Jack Bauer
Posts: 3661
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 10 times
Been thanked: 334 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by Jack Bauer »

My only experience so far running an ipm on load has been cranking my Lister diesel engine. I did indeed find some similarities. e.g. at certain syncofs adding throttle just added current and made heat. It took a lot of experimenting to find the right settings but once dialed in it would crank the engine no problem.

Here are the params I used for the toyota "alternator".
Attachments
params_estima_alt_cranking.json
(1.23 KiB) Downloaded 307 times
I'm going to need a hacksaw
arber333
Posts: 3562
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 134 times
Been thanked: 335 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by arber333 »

Nice that you started playing with offset.

My take on the offset setting was a bit fixed. I also used both 56000 and 18000 going each way BUT when i used low boost (2000) setting car felt very sluggish and in the end it would trip OC.
I noticed however if i would increase boost with offset say 56000 i would get proportionaly higher RPM the more throttle i used.
This would also apply to torque when on the road. With high boost (15000) the car would pull great and drive along, however if i would release throttle it seemed 100% regen at that voltage would come rushing back. That was OK at speed, but at slow movement oscilations would want to tear the car apart. That happened no matter the regen pot setting or the regen value in parameters.
This made me suspect regen is mostly dependent on boost voltage and/or offset setting. Both were constant when i used the car.

So i got two ideas for your programming skils.
1. Use a "regen offset" that would roll down offset with motor RPM until there wouldnt be much effect at low speed. Similar like your slip reduction with ACIM motor.

2. Use a "regen boost" that would reduce boost on regen in relation with RPM. Again the similarity with ACIM motor slip reduction while braking.

A
arber333
Posts: 3562
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 134 times
Been thanked: 335 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by arber333 »

Hm....

Ther would be another way to setup the Leaf inverter i think.
Like using one ACIM motor to act as a load for leaf motor like a dyno.
ACIM would have to be connected to an inverter to get excitation and to set regen.
Then you could drive Leaf motor and vary the load on ACIM.
I would think your clutch coupler would be invaluable since it can eat some missalingment you would have with such home setup.

Motors would have to be anchored to the ground by cord straps...
Both inverters would feed off the same DC battery rails. That way you could measure the loss...
User avatar
johu
Site Admin
Posts: 6709
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1536 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Alright, slight improvement.
I set syncofs to the 64000 region. Now idling at 500rpm takes 50A at the motor but the motor is a lot more lively. It spins up above 8000rpm while still somewhat controllable. The currents are still pretty excessive for what it does though. It keeps tripping pretty randomly, sometimes even when I go off the throttle. But I got up our steep hill now.
Yes I could implement all those specialty treatments but am now ready to bite the bullet and implement a current control loop. Just need to figure out how to distinguish between generator and motor mode. Or maybe just use Mr. Park and Mr. Clarke and have them regulate the sine amplitude.

This was also helpful: https://www.controleng.com/articles/und ... et-motors/
Magnetic torque is maximized when the stator field excites the motor rotor 90 electrical deg from the d axis (motor magnet position). Reluctance torque follows a different path and is maximized 45 electrical deg past the q axis. The maximum magnetic torque takes advantage of both the motor’s reluctance and magnetic torques. Shifting further away from the q axis reduces magnetic toque, but is far outweighed by the gain in reluctance torque. The maximum combined magnetic and reluctance torque occurs near 45 electrical deg from the q axis, but the exact angle will vary based on the characteristics of the PM motor.
Attachments
Leaf 2019-05-18-2.json
(1.16 KiB) Downloaded 427 times
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: 6709
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1536 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Jack Bauer wrote: Sat May 18, 2019 5:56 pm My only experience so far running an ipm on load has been cranking my Lister diesel engine. I did indeed find some similarities. e.g. at certain syncofs adding throttle just added current and made heat. It took a lot of experimenting to find the right settings but once dialed in it would crank the engine no problem.

Here are the params I used for the toyota "alternator".
I see fweak 1000. How did you arrive at that?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
arber333
Posts: 3562
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 134 times
Been thanked: 335 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by arber333 »

Why dont you just use throttle position report to assign the +/- attribute to the mode?
I also noticed at high speeds on my desk Leaf motor would trip OC if i would release throttle too fast.

I am sure we would like your FOC even more than slip control :).

BTW: When i tried to run Leaf motor with one of those chineese 6step controlers it ran perfectly good without any sound! I was amazed how good it performed at start. I am not sure what would happen under load though.
This was 60V 1kW controller for ebike. I didnt use sensors...

My point is; obviously just the 6step comutation works perfectly good for Leaf motor. No need to use something fancy like sine correction etc...
nailgg
Posts: 119
Joined: Sat Dec 22, 2018 8:40 pm

Re: VW Touran powered by Nissan Leaf

Post by nailgg »

Was just wondering if this method would work for correct offset calibration. Just an idea came to my mind, sorry if it sounds impractical or already mentioned somewhere else :)

Suppose we're spinning the Leaf motor from an external source (not through the inverter), at say 300 RPM. We're also giving the excitation to the resolver through the inverter or any other sine source. We will see the generated back-emf voltage at the phase leads. Then if we scope between the U and V phase leads on one scope channel, resolver on the second scope channel, since both the motor and the resolver are 8-pole, we'll see the signals at the same frequency, which is defined by the speed we're spinning the motor. Then we can measure the time between the peak points of two signals. By the "peak" of the resolver, I mean the peak point of the arctan2(sine, cosine) of the resolver.

Now with some low voltage DC bus, let us spin the motor through the inverter (at the very same speed motor was excited from the external source) and make the same measurements on the scope. Play with syncofs until we reach the same time difference between the resolver peak and the U-V voltage peak. Would that syncofs value represent the absolute zero position?

The issue is, we need to scope the arctan2(sine, cosine) so it would be great if we had at least one DAC channel on our STM32F103, but unfortunately we don't.

Edit: Another issue is, I'm not sure if we would be able to keep the motor spinning at 300 RPM through the inverter while playing with syncofs.
User avatar
johu
Site Admin
Posts: 6709
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1536 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Well actually I kindof though of a similar thing. I was more interested in back EMF voltage. So I would have just scoped DC voltage and fstat with the power stage shut off and floating DC bus.

You could toggle a pin whenever angle passes 0°.
The issue is that stator current is not in phase with stator voltage, as far as I know. There is also mention of injecting a low DC current to determine rotor position. But I think syncofs=55000 is quite surely the point where we're 90° offset from the PM field.

Now I found another interesting read: https://www.sciencedirect.com/topics/en ... nce-torque
The optimum angle for a hybrid motor at low speeds (that is, without field weakening) will be between 90° (magnet-flux optimized) and 135° (reluctance torque optimized). Since the reluctance component is usually a fraction of the magnet torque in PM motors, the optimal angle is much closer to 90° than it is to 135°. Still, some angle advance (perhaps 10° or 15°) will often increase the torque of a motor as much as 15%.
arber333 wrote: Sat May 18, 2019 8:14 pmMy point is; obviously just the 6step comutation works perfectly good for Leaf motor. No need to use something fancy like sine correction etc...
Yes you can even run an induction motor with 6-step commutation (with slip of course) it's just less efficient. Same for PM. Even running BLDC motors with sine commutation increases efficiency a little bit.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
nailgg
Posts: 119
Joined: Sat Dec 22, 2018 8:40 pm

Re: VW Touran powered by Nissan Leaf

Post by nailgg »

johu wrote: Sun May 19, 2019 11:40 am The issue is that stator current is not in phase with stator voltage, as far as I know. There is also mention of injecting a low DC current to determine
No they aren't in phase as you mentioned because of the inductances, but is this an issue at all? I meant we could scope the time difference between phase voltage and resolver, not the currents. A low-pass filter is all we need, something like 10k Ohm + 22 nF (~723 Hz cut-off) would be enough to eliminate the PWM while running the motor through the inverter. Also toggling a pin at the resolver zero-point sounds very practical.

I actually made a crude simulation for this method on Matlab and it looks promising. But to test it in practice I need a whole new inverter power stage hooked up to my Leaf motor, which has been laying around for years. Someone who already has all the setup might give it a try :P
User avatar
johu
Site Admin
Posts: 6709
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1536 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

So I did a few more experiments.
At first I tested the over current limit. I had it set to 800A but when plotting il1 and il2 and pulling against the handbrake I got shutdowns near 180A. Si I revisited the "break interrupt" i.e. the routine that is called when the inhibit signal is triggered. It tuns out I did all sorts of things and then checked the pins for the shutdown reason.

I have now turned this around and bingo, what I thought were over current shutdown were actually desat events! Or more precisely desat OR some other fault signal, probably temperature. So since the shutdown occurs beyond some delay it could be that the flow rate of my pump/radiator is too low and I get local overheating. Also 180A (provided my current sensors are calibrated ok) seems a bit low for desat. Anyway, I set iacmax to 200A and ocurlim to 400 and I'm getting less desat/overtemp shutdowns.

I also tested behaviour ad speed. I tested with the idle speed controller 1000, 2000, 3000, 4000 rpm with 50% throttle limit. It turns out a setting of syncofs that works well at 1000rpm (56000) gives high currents at 2000rpm, likewise at 3000 and 4000rpm. So about for every 1000rpm I had to increase syncofs by about 500 dig (about 3°) to run with low current. Whether that is down to the motor or to some lag in position sensing I don't yet know.

When keeping the speed fixed at 1000rpm it was quite irritating to see that changing the offset from 56000 to 56500 (3° !) would cause the current to rise from 4A to 40A! Not very forgiving this beast.

So my hopes are that dethrottling my cooling system might help the shutdowns and that I can find a "syncadvance" value that compensates the apparent lag of the position sensing.

Just for repetition, here is the cooling system: auxiliary water pump from some Mercedes and passenger room heating radiator.
Question: could there be air in the inverter? I have no idea how to de-air a cooling system?

Image
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Jack Bauer
Posts: 3661
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 10 times
Been thanked: 334 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by Jack Bauer »

I can't really see from the picture but do you have a coolant resevoir? Typically you would want one teed into the pump input to put a little static pressure on the feed.

Do you think the resolver tracking is lagging the rotor position?
I'm going to need a hacksaw
User avatar
johu
Site Admin
Posts: 6709
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1536 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Jack Bauer wrote: Sun May 19, 2019 5:40 pm I can't really see from the picture but do you have a coolant resevoir? Typically you would want one teed into the pump input to put a little static pressure on the feed.
Yes the original one. It sits on the tube that exits the picture. So you're saying I should instead connect it to the pump input?
Jack Bauer wrote: Sun May 19, 2019 5:40 pmDo you think the resolver tracking is lagging the rotor position?
Inherently, yes. By the time you read the resolver and command the new dutycycle the motor has already moved on. The faster it spins, the more. At 17.6 kHz the position update rate is 4.4kHz or 228µs. So at 2000rpm that creates a lag of 2000rpm/60/1,000,000*228*360=2.7°. As mentioned that amount of angular shift can decide between 4A or 40A.

EDIT: wrong.Position update rate would be 8.8kHz/114µs. So everything halved. 1.4° then... could still make a difference.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Kevin Sharpe
Posts: 1339
Joined: Fri Dec 14, 2018 9:24 pm
Location: Ireland and US
Been thanked: 8 times

Re: VW Touran powered by Nissan Leaf

Post by Kevin Sharpe »

johu wrote: Sun May 19, 2019 5:21 pmI have no idea how to de-air a cooling system?
I've used a vacuum filling system in the past and plan to use it again on my Tesla P100 battery modules :D

This is a personal post and I disclaim all responsibility for any loss or damage which any person may suffer from reliance on the information and material in this post or any opinion, conclusion or recommendation in the information and material.
User avatar
johu
Site Admin
Posts: 6709
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1536 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Nice, never knew this existed.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
arber333
Posts: 3562
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 134 times
Been thanked: 335 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by arber333 »

The cooling system is very simple to deair(eiluft you guys say in Germany) if you dont have some elaborate valves and heating elements included.
1. You have your reservoir with one supply line and one output line in case liquid would boil.
2. supply line leads to 3way port on water hose from motor to radiator
3. cooler fluid from radiator to suction pump and back to motor

I use another 3way port element in section between radiator and pump. 2 points just pasthrough liquid, but i connect third one to a toilet hose with a screw plug in the end. When i have to deair my system i just supply liquid to reservoir and run the pump. When it starts to suck air i open the end valve and wait for the air to evacuate and liquid to flow from there. That is it. You can use even larger hoses. What is important is that your plug is higher than the system so air can evacuate to the highest point - the plug.
Attachments
IMG_20190519_211625.jpg
IMG_20190519_211613.jpg
User avatar
johu
Site Admin
Posts: 6709
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1536 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Like that basically?
What do you guys think about the radiator?
Attachments
kühlung.png
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
arber333
Posts: 3562
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 134 times
Been thanked: 335 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by arber333 »

It is a bit small and without active cooling. Starts will heat up inverter a lot. Is that a car heater core? This would do for the motor, but for both inverter and motor i dont think it will be enough.
I think i will use original radiator for the motor and i will first let the water from radiator to inverter and charger and then to the motor. From here dT would have to be dropped fast. I will write more about it when i have motor in a car.
rikohm
Posts: 29
Joined: Tue Feb 26, 2019 8:08 pm
Location: Piteå, Sweden
Been thanked: 4 times

Re: VW Touran powered by Nissan Leaf

Post by rikohm »

Might be a good idea to put the pump after the cooler if you are expecting higher temperatures, less risk for cavitation.
(and pump runs cooler, lasts longer)
Post Reply