Difference between revisions of "Touran Conversion"

From openinverter.org wiki
Jump to navigation Jump to search
(ECU connector)
(Fast Charging)
(2 intermediate revisions by the same user not shown)
Line 241: Line 241:
  
 
In VCU a base duty cycle of 34% is generated, with one channel falling 0.06% per % SoC and the other rising at the same rate.
 
In VCU a base duty cycle of 34% is generated, with one channel falling 0.06% per % SoC and the other rising at the same rate.
 +
 +
== Fast Charging ==
 +
[[File:ChaDeMo socket in Touran.jpg|thumb|Nissans ChaDeMo socket just fits into the original fuel filler location]]
 +
I decided to use ChaDeMo for fast charging since the Nissan drive stack came with a ChaDeMo connector and ChaDeMo is pretty simple to implement. I had to twist the socket by 90° because that was the only way to fit it. I soldered a shielded Ethernet cable to the control lines and extended the power cables to reach the relay cluster in the exhaust tunnel. I didn't use original relays but cheap 200A relays keeping in mind that they will never have to interrupt the HV current flow. They just prevent you from getting electrocuted when sticking for fingers into the ChaDeMo socket.
 +
[[File:CAN repeater.jpg|thumb|This PCB contains a CAN repeater, simple relay economizer and drive inhibit logic]]
 +
Next I had to go about implementing the protocol. The charger will supply the car with 12V and up to 2A. This current must suffice to operate the input relays. Therefor relays can't be connected as is but their hold current draw is reduced with a simple economizer: two 680µF caps in parallel to 40 Ohm resistance. The caps will generate an initial pulse for the relays to pull, the resistor leaves enough current (200mA) for the relays to stay closed.
 +
 +
Next up is drive away protection, I decided on a simple hardware logic: when the plug is inserted, the DC relays will not close or be opened if they are already closed. It is a bit dangerous to the relays because they may be forced to interrupt current e.g. if your HV cabin heater is still on at that time. ChaDeMo pulls a pin to GND when inserted. I use that to switch on a small PNP transistor which in turn switches an NC relay which in turn cuts 12V power supply to DC relays. You can see the small relay below the large caps.
 +
 +
Next up the "charge allow" signal. It must be pulled to ground to allow the charger to start. I misused one of the fuel gauge signals for the purpose. It switches on a PNP/NPN pair.
 +
 +
Finally the CAN part. I decided to implement the logical protocol on the existing VCU as it has a CAN interface which extends to the back of the car anyway (because of the BMS). It is powered up by the power that ChaDeMo delivers and detects the charge situation by checking the inverter voltage - it will be 0 because the inverter is not powered up.
 +
 +
Now comes the challenge of using the CAN bus for ChaDeMo. Luckily it is also 500kbit/s and there are no mutual IDs between ChaDeMo and the BMS. But we can't just connect it to the charge port as is because the charger adds additional termination and thus the bus would be terminated 3 times. Also it is not good practice to leave parts of the bus dangling about. So I build a [http://www.ti.com/lit/ug/tidudb5a/tidudb5a.pdf CAN repeater] that creates a new physical bus.
 +
 +
The VCU now talks to the BMS which constantly updates the charge current limit. That info is simple relayed to the ChaDeMo charger. If connection to the BMS is interrupted, the charge control signal is turned off.
 +
 +
Trap for young players: The 5V supply to the VCU seems to leak back into parts of the 12V system. So the vacuum pump, also controlled by the VCU turned on and depleted the 5V supply. So I added extra logic in firmware to keep vacuum pump off in charge mode.
  
 
== Faults ==
 
== Faults ==

Revision as of 08:39, 23 May 2020

I will start loosely collecting infos on the VW Touran from 2004.

Throttle Pedal

The throttle pedal is analog, its signals are put onto the CAN bus by the ECU. I chose to remove the latter so I will have to look into reading the pedal directly. Here is its pin map:

Throttle pedal pin map
Pin # Color code Function
1 green/white 5V
2 yellow/green 5V
3 brown/blue GND
4 white/blue Throttle 1 0.75V-4.1V
5 green/blue GND
6 blue/black Throttle 2 0.38-2.05V

ECU connector

The ECU is connected to the vehicle with a 94-way connector. I have traced out a few signals.

Touran ECU with Rev 2 main board
Touran ECU with Rev 2 main board
Pin # Color code Function
11 - Throttle GND (Pin 5)
12 Throttle 2 out (Pin 6)
13 Throttle 5V (Pin 1)
33 Throttle GND (Pin 3)
34 Throttle 1 out (Pin 4)
35 Throttle 5V (Pin 2)
31 Vacuum sensor GND
37 Vacuum sensor 5V and P5.7*
53 P5.5 (I use it for fuel level signal A)
54 P5.2 (I use it for fuel level signal B)
76 P5.1 (I use it for DC switch switched GND)
80 P5.4 (I use it for CANL towards Nissan BMS)
81 P5.3 (I use it for CANH towards Nissan BMS)
83 Vaccum sensor signal
86 Ignition On - provides enough power to run the main board
87 While the ECU was connected, bridging this signal to 12V engaged the main 12V supply of the ECU. This behaviour could not be reproduced without ECU
67 CANL
68 CANH

I will use a revision 2 mainboard for interfacing those signals.

*Underneeth the car there is a 10-pole connector that used to plug in to some exhaust sensor controller. I call this "P5".

P5.7 is connected to the main board "VCU" 5V rail. I make use of this to power the VCU from the ChaDeMo charger.

Power steering

The power steering is electric and only draws power when you're actually steering. It still worked after engine and ECU were removed. Winner!

As soon as you produce CAN message 0x280 it expects rpm to be above about 600rpm, otherwise there is no power steering.

CAN bus

The car has various CAN buses but we only care about the motor CAN bus (500kbit/s). Here are some useful signals I found:

Some Touran CAN messages
COB Id Len Function Notes
0x1A0 1 Byte 1, Bit 3: Brake pedal switch Produced by whoever
0x280 Bytes 2 and 3: RPM*4 Produced by you, Controls the rpm gauge. Must be > 600 for power steering to work
0x284 6 Byte 0, 1: Counter 0-F in each

Byte 2-5: 0

20ms. Can also be 8 bytes long.
0x288 Byte 0: sequence 0x27, 0x46, 0x8F, 0xD7

Byte 1: Temp Gauge 4/3 x temp + 48

Produced by you, Controls temp gauge. Gain 4/3, offset 48
0x380 8 Byte 0: 0

Byte 1: 0x65

Byte 2: Throttle 0-0xFE

Byte 3-6: 0

Byte 7: Throttle delayed or filtered maybe + idle throttle as it's never 0

It's not actually that constant but apparently sufficient for DSC
0x38A Byte 1, Bit 0: Cruise on/off, Bit 1: Disable button, Bit 2: Set-, Bit 3: Set+
0x480 8 Byte 0: sequence 0x10, 0x68, 0x94, 0xC0

Byte 1, Bit 2: EPC, Bit 3: engine

Bytes 3,4: Consumption signal - incremental. Increasing by 28 per 10 ms results in 10l/h

Byte 5: 0

Byte 6, Bit 2: Cruise light, Bit 4: Message "Motorstörung Werkstatt!"

Byte 7: XOR of Bytes 0-6

Controls various indicator lights and fuel consumption display
0x488 8 Byte 0: Counter 0-F << 4 + 8

Byte 1-4: 21, 21, 7E, A6

Byte 5-6: 0

Byte 7: Counter 0-F << 4

0x572 Byte 0, Bit 3: Key switch in start position
0x580 8 Byte 0: 0x80 + counter 0-F

Byte 1, 2: 0

Byte 3: sequence 0x0f, 0x28, 0x7f, 0x28

Byte 4: sequence 0x1e, 0x10, 0x00, 0x10

Byte 5: sequence 0x70, 0x56, 0xf0, 0x56

Byte 6: sequence 0x0c, 0x48, 0xa7, 0x48

Byte 7: sequence 0x46, 0x90, 0x28, 0x90

100ms

More info here: https://wiki.openstreetmap.org/wiki/VW-CAN

Software here: https://github.com/jsphuebner/stm32-car

CAN bus tap

I wanted to tap into the CAN bus without cutting wires. The power steering assembly is connected via a 6-pole "VW" connector that has the CAN bus on it. The respective part numbers are 1J0973713 and 3B0973813. So I looped through the 4 signals irrelevant to me and directed the CAN bus towards the inverter. The Nissan wiring loom also has a CAN bus return that I then looped back to the power steering.

Battery Integration

Rear Battery Mounting

As opposed to the original plans I currently only mounted one full Nissan Leaf pack in the fuel tank space. I used the existing 5 M8 holes that used to hold the fuel tank and part of the exhaust. In addition I drilled 3 holes into the seat carrying structure that exit exactly between the two battery bricks. Another 3 M10 screws fix the two bricks to the chassis there. So 8 bolts fix the mounting angles to the chassis.

Front Battery Mounting

The mounting angles are screwed into the battery brick with 2 M6 bolts each. There are 11 mounting angles, so 22 M6 screws fix the batteries to the mounting angles.

Positive and negative exit on the cars driver side. Positive passes through Nissans service disconnect jumper that also contains a 225A fuse. Next up the 2 poles connect to Nissans original DC switch gear in the exhaust tunnel and connect to the inverter using Nissans original DC cable.

I reused the original spaghetti wires and Nissans BMS (they call it LBC). It lives on top of the front battery brick. Its current sensor is bolted onto the positive DC switch in the exhaust tunnel. It also still monitors the safety disconnect. Its power supply and communication wires run to the fuel tank service hole under the rear seats. From here it connects to the motor CAN bus. It also runs at 500kbit/s and has no mutual object ids.

Fuel Gauge

Unfortunately the fuel gauge cannot be controlled via CAN bus. Instead there is a special fuel controller under the rear seats. It has a black ground cable, a red cable that used to enable the fuel pump and three smaller wires that used to connect to an analog pot inside the fuel tank. The instrument cluster is very picky about the correct resistance and will simply bottom out the gauge if out of range. Afterwards the instrument cluster must be restarted to forget the error.

Luckily the resistance is measured vs. GND, i.e. the two sense wires (the darker ones, the red is GND) must be pulled to GND via some resistance. I use a pair of BC547 NPN transistors that connect to a 17kHz PWM via a 20Hz low pass filter. Thus their "resistance" to ground can be controlled via the dutycycles of those PWMs. When the resistance on both is equal, about 500 Ohms, the fuel gauge is centered. if it goes lower on one it must become higher on the other one accordingly.

In VCU a base duty cycle of 34% is generated, with one channel falling 0.06% per % SoC and the other rising at the same rate.

Fast Charging

Nissans ChaDeMo socket just fits into the original fuel filler location

I decided to use ChaDeMo for fast charging since the Nissan drive stack came with a ChaDeMo connector and ChaDeMo is pretty simple to implement. I had to twist the socket by 90° because that was the only way to fit it. I soldered a shielded Ethernet cable to the control lines and extended the power cables to reach the relay cluster in the exhaust tunnel. I didn't use original relays but cheap 200A relays keeping in mind that they will never have to interrupt the HV current flow. They just prevent you from getting electrocuted when sticking for fingers into the ChaDeMo socket.

This PCB contains a CAN repeater, simple relay economizer and drive inhibit logic

Next I had to go about implementing the protocol. The charger will supply the car with 12V and up to 2A. This current must suffice to operate the input relays. Therefor relays can't be connected as is but their hold current draw is reduced with a simple economizer: two 680µF caps in parallel to 40 Ohm resistance. The caps will generate an initial pulse for the relays to pull, the resistor leaves enough current (200mA) for the relays to stay closed.

Next up is drive away protection, I decided on a simple hardware logic: when the plug is inserted, the DC relays will not close or be opened if they are already closed. It is a bit dangerous to the relays because they may be forced to interrupt current e.g. if your HV cabin heater is still on at that time. ChaDeMo pulls a pin to GND when inserted. I use that to switch on a small PNP transistor which in turn switches an NC relay which in turn cuts 12V power supply to DC relays. You can see the small relay below the large caps.

Next up the "charge allow" signal. It must be pulled to ground to allow the charger to start. I misused one of the fuel gauge signals for the purpose. It switches on a PNP/NPN pair.

Finally the CAN part. I decided to implement the logical protocol on the existing VCU as it has a CAN interface which extends to the back of the car anyway (because of the BMS). It is powered up by the power that ChaDeMo delivers and detects the charge situation by checking the inverter voltage - it will be 0 because the inverter is not powered up.

Now comes the challenge of using the CAN bus for ChaDeMo. Luckily it is also 500kbit/s and there are no mutual IDs between ChaDeMo and the BMS. But we can't just connect it to the charge port as is because the charger adds additional termination and thus the bus would be terminated 3 times. Also it is not good practice to leave parts of the bus dangling about. So I build a CAN repeater that creates a new physical bus.

The VCU now talks to the BMS which constantly updates the charge current limit. That info is simple relayed to the ChaDeMo charger. If connection to the BMS is interrupted, the charge control signal is turned off.

Trap for young players: The 5V supply to the VCU seems to leak back into parts of the 12V system. So the vacuum pump, also controlled by the VCU turned on and depleted the 5V supply. So I added extra logic in firmware to keep vacuum pump off in charge mode.

Faults

On this connector we find switched 12V, GND and the oil pressure signal (top right)

After powering up the engine I got two error messages: STOP low coolant and low oil level. The first can be solved by filling the reservoir with water. The second is solved by turning off oil sensor support in the instrument cluster.

I programmed the instrument cluster to ignore the missing sensor. You need a CAN OBD adapter with matching software. Then in adaptation channel 39 change value to 0 (=sensor not present). Found here: http://wiki.ross-tech.com/wiki/index.php/VW_Golf_(1K)_Instrument_Cluster

Also the oil pressure switch needs to be faked. Below about 800rpm no oil pressure must be reported. Above 800rpm it must be by pulling the signal to GND. Otherwise you get a "STOP!" message. There is a few seconds time to gracefully switch over. Oil pressure switch is on plug on the front left.

I have implemented the oil pressure faking in my custom ECU.

Update: The threshold for the "dynamic oil pressure warning" can be adjusted down to 0, apparently. In that case it could just be clamped to GND, I reckon.

Counter part of the shown connector has part number 3C0973837.

DSC light

A bit harder to fake was the messages for the ABS/DSC system. It seems all messages originally produced by the ECU need to be on the bus. That is Ids 0x280, 0x284, 0x288, 0x380, 0x480, 0x488, 0x580 and 0x588. So far it seems their content doesn't have to match exactly. See table above.

More connectors

There is another 6-pole connector whos counterpart has part number 1J0973833. Four of its pins end up inside the ECU so it is useful for getting "miscellaneous" signals out of it. I put the oil pressure simulation and DC switch on it.

There is another 10-pole connector underneath the car that has quite a few pins ending up in the ECU. It used to be connected to some kind of exhaust sensor. The mating plug has part number 6X0973815.

I will use it for DC switch, fuel tank fill level simulator, and CAN bus (towards Nissan LBC). I'm doing the latter because the current CAN bus layout gets disturbed by EMI.