Using AFR instead of Volts with AEM Wideband in AFR Target Table - Miata Turbo Forum - Boost cars, acquire cats.

Welcome to Miataturbo.net   Members
 


MEGAsquirt A place to collectively sort out this megasquirt gizmo

Reply
 
 
 
LinkBack Thread Tools
Old 11-11-2008, 03:25 PM   #1
Boost Pope
Thread Starter
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Chicago (Over two miles from Wrigley Field. Fuck the Cubs. Fuck them in their smarmy goat-hole.)
Posts: 26,317
Total Cats: 1,915
Default Using AFR instead of Volts with AEM Wideband in AFR Target Table

This has been posted before, but comes up often. So I'm putting all the info in one place and adding it to the Super Important sticky.

By default, if you select "AEM Linear" in the MegaTune Configurator, your AFR Targets table is scaled to volts, and you must reference the AEM documentation to find the correct values. You can change this so that your AFR Targets table is scaled properly in AFM instead.

First, go into the \Program Files\MegaSquirt\MegaTune2.25\mtCfg\ directory, and open the file msns-extra.ini in notepad.

2015 curly edit: For TS, you'll want to open you TS project folder\projectCfg\mainController

Scroll down until you come to a section labeled
page = 7 ; TARGET AFR table 1 BINS FOR VE 1 (First find which sensor used)
This is to ensure that we're altering AFR Target Table 1, which for most folks is the only one in use.

Look for the following lines in that section:
#elif AEM_LINEAR
afrBins1 = array, U08, 0, [8x8], "Volts", 0.0196, 0, 0.0, 5.0, 2
You want to make the following changes, which I've highlighted in red:
#elif AEM_LINEAR
afrBins1 = array, U08, 0, [8x8], "AFR", 0.038666, 255.0, 10.0, 20.0, 1
If you wish, you can just copy and paste the second line into your file.

The next time you open MegaTune and look at your AFR Targets table, you'll find that it is scaled in AFR rather than Volts. The contents of the table will be garbage so if you already had values in here you'll need to re-create them, but from now on you can work in meaningful units.



Now, a lot of folks have reported problems with the default calibration, in that it can be a few tenths out in terms of the MS agreeing with the AEM. It seems that there is some variance from one AEM unit to the next. If you find yourself in this group, you can correct it by opening up the file file "lambdasensors.ini" which you'll find in the same directory as before. Locate the following section, and note that I've highlighted a certain pair of values in red:
#elif AEM_LINEAR
afr = { 9.72 + egoADC * 0.038666 }
lambda = { afr / 14.7 }
TargetAFR = { 9.72 + afrtarget * 0.038666 }
TargetLambda = { TargetAFR / 14.7 }

To alter the calibration, you need to change the 9.72s to something else. And this, sadly, is where the fudge factor comes into play. Some people have reported success in scaling the value up (to 10, for example) others report needing to insert lower values (9.5, in one instance). You're going to have to play with it and see what works. Just turn off EGO correction and eyeball the laptop display vs. the gauge at idle. Find a value that works for you.



Sources cited in compiling this info:
forums.plastikracing.net :: View topic - MegaSquirt Tips and Tricks
forums.plastikracing.net :: View topic - Fixed algorithm in Megatune for the AEM UEGO
MiataTurbo.net :: View Topic - For those using AEM Linear with MS



Addendum:

A lot of folks have been reporting trouble with this. It seems that all these folks have non-standard Megatune installs, wherein there are multiple copies of the msns-extra.ini file in various locations.

If this is you, then you need the find the one that's actually important. My guess is that if, when you open MegaTune you are presented with the "Select a Project" window, then you need to edit the copy of msns-extra.ini in the appropriate Project folder, and not the main one.

As an example, I installed the MSPnP software package, and I now have six project folders, two each (with and without AFM) for 9093, 9495, and 9697. If I edit the one in C:\Program Files\MegaSquirt\MSPNP MM9093 without AFM then I see AFR as units when I start MegaTune and select that project, but if at startup I select the "MSPNP MM9093 with AFM" project, I see units in volts.

So check that.

Last edited by curly; 03-02-2015 at 10:37 AM. Reason: Added addendum
Joe Perez is online now   Reply With Quote
Old 01-05-2009, 09:22 PM   #2
Elite Member
iTrader: (30)
 
Join Date: Aug 2007
Location: Va Beach
Posts: 7,282
Total Cats: 0
Default

I followed your exact instructions and my table still comes up with volts. Is there anything else that should be done?

Thanks.
__________________
Best Car Insurance | Auto Protection Today | FREE Trade-In Quote
levnubhin is offline   Reply With Quote
Old 01-05-2009, 09:28 PM   #3
N3v
Junior Member
 
Join Date: May 2008
Location: Nashville/Knoxville, TN
Posts: 318
Total Cats: 1
Default

you have to do it in \Program Files\MegaSquirt\MegaTune2.25\mxextra\mtcfg too.
N3v is offline   Reply With Quote
Old 01-05-2009, 09:44 PM   #4
Elite Member
iTrader: (30)
 
Join Date: Aug 2007
Location: Va Beach
Posts: 7,282
Total Cats: 0
Default

Do not see that anywhere. I just noticed that after doing what Joe says my AFR targets for VE table 3 is in ARF, but targets for table 1 still reads volts.
__________________
Best Car Insurance | Auto Protection Today | FREE Trade-In Quote
levnubhin is offline   Reply With Quote
Old 01-05-2009, 09:49 PM   #5
Elite Member
iTrader: (5)
 
Join Date: Mar 2007
Location: NYC
Posts: 1,997
Total Cats: 1
Default

well are you sure you didn't skip over table 1 in the ini by accident?
johndoe is offline   Reply With Quote
Old 01-05-2009, 09:52 PM   #6
Elite Member
iTrader: (30)
 
Join Date: Aug 2007
Location: Va Beach
Posts: 7,282
Total Cats: 0
Default

Quote:
Originally Posted by johndoe View Post
well are you sure you didn't skip over table 1 in the ini by accident?
Edit:

Nope, says "page = 7 ; TARGET AFR table 1 BINS FOR VE 1 (First find which sensor used)
"

Right above where I made the changes.
__________________
Best Car Insurance | Auto Protection Today | FREE Trade-In Quote
levnubhin is offline   Reply With Quote
Old 01-05-2009, 10:07 PM   #7
Elite Member
iTrader: (5)
 
Join Date: Mar 2007
Location: NYC
Posts: 1,997
Total Cats: 1
Default

wierd. Not to beat a dead horse but your sure you chose aem linear and not non linear? You changed volts to afr? You also have aem linear selected in the configurator? i can't see what else it could be.
johndoe is offline   Reply With Quote
Old 01-05-2009, 10:17 PM   #8
Elite Member
iTrader: (9)
 
Join Date: Aug 2006
Location: Concord, North Carolina
Posts: 4,173
Total Cats: 5
Default

I was having problems. I have all of my files and version of the high res in Megasquirt/MyStuff file.

I had to change it in the mtcfg file there before it would do anything.
miatamania is offline   Reply With Quote
Old 01-05-2009, 10:29 PM   #9
Elite Member
iTrader: (30)
 
Join Date: Aug 2007
Location: Va Beach
Posts: 7,282
Total Cats: 0
Default

Quote:
Originally Posted by johndoe View Post
wierd. Not to beat a dead horse but your sure you chose aem linear and not non linear? You changed volts to afr? You also have aem linear selected in the configurator? i can't see what else it could be.
Yes, yes and yes.

page = 7 ; TARGET AFR table 1 BINS FOR VE 1 (First find which sensor used)

#if NARROW_BAND_EGO
afrBins1 = array, U08, 0, [8x8], "Volts", 0.0196, 0, 0.0, 5.0, 2
#elif WB_1_0_LINEAR
afrBins1 = array, U08, 0, [8x8], "Volts", 0.0196, 0, 0.0, 5.0, 2
#elif WB_UNKNOWN
afrBins1 = array, U08, 0, [8x8], "Volts", 0.0196, 0, 0.0, 5.0, 2
#elif AEM_LINEAR
afrBins1 = array, U08, 0, [8x8], "AFR", 0.038666, 255.0, 10.0, 20.0, 1
#elif AEM_NON_LINEAR
afrBins1 = array, U08, 0, [8x8], "Volts", 0.0196, 0, 0.0, 5
__________________
Best Car Insurance | Auto Protection Today | FREE Trade-In Quote
levnubhin is offline   Reply With Quote
Old 01-05-2009, 10:43 PM   #10
Elite Member
iTrader: (30)
 
Join Date: Aug 2007
Location: Va Beach
Posts: 7,282
Total Cats: 0
Default

I got it. I had to make the changes in the msns-extra configuration settings file.
__________________
Best Car Insurance | Auto Protection Today | FREE Trade-In Quote
levnubhin is offline   Reply With Quote
Old 01-05-2009, 11:16 PM   #11
Elite Member
iTrader: (3)
 
Mach929's Avatar
 
Join Date: Oct 2004
Location: lansdale PA
Posts: 2,500
Total Cats: 0
Default

i never could get this to work, still can't
Mach929 is offline   Reply With Quote
Old 01-05-2009, 11:17 PM   #12
Elite Member
iTrader: (30)
 
Join Date: Aug 2007
Location: Va Beach
Posts: 7,282
Total Cats: 0
Default

Quote:
Originally Posted by Mach929 View Post
i never could get this to work, still can't


Try what I did.
__________________
Best Car Insurance | Auto Protection Today | FREE Trade-In Quote
levnubhin is offline   Reply With Quote
Old 01-05-2009, 11:19 PM   #13
Elite Member
iTrader: (3)
 
Mach929's Avatar
 
Join Date: Oct 2004
Location: lansdale PA
Posts: 2,500
Total Cats: 0
Default

i don't really understand what you did, where is that file?
Mach929 is offline   Reply With Quote
Old 01-05-2009, 11:24 PM   #14
Elite Member
iTrader: (30)
 
Join Date: Aug 2007
Location: Va Beach
Posts: 7,282
Total Cats: 0
Default

Megatune 2.25\mtCfg\msns-extra configuration settings. Look for page 7.
__________________
Best Car Insurance | Auto Protection Today | FREE Trade-In Quote
levnubhin is offline   Reply With Quote
Old 01-05-2009, 11:42 PM   #15
Elite Member
iTrader: (3)
 
Mach929's Avatar
 
Join Date: Oct 2004
Location: lansdale PA
Posts: 2,500
Total Cats: 0
Default

no worky on my desktop or my laptop, i really don't know what i could be doing wrong, when i tried this months ago i couldn't get it right either
Mach929 is offline   Reply With Quote
Old 01-06-2009, 01:03 AM   #16
Elite Member
iTrader: (9)
 
Join Date: Aug 2006
Location: Concord, North Carolina
Posts: 4,173
Total Cats: 5
Default

Could be my problem.

My maps/files are in a subfolder...I had to change the mtcfg file in that folder rather than the megatune folder.


If yours is anything like that, try it.
miatamania is offline   Reply With Quote
Old 01-06-2009, 01:23 AM   #17
Boost Pope
Thread Starter
iTrader: (8)
 
Joe Perez's Avatar
 
Join Date: Sep 2005
Location: Chicago (Over two miles from Wrigley Field. Fuck the Cubs. Fuck them in their smarmy goat-hole.)
Posts: 26,317
Total Cats: 1,915
Default

Quote:
Originally Posted by N3v View Post
you have to do it in \Program Files\MegaSquirt\MegaTune2.25\mxextra\mtcfg too.
In a typical installation of MegaTune, no such directory exists.

Quote:
Originally Posted by levnubhin
I got it. I had to make the changes in the msns-extra configuration settings file.
What the hell file were you editing before?



Everyone, this is being made out to be more complex than it is.

Assuming you already have your AEM sensor working and being correctly read by the MS, there is only one file that you need to edit. Assuming your MT directory structure is "normal", that file is located in:
C:\Program Files\MegaSquirt\MegaTune2.25\mtCfg\

Note that it does not matter what version of code you are using, or where your car-specific config files are stored. This is a global setting for all of MegaTune, and global settings are stored in \mtCfg\.

The name of the file is msns-extra.ini.

Open it in notepad.

Scroll down until you come to a section labeled
page = 7 ; TARGET AFR table 1 BINS FOR VE 1 (First find which sensor used)

Then find the entry for #elif AEM_LINEAR and make the changes.

That is all.
Joe Perez is online now   Reply With Quote
Old 01-06-2009, 10:34 AM   #18
Elite Member
iTrader: (3)
 
Mach929's Avatar
 
Join Date: Oct 2004
Location: lansdale PA
Posts: 2,500
Total Cats: 0
Default

for sure it doesn't work for me, i give up again
Mach929 is offline   Reply With Quote
Old 01-06-2009, 01:36 PM   #19
N3v
Junior Member
 
Join Date: May 2008
Location: Nashville/Knoxville, TN
Posts: 318
Total Cats: 1
Default

sorry I didn't have the directory right at hand, I only have MS installed on my laptop. Changing stuff in the directory you specified first showed only volts, then I poked around and found a similar ini file in Megatune2.25\mtCfg\msns-extra, and after I did the same changes to it, it worked.
N3v is offline   Reply With Quote
Old 01-06-2009, 01:45 PM   #20
Elite Member
iTrader: (30)
 
Join Date: Aug 2007
Location: Va Beach
Posts: 7,282
Total Cats: 0
Default

Quote:
Originally Posted by N3v View Post
sorry I didn't have the directory right at hand, I only have MS installed on my laptop. Changing stuff in the directory you specified first showed only volts, then I poked around and found a similar ini file in Megatune2.25\mtCfg\msns-extra, and after I did the same changes to it, it worked.
Thats exactly what worked for me.
__________________
Best Car Insurance | Auto Protection Today | FREE Trade-In Quote
levnubhin is offline   Reply With Quote
 
 
Reply

Related Topics
Thread Thread Starter Forum Replies Last Post
Back to Stock Part Out!! Turbo Parts, MS2 Enhanced 01-05, Suspension, and MOAR! StratoBlue1109 Miata parts for sale/trade 16 10-02-2015 10:39 AM
1996 Turbo Build Goldwar DIY Turbo Discussion 2 09-29-2015 10:20 AM
wiring wideband ground to battery terminal btabor ECUs and Tuning 10 09-28-2015 06:33 PM
why is my car running like pewp? (tune/datalog) itsMikey MSPNP 3 09-28-2015 07:40 AM


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -4. The time now is 07:15 PM.