ZX10R Info Display

Client requires a visible indicator of the throttle position for a 2006 ZX10R.

They have also requested to use an old EA kit for O2 readout (LED Seven Segment 3 char display).

We will combine these functions as well as RPM into one unit.


Throttle position sensor inputs:

From the workshop manual (DFI section) we learn the position sensor outputs from the center middle of a standard type potentiometer:

Main Throttle Sensor Output Voltage Connections to ECU Connector
Meter (+) → Y/W lead (terminal 26)
Meter (–) → BR/BK lead (terminal 34)

Input Voltage at Sensor: Standard: DC 4.75 ∼ 5.25 V ECU pin 7 (BL) (we measured this and on the target 2006 ZX10R it is 4.99-5.00v (fluctuating))

Output Voltage at ECU: Standard: DC 0.65 ∼ 3.90 V (at idle throttle opening to full throttle opening)

NOTE: The throttle sensor is operating correctly if the following voltages are obtained:

  • DC 0.65 V (or slightly higher) with the throttle at the idle position.
  • DC 3.90 V (or slightly lower) with the throttle at the fully open position.

We are currently assuming it as a linear output.


Solution: read the value into a AD and output a % 0-100 visually with 0.65 being 0% and 3.9v being 100%.

Additional: Provide the option to recalibrate on power up by:

  1. Read value on power up after a short delay and set this as 0%
  2. Display message re "calibrate now"
  3. Wait for change, if is over 3v then assume highest value represents 100%
  4. Output calibration values for 5 seconds.

Additional: If the min/max limits at any time exceed the values given, recalibrate to those values.

Building Blocks:

  • No 5v voltage regulator required as we have the 5v regulated supply at ECU pin 7 (BL).
  • Input buffer
  • Processor to take analogue voltage from buffer and convert to a %.
  • Display

MPU chip requires:

  1. 5v VDD
  2. AD conversion
  3. Ability to output to remote display (Can on board or SPI to Can controller)
    • Nokia 5110 or LCD or LED display (display other than LED will allow additional information later ie O2 Sensor)
    • Buttons for mode selection (later)
  4. 5V so I dont need to scale or offset the input..
  5. Sufficient rom/ram/functionality to write to log to SDCARD or USB at a later date.

Input buffer selection:

Input signal unity gain buffer (Op Amp in negative feedback mode).  Ideally we would use an Instrumentation Op Amp but as we have dont have any available domestically we will use an Op Amp.

The Op Amp needs to be single supply (5V), and able to output 0.65-3.90v preferably with Vcc at 5v.

We have LM358N/P (Dual Op-AMps) on hand, however Output max is Vcc -1.5v so either we run this at 12v or find another part.  As the LM358 is good up to 32v we will simply run it off the bikes regulated supply ~12v.

Version 1 (proof of concept):

  1. Input buffer - LM358 running off 12V supply
  2. Microchip 40 pin 16F887 PIC displaying on local Nokia 5110 display (later we will move to either a PIC18F886 or PIC18F2539) - both are 28 pins).

Loom connections:

What  2006 ECU Pin 
 ~12v  Pin 15 or 32 BR/G
 5v  Pin 7 BL
 Gnd  Pin 34 BR/BK
 Throttle sensor output  Pin 26 Y/W lead

Nokia 5110 pins connected to RJ11 6p6c jack:

Nokia Pin   Function  Function note RJ11 pin  Connection note  
 1  Vcc  3.3v (5v ok)  6    
 2  Gnd    5    
 3  SCE  Chip enable, active low  1  Tied high via 10k  
 4  Reset  Active low    Tied high via 10k   
 5  D/C  Data (High) / Command (Low)  2    
 6  SDI  Data in  3    
 7  SCLK  Data clock  4    
 8  LED +      Connected to Vcc via 270R  


Code:

Using CCS C 4.057, with the Nokia driver library we adapted last year..

Initialise

  • Define default values for Throttle min / max
  • Initialise AD pin
  • Initialise Nokia display
  • Display welcome message
  • Display reminder to calibrate throttle.
  • Delay

========

Main:

  • Read AD value
  • Is Value < Min? then set Min = value
  • Is value > Max then set Max = value
  • Convert AD to % (see note below)
  • Add % value to last xx % values
  • Check if is time to update the display:
    • Calculate average % over xx values
    • Update display
    • Display %
  • Repeat

Nokia Library:

  • Modified for this project to display double line fonts for readability (we based our font on ARIAL Bold 16 pt as converts nicely to 10x15 pixels) using trial version of GLCD Font Creator.


Converting AD value to a % (Reference voltage is 5V, and we have a 10bit resolution on the AD converter.)

Initial Min: 0% throttle should return 0.65v which as a raw AD value is (0.65 / 5)*1024 =  133.12 = ~133

Initial Max: 100% throttle should return 3.90v which as a raw AD value is (3.9 / 5)*1024 =  133.12 = ~798

From a particular reading (R) , we can then determine the throttle % (T) as: T = ((R - Min) / (Max - Min)) * 100

As we want to use integers and not fractions (8 bit MCU) we will represent the above equation as:

      throttlepercent = (((reading - throttlemin)*50) /((throttlemax - throttlemin)/2));

Issues: The sample potentiometer we are using jumps around a bit so the displayed % moves a lot.  To help correct we will add a circular buffer to store the last 16 percentages and we will display the average of this.  (Unfortunately this introduces a bit of latency so we may have to reduce if is a problem).

Note on Min/Max values:  We will set our initial min/max at 135/700 respectively and expect the autocalibration routine to adjust as necessary.

Version 1 code works fine.


20090220 Upgraded to a PIC18F4610 and with the extra horsepower have tweaked both the display update frequency (slowed it down a lot) and increased the circular buffer with the result being no latency and minimal jumping around.


20090222 Control buttons:

We should be able to use the DC / SDI / SCLK lines to access 3 tact switches included on the Nokia display module.  We will use an active high buffer (tristate) driven by SCE to isolate these from the Nokia display.  The switches will be tide high via 10k each and will be pulled low on activation.

We don't have an active high buffer (74x126) but we do have a 74HC125, so we will invert SCE (don't have an inverter on hand) through a 74HC02 Quad Nor.

The above setup when tested shows that it works for buttons on DC & SCLK but going low onbut for some as yet unknown reason, pulling SDI from high to low even when SCE is high corrupts the display, so we will use two buttons on DC & SCK only.  Actually even SCK causes some issues occasionally so I added a few nops every time the Nokia routines pull CS low so let the 74HC125 fully disable the button inputs.


Next Step: Test input OP-AMP circuit.



O2 Sensor input:

In this instance the bike does not have an O2 sensor fitted so we will not have to cohabitate with the ECU.

A standard zirconium O2 sensor outputs maybe 0 - 1v, with 200mv being lean, 0.45 (14.7 = Stoichiometric), and 800mv being rich.  However the outout curve moves agressively either side of 0.45v so doesnt give accurate readings other than lean/rich.  Needs a high impedance input as well.

For the future we note the availability of wideband sensors:

A LSU-4 (Bosch) Planar Wideband (also NTK UEGO Universal Exhaust Gas Oxygen) varies in a much more linear fashion but needs active driving..

Note: Volkswagon part: 021-906-262-B

Controller chip is Bosch CJ125