Notices
928 Forum 1978-1995
Sponsored by:
Sponsored by: 928 Specialists

LH2.3 MAF input

Thread Tools
 
Search this Thread
 
Old 01-08-2014, 09:47 PM
  #1  
PorKen
Inventor
Rennlist Member

Thread Starter
 
PorKen's Avatar
 
Join Date: Sep 2002
Posts: 10,099
Received 334 Likes on 199 Posts
Default LH2.3 MAF input

LH2.3 converts the voltage from the MAF into two different digital inputs to be read by the (8051) processor.
Unfortunately, neither are very good for tuning.


The first A/D conversion is to a 8-bit (0-255) number.
It reads up to ~5 volts, or a reading of around 300 maf units (the calculated value for scaling).
It is used for cranking, idle, acceleration pump(?).

The second conversion is to a frequency which is read by the processor as a 16-bit (0-65535) number.
It can read up to the full ~6.5 volts from the MAF (648? maf units).
This number is used for most data work in the code. It is processed into the load frequency sent to the EZ.
It is very sensitive to voltage changes (or is just moody) with seemingly random peaks and valleys throughout.
Over 5400 rpm it is especially bad, making peak HP difficult to make consistent.


Note the 928 MAF is an oddball, with a voltage range of roughly 2~6.5 volts, instead of the more common 0-5V.


Lean spikes will often be accompanied by a knock. And it may not only be because the injector time is going up or down.
At cruise or if you are not using the EZ WOT map, IE. cruise only, then the ignition timing is going up/down, too.


The factory base fueling table goes up to 324 maf units.
Max S4 WOT reading at rpm limit is over 400 maf units.
300 happens before 3000 rpm at WOT, well before the first torque peak!



The last pic shows examples of factory code vs. additional (new) coding to smooth the MAF frequency by setting a maximum rate of change plus or minus.


This post is based on my reverse engineering of the code and logging runs.
I will update it as more information is available.



MAF volts (max ~5 volts, ~300 maf units)


MAF frequency from a typical WOT logging run (compare to the green line in the logs below)


Base fueling table combined with the MAF ideal table ('88 S4 with cat)


AFR, MAF volts, Inj duty, RPM (3rd gear WOT 1500~6500)

Last edited by PorKen; 01-29-2014 at 02:29 PM.
Old 01-08-2014, 09:48 PM
  #2  
PorKen
Inventor
Rennlist Member

Thread Starter
 
PorKen's Avatar
 
Join Date: Sep 2002
Posts: 10,099
Received 334 Likes on 199 Posts
Default

There is code to average/smooth the MAF signal, which helps cut down on the spikes, but it is not always used.

If the 8-bit MAF number is not changing much, there is no smoothing.
So at full throttle, over ~5 volts/3000 rpm, the 16-bit number is used directly, spikes and all.

Below is the code that sets the 16-bit MAF frequency number (from the timer which reads the A/D frequency).
It takes the new value, adds it to the old, then divides by two (right shift).


For folks using the 'SharkTuner', you can force smoothing all the time by making a one byte change in the code.
This will reduce the spikes/errors for both injector time and ignition at cruise and WOT somewhat.

With a hex editor, change the value at 056F and 456F from D2 to C2.
This changes the SET to a CLR for the flag which controls the smoothing.

(Two places to change as there are two banks of the same code, repeated.)


Example of free hex editor - (HXD hex editor)
File, Open the BIN file to modify.
Press Ctrl-G, type 56F, OK, type C.
Repeat for 456F, Save.






Or, go the full monty with this patch, which could produce graphs like the last one above.

Careful, you may be surprised how off your WOT tune is in places w/o all that noise! (Mine was.)

(Patch includes cruise averaging, so no need to do the above tweak.)


XDF - right click, save as, rename .txt to .xdf
MAF rate patch - TP5_LH23_PK_MAF.txt

TunerPro 5.0
download page

Make a backup of your BIN!

Open XDF, Open BIN, double click on 'MAF patch', click 'Apply Patch', click 'Apply' to close window, Save.

Change both (+) and/or (-) values to adjust the rate. Save.


Last edited by PorKen; 01-29-2014 at 01:16 AM.
Old 01-08-2014, 11:25 PM
  #3  
AO
Supercharged
Rennlist Member
 
AO's Avatar
 
Join Date: May 2002
Location: Back in Michigan - Full time!
Posts: 18,925
Likes: 0
Received 59 Likes on 33 Posts
Default

Originally Posted by PorKen
For folks using the 'SharkTuner', you can force smoothing all the time by making a one byte change in the code.
This will reduce the spikes/errors for both injector time and ignition at cruise and WOT somewhat.

With a hex editor, change the value at 056F and 456F from D2 to C2.
This changes the SET to a CLR for the flag which controls the smoothing.

(Two places to change as there are two banks of the same code, repeated.)


Example of free hex editor - (HXD hex editor)
File, Open the BIN file to modify.
Press Ctrl-G, type 56F, OK, type C.
Repeat for 456F, Save.


Ken,

I don't know how you figured this stuff out, but it's pretty friggen cool you did. I attempted to decode the LH2.3 but don't have the chops to do it.

Cheers to you and all your crazy and not so crazy endeavors!

Man I love this crowd... even the ones that make me shake my head from time to time! (You know who you are... Hacker)
Old 01-09-2014, 12:14 AM
  #4  
FredR
Rennlist Member
 
FredR's Avatar
 
Join Date: Jun 2005
Location: Oman
Posts: 9,703
Received 665 Likes on 542 Posts
Default

Ken,

Brilliant stuff.

Not so sure I understand what you have written but is the implication that some of the knocks we see are a result of poor control or interpretation of data inputs rather than an acual knock event per se?

Rgds

Fred

Last edited by FredR; 01-09-2014 at 12:42 AM.
Old 01-09-2014, 12:48 AM
  #5  
PorKen
Inventor
Rennlist Member

Thread Starter
 
PorKen's Avatar
 
Join Date: Sep 2002
Posts: 10,099
Received 334 Likes on 199 Posts
Default

Knocks caused by random MAF conversion values causing lean spikes.
Also, a low MAF reading could translate to reduced load, which could raise the ignition advance suddenly at the same time.

Also, constant (sometimes huge) rich spikes above 5400 make it look like there's too much fuel in your WOT map there, so you end up taking out fuel.
Next run, no spike, too lean, knock, so you back off timing, HP drops.

You can see this in the after log, where it is a bit more lean above 5800.
With smoothing, the injector duty graph almost matches the WOT fuel map exactly.
There's still a little randomness in there, but it mostly makes for rich spikes, which are OK.
(In my smoothing code, I made the allowed rate for increasing MAF values larger than decreasing.)


Note, because of the way it is calculated, at WOT the load value the EZ sees is pretty much a straight line at full load at any RPM.


In looking for a different variable to send to the EZ at WOT, in place of the max'ed out load value, I came across the code above.
Now that I have figured out to how to mostly straightened out the MAF value, I may be able to make a load sensitive WOT map.
Old 01-09-2014, 01:10 AM
  #6  
FredR
Rennlist Member
 
FredR's Avatar
 
Join Date: Jun 2005
Location: Oman
Posts: 9,703
Received 665 Likes on 542 Posts
Default

Ken,

Fascinating. You may remember the dialogue we had wherein I was puzzled by the way the motor seemed to very inconsistently knock at around the 5300 rpm range. You may also note that I do not run on the WOT map because I had a problem with the icky WOT throttle switch- so by the sound of it perhaps that is not such a good idea after all given your observations that are sinking in now that I have had a cup of tea.

Something else I have also noticed recently that may or may not be connected is that the wiring loom insulation at the MAF connector was crumbling away leaving bare wires. I cut into the loom about 3 inches further back and did a "temporary" r/r job. Since then the motor has been running better [or so it feels] and interestingly, another problem I had- the tacho signal on the clock breaking down at around 5300 rpm also seems to have mysteriously "dissappeared". No idea why this has happened but all this makes me wonder if there is some commonality.

I could probably do to re-wire the entire engine bay and am continuously fire fighting having r/r'd injector plugs, MAF, the 14 point connector and hopefully will be fitting a new front harness soon.

Rgds

Fred
Old 01-09-2014, 04:12 AM
  #7  
daveo90s4
Pro
 
daveo90s4's Avatar
 
Join Date: Feb 2006
Location: Australia
Posts: 665
Received 6 Likes on 6 Posts
Default

Ken, is this the sort of amendment that could be made by you to otherwise stock EZK / LH PEMs / chips, is it the sort of change that would come with no downside, and is it the sort of change that you would recommend be made for a daily driver S4?

Thanks in advance

Dave
Old 01-09-2014, 04:16 AM
  #8  
Tony
Addict
Lifetime Rennlist
Member
 
Tony's Avatar
 
Join Date: May 2001
Location: Las Vegas
Posts: 14,671
Received 580 Likes on 302 Posts
Default

Some of you guys on here scare me.

Where is the "if then...goto" line??
Old 01-09-2014, 04:57 AM
  #9  
danglerb
Nordschleife Master
 
danglerb's Avatar
 
Join Date: Oct 2006
Location: Orange, Cal
Posts: 8,575
Received 3 Likes on 3 Posts
Default

I so prefer ASM, I like to KNOW what my bits are doing.

As I recall the Ljet uses a 9v range, wonder why the differences?
Old 01-09-2014, 05:14 AM
  #10  
Hilton
Nordschleife Master
 
Hilton's Avatar
 
Join Date: Jun 2006
Location: ɹəpun uʍop 'ʎəupʎs
Posts: 6,279
Received 54 Likes on 44 Posts
Default

Very interesting, thanks a heap Ken for posting.
Old 01-09-2014, 07:58 AM
  #11  
simos
Instructor
 
simos's Avatar
 
Join Date: Oct 2005
Location: Finland
Posts: 137
Likes: 0
Received 0 Likes on 0 Posts
Default

Many thanks Ken, that should be doable.. You forgot to mention about taking backup copy of LH bin-file before modifying

Is the MAF signal unstable before and after the A/D conversion? Just thinking about turbulence before MAF, it will happen in some specific cfm flow numbers as velocity will increase when flow is increasing.

Definitely something which needs to be tested,,,, in next summer.
Old 01-09-2014, 01:09 PM
  #12  
PorKen
Inventor
Rennlist Member

Thread Starter
 
PorKen's Avatar
 
Join Date: Sep 2002
Posts: 10,099
Received 334 Likes on 199 Posts
Default

An unstable MAF voltage appears to be amplified by the frequency conversion.

Here is a graph made in the spring with the airbox lid off (for more power ).
Notice the green MAF voltage graph is bumpier than the lines above, with terrible injector duty and AFR spikes as a result.

I would imagine that a supercharged graph could look even worse?


AFR, MAF volts, Inj duty, RPM (3rd gear WOT 1500~6500)
Old 01-09-2014, 01:46 PM
  #13  
PorKen
Inventor
Rennlist Member

Thread Starter
 
PorKen's Avatar
 
Join Date: Sep 2002
Posts: 10,099
Received 334 Likes on 199 Posts
Default

BTW, big props to Chris F. and his web page on the LH, because 'I don't know tech stuff'.

(928s4.com)

I could not have figured out the workings of the code without his circuit diagram of the LH board.
There are a couple of things which were incorrect which threw me for a loop, threw me for a loop (corrections annotated).

(928_lh5_new.pdf)
Old 01-09-2014, 02:03 PM
  #14  
Lizard928
Nordschleife Master
 
Lizard928's Avatar
 
Join Date: Apr 2003
Location: Abbotsford B.C.
Posts: 9,600
Received 34 Likes on 25 Posts
Default

Very cool info Ken,
Old 01-09-2014, 02:07 PM
  #15  
FredR
Rennlist Member
 
FredR's Avatar
 
Join Date: Jun 2005
Location: Oman
Posts: 9,703
Received 665 Likes on 542 Posts
Default

Well, it is easy enough to modify the bin file as you described with the software you linked.

Maybe I will try out this approach tomorrow. Presumably this implies one has to check/re-tune the AFR and then attempt to dial in more advance at full load conditions.

Rgds

Fred


Quick Reply: LH2.3 MAF input



All times are GMT -3. The time now is 06:39 AM.