MegaTune/Development

Developer section / Beta Ini files

Locking / Status:

Write your name here when you are actively working on the files

BUGS Found:

Assigned TODO tasks: long term TODO:

Proposed features

Beta files


There is an error in the .ini file - the line

map = { (kpafac/ 255) * mapADC + kpaofs}

should probably be

map = { (kpafac/ 255) * (mapADC + kpaofs/8)}

Or else the readings in megatune will be wrong if the offset calibration is used

BTW, why use the sampled value directly? and not the real value in KPA?


MAP saga

The r14 and r15 ini files still bad.

Firmware calculations: just changed, see fuelcalc.c and GenBoard/Manual/Config/ManifoldAbsolutePressure .

The way we it could be done in Megatune: it recieves sensor8 value of map; sensor8 = sensor11 >> 3

map = { (mapADC * kpafac) / 128 + kpaoffs/4 -32 }

But functionality needs to be tested. Assumed map is needed in 1 kPa unit (not in 250Pa finer resolution, as in firmware).

It's obvious that we can't get the calculation right in megatune, and sending the raw value is bad anyway.

It's best time to break up with the broken 8-bit sensor-raw value, and send the precise and "guaranteed to match what firmware believes" 16 bit engine.kpa250 value to megatune I think megatune will see it as 2 independent 1byte values (x,y), and we make a computed kpa=x*256+y. It's nice for logging as well. 2 kPa resolution is almost useless when one likes to measure air-filter restriction (measure MAP at WOT in function of RPM).


Old ini-s

KPA_CONFIG_RESOLUTION=2 must not be default - it confused every user who tried.

If we don't directly maintain the ini, but generate the ini file from template (maybe with C preprocessor? or perl?), that has say %%KPA_CONFIG_RESOLUTION%% which gets substituted, than maintenance is not a headache. Actually the example my_make defines KPA_CONFIG_RESOLUTION in a bad way(== instead of =), which results in 1kPa. For 1 kpa resolution, changes needed in some mapBins* lines from 2.0 to 1.0 to get good kpa reading and easier tuning. Note that the r007 ini seems to pretend that some config variables (eg. ego_maxmap) are 1.0 kPa resolution that are 2.0 when KPA_CONFIG_RESOLUTION is defined as 2.


mmtf - the way to configure other tables with old megatune that only knows about VE table

Often used with megatune 2.16 and 2.20.

mmtf (menu megatune fool) makes it possible to trick old VE-only megatune to think it talks to the VE table (j[]) while it is in fact talks to ignition advance (n[]) or lambdacorr (l[]) table.

We keep an internal pointer (called megatune_table), which default points to ve.ref_table (so default behaviour is consistent):

Don't enter the space, only provided on command boundaries for easier reading.

The mtt. command switches to n(,j,l respectively) table and the mmtf fool megatune to see that table instead of the default j[].

You better only issue mtf command when the VE-tuning screen in megatune is closed. Otherwise you risk writing data into the ignition table that you read from the injection table previously, or the other way around, not good..

Most convenient to issue the table-switching command from a directly attached KeyBoard. Issuing it from TerminalProgram works, but more strokes:


Lambda info should live on a subpage of GenBoard/Manual/Tables

Lambda table is important when the system learns the VE, or when mixture is controlled according to the WideBand lambda sensor even at high-power loadsites.

The original combined (VE / lambda) value is useless for this, since the ECM cannot figure out from that what lambda-target the user wants. This was no issue for original Megasquirt, since it cannot learn, nor control for a (MAP, RPM) dependant WBO2 target.

AFR=14.7 * Lambda for gasoline. (Stoich is lambda=1.0 or AFR=14.7)

Of course lambda can be left 0.8 all over the place initially if you like (but take care not to lean where you shouldn't).

Internal scaling for l[] lamdacorr table is

Some decimal examples for l[] lamdacorr table (use numberformat=10 option or convert to hexa)

Firmware-workaround was made so megatune can display and input real lambda values like 0.8 (not 1/lambda=1.25 or internal lambdacorr=120) even with the limited formula capabilities (1/x not possible in megatune ini files).


Misc notes

The reason for this is that mstweak is broken: idle condition confuses it.

We should propose to include the feature to record mono or stereo wav-s that are syncronized to engine logs. It is often useful. Eg. when

Who writes a mail to the appropriate forum ?

[[Manual: Basics.Install.Software]]


Back to: MegaTune