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

Tell us about the project you do with the open inverter
User avatar
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

Post by Zapatero »

Just wanted to leave my knowledge about Chademo here alltough you propably already know all that :D
This information is out of the Orion BMS Software which is accessible for everyone by download from their site.

Canbus Messages:

0X100
Byte 0 Empty
Byte 1 Empty
Byte 2 Empty
Byte 3 Empty
Byte 4 Max Cell Voltage (Little Endian / Most significant Bit) 2 bytes long (((Value * 96) + 10.000) / 5)
Byte 5 Max Cell Voltage (Little Endian / Most significant Bit) 2 bytes long (((Value * 96) + 10.000) / 5)
Byte 6 Constant Value: C8
Byte 7 Empty


0x101
Byte 0 Empty
Byte 1 Constant Value: FF
Byte 2 Constant Value: FE
Byte 3 Empty
Byte 4 Empty
Byte 5 Empty
Byte 6 Empty
Byte 7 Empty



0x102
Byte 0 Constant Value: 01
Byte 1 Max Cell Voltage (Little Endian / Most significant Bit) 2 bytes long (((Value * 96) + 10.000) / 5)
Byte 2 Max Cell Voltage (Little Endian / Most significant Bit) 2 bytes long (((Value * 96) + 10.000) / 5)
Byte 3 Pack Charge Current Limit (Most significant Bit order)
Byte 4 Bit 0 = Charger Safety
Byte 5 Bit 0 = DTC Highest cell voltage too high fault
Byte 5 Bit 1 = DTC Lowest cell voltage too low fault
Byte 5 Bit 2 = Current Failsaife
Byte 5 Bit 3 = DTC Thermistor Fault
Byte 5 Bit 4 = Cell Open Wiring Fault
Byte 5 Bit 5 = Charger Safety Relay Fault
Byte 6 Pack State of Charge
Byte 7 Empty
User avatar
johu
Site Admin
Posts: 6711
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1537 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Yes I have the specification but this is more condensed 8-)
JaniK wrote: Wed Feb 12, 2020 5:42 pm Great stuff!
Is this planned to appear in a product of some kind?
Like something from JLCPCB maybe? ;)
In my case it runs on a V2 mainboard :) Source code will show up here: https://github.com/jsphuebner/stm32-car
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: 6711
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1537 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Alright, first cut down. Of course fully untested due to lacking charger.

https://github.com/jsphuebner/stm32-car/tree/chademo

So chademo.cpp just handles the CAN decoding/encoding. Sequencing takes place in stm32_car.cpp

So I will be disabling the relays 12V supply by the proximity signal. Additionally the inverter won't power up when I inject 5V into the VCU. So the inverter voltage will definitely read as 0.

So if 3s after startup there is no voltage reported by the inverter, I consider being in charge mode.

I stop sending the normal CAN messages and instead send the ChaDeMo messages. Of course the Nissan BMS CAN also stays active.

Next I wait for the charger to lock the connector, which it signals via CAN bit #109.5.2. 3s later I enable charging using bit #102.5.0
All other flags are unused...
I set a charge current as allowed by the BMS. I might need to add a ramp because it says 20A/s change rate.

If somebody experienced wants to take a look that would be great.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
celeron55
Posts: 803
Joined: Thu Jul 04, 2019 3:04 pm
Location: Finland
Has thanked: 38 times
Been thanked: 136 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by celeron55 »

You need to send out the physical signals also in addition to canbus. Maybe I just didn't notice that in the code?

The standard says the charger not only has to make sure the signals you send out match the canbus flags, but also that the bus and the signals change in correct order relative to each other. I suppose not all chargers check the same things though.
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 »

This might help:)
Attachments
interface.jpg
sequence.jpg
I'm going to need a hacksaw
User avatar
johu
Site Admin
Posts: 6711
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1537 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

celeron55 wrote: Wed Feb 12, 2020 11:24 pm You need to send out the physical signals also in addition to canbus. Maybe I just didn't notice that in the code?

The standard says the charger not only has to make sure the signals you send out match the canbus flags, but also that the bus and the signals change in correct order relative to each other. I suppose not all chargers check the same things though.
No you're right, it's not (yet) in the code - so well spotted :)
I found the only signal that needs special timing is the "Charging enable" on pin 4. I will forego the "EV contactor control relay" as I just don't believe there are chargers out there that continue charging despite being told not to by CAN and the enable signal.

So "Charger start/stop 1" will power up the whole system and consequently it can only start sending messages then. The relays are then solely controlled by "Charger start/stop 1+2". I will reuse one of the "fuel gauge" signals (open collector output basically) as "Charging enable".

What is it with all those opto couplers?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
celeron55
Posts: 803
Joined: Thu Jul 04, 2019 3:04 pm
Location: Finland
Has thanked: 38 times
Been thanked: 136 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by celeron55 »

I've been wondering about the optocouplers myself. Maybe it's just a way of drawing some relatively low impedance heavily filtered signals? There's no particular explanation or requirement anywhere.

Altough, at least in the Leaf PDM CHAdeMO is indeed implemented with the same exact optocoupler setup, as far as I cared to look into it.
User avatar
johu
Site Admin
Posts: 6711
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1537 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Last nights lesson learned: you cannot put two CAN transceivers back-to-back :(
In hindsight it's obvious: CAN transceivers always feed back the sent data to the receive pin so that the actual CAN interface may detect bus congestion. So what happens

Code: Select all

CAN1H/L -> Transceiver 1 RX -> Transceiver 2 TX -> CAN2H/L -> Transceiver 2 RX -> Transceiver 1 TX -> CAN1H/L 
Loop complete, permanent bus congestion. Looks like I'll need an STM32F107 just to act as a CAN gateway :roll:

EDIT: maybe there is a chance: http://www.ti.com/lit/ug/tidudb5a/tidudb5a.pdf
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: 6711
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1537 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Yes, this works :) It opens the feedback loop.
Hail to my 74 logic collection :)
Attachments
Bildschirmfoto vom 2020-02-14 12-25-39.png
Bildschirmfoto vom 2020-02-14 12-25-39.png (11.47 KiB) Viewed 7279 times
IMG_20200214_123101.jpg
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
JaniK
Posts: 395
Joined: Sun Aug 25, 2019 12:39 pm
Location: Finland
Has thanked: 58 times
Been thanked: 14 times

Re: VW Touran powered by Nissan Leaf

Post by JaniK »

Good job Johannes!
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.
User avatar
johu
Site Admin
Posts: 6711
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1537 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Hold on to your hat :)
Aren't you comforted by the fact that this will control a 50kW charger ;)
Attachments
IMG_20200214_213100.jpg
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Berdi
Posts: 18
Joined: Fri Jul 19, 2019 11:42 am
Location: Georgia

Re: VW Touran powered by Nissan Leaf

Post by Berdi »

Хорошая работа!!! :)
User avatar
johu
Site Admin
Posts: 6711
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1537 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Finally put this in the car and tested with a lab supply. It works.
So as Pin 2 gets 12V the VCU and BMS does indeed turn on, I can connect via wifi and see BMS values. Also the proximity signal cuts the 12V supply of the DC switches making it impossible to drive. When Pin 10 is grounded the two relays switch on via the economizer staying well below the 2A limit of ChaDeMo. Pin 4 can be controlled via what is normally the fuel gauge driver.

Will do a little CAN test this week and a proper ChaDeMo test once the car is approved.
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: 6711
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1537 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Got a very nice call from TÜV Göttingen today. Apparently the documents and photos I sent looked quite promising and once again I was confirmed that I DO NOT need an EMC certificate for the Nissan components nor do I need to test the entire car. Even though it is post-2002. So way to go for Germany.

Inspection will be on March 10th, provided the weather is good. They need dry roads for some tests.
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: Wed Feb 19, 2020 10:19 pm Got a very nice call from TÜV Göttingen today. Apparently the documents and photos I sent looked quite promising and once again I was confirmed that I DO NOT need an EMC certificate for the Nissan components nor do I need to test the entire car. Even though it is post-2002. So way to go for Germany.
That's good news... if you get some spare time I've started a section in the Wiki for Germany :)

https://openinverter.org/wiki/Legalities
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: 6711
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1537 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Great, will fill it in!
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: 6711
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1537 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Just spent some more time in the car fixing things. While in it I saw the power steering warning light flicker which is an early indication of CAN bus troubles. Sure enough soon after ABS and airbag faulted out. Culprit is of course the newest addition, the CAN repeater for ChaDeMo. I don't know yet if it's the circuit or the bus layout. It taps off like 20cm with an unshielded, untwisted cable.

First thing is to try and cut power to the module in drive mode.
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: 6711
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1537 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Just back from a 40km test drive 6.7 kWh or 15.9 kwh/100 km. Really happy with that as its winter (well, sort of, 7°C) and the terrain is hilly. Supposedly SoC went from 93% to 57% but I don't think SoH is correctly calculated yet, it has been sitting at 85% since I first powered up the LBC.

Fixed the CAN problem by not powering the repeater module while not charging.
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: 6711
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1537 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Worked on the rev limiter today, it had a tendency to oscillate up to causing over current. Now it's very smooth because I filter the frequency before regulation. Also added filters before field weakening controller and adaptive integral gain. It's almost a general rule: thou shall filter thy input values.
Will do the same to the power limiter in the VCU which is also quite choppy.

Moreover I fixed most actuators of "Climatronic". Arber was right, the left warm air flap on passenger side was completely stuck. I re-greased the worm drive, now it's completely smooth.The one on the drivers side is the noisy one, though it still moves ok. Unfortunately it is buried so deep that I cannot get it out and grease it :(
But still, I tested the heating again and it now works. I'm getting 20°C warm air when water is at 50°C. Not great, but good enough for now. Will implement some "standstil current" parameter in the inverter so that it produces heat when stationary, perhaps even when driving slowly with little throttle. In VCU I can activate this parameter when outside temperature is below X and coolant temperature is below Y.

Observed the SoC calculation of the LBC a bit. It is strange. While charging at 10kW it did not move at all. After "rebooting" it had climbed a bit. Only when I started to pull some current SoC slowly climbed. Not sure what the deal is. On other occasions SoC climbed while charging, as expected.
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: 6711
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1537 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

So today was supposed to be the big day to get the car approved. But: it rained. And in rain they can't do some tests. So we agreed that I should bring the car in and bugger off to my holiday. Sometime in between it will be checked.

So this is how it went:
Drove to "Raststätte Göttingen" via A7 Autobahn. Car drove really well, it was a joy. I tried ChaDeMo charging but it couldn't connect. Not sure why. So instead I plugged in the 43kW AC charger for a hefty 6.40€ flat rate fee. At least that worked well. It was interesting to see how the rectified voltage only dropped to about 550V @ 10kW while back home it drops to 520V.
So I charged for about 45 minutes. The moment I pull out a Police van shows up behind me. "STOP POLIZEI". I was doing nothing illegal at that stage as you're allowed to drive to the inspection. Well, normally the inspection is in the same town, not 40km away. "Sir, your last inspection date was March 2019". "Yes I know, I have converted this car to drive on electricity and I'm taking it to be inspected". Silence... "Well you gotta to know I hear a lot of lies when I stop people" ... "ok, let me show you something" (I open the hood) "I guess you can see that this is not the OEM motor" "Urm... yeah, well let me see some ID". I hand her my ID card. "Sir your ID card has expired July 2019" "Oh, no thats terrible". The officers were rather young, I guess in their twenties. While I talk to the girl the guy starts inspecting the tires. "Sir, are these winter tires?" "Uh I don't know, it's the tires that came with the car". "Well the rear tires are dated 2004, do you know how dangerous it is to drive on tires that old?". And so on.

(EDIT June: the tires are 2014 dated, officer misread that)

In the end I get handed out a piece of paper that needs to be signed by the TÜV engineer. Alright, off we go (Ines joined me in the Diesel car). As we drive back to the Autobahn a large semi gets between us. On the on-ramp another semi driver decided to have lunch. While I can pass, the semi behind me can't. So can't Ines. Autobahn is not the place to pull over and wait for someone, especially not after a Police rendezvous like mine. So I keep going slowly. It doesn't help, shes gone. And she forgot her phone. And she doesn't know where to go. Good preparation.

I take the car to TÜV. He calls the Police to keep me out of jail (well, actually 60€ would have been the fine). I take the train back to Kassel. Ines comes to pick me up. I have to say I haven't driven the Diesel car for a while but it sounded very angry. "Oh yeah it sounds like that for a while now"... Give me strength, we want to drive 3000km in the next 3 weeks. We go to the nearby workshop. The exhaust has sheered off right behind the catalytic converter. Nice reminder that fossil tech is stupid and I did the right thing.

What a day. Results:
- Car drives beautifully on Autobahn, taking in 17 kWh/100km
- I failed at implementing ChaDeMo blind folded
- Two Police officers have a funny story to tell
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 »

That's great progress. Took weeks for me to get chademo working the first time. lots of trips to the local fcp:)
I'm going to need a hacksaw
User avatar
johu
Site Admin
Posts: 6711
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1537 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Please, please tell me what were the catches? :geek:

https://github.com/jsphuebner/stm32-car ... hademo.cpp
https://github.com/jsphuebner/stm32-car ... r.cpp#L116

I need to have it running by the time I drive to fully charged.

Things I know that are not standard:
- The "charge allowed by vehicle" signal will briefly engage for 2s after C1 (12V supply by charger) closes
- There are "alien" COB Ids on the bus, for BMS communication

Could any of these cause issues?

EDIT: just found another one - the "allow" signal was constantly reset. But I don't think I was in a state where that mattered, yet.
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: 6711
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1537 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

So the car is still sitting at the inspection facility 40km away from here. I talked to the engineer today. What is holding him back is the noise measurement. So he has done all of the other technical inspections and found a few issues both with the car itself and my changes to it. So I will pick up the car this Friday and bring it back here.
I hope there is nothing too serious and I can get the car registered once the current bans end.
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: 6711
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1537 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Just got another call from TÜV today. Apparently the 12V battery is drained and they can't start the car. What this most likely also means is 4 more 60AH LFP cells are scrap :( More updates tomorrow.

On other news I have started to write about the German road worthiness procedure: https://openinverter.org/wiki/Germany
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: 6711
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1537 times
Contact:

Re: VW Touran powered by Nissan Leaf

Post by johu »

Alright, good news today :)
I got the car back. One of the 4 LFP cells was dead, 3 survived.

At inspection they found quite a few items, but nothing too serious. The passenger rear brake isn't fully working, they don't like garden hose as cooling pipes etc.

I decided to work on ChaDeMo a bit more. Drove to the local Peugeot dealer who has a fast charger and tried. Results:
- It doesn't work when ignition is off. Not sure why
- I reacted to what I thought was an EVSE stop request by sending a stop request myself - wrong! It's apparently just a status bit.
- I failed to send a current request

With that fixed the EVSE started charging but not for long. Most energy I ever got from it was 0.5kWh. It did successfully ramp up to 70A and reported the same DC voltage as the BMS but it always turns off after a short while. The target charge voltage is set to 410V, limit voltage to 420V but it turned off at about 380V. It just says "charging complete" and thats it. Any clues?
Attachments
charging.png
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Post Reply