• Samples and Examples

Example: Motronic Axis Calculation (Download)

Axis calculation for Motronic and other Bosch binaries is done in a different manner than most. In this example, we'll take a block of 16 bytes, each byte representing the corresponding raw value in the calibration for a cell in an RPM axis. The bytes are (in decimal):

05 15 05 29 11 12 04 06 06 09 06 07 07 06 10 98

First, we need to calculate the first cell in the series, which is actually the last cell in the axis (cell 16 in this example). This is represented by the value 98 above. The RPM value for this cell is calculated by the following equation:

(255 - 98) * 40

where 255 is a constant (the max value of a byte), 98 is the value from the calibration, and 40 is the RPM scalar (a constant). This calculates to 6280 RPM.

Each cell after the first in the series is calculated using the following equation:

PreviousCell - (X * 40)

where PreviousCell is the output from the previous cell in the series, X is the value from the calibration for this cell and 40 is the same constant RPM scalar. So, to calculate the next cell in the series (cell 15), we have

6280 - (10 * 40)

or 5880 RPM.

The next cell (cell 14) is calculated the same:

5880 - (06 * 40)

or 5640 RPM. And so on. The download for this example uses the per-cell equation engine in TunerPro to calculate the first cell in the series, and uses a common global table equation for the rest of the cells. The first cell in the series is calculated via (255 - THIS()) * 40, and the rest of the cells are calculated using CELL(ROW()+1;COL();FALSE) - (THIS() * 40). This example specifically uses a row-based table (1 column, 16 rows). If you were doing this with a column-based table (16 columns, 1 row), the common equation would instead be CELL(ROW();COL() + 1;FALSE) - (THIS() * 40).

 
Copyright 2002 - 2011 Mark Mansur