Friday, April 17, 2009

Traction Control Connections

Weeling in mounted on my Yamaha R6, I still have to decide how to operate the Traction Control and how to connect it to the byke ECU.
Thinking and rethinking I had the idea to connect the traction control as the Electronic Shift units are doing. I found the following instructions:

so, if I have correctly understood the idea is to cut the power supply of the fuel injectors or of the spark coils.

Some friend told me that avoiding the spark firing could be that the spark get wet and therefore damaged... not really nice!!! Most likely is better to interrupt the fuel Injection.

From the R6 manual (2003 model), I have extracted the following electrical circuit:

(where "12" is the POWER SUPPLY RELAY and "18" are the fuel injectors).

The idea could be to use an HV P-MOS transistor and turn off the power supply of the fuel injectors as:


The driver circuit could look like:


Someone have some idea or suggestions?

Friday, April 10, 2009

Yamaha R6 (2003 Model) Water Temperature Sensor

Finally I was able to connect my "Welling" to the Yamaha R6 (2003 model) ECU in order to acquire the water temperature.
I explayin how to do, looking to the Yamaha R6 electrical circuit manual, the water temperasture sensor (#23 in the picture) is directly connected to the ECU:

Therefore is quite simple to connect it: just take a cable and solder it on the ECU connector G/W (Green/White- mainly is a green cable with a little white stripe) cable, bring it to the XE164 KeyChain and compute the temperature as:
uiTmp = (unsigned int) ( ((float) ( uiTemperature >> 4) ) * (-1.32) + 127.42 )
/*
uiTemperature is the 12-bit ADC converted values, before temperature calculation I reduce the precision to have stable temperature visualization (I do not need so high precision)
*/


I've used such equation since I have desumed from the Yamaha manual the following NTC curve (it declares that the NTC has 6.37KOhm at 0°C and 0.35kOhm at 80°C):
Temperature Vs. NTC resistance

The same could be plotted as Temperature Vs. ADC Voltage
Temperature Vs. ADC Voltage

Looking to the same, but plotting Temperature Vs. ADC value in the range 60°C .. 110°C (the most important temperature range), we get:
Temperature Vs. ADC value
and this is what I measured:

After a little rearrangement, I fit it better:

Now I calculate the SLOPE and the INTERCEPT (I assume a linear equation to have a simple calculation):
SLOPE = -1.32
INTERCEPT = 127.42

Thursday, April 2, 2009

Traction Control Settings (Con't)


As promised, here it comes the debug... So, the only bug I discover was that in my calculation I have used 10-bit ADC resolution, but in reality the XE164 has 12-bit resolution (from 0 to 4095), so the only modification I did was to shift the value as:
uiTmp = ( ADC1_RESRA0 >> 2 ); // Get latest Manettino value
Moreover I have added a piece of code to show on display the TC settings, the meaning is: At the end the weeling electronics in its little box is:

Wednesday, April 1, 2009

Traction Control Settings

As you can immagine, I'm continuosly thinking on how to tune the Traction Control (TC). One idea could be to flash some key parameters or to control it more easily. Looking around I've seen this very interesting solution:
(Bazzaz)
I like since seems user frendly... I try to go for it!


Step 1
first is to select the adjustment switch: I go for a 10K potentiometer since it is cheap and I think it ca do all what I need. In order to give fashion to it, I like to call it as "MANETTINO" like Ferrari does for a similar stuff they have on the dashboard (by the way, manettino means "tiny handle").

Step 2
I try to define what I really need: I like to be able to change the TC threshold (I mean when it starts to work) and the sensibility (I mean how much strongly reduces the engine tourque).

Step 3
Potentiometer working definition:
- each 40° of potentiometer revolution I like to change the TC threshold as:

Fig.1) depending on manettino position, the potentiometer output voltage is changed from 0V to 5V corresponding to OFF, 110%, 120%, 130%, 140%, 150% and 160% threshold factors.


- inside each 40° of potentiometer revolution I like to modulate the TC sensitivity giving a progressive change in both sensitivity:

Fig.2) depending on manettino position, the TC threshold is changed from OFF, 110%, 120%, 130%, 140%, 150% and 160%. Once the threshold is selected, the sensibility can be adjusted from 0 to 1


Step 4
The circuit to be added is quite easy: I add just one potentiometer from 5V to GND, the cursor is connected to the ADC_1 channel 0.

Step 5
Off-line calculation: in order to write the software I need to write down all the variables and try to build up a model: I use a spreadsheet - what else!
This is what I generate, I know is not so easy to understand, but it shows how the manettino position is converted to voltage and to ADC value and then to TC threshold and TC sensitivity:


Step 6
Now is time to think about the software changes. First I need a couple of new static variables:
- uiTC_Threshold
- uiTC_Slope
and then I need to configure the ADC_2 for cntinuous conversions, I use DAvE as usual:

I like to limit the "manettino" changes only when the bike is not running, therefore, in the OFF state I add the following lines:
uiTmp = ADC1_RESRA0; // Get latest Manettino value
if ( uiTmp > 150 )
{
uiTC_Threshold = 1000 + ((unsigned int)( uiTmp / 151 ) * 100); // 110% is 0.74V
uiTC_Slope = ( uiTmp % 151 ); // Remainder
} else {
uiTC_Threshold = 0;
uiTC_Slope = 0;
}


Step 7
I need now another timer to modulate the engine tourque as calculated by the TC, I use Timer_7 from the CC2 unit:

The selected resolution is 15.515 usec, therefore to conver the ADC value into timer counter value, I just need to multiply by 432:
// Traction Control Timer Calculation
CC2_vLoadTmr ( CC2_TIMER_7, uiTC_Slope*432 );

The last stuff is to toggle port P10.7: the software turns it on, the Timer 7 Interrupt Service Routine turns it off:


IO_vSetPin( IO_P10_7 ); // TC-OFF to HIGH

...

void CC2_viTmr7(void) interrupt CC2_T7INT
{
// TC-OFF signal to LOW after timer expires
IO_vResetPin( IO_P10_7 ); // TC-OFF to LOW
} // End of function CC2_viTmr7



Step 8
well, last step is to test it! I'll do tomorrow...