README file to accompany vebin.c
vebin.c and this file are copyright 2003 Perry Harrington.
Original source code and this document are at:
http://www.dainst.com/info/programs/ve_fitter/
Due to SPAM spiders you can contact me via the Feedback Form at http://www.dainst.com/
USAGE
Vebin generates a starting point VE map for use with the MegaSquirt ECU. It's an
8x8 grid of values which represent the amount of fuel to inject, relative to max
power at stoic. If your REQ_FUEL constant is correct, the 100% value in the VE
map represents a 14.7:1 AFR at that MAP and RPM combination.
Vebin requires a dataset of torque values. These are RPM vs Torque. You must have
a minimum of 8 values, but more (many more) is preferrable so that you get a more
accurate output.
Vebin can accept 2 arguments and reads the torque curve dataset from the keyboard
input.
Hence, to execute Vebin:
vebin < tq.txt
The 2 arguments are -c and -v.
-c is the canonical mode. The output is a table of RPM vs MAP values that is
ordered the same as the MegaSquirt. This is useful for human viewing.
-v is the VEX mode. This mode generates a VEX format file for use with MegaTune
and other programs that understand this format.
To create a VEX file you would:
vebin -v < tq.txt > motor.vex
HOW IT WORKS
The program takes the torque values and draw a linear line between them. It then
calculates the error between the dataset and the derived data. The point with the
highest error becomes a vertex in the derived dataset. The program then iterates
until it has satisfied the required number of data points and then prints out the
RPM values that correspond to the derived vertices.
To generate a VE map the program takes a max MAP value (defined at 100Kpa) and
divides it into a number of bins. The number of bins defaults to 8. It then
finds the largest torque value of all the points in the derived dataset. For each
point in the VE table it determines the difference between the max torque value
and the current torque value and then factors in the MAP multiplier. The relationship
between MAP and VE is linear.
Hence:
VE = MAX VE / (Max Torque / Current Torque) * MAP
Simplified Example:
Max torque = 310 lb/ft
Current torque = 285 lb/ft
Max VE = 100
MAP = 37 Kpa (.37 BAR)
310 lbft (Max torque) / 285 lbft (Current torque) = 1.0878 (Torque multiplier)
100 (Max VE) / 1.0878 = 91.93 (VE)
91.93 (VE) * .37 (MAP) = 34 (VE)
NOTE:
It is convention to use all multiplication in engine management equations. I have
illustrated the equation above with division for simplicity. This is why you will
see most factors called multipliers in engine management, as they are multiplied
factors of an equation.
To divide using multiplication you simply multiply by the compliment of the division.
To get the compliment, divide by 100.
Example:
100 / 50 = 2
50 / 100 = .5
100 * .5 = 50
100 / 2 = 50
50 / .5 = 100
50 * 2 = 100