My Megasquirt adventures over the years

Now we're getting into the fun stuff, which is actual fuel control. The menu starts out with EGO control, though when actually tuning, it's debatable whether you should leave this on or off to begin with. It's nice as a safety blanket, but at the same time the EGO correction could be yanking your tune around while you're trying to change things manually, so just something to be careful of. Like I mentioned earlier in this thread, ideally you should be able to run your tune with EGO completely off. The goal of a good tune is to be able to run "proactively" based on the sensors at the "front" of the engine, not reactively based on what's coming out the back. This is also where I implemented my OEM style "open" vs "closed" loop tuning.

1755051051248.png

The main EGO control window is where you'll set what kind of algorithm you want to run to adjust fueling based on an O2 sensor. The options here are "simple", "PID", and "no correction" (off basically). The simple algorithm is just that. It's probably designed to be used more with narrowband sensors, but works with wideband sensors as well. It basically looks at your O2 sensor and asks "am I rich or lean?". If it's rich, it will lean it out by the step size value and check again after your delay (either IGN events or a time delay). If it's lean, it will richen the mixture by the step size. So what you'll tend to see in your datalogs are stairsteps as the O2 feedback adds or pull fuel from your mixture. It's not crazy obvious here due to my smaller step size, but you can kind of see it in this trace (white is EGO correction, red is measaured AFR):
1755051396298.png

The PID setting will instead use a PID feedback algorithm to estimate how much to lean or richen the mixture by based on the measured AFR vs the target AFR. So this would give much quicker adjustments to try to pull things back to your target the further off you are, instead of having to "step" it's way back. I used to have mine set up this way, but went back to simple because I felt I needed to tune my main VE table better and not rely on EGO feedback as much. I'll probably try going back to it in the future as it's one of the benefits of a wideband sensor. Knowing how far off you are from you target can help fix a problem much quicker if one were to arise.

The other important setting here for me is the controller authority. This limits how much you EGO feedback is allowed to change the mixture. This kind of acts like a failsafe in case your sensor loses its mind. Ideally you want this fairly low as your VE table should be accurate enough that you shouldn't be relying on your EGO feedback to get things in line. I started with 10% and have turned it down to 5% since then. I'll watch my datalogs and live gauges from time to time to see what the live correction is to get an idea of how far off my VE table might be. Given that most OEM injectors also operate in a 5-7% kind of tolerance from what I've heard, this also feels fairly reasonable. 10% is likely the safer option though.

Futher down in the settings you can configure when you want EGO correction to be active. Typically, you would want to wait for your engine to be warm (and the sensor for that matter), and some people might want to disable it at high or low rpm based on their preferences. I have mine disable at idle because my AFRs tend to swing around a bit with my cam. You can also set up multiple sensors, like one for each cylinder if you were so included and well funded. At the moment I'm only running a single one on a single bank. I'd like to get one on my other bank some day, but it hasn't been a priority for me.

The AFR tables themselves are where you finally start commanding some actual fuel into the engine. These go way back to the original setup settings where we chose to "incorporate AFR target". If you have that value selected, then the values your put in these tables are the AFR you are telling the MS to try to run your engine at. My first table is set up for cruising and is basically 14.7 everywhere. I richen it up just a bit at the high end of load to be safer, but you could effectively consider this equivalent to an engine running in "closed loop" in the OEM world. My second table is the "WOT" table, or "open loop" to some degree. Technically speaking my car is still closed loop all the time because I have a wideband sensor and am always using the feedback, but this table is only active when my TPS is greater than 85% (more on setting that up later).

Strictly speaking, I don't believe HP Tuners has a "closed loop" AFR target table. However, they do have a "power enrichment" table that is what I made my "WOT" table from:
1755052153398.png

Again, Dodge is weird and uses 1 / AFR instead of the AFR value directly, so the numbers look weird, but work out to be what is in my table. I'm not 100% certain how this table is used in the OEM setup either. My assumption from the little I can guess based on available settings in HP Tuners is that once the pedal input exceeds the WOT threshold, this table goes into effect. What I'm less sure about is what throttle percentage that actually relates to. They talk in voltage because it's drive by wire (or could still be TPS, but regardless), and I'm not sure what their limits are. Conventional wisdom might assume 5v is 100%, but 3.196v would only be ~64%, which seems low to me and I know most TPS sensors calibrate far less than that. I think several are more like 1.5-3.5v range in actual use, which would make 3.196 more like 90% throttle, which sounds more realistic.

Lastly, the MS does have a neat AFR safety system that will kill spark and fuel if your measured AFR is too far off your target AFR based on the table values you set. This is likely much more useful in boosted applications where things can go south in a hurry. I haven't messed with it because my engine is still pretty mild in the grand scheme of things.