Mazda MX-6 Forum banner

How to setup Autotune for your MegaSquirt and Wideband setup

56K views 14 replies 8 participants last post by  Zach  
#1 · (Edited)
Had someone ask me to throw this together. Figured it would be pretty straightforward.

Auto tune on a Megasquirt comes pre programmed, auto-tune to only tune to 14.7 AFR and only under vacuum. If you want to use the autotune feature of your MS then you need to do a few alterations to set it up with your wideband.

If you have your MS running on the wideband already you can start from here.

1) Go into your C:\Program Files\MegaSquirt\car1\mtCfg\custom.ini

Then, determine which processor your MS is running. In my case its MS_1 so, Im going to go under #if MS_I and change some settings seen here.

Image


I will go over the red dots top to bottom

If MS_1 then run the following parameters

1) turn autotune on

2) leave corrector at egoCorrection
3) Set your low and high RPM limits that you want it to tune
4) Set your low and high kPa limits that you want it to tune
5) Set your low and high VE limits that you want it to tune

6, 7) Set your sensitivity by detrmining how close RPM and kPa must be to a vertex before it will tune

8) Set how often you will allow it to tune a point on your VE table
9) Set the gain that you will allow it to tune by (.5 = It moves by a half percent each time it makes a change)
10) Set the window that you will allow it to tune (5 = up to 5% before it will not tune in one direction any more)


So save the custom.ini and exit.

2) Go to your Megatune program. Go More Settings > Lambda AFR Settings

Turn 8X8 AFR Taget on for VE table 1 (or whatever VE table you wish to use.)

Image




After you do that, you will notice under More Settings > AFR Targets for VE Table 1 is now avalible.

Once you are in there, You need to cross refrence a Voltage/AFR in the documentation that came with your wideband unit.

You will then enter values into the table so that above 100Kpa you will be tuning twords a 11.5-12 AFR, and below 100 Kpa you will be tuning to a 14.7 (but you need to input the correct voltage for the Target VE table.)

Here is a table that I threw together By crossrefrencing the analog voltages with the gasoline AFR.

.39 V ~ 10.75 AFR
.47 V ~ 10.95 AFR
.63 V ~ 11.25 AFR
.71 V ~ 11.4 AFR
.78 V ~ 11.56 AFR
2.25 V ~ 14.5 AFR

So you can see im going to be tuning twords a 14.5 in vacuum at all RPMS, and tuning in the 11's under boost (a little richer under high boost / high rpm)

Image




You can then go to Tuning > Ve Table 1 Then Tools > Autotune

The red dot will now chase the green dot around and tune to the target AFR you have set it to. It will only do so much tuning (depending on the parameters you entered in your custom.ini). Every so often you will want to go File > Burn to ECU so it resets the autotune variables and it will continue tuning.


You may have to do some final tweaking after the autotune, but you should be pretty set :)

Let me know if you have questions, I will add to this how to if needed.
 
#2 ·
great write up!!:tup:
 
#4 ·
:( :confused: :shrug:
Maybe ill pay you to come get mine started... lol..

good write up though, im glad your understanding it all... I feel like i lost alot of interest in the MS after attempting to build my own..
No Charge ;)

Its really not that hard to understand. But then again, I am a programmer, and work with structured text so I know what everything in the custom.ini is doing :)

But yeah, I would be glad to come help you get yours up and running.
 
#7 ·
Just to add to this...

At a lot of places you don't need to run 14.7:1. Highway cruise you want to run ~15.5:1 for MPG sake. Any more rich than that is a waste really. In theory, you could run even leaner (watch EGT) since most of us don't have a cat. Too lean and you would melt it.

As for tuning while under load, you might want to change the limits IN boost, which is the two boxes in the top of the "LAMDA SENSOR TARGETS" window. You don't want the MS to inadvertly overshoot something and run excessivly rich or lean while running in closed loop.

I know the "lumpiness" variable is there, but that is only for autotune. If you are running an EGO authority of say 10% or more, if something goes askew, MS could end up "autocorrecting" you way lean.
 
#8 ·
Good addition radar :) I will modify my table to accomodate :)

The only reason those 2 boxes are not filled in is because I was building this table on a blank MSQ...

On my msq those 2 boxes are set at

Change EGO limit above (KPa) 255
Change EGO limit to (+-) 5

I do beleive I want to change that first setting to 100 KPa.
 
#10 ·
I highly reccommend looking into your documentation before using these numbers just to be safe, but the following should be true for certain WB units.

AFR Voltage Cross refrence for any wideband running 0-5V and 10-20:1 AFR

Provided by adjat84th

.39 V ~ 10.75 AFR
.47 V ~ 10.95 AFR
.63 V ~ 11.25 AFR
.71 V ~ 11.4 AFR
.78 V ~ 11.56 AFR
1.00 V ~ 12.0 AFR
1.25 V ~ 12.5 AFR
1.50 V ~ 13.0 AFR
1.75 V ~ 13.5 AFR
2.00 V ~ 14.0 AFR
2.25 V ~ 14.5 AFR
2.35 V ~ 14.7 AFR
2.50 V ~ 15.0 AFR
2.75 V ~ 15.5 AFR
3.00 V ~ 16.0 AFR
 
#12 ·
Yes, I need to fix all my pictures in my how to since I moved off photobucket.

I never really got a chance to use it that well. Never put enough miles on the car and I didnt have a laptop that had a lasting battery. Now I got a new laptop, still running off the base MSQ I got with my unit, just richened the whole table up a bit when I went to the 550's, and tweaked the idle, everything is actually pretty close to the end result.

I know KING6 has used autotune, with different values than I use in my target table, and he has had some success.

I will fix the fix the pics today at work.

I was gonna wait until the spring to have it dynod, but with all this warm weather we have been having I should be driving it and get it on the rollers before snow flies :(
 
#14 · (Edited)
I dont think 1g or 2g is going to make a difference, this is all software setup, really has nothing to do with the hardware.

Pictures are linked in about 30 seconds.

Edit - Zach remember to cross reference your wideband voltages as they might be different for your setup. The voltages I was using are for an AEM ugeo unit.