[DRIVING] VW Touran powered by Nissan Leaf [FINISHED]
- Kevin Sharpe
- Posts: 1345
- Joined: Fri Dec 14, 2018 9:24 pm
- Location: Ireland and US
- Been thanked: 8 times
Re: VW Touran powered by Nissan Leaf
I'll try to find my notes on connector part numbers... in the meantime have you seen this post from Mike at Indra?
https://www.diyelectriccar.com/forums/s ... tcount=207
... and this thread?
https://www.diyelectriccar.com/forums/s ... p?t=201233
https://www.diyelectriccar.com/forums/s ... tcount=207
... and this thread?
https://www.diyelectriccar.com/forums/s ... p?t=201233
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.
- Kevin Sharpe
- Posts: 1345
- Joined: Fri Dec 14, 2018 9:24 pm
- Location: Ireland and US
- Been thanked: 8 times
Re: VW Touran powered by Nissan Leaf
Here are the connectors that I used on my Leaf BMS;Kevin Sharpe wrote: ↑Fri Oct 25, 2019 7:41 pm I'll try to find my notes on connector part numbers...
https://www.diyelectriccar.com/forums/s ... stcount=12
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.
- johu
- Site Admin
- Posts: 6578
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 325 times
- Been thanked: 1461 times
- Contact:
Re: VW Touran powered by Nissan Leaf
The variation is not really there, I checked with my multimeter. Like said the BMS is partly damaged. The other ones might just be bad connections. I pushed some pins back out with a paper clip, maybe they got wideneddoobedoobedo wrote: ↑Fri Oct 25, 2019 6:48 pm Looks like you've got a fair amount of variation there. For the really low ones you could try bringing them up to around nominal voltage slowly and see if they manage to hold the charge.

Yes that was my starting point but I think it was missing the male ones or something. Anyhow, definitely useful.Kevin Sharpe wrote: ↑Fri Oct 25, 2019 8:04 pm Here are the connectors that I used on my Leaf BMS;
https://www.diyelectriccar.com/forums/s ... stcount=12
I made a wiki page for the Nissan BMS, feel free to make additions: https://openinverter.org/wiki/Nissan_Leaf_BMS
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- johu
- Site Admin
- Posts: 6578
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 325 times
- Been thanked: 1461 times
- Contact:
Re: VW Touran powered by Nissan Leaf
While working on the car today suddenly all warning lights went on and the hand brake symbol started blinking. I couldn't access various controllers except the instrument cluster and was a bit terrified that I might have damaged something. Well to cut it short it was my wire-tap connector that I had used to tap into the motor CAN bus with the inverter. When moving it around the errors would appear.
So I removed them and am now looping the CAN bus through the inverter as you're supposed to do. Luckily I had the 6-pole VW connector handy so the CAN bus tap is now super clean without cutting any wires or tapping into them.
Apart from that I cut off most of the bus bar of the Leaf current sensor and screwed it directly to the B+ relay. The BMS itself is going to live on top of the front battery stack.
Last but not least I did a test drive with MTPA control and field weakening control but there is no real change I'm afraid. Maybe the motor now runs cooler but it still vastly looses torque above 4500rpm. Attached the software in case someone is interested. throtiq and throtid have been replaced by the single parameter throtcur as the d and q part are now decided upon by MTPA or field weakening. The field weakening controller has a parameter fwkp for controller gain.
Pictures tomorrow.
So I removed them and am now looping the CAN bus through the inverter as you're supposed to do. Luckily I had the 6-pole VW connector handy so the CAN bus tap is now super clean without cutting any wires or tapping into them.
Apart from that I cut off most of the bus bar of the Leaf current sensor and screwed it directly to the B+ relay. The BMS itself is going to live on top of the front battery stack.
Last but not least I did a test drive with MTPA control and field weakening control but there is no real change I'm afraid. Maybe the motor now runs cooler but it still vastly looses torque above 4500rpm. Attached the software in case someone is interested. throtiq and throtid have been replaced by the single parameter throtcur as the d and q part are now decided upon by MTPA or field weakening. The field weakening controller has a parameter fwkp for controller gain.
Pictures tomorrow.
- Attachments
-
- stm32-foc.zip
- (63.62 KiB) Downloaded 226 times
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- johu
- Site Admin
- Posts: 6578
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 325 times
- Been thanked: 1461 times
- Contact:
Re: VW Touran powered by Nissan Leaf
New BMS arrived from UK, thanks very much to member Scirocco EV who sent it over for 0€ delivered
Had to shave some plastic from the LV connector then was able to start - exciting! Here are the voltages:
So about 70mV variation, much better. Only the first value must be misinterpreted, it always shows 3586mV. Even on the other BMS.
So now I'll wire up the CAN bus and talk to the BMS via my custom ECU.
Edit: just went back down to see how things developed. Car was slow charging. Now suddenly the hi-byte of cell 1 had jumped to F translating to 3.8V. But the low byte is always stuck at 0x2

Had to shave some plastic from the LV connector then was able to start - exciting! Here are the voltages:
Code: Select all
3586 3821 3797
3784 3798 3790
3790 3790 3792 3798
3789 3748 3816
3792 3788 3780 3789
3788 3788 3780
3789 3789 3793 3789
3789 3795 3792
3788 3788 3788 3792
3783 3789 3787
3787 3783 3788 3790
3790 3790 3790
3787 3792 3788 3794
3789 3789 3787
3784 3781 3788 3756
3820 3790 3795
3819 3785 3789 3789
3785 3789 3799
3792 3751 3816 3788
3780 3756 3812
3786 3787 3783 3783
3780 3794 3785
3793 3792 3788 3789
3784 3783 3801
3792 3798 3780 3798
3789 3794 3794
3795 3783 3790 3796
3801 3807 36563
So now I'll wire up the CAN bus and talk to the BMS via my custom ECU.
Edit: just went back down to see how things developed. Car was slow charging. Now suddenly the hi-byte of cell 1 had jumped to F translating to 3.8V. But the low byte is always stuck at 0x2
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- johu
- Site Admin
- Posts: 6578
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 325 times
- Been thanked: 1461 times
- Contact:
Re: VW Touran powered by Nissan Leaf
Want to dig that one out again, look what I found:
Apparently Tesla burn power in the motor to heat up the battery.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
-
- Posts: 3541
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 129 times
- Been thanked: 325 times
- Contact:
Re: VW Touran powered by Nissan Leaf
Hm...
There are some points that you will have to take into account then.
1. Temp needed should be at least 55deg for the air heating to be effective I think. You can try with a 230Vac washing machine heater. On 230Vac it makes 2.2kw but on 360Vdc it makes almost 5kw. You can use one digital thermostat with a relay to shutoff/on contractor and try how much temp you need to heat up interior. You can even use it for very cold days if motor doesn’t make enough heat.
2. To get that out of the motor there should be very short coolant path to the heater.
3. Inverter cooling should be on separate loop from motor, just in case.

There are some points that you will have to take into account then.
1. Temp needed should be at least 55deg for the air heating to be effective I think. You can try with a 230Vac washing machine heater. On 230Vac it makes 2.2kw but on 360Vdc it makes almost 5kw. You can use one digital thermostat with a relay to shutoff/on contractor and try how much temp you need to heat up interior. You can even use it for very cold days if motor doesn’t make enough heat.
2. To get that out of the motor there should be very short coolant path to the heater.
3. Inverter cooling should be on separate loop from motor, just in case.

- johu
- Site Admin
- Posts: 6578
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 325 times
- Been thanked: 1461 times
- Contact:
Re: VW Touran powered by Nissan Leaf
So hooked up the BMS today and looked at CAN values.
Of course most values don't make sense as the LBC/BMS doesn't belong to this battery.
I am getting a very low power limit (0 charge, 4.5kW discharge) because of "LBC malfunction". DTC is 10. Anyone know where I can find a list of DTCs?
Gotta say, SavvyCAN is awesome, it was real easy to define the signals despite the weird bit order.
Of course most values don't make sense as the LBC/BMS doesn't belong to this battery.
I am getting a very low power limit (0 charge, 4.5kW discharge) because of "LBC malfunction". DTC is 10. Anyone know where I can find a list of DTCs?
Gotta say, SavvyCAN is awesome, it was real easy to define the signals despite the weird bit order.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- johu
- Site Admin
- Posts: 6578
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 325 times
- Been thanked: 1461 times
- Contact:
Re: VW Touran powered by Nissan Leaf
Quoting myself again. I figured out my mistake when decoding the voltages: they are all big endian!johu wrote: ↑Tue Oct 29, 2019 12:18 pm So about 70mV variation, much better. Only the first value must be misinterpreted, it always shows 3586mV. Even on the other BMS.
So now I'll wire up the CAN bus and talk to the BMS via my custom ECU.
Edit: just went back down to see how things developed. Car was slow charging. Now suddenly the hi-byte of cell 1 had jumped to F translating to 3.8V. But the low byte is always stuck at 0x2
Code: Select all
3876 3847
3830 3843 3841
3841 3836 3838 3843
3834 3789 3858
3838 3834 3825 3834
3829 3834 3830
3830 3839 3839 3835
3834 3836 3833
3834 3834 3829 3838
3824 3834 3833
3838 3828 3838 3836
3836 3841 3841
3833 3838 3834 3843
3835 3835 3828
3835 3831 3834 3801
3866 3841 3845
3808 3865 3834 3839
3830 3835 3846
3838 3801 3857 3834
3825 3806 3862
3841 3833 3824 3829
3826 3839 3830
3839 3838 3838 3834
3830 3834 3842
3838 3843 3830 3843
3834 3839 3846
3841 3824 3831 3847
3847 3854 3841
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- Kevin Sharpe
- Posts: 1345
- Joined: Fri Dec 14, 2018 9:24 pm
- Location: Ireland and US
- Been thanked: 8 times
Re: VW Touran powered by Nissan Leaf
checkout LeafSpy which we used for resetting DTCs when we did our Leaf based conversion. Maybe they have documented the DTCs somewhere.
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.
- johu
- Site Admin
- Posts: 6578
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 325 times
- Been thanked: 1461 times
- Contact:
Re: VW Touran powered by Nissan Leaf
Still no success in that respect but I'm already using the BMS for calculating power, SoC and cutting of the charger on a per cell voltage threshold.Kevin Sharpe wrote: ↑Sun Nov 03, 2019 2:17 pm checkout LeafSpy which we used for resetting DTCs when we did our Leaf based conversion. Maybe they have documented the DTCs somewhere.
But more exciting news today: Finally field weakening is working! See more here: viewtopic.php?f=7&t=153&p=3964#p3964
There is no longer a weird torque knee at 4000 rpm but it just keeps revving. At 6000rpm I was too scared to continue, but it seemed torque hadn't diminished at all.
On other news I figured out the economy meter, ie. the ones that displays "l/100km" for the gas engine. Of course it still calls it l/100km but it is now kWh

Will update the Touran wiki accordingly.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- Zapatero
- Posts: 445
- Joined: Fri Oct 25, 2019 11:08 am
- Location: Germany, Ulm
- Has thanked: 25 times
- Been thanked: 42 times
- Contact:
Re: VW Touran powered by Nissan Leaf
That are awesome news. Looking forward to experience the electric potential of the leaf inverter in my Toyotajohu wrote: ↑Thu Nov 07, 2019 11:40 am
But more exciting news today: Finally field weakening is working! See more here: viewtopic.php?f=7&t=153&p=3964#p3964
There is no longer a weird torque knee at 4000 rpm but it just keeps revving. At 6000rpm I was too scared to continue, but it seemed torque hadn't diminished at all.

-
- Posts: 52
- Joined: Fri Feb 15, 2019 10:22 am
- Location: United Kingdom
Re: VW Touran powered by Nissan Leaf
Well done with the FOC Johannes , and thanks for posting the Touran canbus software - I hope it'll be useful for me -when I get that far !
Do you think I can replace Touran VCU with a blue pill and can driver ?
I'm still struggling with the coupler! Not sure which will be better- straight Damien style coupler with iffy clutch centre (unless I can find one with a really good fit ) , or butcher the gearbox for the Nissan input shaft and have that machined .
Do you think I can replace Touran VCU with a blue pill and can driver ?
I'm still struggling with the coupler! Not sure which will be better- straight Damien style coupler with iffy clutch centre (unless I can find one with a really good fit ) , or butcher the gearbox for the Nissan input shaft and have that machined .
- johu
- Site Admin
- Posts: 6578
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 325 times
- Been thanked: 1461 times
- Contact:
Re: VW Touran powered by Nissan Leaf
Yes Blue Pill and CAN driver (and 12->5V power supply) should be sufficient. Just go over the various pins and check they are all present on the pill.
Yeah coupler is always a drag, good luck
Yeah coupler is always a drag, good luck

Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
-
- Posts: 99
- Joined: Sat Dec 22, 2018 9:39 pm
- Location: Vancouver, Canada
- Been thanked: 10 times
Re: VW Touran powered by Nissan Leaf
johu wrote: ↑Thu Nov 07, 2019 11:40 am
But more exciting news today: Finally field weakening is working! See more here: viewtopic.php?f=7&t=153&p=3964#p3964
There is no longer a weird torque knee at 4000 rpm but it just keeps revving. At 6000rpm I was too scared to continue, but it seemed torque hadn't diminished at all.
That is great news.

- johu
- Site Admin
- Posts: 6578
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 325 times
- Been thanked: 1461 times
- Contact:
Re: VW Touran powered by Nissan Leaf
Reading

Basically I implemented this: http://www.ti.com/lit/pdf/spracf3
But that alone had no effect, as the d-voltage would always hit its saturation point and then no matter which fancy algorithms you deploy, you cannot further increase d-current.
So the most important bit was (re-) introducing speed dependent phase shift (called syncadv). In most papers you will not see this. Another important piece was helping the PI controllers by adding a speed dependent voltage offset. That greatly reduces integrator windup. And that in turn reduces regen peaks when transitioning to regen. Only a few papers actually mentioned the necessity of it.
No surprise, if you're a student you'll just copy the generic FOC structure out there, add some fancy algorithm to make it sensorless (involving neural networks, observers or blockchain

Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- johu
- Site Admin
- Posts: 6578
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 325 times
- Been thanked: 1461 times
- Contact:
Re: VW Touran powered by Nissan Leaf
Did a test drive yesterday and here is the economy figure
(kWh/100km).
It was like 80-100km/h mostly flat back road driving

It was like 80-100km/h mostly flat back road driving
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- tom91
- Posts: 2267
- Joined: Fri Mar 01, 2019 9:15 pm
- Location: Bristol
- Has thanked: 198 times
- Been thanked: 520 times
Re: VW Touran powered by Nissan Leaf
is that trip meter accurate? At 176wh/km doing 80-100 km/h is very good for such a big car.
-
- Posts: 395
- Joined: Sun Aug 25, 2019 12:39 pm
- Location: Finland
- Has thanked: 55 times
- Been thanked: 14 times
Re: VW Touran powered by Nissan Leaf
Thats about the same what I get with driving 100kmh on the Nissan Leaf @1460kg. So looks really good.
How is the weight of Touran now?
How is the weight of Touran now?
Any opinions are my own, unless stated otherwise. I take no responsibility if you follow my way of doing things and it doesn't work. Please double check with someone who knows what they are doing.
- johu
- Site Admin
- Posts: 6578
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 325 times
- Been thanked: 1461 times
- Contact:
Re: VW Touran powered by Nissan Leaf
Yes it should be. It is fed by an upcounter. The faster it upcounts, the higher the consumption. It is linear, I checked. So if you count up by 28 per 10ms it will display 10l/h. If you start driving it will convert that to l/100km. So I just take the power reported by the BMS in kW, multiply by 2.8. Now if I pull 1kW it will display "1 l/h".
Wow, thats almost too good. Maybe because I have no auxiliary drain right now. I don't have any equipment to weigh the car, so will have to wait for the TÜV visit.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
- johu
- Site Admin
- Posts: 6578
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 325 times
- Been thanked: 1461 times
- Contact:
Re: VW Touran powered by Nissan Leaf
Sorted the fuel gauge today.
Blue Pill+MCP2562 CAN Transceiver+ 2 BC547 transistors
So at 50% SoC we output 36% duty cycle on both transistors. As SoC increases we decrease duty cycle on one channel and increase it on the other one by a certain amount per % SoC. Perfect analog pot simulation.
Then mapped SoC from the Nissan BMS to it, done. Still took me all day
Idle duty cycle and SoC gain are configurable so I hope it will work for other cars with a similar setup.
Blue Pill+MCP2562 CAN Transceiver+ 2 BC547 transistors
So at 50% SoC we output 36% duty cycle on both transistors. As SoC increases we decrease duty cycle on one channel and increase it on the other one by a certain amount per % SoC. Perfect analog pot simulation.
Then mapped SoC from the Nissan BMS to it, done. Still took me all day

Idle duty cycle and SoC gain are configurable so I hope it will work for other cars with a similar setup.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
-
- Posts: 3541
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 129 times
- Been thanked: 325 times
- Contact:
Re: VW Touran powered by Nissan Leaf
Ah J where were you last week!!! I was just banging my head at my fuel mapping and wonder why I can't go past 50% indicated.johu wrote: ↑Tue Nov 12, 2019 4:17 pm Sorted the fuel gauge today.
Blue Pill+MCP2562 CAN Transceiver+ 2 BC547 transistors
So at 50% SoC we output 36% duty cycle on both transistors. As SoC increases we decrease duty cycle on one channel and increase it on the other one by a certain amount per % SoC. Perfect analog pot simulation.
Then mapped SoC from the Nissan BMS to it, done. Still took me all day![]()
Idle duty cycle and SoC gain are configurable so I hope it will work for other cars with a similar setup.
Well my SOC probe uses single Fet driver to move needle in mazda. But here single pwm doesn't go beyond 50%.
Can you show a circuit to get single pwm signal to move needle full range?
Tnx
- johu
- Site Admin
- Posts: 6578
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 325 times
- Been thanked: 1461 times
- Contact:
Re: VW Touran powered by Nissan Leaf
At least in Touran that is not possible. You need two channels. Before fancy PWM you should try your luck with an actual mechanical pot. There are 3 wires in Touran, only do many ways to connect them
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
-
- Posts: 3541
- Joined: Mon Dec 24, 2018 1:37 pm
- Location: Slovenia
- Has thanked: 129 times
- Been thanked: 325 times
- Contact:
Re: VW Touran powered by Nissan Leaf
Hm... I have 4 wires... but wiring sch says 2 of the wires are used for the pump. Ouch! It just occured to me that probe is 150R and current driven. I may be using too small of a current. I used one resistor inline so not to damage the sensing circuit. I have to try if it will run with one larger NFET.
- johu
- Site Admin
- Posts: 6578
- Joined: Thu Nov 08, 2018 10:52 pm
- Location: Kassel/Germany
- Has thanked: 325 times
- Been thanked: 1461 times
- Contact:
Re: VW Touran powered by Nissan Leaf
I final-mounted the fuel gauge driver today and put all the trim and seats back in.
But oh no, as soon as I spin the motor all warning lights go crazy
Seems my CAN bus extension from BMS to gauge driver causes a problem. After all it's routed on top of the batteries so will see a fair bit of EMV. Maybe it's a termination issue. Still haven't measured total bus resistance.
So remove seats and trim and try again
But oh no, as soon as I spin the motor all warning lights go crazy

So remove seats and trim and try again

Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9