Electric Power Steering
As part of the implementation of the Vauxhall Corsa C Electric Power Assisted Steering (EPAS) into the car, I need to consider switch gear. The ignition switch only carries signal currents, indicating the Body Control Module (BCM) the switch position. The electrical ‘heavy lifting’ is handled by BCM controlled relays. I need to retain the ignition switch as-is, so I will have to find a way of replicating this function. I could wire a relay for ignition and engine cranking to the ignition switch, but there are other areas to consider:
The Corsa C uses a series of resistor ladders in the control stalks (indicator, main beam, cruise control (where fitted), wiper and washer).
I managed to track down the following internal schematic from the Locost Builders forum.
S229.1 Switch - High beam
S229.2 Switch - Turn signal
S229.3 Switch - Cruise control
Basically, this results in a resistance for each switch position which is nice and simple (read cheap) when engineering the switches themselves, but adds some complexity to the electronics. The control stalks appear to be physically interchangeable with the Vectra B counterparts, so it is possible to retain the Gardner Douglas approach and pass the bulb and wiper currents through the switches. However, this would not allow the use of a ‘lane change’ flick to flash the indicators, dictate the use of manual wipers (no rain sensing), remove the ability to use a modern hazard switch, and makes automatic wipers a non-starter. Electronic engineering is the way forward!
One way the indicator could be connected to a ‘new’ BCM is to apply a voltage to switch pin 3 and add a suitable resistor between pin 2 and ground. The BCM can then read the voltage across the pull-down resistor and determine the switch positions – easy!
Not quite. The BCM has to, among other things, try to catch quick switching events (e.g. a lane change ‘flick’ of the indicator) so it would have to continuously poll the voltage, and still may miss events due to the time involved in the Analogue to Digital Conversion. In addition, this then doesn’t leave time for other jobs in the BCM such as measuring the other switch positions, managing the bus communications, or working out the required light configuration.
I needed a new plan.
A better way to react to asynchronous events is with an interrupt. Some microcontrollers have the ability to interrupt when the voltage at a pin changes level when compared to a reference voltage. Upon a switch event, the change in voltage at the output of the switch would change the output of a comparator, invoking an interrupt. Perfect! Unfortunately, the
number of comparators available on my options of microcontrollers for the BCM brain (Arduino / Teensy / Pyboard) is limited (one or two in some cases), and I would like to apply this across at least five inputs in the BCM, it is not a reasonable route. Oh dear!
I can take the principal of the comparator interrupt and build an external circuit to achieve much the same effect. Since a Pin Change Interrupt is available on most digital pins of the micros, I have a way forward. Joy!