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

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

Re: VW Touran powered by Nissan Leaf

Post by arber333 »

Very nice! I like that mount.
Did you disconnect some GND wire or cut any harness? Inside harness there are usually some wires that serve just to connect all the connector GND references. If you cut one you may disable a lot of things inadvertently.

Or maybe car is sensing a voltage reference change. Did you connect 12V battery?

A
User avatar
johu
Site Admin
Posts: 5789
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1023 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

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?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by Jack Bauer »

A vagcom cable should do it. About 10 Euros on ebay. Congratulations on the test drive. I have an 80v pack ready to drop into the E46.
I'm going to need a hacksaw
User avatar
johu
Site Admin
Posts: 5789
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1023 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Yep, ordered one.

Here is a video from the Touran series:
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Cookie6000
Posts: 246
Joined: Wed May 08, 2019 9:27 am
Location: Wicklow, IRL
Has thanked: 12 times
Been thanked: 32 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by Cookie6000 »

Looking great!
Glad to see some relatively modern VAG related conversion going on here. Have a 2003 A6 C5 1.9 Avant that has the makings of a donor. Good to hear how you have found a liking for the CAN on these as this was one of my thoughts on how difficult it was to get around acquiring all the relevant messages you need to keep the dash from lighting up like a Christmas tree :D .
Plan to go the Leaf power train route also. This thread is my new sticky ;)
Home of the #Audi8e - https://twitter.com/FiachraCooke
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by arber333 »

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?
Nice! I have seen the video and it is hillarious. I love the measured movement backwards.
There are two guys in Slovenia that are biting nails for results now...

To delete errors on Ampera i use ELM327 bluetooth dongle that goes to OBDII port and i use Torque pro app on my phone. I loaded PIDs for Ampera and i can now reliably read all parameters and delete errors if they appear...
doobedoobedo
Posts: 260
Joined: Sat Jan 12, 2019 12:39 am
Location: UK

Re: VW Touran powered by Nissan Leaf

Post by doobedoobedo »

I'll give torque a +1. It's an excellent app.
User avatar
johu
Site Admin
Posts: 5789
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1023 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Mounted one battery in its final position and one temporary.
So now I could test at full voltage (380V). First thing I did was burning out the relay driver buried in the inverter :(
So I did manual precharging from now on
So when car is not in gear it tends to "idle". I got it to spin up to 4000rpm. The throttle/current curve is weird. When at high speed when I ease the throttle current actually increases. A lot to tune here. syncofs is 57000, next I will try the value that Arber used.
The first test drive was very slow and with unwanted regen. So just like Arbers experience.
Attachments
IMG_20190512_200003.jpg
IMG_20190512_195948.jpg
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by arber333 »

Wow! So you actually did a full test drive with 360Vdc! That is a great step.
So did you use a strong steel profile to mount the battery pack? This will be tested now that your car will move and buck under 360Vdc.

I am looking forward to testing your findings in action.

A
User avatar
johu
Site Admin
Posts: 5789
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1023 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

No I was too lazy to change the mounts ;) I drilled the middle one so that it now also fits. Also re-tapped the hole with the damaged tread.

Attached is todays parameter file.
Attachments
Leaf 2019-05-12.json
(1.29 KiB) Downloaded 137 times
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 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: 76
Joined: Tue Jan 15, 2019 10:49 pm
Location: Ireland
Been thanked: 2 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: 5789
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1023 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: 5789
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1023 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: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 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: 5789
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1023 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: 5789
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1023 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 113 times
Leaf 2019-05-18.json
(1.16 KiB) Downloaded 115 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: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 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 111 times
I'm going to need a hacksaw
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 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: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 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: 5789
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1023 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 111 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: 5789
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1023 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: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 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: 5789
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1023 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
Post Reply