Automatic Mixture Control for MegaSquirt-II
There is an adaptive learning algorithm called "Automatic Mixture Control" mode in the MegaSquirt-II code (V2.6+). It updates your VE table while you drive based on when you are at a stable vertex in the VE table and averages your ego correction. If it stays in this state long enough the VE table will automatically be updated, so the ego correction should quickly drop to 0. On a schedule which you can determine it will update the VE in flash - you can set this to be fairly frequent when the car is first being tuned, then set it to very seldom or never.
Automatic Mixture Control (AMC) allows MegaSquirt-II to adjust and make permanent changes to the VE table based on the exhaust gas sensor without a laptop computer attached, much like OEM ECUs.
Before automatic mixture control, there were a few ways to use EGO feedback to adjust the VE table:
- Manually examining a datalog to find areas (rpm & MAP) that were rich or lean of the desired targets, and adjusting the VE table manually (which required some knowledge of what you wanted and how to interpret a datalog),
- Use a separate program (like MSTweak3000 or VexME) to process the datalog and create a new VE table (this frequently depended on having the 'correct' datalog format),
- Use MegaTune's autotune to re-write the VE table interactively (but which required a laptop to be connected with MegaTune running).
Automatic mixture control (AMC) will work entirely internally, no laptop needs to be connected. AMC acts if:
- the user has enabled it, and
- MegaSquirt-II is operating in closed loop mode, and
- the engine operating parameters (MAP and rpm) remains near a VE table vertex (near being user inputs)
Then the program will average the ego correction for a user specified period and then update the VE table in RAM by some user specified portion of the amount of the correction.
As a result, the average closed loop correction should gradually decrease to zero. A separate loop will check and burn flash with the updated VE table, according to again specifiable user inputs.
Because the AMC algorithm relies entirely on the EGO sensor/controller output, it is best used with a wideband controller that is known to be accurate and reliable. Narrow band sensors will work, but will operate only in the areas where EGO feedback is allowed, and only for stoichiometric mixtures.
Automatic Mixture Control is enabled from the 'Settings/Automatic Mixture Control' menu item in MegaTune. It can be set to:
- Disabled: No automatic mixture update of fuelling VE table(s).
- RAM Update: This mode automatically updates the VE table(s) in MegaSquirt's 'volatile' RAM memory, but changes will be lost on power-down if not saved (with a manual 'Burn to ECU').
- FLASH Update: This mode updates the VE table in RAM, and also automatically updates VE table(s) in MegaSquirt's 'non-volatile' FLASH memory periodically, causing the changes to be retained even if MegaSquirt® is shut down (but the original VE table is over-written).
There are a number of settings that affect the operation of AMC:
- Step Size (%): % of AMC correction to be applied when RAM VE is updated. A typical value is 10%, this means apply 10% of the change between the old VE value and the adjusted VE value to the VE table(s).
- Minimum VE Change (%): smallest AMC VE change that will be applied to the table in RAM, if the change is less than this, it will be ignored (until it reaches the threshold).
- Vertex Tolerance (RPM): the furthest that the nearest rpm bin can be away and still have the AMC change applied to that entry.
- Vertex Tolerance (kPa): the furthest that the nearest kPa bin can be away and still have the AMC change applied to that entry.
- Table Change Interval (sec): is the minimum time (in seconds) between updates of RAM VE table.
- Flash Update Interval (sec): is the minimum time (in seconds) between FLASH burns of the RAM VE table (only used when FLASH Update is selected).
- Update After (events): is the minimum number of AMC RAM VE updates that have to be made before the program will burn the table to FLASH (only used when FLASH Update is selected).
Note that if you want to save the changes made to a VE table manually, and not wait for the automated FLASH burn to save the changes, you must do a 'fetch/burn' cycle on the VE table.
Also note that if you enable AMC on the stim, it can pull the VE table 'out of shape', because the EGO input does not reflect the output pulse width. So be careful and watch the VE table to be sure it isn't mangled by AMC on the stim before you transfer those settings to your vehicle.
MegaSquirt® and MicroSquirt® controllers are experimental devices intended for educational purposes.
MegaSquirt® and MicroSquirt® controllers are not for sale or use on pollution controlled vehicles. Check the laws that apply in your locality to determine if using a MegaSquirt® or MicroSquirt® controller is legal for your application.
©2006 Bruce Bowling and Al Grippo. All rights reserved. MegaSquirt® and MicroSquirt® are registered trademarks.