OS12593359 - Speed Density conversion

They go by many names, P01, P10, P12, P59, E38, VPW, '0411 etc.
laocoon7
Posts: 14
Joined: Mon Nov 02, 2026 4:57 pm

OS12593359 - Speed Density conversion

Post by laocoon7 »

I've been looking at moving to a speed density setup so I can ditch my MAF. It seems like everyone just hides the related MILs while leaving the DTCs enabled and intentionally crashes the MAF sensor readings while copying the low octane to high octane spark table and tuning fully off the VE main table. However, on the 2000- pcms, a failed MAF kicks you back to a "VE_FAILSAFE" table that is about 1/2 the size of the main VE table.

I've hunted down the changes needed to actually convert into a speed density setup. Here's my notes:

Code: Select all

ADDRESS - BYTES - REASON
#######################
012e2d - 00 - disable MAF diagnostics

03113c - 36 38 94 e0  - use SD AIRMASS to calculate oil life by airflow accumulators

0311c2 - 36 38 94 e0  - use SD AIRMASS to calculate oil life by airflow accumulators

0361de - 31 fc 10 00 84 c0 4e 75 4e 71 - move.w #0x1000, (OCTANE_BLEND_FACTOR).w; rts; NOP;

0675d6 - 4e 71 4e 71 4e 71 - don't calculate maf frequency or airmass

06760e - 4e 71 4e 71 4e 71 4e 71 4e 71 4e 71 4e 71 4e 71 4e 71 4e 71 4e 71 4e 71 4e 71 4e 71 - don't compute AIRMASS_MAF_RAW

067682 - 42 38 95 1d 42 38 95 1f 36 38 94 ce c6 f8 94 d0 e0 8b e6 8b 31 c3 94 d4 31 c3 94 c8 31 c3 94 e4 31 c3 94 c6 60 00 05 fe - clr.b (AIRFLOW_FAILSAFE_ACTIVE).w; clr.b (MAF_ONLY_HIGH_RPM).w; move.w(AIRMASS_SD_RAW).w, D3w; mulu.w (AIRFLOW_CORRECTION_MULTIPLIER).w, D3; lsr.l #0x8, D3; lsr.l #0x3, D3; move.w D3w, (AIRMASS_DYNAMIC_FILTERED).w; move.w D3w, (AIRMASS_DYNAMIC_RAW_EST).w; move.w D3w, (AIRMASS_PREDICTED_UNCLAMED).w; move.w D3w, (AIRMASS_DYNAMIC_FINAL).w; bra.w 0x067ca6;

079984 - 4e 71 4e 71 4e 71 - don't run intrusive airflow drop test
We set the bool the DiagnosticEnablers+0x1d to false. This keeps any of the maf diagnostic code from executing. We also setup the oil life calculations to use the speed density air instead of the MAF (this is pretty much optional). We also lock OCTANE_BLEND_FACTOR or OCTANE_SCALER to 0x1000, we don't need the rest of the function calculating anything, because we just want to lock to the high octane spark table. Then we hit the main air mass calculation function. We don't need to calculate anything from the MAF, so we disable that function, then, after we calculate the speed density airmass, we set all our flags and values based solely on the speed density value. Finally we jump past all the diagnostics and default/fallback section. There is one last test that we skip.

At this point, we should be able to remove the MAF and tune completely off the VE main and high octane tables. I won't be able to get around to this until closer to January, but would like to hear any feedback/discussion. Did I miss something? Should I cut out more somewhere? I'm all ears.
User avatar
antus
Site Admin
Posts: 10121
Joined: Sat Feb 28, 2009 10:34 am
cars: TX Gemini 2L Twincam 8psi
TX Gemini SR20 18psi
Datsun 1200 Ute
Subaru Blitzen '06 EZ30 4th gen, 3.0R Spec B
Subaru WRX 2007

Re: OS12593359 - Speed Density conversion

Post by antus »

It sounds good! But I would not try and fight the system to clear the MAF error. If you are allowing the MAF test to pass, but then patching code that decides what to use for it's data source, it seems like added complication. I would follow a similar approach but hard fail the MAF and set the MIL to not to display, then patch only the code where that has a negative effect for the backup options. You'll have less modifications overall and if someone hooks up a scantool they'll see a MAF code and no MAF airflow on the relevant PIDs and it'll make sense. Saying your MAF is ok, but it not being present and the hz is not correct is not a big deal but it feels like the wrong approach to me. YMMV.
Have you read the FAQ? For lots of information and links to significant threads see here: http://pcmhacking.net/forums/viewtopic.php?f=7&t=1396
laocoon7
Posts: 14
Joined: Mon Nov 02, 2026 4:57 pm

Re: OS12593359 - Speed Density conversion

Post by laocoon7 »

antus wrote: Wed Nov 25, 2026 12:37 am It sounds good! But I would not try and fight the system to clear the MAF error. If you are allowing the MAF test to pass, but then patching code that decides what to use for it's data source, it seems like added complication. I would follow a similar approach but hard fail the MAF and set the MIL to not to display, then patch only the code where that has a negative effect for the backup options. You'll have less modifications overall and if someone hooks up a scantool they'll see a MAF code and no MAF airflow on the relevant PIDs and it'll make sense. Saying your MAF is ok, but it not being present and the hz is not correct is not a big deal but it feels like the wrong approach to me. YMMV.
I try to think of it as if the C code had a bunch of `#IFDEF MAF` and it was compiled without `MAF` what would the code do? It wouldn't spend cycles checking diagnostics on a MAF that doesn't exist. Telling the PCM to not do diagnostics on it was a single byte. Having no MAF and no codes for something that doesn't exist seems far better than having a bunch of DTCs "oh just ignore those." If the system doesn't need the MAF, and there is no MAF, why is there a code for one? The PIDs will report 0s for the MAF pids, I thought about patching in the SD measurements, but I think that would be more confusing than trying to read a MAF that doesn't exist and it shows 0.

I'm not saying my MAF is ok, I'm keeping the PCM from thinking there's a MAF at all.
User avatar
antus
Site Admin
Posts: 10121
Joined: Sat Feb 28, 2009 10:34 am
cars: TX Gemini 2L Twincam 8psi
TX Gemini SR20 18psi
Datsun 1200 Ute
Subaru Blitzen '06 EZ30 4th gen, 3.0R Spec B
Subaru WRX 2007

Re: OS12593359 - Speed Density conversion

Post by antus »

In that case you should probably remove support for the maf pid outright, both in the handler and in the supported pids request bitmap (if it has it). It sounds like you already have identified RAM addresses for those variables, and that provides as way to be sure you found everything that expects it to be populated. It's possible to miss an indirect lookup, but for maf hz there may not be any. And make sure grams/s of air is calculated and populated from MAP before it is used, if that is how it works. I think most calculations are grams/s or grams/cyl of air based.
Have you read the FAQ? For lots of information and links to significant threads see here: http://pcmhacking.net/forums/viewtopic.php?f=7&t=1396
laocoon7
Posts: 14
Joined: Mon Nov 02, 2026 4:57 pm

Re: OS12593359 - Speed Density conversion

Post by laocoon7 »

@ 0675d6, there's a jsr to the place that MAF frequency and airmass are calculated/updated. I just NOP that call altogether, no need to update all of that.

I've hit the cross references, and there are what I think are some startup routines that set stuff like OCTANE_BLEND_FACTOR to it's initial value from calibration (starts high at 0x1000), but I hit everything that uses MAF_AIRMASS and MAF_AIRMASS_UNFILTERED. Those are the only two values that matter for the MAF. Everything else is a cross with speed density calculations.

The main air calc function basically works like this:

Read new values off the MAF and calculate the HZ.
Get TPS based on if ETC or not.
Calculate the RAW airflow (MAF_AIRMASS multiplied by how long the cycle is (I called it the CYLINDER_EVENT_PERIOD)).
Lookup VE from VE_MAIN based on RPM by MAP
Calculate speed density RAW from MAP by IAT
A big section checking every diagnostic/error flag from the MAF:
If the MAF is high or performance faulted (p0102 p0101) (what most people set to get the MAF to throw codes) It looks up a new VE from VE_FAILSAFE (low resolution VE table, so you can't just copy VE_MAIN over VE_FAILSAFE like normal). And builds the same list of variables I build.
Then a bunch of active fault checks for map/iat/tps/ect/overboost/throttle control, where it will set the list of variables from MAF.
Then checks to see if we are over 4000 RPM and sets MAF only calculations.
The some steady state and dynamic airmass calculations to decide whether it should trust MAF or SD.
Some predictive stuff to makeup for MAF lag.
At this point here, It has decided and calculated the same variables I'm setting, I just don't run any of those calculations to get here.

If your MAF is unplugged all the MAF_ variables will be left at 0. The place that they are read include this function, an emissions function, some diagnostic functions, and the thing place that adjusts oil life based on airflow. Because the MAF_AIRMASS is blended with SD_AIRMASS, any functions trying to use AIRMASS in calculations use the post blended versions, which we already handle.