Tuning ITBs - Blended SD/AN Tuning

Home > Projects > Megasquirt > Tuning ITBs

Up

 

Blended SD/AN Tuning | Blended with AN Main Table | Blended with SD Main Table | Creating Blended Tune Tables | Tuning Blended Tables | Idle Air Control

Blended SD / AN tuning

Starting with the MS2-extra code, a solution to address ITB tuning difficulties was provided.  This solution uses a tuning method that requires 2 separate tables.  One table is SD and the other is AN.  The data in these two tables is blended together to allow a seamless transition from running SD to running AN for the portions of the operating range where each method works the best.

Below a MAP of approximately 90%, SD tuning works really well.  As shown in the throttle graphs, the area below 90% is triangular in shape and at low RPMs is covered by only a few percent throttle movement.  The MAP signal in this region is very smooth and has a broader range of percent change than the TPS signal.

Above a MAP of 90%, the MAP signal starts to get noisy and very small changes in MAP represent large changes in fuel.  For these reasons AN tuning works well in this area. 

 
This chart shows the general idea of blended tuning.  Both SD and AN tuning are used in the tuning region where they each work the best.

The way this is implemented in Megasquirt is with two VE tables.  The first table is the primary table and can be set up for either AN or SD.  The second table is then set up for the tuning scheme not use in the primary table.  The second table is defined as a percentage multiplier table.  To calculate the fuel for a given point, the value from the primary table is multiplied by the value in the second table.  The value in the second table is interpreted as a percentage.  For example, 100 = 100% which leaves the primary value unchanged.  10 = 10% which multiplies the value in the primary table by 0.1

Example Blended Tuning With AN Main Table

It's easier to look at a couple examples.  The first example is for the 2.3L engine.  The primary table is AN and the secondary multiplier table is SD.  The transition point was set to approximately the 90% MAP line

 

Alpha N Main Table

SD Multiplier Table

Primary AN table.  Notice that all the bins in the region below 90% MAP have the same value.  These columns were all set to the value needed at the 90% MAP line.  These values will be reduced by the percentage value in the secondary table.  The 3D view shows that the part of the AN only table that had the steepest slope is now flat.  It is taken over by the SD table.

 

Secondary SD table.  All values in this table represent a percentage to multiply the value from the primary table.  Notice that this table only has real values up to the 90% point and then 100% for the top row indicating no modification to the AN table.  At MAP values close to 100%, this table does little to modify the AN table.  The 3D table shows that the part of the SD table with the steepest slope is now flat and unused.  It is now taken over by the AN table.

 

Example Blended Tuning With SD Main Table

Here is an example of blended tuning where the primary table is the SD table and the multiplier table is AN.  This is from my 2.0L engine's current tune with the 40mm ITBs.  I am using the 16x16 table option in this tune to give me some extra rows of data for the AN table.  When I originally set up this tune, my SD bins around idle were only around 15 or so.  This gave me problems tuning idle since a change in value of just 1 yielded a 7% change in fuel.  To help correct this, I divided my multiplier table by 2 and multiplied the SD table by 2.  This change did not effect the final fuel calculations but increased my idle bins up to around 30.

I am currently running my engine with this tuning scheme but I plan on converting over to the AN main table form of blended tuning.  After implementing blended tuning both ways, I have found the AN / SD version easier to work with than the SD / AN.

Speed Density Main Table

Alpha N Multiplier Table

Primary SD table.  The bottom rows are really never used and are just place-holders to fill out the table.  This main table maxes out at a MAP of 94%.  I use the AN multiplier to table to increase the top row values for throttle positions that yield a MAP greater than 94%.

AN multiplier table.  This table both increases and decreases the main SD table.  The transition between bins with a value of 50 and those greater than 50 is set just a little over the 90% MAP point.

 

Creating Blended Tune Tables

Based on the experience I have had with using both types of blended tables (SD/AN and AN/SD), I would recommend using the AN main table with a SD multiplier table.  I see a few advantages to this approach over the SD/AN:

  • It is easier to get a baseline AN table running with ITBs than an SD table.
  • The values in the SD multiplier table tend to be numerically larger, this gives better resolution around idle mixture control
  • This is a subjective point, but I find it easier conceptually to see what is going on with the main table being AN

When I finish my 2.2L engine build I will need to re-tune.  I will be using this opportunity to convert my own tune over to an AN main table.

In order to create a blended set of tables, you need to first create a single table tune that works well enough to allow you to drive the car through its full operating range of engine loads and RPMs.  I would recommend creating an AN tune.

Using this single table tune, you need to collect enough log data to generate a TPS vs. MAP graph like the ones shown in the ITB sizing page.  To create these graphs, I use Megalogviewer to locate operating points where the MAP is equal to the desired value.  I locate points where the engine RPMs are pretty constant (not accelerating), and use the RPM and TPS at that point as a datapoint.  I use Excel to plot the datapoints and draw a trend line through them.

Next you need to select the MAP value you want to use as the transition point between the AN and SD tunes.  I would recommend a value of about 90% MAP.

I recommend printing out a hardcopy of your baseline AN table for reference.  You need to record what the values are of the bins in your bottom (0% TPS) row.  These values will be needed for generating the SD multiplier table later.

To enable blended tuning, you need to make the following settings changes in MS.  These specific menus are for TunerStudio, Megatune will be similar:

  • Basic Setup / Engine Constants / Control Algorithm -> Alpha-N
  • Basic Setup / More Engine Constants / Secondary Fuel Load -> Percent Baro
  • Basic Setup / More Engine Constants / Secondary Fuel -> Multiplicative
  • Basic Setup / More Engine Constants / Multiply MAP -> don't multiply

These setups will enable editing of Fuel VE Table_1 (AN table) and Fuel VE Table_2 (SD multiplier table).  Table 1 should contain the values from your original AN tune.  Table 2 will contain garbage values and will need to be fully populated.

Modifying the AN table for blended tuning

Now go to Table 1 (AN table).  Using data from your TPS vs. MAP graph, locate the bin in each column of the AN table that corresponds to the TPS position for the transition MAP value you selected (I will be using 90% for this example).  You need to set all bins below this one to the same value as the 90% MAP bin.  This will create an AN table where all throttle positions that will cause a MAP of less than or equal to 90% will have a value equal to the 90% load bin.  Your modified AN table should now have a triangular region along the bottom where all values within a column have the same value.  Refer to the AN/SD example above for reference.

Assigning MAP row values to the SD multiplier table

Now it's time to set up the SD multiplier table.  Make sure the SD table has the same RPM assignments for the X axis as the AN table. 

The first step is to assign the row's MAP values (the Y axis of the table).  Go back to the datalogs you collected on the AN only tune and take a look at the MAP values for your engine in each of these operating ranges:

  • Idle
  • Maintaining speed (not accelerating)
  • Overrun (engine braking)

The lowest MAP value you will need in your SD table is one at the bottom of the table for your overrun MAP which will be less than idle.  Then you will need a row above the overrun row for the lowest MAP value you expect to see for idle.  You should have a couple rows around your idle MAP just to allow some fine tuning of the idle mixture for slightly different engine loads.

I normally use the two top rows to define the region where the multiplier will be set to 100 and the engine will be controlled from the main table only.  The top row is the 100% MAP row and the second to the top is the 90% row.  This way you can change the 90% row slightly to fine tune the transition between the two tables.

The remaining rows should be dedicated to defining the area between 90% MAP and idle MAP with an emphasis on using rows to define the area where you do most of your light-load driving just maintaining speed.  This is most likely in the 80% to 90% range.  You will most likely come up with MAP values for your SD rows that look similar to the Y axis of the examples above.

Assigning initial bin values to the SD multiplier table

At this point you should have a SD multiplier table with the Y axis defined and the top two rows of bin values set to 100.  (the 100% and 90% rows).

Now it's time to assign some reasonable initial values to the remaining bins.  This is where that printout of your original AN table will be needed.  First we will determine the correct initial values for idle.  Compare the bin values on the original AN table for 0% TPS and idle RPM to the current value in the modified AN table for the same TPS/RPM point.  You want to calculate the percentage you need to multiply the value in this bin on the modified table to achieve the value in the original table.  For example, lets say that the original AN table has a value of 25 for the bins used for idle and the modified AN table now has a value of 50 since all bins below the 90% MAP point have been set to the value of the 90% MAP bin.  In this example, you would calculate that you need to use a multiplier of 0.50 to multiply the value in the modified AN table to get the desired idle fueling value of 25.  To do this you would set the multiplier bin value in the SD table for the idle MAP/RPM to 50.

Repeat this exercise of using the original AN table to calculate the fractional multipliers needed to modify the values in the current AN table to achieve the original AN value for each RPM column of the SD multiplier table.  You need to keep in mind the MAP row on the SD multiplier table that corresponds to the 0% TPS row on the original AN table.  RPMs at or below idle will correspond to the idle MAP value.  0% TPS at RPMs over idle will correspond to the overrun MAP.

You should now have an SD multiplier table with the upper rows set to 100 and a value in either the bottom or second to bottom row set to a value less than 100 that defines the fraction to multiply the AN table by to achieve the original value from the baseline AN tune.  Now it is a matter of interpolating the points in each column of the SD table between these bins.  There is no exact formula to this.  I recommend a linear interpolation between the 100 bin and the lower bin as a starting point.  Tunerstudio has an interpolate feature in the table editor to assist with this.

I have used this technique to successfully create a reasonable starting point for blended tables using a known good AN only tune as a starting point.  The multiplier values using this technique were close enough to get the engine started and for the most part will be within 10% to 15% of the final values.

Tuning Blended Tables

The one disadvantage to using this blended table approach is the complexity of tuning. The auto tuning features of Megasquirt, Megalogviewer, and Megatune do not understand blended tuning.  The use of two different tuning schemes (AN and SD) across two different tables is not understood by the applications.  This means that you need to analyze the log files and make manual changes to the correct bins in the correct table to effect the tuning changes you want. 

Fortunately, Megalogviewer can be set up to correctly show the correct active bins on each VE table.  To do this, you set the main Y axis field to the tuning scheme used for table 1.  This is selected in the 'Options / Y Axis Field' menu within Megalogviewer.  In the .msq section, select the correct tables for VE table1 and VE table2.  Both tables will track based on the previous menu selection.  To change how the second table tracks, right click on the second table's 'Y' axis and enter the selection for the second table.  For blended tuning with AN as table1, the 'Options / Y Axis Field' would be set to 'TP' and the value you enter by right clicking the table2 'Y' axis would be 'MAP'.  Now as you scroll through a datalog, you will see that each table is tracking the correct bins used for the AN and the SD tables.

In order to tune blended tables, you need to recognize which table is in primary control at the point you are trying to tune:

  • If the MAP is below the defined transition point, the multiplier table (table 2) is the table you want to look at
  • If the MAP is above the defined transition point, the primary table (table1) is the table you want to look at.
  • If at least one of the bins being used is at the transition point then you need to be careful.  If you change the value on the main table then you should really change the values of all bins below it as well.  This would require re-scaling the multipliers for that row in the second table.
  • Also be aware that several bins on the SD table can apply to the same bin on the AN table.  This is why you want to keep all the bins below the 90% MAP point within a column on the AN table the same value.  This way the SD values will react in a predictable way.

I normally scan through the log files and get a feel for how the tune is working.  If I suspect a spot on a table needs to be changed, I look for other points in the log where the same bins are in use and determine if the change I want to make will work in all these spots.

Tuning For Idle Air Control With Blended Tuning

One side effect of using blended tuning is the problem it presents in using an idle control valve.  Blended tuning relies on the relationship between throttle position and MAP to determine the correct amount of fuel to deliver.  When an idle air valve is used to increase air flow without the use of the throttle, the relationship between MAP and throttle position that the blended tune relies on is rendered invalid.  Basically, the idle air valve requires SD only tuning to work correctly as the throttle position will always be zero while MAP changes based on idle valve position.

The problems this presented in tuning were that when I generated blended tuning values that worked well for driving, the mixture during fast idle was too lean.  This was because the AN value was at zero percent TPS but the MAP was up around 90%.  The correct AN TPS value for this MAP level should have been closer to 5%.  Therefore the wrong (too small a value) multiplier was being used from the AN table during fast idle.

The solution I found for this issue was to create a SD only portion of the blended tables in the RPM range that I wanted to use for idle control.  The way I did this was to create a region in the AN table that is constant in value across the RPM range and the full MAP range.  This means that TPS is no longer a variable within this region.  The transition between SD only and blended regions is managed with two RPM columns that are only 10 RPM apart.  This creates a virtually instantaneous transition between SD only for idle and blended tuning for the normal driving region of the tables.  Both the SD and the AN tables must have the same transition point between SD only and blended operation.

With the AN table a constant, I was able to use the SD table to control the idle region's mixture independent of TPS and therefore the mixture would be correct for MAP changes caused by either the idle valve or the throttle.  The SD only tuning performance just off-idle is adequate for driving purposes.

The constant multiplier value for the AN table was picked to give a reasonable range of values for the SD table.  To create a smooth transition of fuel from the SD only region to the blended region, data logs were examined and the SD only values were adjusted in the 1490 RPM column to match injector pulse widths from the 1500 RPM blended column.

 

Speed Density Main Table With Idle Air

Idle Range 0 - 1490 RPM

Alpha N Multiplier Table With Idle Air

Idle Range 0 - 1490 RPM

Primary SD table.  This table completely controls the fuel up to 1490 RPM.

AN multiplier table.  This table does not begin to vary the fuel delivered until above 1490 RPM.

 

So now my fuel tuning is a combination of SD only for idle through fast idle and blended for the rest of the RPM range.  I have not noticed any negative effects in drivability but I don't normally drive under 1500 RPM.  Fast idle tuning now reacts as it should because of these tuning changes and because of the air flow balancing I did in my fast idle circuit as explained at the bottom of my idle air control page.

 Top

 

email me

This site was last updated 05/09/10