There are several inputs that affect AFR. Do you plan on accounting for things like ACT, ECT, timing, load, etc?
Initially, just load and RPM, as per the table above. My initial, sort of lowest level, intent is to simply bin the data by cells in the table above. Then determine the 'best' approach to calculating the VE to input.
During this initial phase, I'll do my best to control other variables. I'll keep the engine at operating temps (185-205) in order to control that variable. I *might* go as far as setting the two ECT correction cells to the same value to further control that. I'm not quite certain how the ACTs are dealt with in the Big Stuff. There is a Air temperature correction table, but it's listed under the "Warm Up" drop down, and my adjustments there did not *seem* to affect things at operating temps. There's also a MAP v. Coolant correction table under the Warm Up drop down, and I'm uncertain if it affects things at operating temperature. Needless to say, I still have a lot to learn.
Later, and I likely will play with this for years, I may bin again within the above bins by each successive variable I want to tackle, i.e. ECT, ACT, Timing, dMAP, dTPS, etc... This would allow me to inspect the affects on each cell. Another way would be to group all cells and determine the overall effect of ECTs and ACTs in order to make a global adjustment.
Edit: So it turns out that the top "Air Temperature Correction" table is not used with Speed Density, only Alpha-N. Only the bottom table with Map v. Coolant is used. I think it's just during warm-up. If there's a way to adjust fuel on ECT or ACT while at operating temp. It also turns out that the Warm-up MAP vs. Coolant isn't just for warm up. I took the car for a drive today, and I can definitely adjust fuel trims with this table.
Regarding timing, my initial thought is that since timing is also based on load and RPM, it will be consistent as is, meaning that every time I visit a cell in the VE table, the base timing at that point will also be consistent. However, adjustment tables might interefere. Here's how the base timing table is laid out:
As far as tuning timing, that's still a bit of a black box to me. I was hoping to use the optional accelerometer I got for the BS3 to help me with timing at WOT. However, I frankly do not know a good method for tuning timing at partial and light loads. So far, I'm basing it off of what a "real" tuner plugged into my 1st car. The above example is the 93 octane tune for my '91 LX. If you have any methodology pointers here, I'm all ears. My best guess would be trying adjust based on the look of the plugs. Seems pretty infeasible to do for every cell.
Perhaps limiting your code to only look at AFR when within certain windows of these values?
Yep, that's a similar approach. I could filter out that data, or just bin it separately. One of the challenges in binning is that the BS3 interpolates across cells. So, I'm not sure how I'm going to account for the interpolation, yet. Based on that, the values may never truly be entirely from a single cell.
For example, if I'm halfway between a cell containing "22" and a cell containing "26", then the VE the computer uses might be "24." I'm assuming the underlying software uses a linear interpolation. I would love to see the underlying code, though I'll bet John Meaney is unlikely to disclose anything I can't access myself.
I am curious about some of the details on what you plan on doing, it sounds like a very fun project, but also one that you could potentially spend several years perfecting... I would go into this very cautious of scope creep.
Scope is critical given the amount of time and other competing requirements. I think the simplest approach of averaging the feedback for each cell and adjusting the tune based on it will be easy enough to finish the project. However, I like how I can scale up, because that might lead to future related projects.
I have always been fond of the simplicity of the KAM corrections done in the factory ecu. I have not seen the background code that creates the KAM, and not sure if it is in the GUFB... but from a user/tuner standpoint, it is a simple and effectie way to make minor closed loop changes to fueling.
Big Stuff doesn't use KAM in the way I understand that the EEC IV does. Big Stuff's open-loop makes immediate feedback and corrections based on the actual AFR, but so far as I know, it doesn't store the value to reference against later. If I'm wrong about that, I have not found such a table. The VE table itself must be modified.
My background is materials/structural testing, and as part of that I have written some software programs for controlling test temperatures (hot and cold). I used PID control for up to 4 independent channels.
What code are you working within?
Excellent! The more brains/experience thinking about this stuff, the more likely I will approach things correctly. I welcome your interest and feedback as I progress.
Primarily python, though this might seqway into the use of R in the future.