Thursday, June 25, 2009

Parametric VE explained



This is an explanation, representation, and pros & cons of the Parametric VE.
I was told to cut it out with the math, so here it is watered down for easy reading. I kept the math simple, I might have mentioned matrix multiplication once, but I think I got away with it.

It's way too involved to be a web page so here's the downloads:

Word2007 version PDF version

enjoy and for the love of Newton, please comment profusely,
Marcin

Friday, April 25, 2008

Spot the Surge

This is a short demo of why in addition to the traditional MAX, MIN, and AVG aggregates of data we also need STD (Standard Deviation).

Normally when you graph data in a histogram, you just use the AVG view, so if you were to make such a view on a log with a surging idle only in one range of temperatures, you'd get a boring and useless graph like this:

NormalAVGview.png

However, if you look through few thousands frames on the Chart view, you will notice a pattern:
Low temp (27C):

ECT27c.png


warmer (43C):

ECT43c.png


warm (58C):

ECT58c.png


hot (72C):

ECT72c.png


It goes no surge, big surge, big surge, small surge, no surge. Strange, we didn't see that pattern in the average view in the scanner, did we? Only if there was a simple mathematical construct that compares the swings of a value in reference to it's average...

So here comes a new tool of mine called Tableau. I paid good money for it, so why not show it off, right? Watch and learn what your scanners should be able to do:

SurgingSummary.png


The top one is STD of RPM, the middle is STD of Spark, the bottom is STD of MAP. Also, for better visualization I took the liberty of splitting the ECT intervals from 12 to 6C.
All these graphs are very clear: there is very little variation at low and high ECT's, but somewhere in the middle they go crazy. The cool part is that all three measures here show the exact same behavior! You can trace the interval temps in the summary graph to the 'in time' charts from the scanner, and see they agree to where the engine surges and where it's docile.

So I made a one more experiment and wanted to see how my new tool would display the averages graphically, to see if maybe with better graphics the surging would be visible:

SurgingAVGexamples.png
Nope, still not visible, averages 'flatten' the surging losing all the important details.

So here's my call to both HPT and EFILive:

INCORPORATE THE STANDARD DEVIATION VIEW INTO YOUR SCANNERS!

It's useful, I have a lot of other uses, but this is a nice and easy demo of how one extra function can save a lot of time chasing around the precise areas where the OLFA or RAF must be adjusted.

Feel free to annoy Paul and Keith until they code it up ;)

enjoy,
Marcin

Sunday, April 06, 2008

Three Airmass Models

In physics, when you're trying to get to the bottom of something, you usually have a model (a formula) and some data (variables with values).  Then you usually calculate something, or compare it to something which values you already know, and find a variable or a constant you don't know.  Then, these constants or calibrations can be used to be used for all other cases.  Same methodology applies to tuning, however we have not been able to use it properly, due to the lack of models for many important aspects of tuning like airmass, fueling, or temperature.

So far we've been spoon fed some bullshit belief that tuning is adjusting tables because fueling changes.  It happened because we did not approach it from the physics angle.  But things have changed, and in the past 3 yrs we have determined the models for all the main processes that the ECU is using to estimate airflow and fueling.

For example, there are few different ways of getting to the airmass, the main value which determines fueling.

Airmass 1, from MAF sensor:

MAF= A*MAFhz^3+B*MAFhz^2+C*MAFhz+D
MAF= CAM1*CYL*RPM/120
CAM1= 120*(A*MAFhz^3+B*MAFhz^2+C*MAFhz+D)/(CYL*RPM)

this is nice because all the variables here are truly independent:
MAFhz comes from a sensor, and so does RPM.  CYL is a constant we know. 
The only thing left is to figure out A,B,C,D.  Once we know these 4 constants describing the MAF calibration, we can give a precise reading of Airflow or Airmass, because then we have all the necessary variables and constants.

But how do we find the values of A, B, C, and D?  The typical physics thing to do would be to somehow produce a situation in which we know the airflow or airmass, take the values of MAFhz and RPM, and the rest is a 3rd order polynomial fit, which is easily done in Excel or Matlab.

The problem is monetary:  we dont have a device that could produce a wide range of known airflow figures.  Thus we must resort to producing that Airflow or Airmass number from somewhere else, which happens to be...another Airmass model

Airmass 2, from fuel consumption:

CAM2= IPW*IFR*AFRwb

This looks nice and simple as the scanner gives us IPW, wideband gives us AFRwb, and IFR can be either scanned or just a lookup function based on Manifold Vacuum.
If we assume that this is a good enough airmass model, we should be able to use it to use it as the Airmass figure in the previous section:

IPW*IFR*AFRwb = 120*(A*MAFhz^3+B*MAFhz^2+C*MAFhz+D)/(CYL*RPM)

This formula looks long and scary, but it's actually quite easy to solve:

IPW*IFR*AFRwb*CYL*RPM/120 = [A B C D]* [MAFhz^3 MAFhz^2 MAFhz 1]

This is more for a Matlab setup, in which either polyfit or mldivide work great. 
In Excel you can simply graph it, and then 'insert trendline, type: polynomial, option: 3rd order, print equation on graph' and you will get a full equation with all the coefficients on the graph.  There's also a numerical way of doing with with the regression plugin, but if you know about this plugin, you probably can figure out how to use it.  This exercise will be left to the reader (I always wanted to say that!)

Back to tuning... What this big ugly formula says is that the airmass from the fuel consumption is equal to the airmass from the MAF sensor.  As long as all the elements in the formula for CAM2 are truly descriptive of the things they describe, this method is perfect.

Unfortunately the reality is much more complicated:
Fuel systems do not hold fuel pressure under load as well as we wished.
Injectors do not have linear fuel characteristics, so when commanding the injector to do 8ms of fuel will not result in 8 times as much fuel injected as when commanding 1ms pulse width.  This is why we have the Voltage Offset and Short Pulse Adder tables.  I'm not going to dive into details, as that could be its own huge article, all you need to know is that IFR and IPW and AFRwb are all prone to severe noise in data, and as such are not the greatest source of Airmass.  Of course with enough data we could employ statistical tools to weed out the outliers, but WOT data is hard to generate as it is.  Demanding great amounts of samples mostly increases our chances to get a speeding ticket.

So is this Airmass model of any use?  Yes, if you have injectors for which you have full data in the format GM ECU's use.  This narrows it down to stockers, which cannot support much power.  Even then that's just IPW, IFR could use a fuel pressure sensor to be dynamically determined, instead of using assumptions of perfection in GM engineering <HA!>

Then there's another Airmass model #3 (Speed Density):

CAM3= GMVE*MAP/TEMP

GMVE is just a computational shortcut describing VE:

GMVE= CYLVOL*VE/R    

Since CYLVOL and R are constants, using GMVE saves the ECU one multiplication and one division that would always yield the same value.  That's why GM decided to use GMVE instead, as it's simply faster.  To humans however, it is easier to understand 90% VE than 2.3 g*K/kPa.  However, if you can scan values directly in GMVE, it does make the math easier.

TEMP is...well, if you've read my blog before you know I've spent the past year chasing after this little bugger.   TEMP itself has multiple models, depending on model and year of your vehicle.  In the simplest case:

TEMP= IAT+(ECT-IAT)*BIAS
where BIAS is a lookup table referenced against airflow

So we could use the same method I demonstrated in the previous section, and set CAM3 equal to CAM1 (if we have MAF tuned perfectly), or CAM2 (if we can describe fuel consumption precisely).  Let's take a look at the CAM2 case:

IFR*IPW*AFRwb = GMVE*MAP/(IAT+(ECT-IAT)*BIAS)

tuning the VE (or GMVE) consists of solving for GMVE:

GMVE= IFR*IPW*AFRwb*(IAT+(ECT-IAT)*BIAS)/MAP

This doesn't look too bad, right?  Well, the kicker is that GMVE will be determined by BIAS, which by itself is determined by Airflow, which is determined by GMVE.  You ever seen a dog chasing its tail?  This is exactly what this equation is doing.  In practice this is a very difficult problem to solve, and remember that this is for the simplest TEMP model, I could've given you something from a '08 Corvette which has a Bias table based on Airflow AND Speed, and the Filter table introduces a whole new dimension, as it has a damping effect on TEMP, but it does it in reference to time.
Do not try this at home, you just might hurt yourself on a really sharp and pointy equation...

OK, so what about equating CAM3 and CAM1?

GMVE*MAP/TEMP = 120*(A*MAFhz^3+B*MAFhz^2+C*MAFhz+D)/(CYL*RPM)

Oh wait, this has the same problem as we just discussed, as it contains the dreaded TEMP variable, which is not only car dependent, but it also combines complexity of time travel with the witchcraft...

So it looks like either way we slice it, there's problems.  Anything fuel related suffers from faults and imprecisions of the fuel system.  Everything Temp dependent requires major modeling and simulation work. 

So while we have not established anything new here per say, it's clear what we should work on next, to further our understanding and ultimately develop tools to aid the tuning process.
The bigger point here is that even though we can convert one model to another, we still need a starting point.  If we had fuel, we could have MAF or SD.  If we had MAF, we could convert it to SD or vice versa.  But there is no good start point.  If the intake tract is stock, we could assume that MAF is the start point.  If we a have stock fuel system with stock injectors, we could try to use the fuel as a starting estimator of airmass. 
The only other solution (that I've been working on for quite some time) is to use numerical optimization methods to find calibrations that through simulation would yield the most consistant fueling.  So far, this process has been partially sucessful, but plagued by the initial lack of information on Temperature models (now solved for most model/years), and my shortcoming in mathematical education.  There's been some datasets that yielded clear results, but my methodology is not robust enough to deal with some of the more unruly cars producing noisy data, and ultimately throwing off the math so badly that the VE surfaces end up jagged and having unreasonably low or high numbers.

The short version:  we got the plan for the attack, now we just gotta do the hard math.

Hope this cleared up some concepts, as multiple people lately have been asking some really insightful questions.
enjoy,
Marcin

Saturday, April 05, 2008

Cranking VE approximation

I created a quick and dirty spreadsheet that approximates CrankingVE, based on PrimaryVE table.

The tables are done in EFILive format, so HPT users for now have to copy and paste special->transpose their Primary VE table before pasting into the spreadsheet, and then the same thing before they paste the results into CrankingVE table.

Of course, if someone wants to create another version that works with HPT standards, I highly encourange you. I will include it in the future version, just like the injector spreadsheet.

My car is currently down so I can't test it on my own setup, so please use with caution and common sense.

DOWNLOAD OLD

April 05, 2008 update:
Aaron (aka 405HP_Z06) have just contributed a more complete version of this spreadsheet with both EFILive and HPT format tables. Enjoy, and thank you Aaron.
DOWNLOAD NEW

Wednesday, February 13, 2008

Temperature Models are important

Both E38 and E40 ECU's have a Temperature Bias table with both Airflow and Speed axis, making us think that it's using both to determine the proper Bias value. But to just make sure that's truly the case, I made a little experiment:

How closely can I can predicting the temperature calculating it from components (Airflow, Speed, Filter, IAT, ECT) to the scanned values of Manifold Temperature?

I wrote few Matlab scripts to take the component values, and use the model I thought it was using. I must admit I went from pure observation and gut feelings on this, but it worked out great.

Test #1:
I made a simple model without any Speed dependencies, the Bias table was purely based on Airflow. I used it to model some E38 data, and it was just rubbish, completely different look and feel to the scanned vs the calculated values.


Test #2:
I expanded the previous temperature model to include Speed in predicting the scanned Manifold Temperature values. And the results were very positive: not only the graphs of predicted vs scanned values were very close to each other, but the set of parameters that yielded the best fit were very similar to the values in the tune which was used to generate this log!



Test #3:
A month or so passes, and I get some E40 data. Blindly, I grab the Temp modeling scripts I've been working with (the ones that worked so well for E38 data), and use them to predict some temps on the E40 values. The result was confusion and big disappointment: the predicted values were somewhat following the scanned ones, but the differences were sometimes quite large (~10 Kelvin). (click on pictures for bigger, more readable versions)










Then I remembered that I'm using the newer model on the data generated by an older ECU. Quick edit of my scripts, and the new predicted values were dead on overlayed the scanned.










This is important for few reasons:
1. We now know the temperature model for E40 (uses Airflow only for the Bias table)
2. We now know the temperature model for E38 (uses Airflow and Speed for the Bias table)
3. We now know that the Bias tables in the two ECU's even though they show the same in HPT (I haven't looked in EFI yet) are actually used very differently. This is a glorious display of phrases like 'looks might be deceiving' and 'verify your assumptions'
4. Newer models aren't necessarily backwards compatible.



Now that we know this, we can do some cool stuff, but more on that later...

Saturday, January 12, 2008

Temperature Modeling, part 2

Since my last “Temperature Modeling” paper came out, there was a lot of good discussion concerning the paper itself, the findings, the spreadsheet, the theory, and a lot of other concepts intrinsically bound to the airmass estimation process.  I am going to try to address as many of these issues here for further clarification, as you guys really can bring up a lot of good points forcing me to go back, rethink, recheck, reevaluate a lot of previous notions.

The spreadsheet accompanying the paper is NOT a solution to the bias tuning problem.  It is merely a simulation, a toy helping to understand the process of estimating temperature.  It was my mistake to use the word ‘optimize’ anywhere near it, as a lot of people thought you can use it to figure out what you need to put in for the values in Bias and Filter tables.  It is not.  It is there purely for education and entertainment.  I helped me a lot in understanding how the bias and filter work together to simulate smooth transitions of temperature of air in the intake.

What you can ‘optimize’ with it, is the model itself.  While we have the tables containing data, we do not have the formulas governing them.  For example, in the Bias table, intervals are 10g/sec (i.e. on the older F-body computers) or 4g/sec (on the E40 and newer computers).  Are the values contained in the cells for the border value itself, or the centers of the range around them (32g/sec would be a center of 30..34g/sec on an E40 ECU)?  What happens when the value we need to look up is not in the cell directly?  Is it rounded to the nearest known value?  Is it interpolated?  What kind of interpolation:  linear, spline, cubic, Bezier?  Until we start hacking the code on the ECU itself, we will not know answers to these questions, however, a spreadsheet like this allows us to play with the different scenarios and see what works and what does not.  Of course this is not a proof of anything, but the changes should be visible enough to see some interesting correlations.

Another important thing that came up during the creation of the spreadsheet is the final metric, how we evaluate the goodness of the model we conjectured.  The traditional metric in HPT or EFILive is expressed by (AFR-AFRwb)/AFR.  So when a metric of a fit is needed for a range of values, most people employ the average of the AFR%Error or BEN.  The problem with that is these errors can be both positive and negative, so they can eliminate each other numerically.  For example if you just used the traditional AFR%Error histogram and see 0%, you automatically jump to the conclusion you have the perfect tune, while in fact it might have been roughly the same number of errors on positive and negative sides.  Considering that measuring entities often follows the normal distribution, the errors on both sides will quite likely be in the business of pushing the average toward 0.  This is probably why it takes a few passes to get the fuel trims in the neighbourhood of where they should be to begin with.  This made me decide that a better metric is needed to assess the different models we come up with.  Just putting an absolute value on the AFR%Error will give you only positive values, making all errors ‘grow’ the average, not drive it toward a zero average.  Also, since the number resulting from such a computation is an actual percent of difference, you can sum or even average the errors, getting a better idea on the nature of the errors in your system.  Such a system would work just as intended with a great number of clean samples.  However, in real world, lots of data is hard to gather, as well as outliers occur fairly frequently, throwing off the averages.  Thus, someone had an idea of squaring the difference (AFR-AFRwb)2 between the empirical data (AFRwb) and the intended target (AFR).  This way, the small errors would contribute very little to the sum, while the larger errors would carry a significant weight with them.  This approach is great for spotting systems with a large number of outliers, as they make the sum grow quickly.  The problem is that too many outliers will weigh so much that the real data will become almost completely ignored.  Yet another metric is the maximum error (max(AFRwb-AFR)).  The good aspect of it is that while the errors might not be small, they’ll all be within a certain range from the target. 

No matter which of these metrics are used, the goal is the same:  to make our system predict/describe an observed function with more precision.  Certain metrics are going to skew results in different ways, but altogether they improve the model.  The important thing here is that there is no one ultimate metric, we have to know and understand few different ones, and use the ones that make most sense for what we’re trying to do.  In the case of tuning AFR, you don’t want to go too lean or too rich; you want to keep the discrepancies close to the target AFR.  For such a situation I like to use the maximum deviation metric, as it tries to ‘squeeze’ all the errors under the same level.  However, I found practically that it’s not a good metric to start with, as the computer was having problems with finding an optimal answer starting from a wild guess.  Sum of squared errors metric was much better for the initial pass, to get the parameters close to what we’d like it to be.  With these initial parameters, the maximum deviation metric was much more useful.

So what is all this metric talk for really?  The idea of optimization is to minimize errors.  However, you cannot make a decision on which model is better, until you can put a number on every model.  The interesting part is that in the end it does not matter what it is that you’re minimizing, the maximum deviation or sum of squared errors, as long as it is smaller than before, progress was made.

That is how I set up the spreadsheet.  There are multiple models, with multiple metrics assessing the fit.  Parameters in all of them are the same, but strangely enough, different models like different parameters, which only further stresses the importance of figuring out the full model, not just the parameter values.  The Solver in Excel is quite good, albeit tricky sometimes, at arriving at the best set of parameters.  It is however very intriguing to watch how the parameters change (or not!) depending on which metric was being minimized.  The best part is to watch the charts change; MATbias, MATfilter, MATscanned, alongside with ECT, IAT and Airflow all dancing around, and the more you optimize, the closer the MATfilter would get to MATscanned.  Another interesting thing is to see the more drastic changes in airflow (acceleration, deceleration) rapidly swing the estimated temperature one way or another.  Depending on which metrics get optimized, certain patterns on the graph are either followed closer, while others get ignored altogether.  I highly recommend spending some quality time playing with the different models and metrics, to get a real feel for what we’re dealing with here.

We cannot forget what this spreadsheet is however.  It is an estimator of an estimator.  We do not, and will not know the real temperature inside of the intake, until we use an old-fashioned empirical method of sticking an extraneous probe into the bowels of the intake somewhere.  At best, if all the math and modeling we developed is perfectly the same as the one in the ECU, the MATscanned and my MATcalculated would be the same.  Making them the same does not optimize the model to report the proper temperature; it only allows me to play with the components in such a way that I predict the result with greater degree of confidence.  IAT, ECT, and the Bias and Filter tables are all a part of an estimator—that is all they do.


The purpose of all this mathematical gymnastics is to learn how the computer estimates the temperature in the intake.  With understanding comes control.  Control allows experiments and simulations to take place and either prove a theory or debunk a myth.  If our model is consistently close enough to MATscanned though, it would be a good time to try the optimized parameters in the tune, and see if it follows what the numbers intended to yield. 

The real complication is that it looks like we will not get VE tuning without arriving at the correct Bias tables, and we will also not get Bias without a solid VE table.  I am trying to do it together, hoping that setting them to correct and realistic values would yield least errors across the full simulation, but it is neither obvious to understand nor easy to implement.

 

Few other points that came across very strongly in all the discussions:  Proper attribution is key:  other factors (i.e. timing, transitions) can have a significant influence on AFR, and the changes due to temperatures are lost in the noise from other factors (hpt  thread 14996)

This temperature accounting discussions brought out few new people:  For example, one dude named Adrian had this simple, but very profound idea.  If MAT=IAT+(ECT-IAT)*BIAS then MAT-IAT=(ECT-IAT)*BIAS, so with a MAT probe we could determine BIAS.  If MAT=IAT, then BIAS=0, which is nice, because not only it satisfies scientific formulas, but also makes common sense.  With an extra temperature probe in the intake (probe part number GM PART # 25036751) we could arrive at BIAS in a very simple way.  Any takers?

Another interesting point that came up in the discussions was the reason for the whole temperature estimation model, instead of a simple probe mounted inside of the intake.  Would it be reasonable to think that the whole complex estimator was created because probes in MAT were measuring the temperature of the intake housing, and not the air inside?

Another guy, Phillip, did some experiments and brought up to light that the temperatures do not affect MAF readings, while SD is clearly affected by temperatures.  This means that with a proper MAF calibration, VE calibration can be obtained by mapping out the MAF airflow on the traditional RPM/MAP axis, and back calculating VE based on the temperature estimates.  This is interesting, as one of my first contributions to the tuning community was the idea that MAF tuning is easy, because all you have to do is map out the airflow resulting from the VE-based SD calculations onto the MAF scale, which is the exact reverse of what this newest batch of research suggests.

A thing that bugs me about the various bias tables is how they differ from one model year to another.  There are straight lines, two sloped straight lines, lines that look like exponential delay… ultimately, they all point at the same patterns:  at small airflow numbers the bias line starts toward ECT, and quickly works toward IAT, asymptotically leveling off at the end.  To make estimating the bias curve possible, we must have some sort of idea for the function.  Exponential decay curve makes for such a line, as it has all the properties we need (BIAS=a*e(-k*MAF)+b).   Another great thing about the exponential decay curve is that we can manipulate its shape using three parameters, making the fitting process about as complicated as a polynomial or even a straight line, but results in a fairly complex curve shape.

 

Tunes often have tables that are either unused, or used in irrelevant ways.  For example there’s a voltage multiplier for IFR, which is just set to 1.0 on most cars.  However, on the 4 cylinder cars you can use it to achieve the effective IFR higher than its natural limit of 64 lbs/hr.  On all other platforms I tried, changing these values has no effect.  Such ‘occasionally functional’ tables make me wonder what is the purpose of adding a dimension of speed to the Bias table in the E40 ECU on the 05-06 GTO.  The Bias values do not change along the speed axis, making it effectively useless.  Is the full table used, and the calibration just does not take speed into account, or is the computer still using only one row of values, and the rest of the table is unused?  It is not that extra complicated to account for it, but I do not want to introduce variables to the model that are simply not there.

 

Most discussions about system modeling end up with someone attempting to oversimplify a complex system.  Reducing GM’s MAF/SD hybrid to pure MAF or pure SD to tune a particular table is an example of simplification in the name of gaining control.  On the other hand, we have people setting the Bias table to one value across the entire table, simply because they do not understand how the system works.  The combination of the Bias and Filter tables is a great example of how an ‘overcomplicated’ system can easily (and properly!) become a simpler, older version of the same system.  You can think of it as an evolutionary process, where evolution was forced upon insufficient precision of the older, simpler systems.  In the beginning there was a single IAT probe which was used for air charge’s temperature estimation.  It probably did not work too well, so they decided to move this probe into the intake, hoping to be ‘closer to the action.’  This also turned out to be a fiasco, as the probe ended up measuring the temperature of the intake more so than the air inside the intake.  The decision was made that since you cannot apparently measure the temperature in the intake, then it would be better to estimate it, as it is going to be between the two sources of the extreme temperatures in the engine bay—the airbox and the coolant.  A first attempt at this estimator was made using the Bias table alone, a simple matter of proportioning the two temperatures based on airflow involved.  If you simulate it, the sequence of temperatures resulting from such proportioning yields rather choppy and abrupt final temperature function.  Since most things in nature have smooth transitions, such a model demonstrated a need for a smoother output.  Such an output was provided by introducing the Filter table into the model.  The more airflow is involved, the quicker the temperature will converge to the newly present conditions.  If that was not complicated enough, the Bias table have grown a dimension to accommodate changes in bias depending on speed of the vehicle.  I would guess this is due to the fact that at higher speeds the incoming air not only gains density, but it also has lower temperature of the air charge.  So the system have evolved from a single sensor with no corrections on it, to a monster with three sensors (IAT, ECT, SPEED), and two tables (Bias is 2D, Filter is 1D), proportioning and dampening the inputs to create an estimator of temperature in the intake.  Let’s say we have a car with the fully evolved implementation of this estimator, but we have no clue how to calibrate all the necessary tables.  However, we might know how to deal with a simpler system, let’s say it’s the one without the filter table and with a 1-dimensional Bias table.  If we fully understand the system (even if we cannot control it) we can set the values of the Filter table to 1 (instant change) practically eliminating it from the system.  Then, if the Bias table’s speed dependent values are set to be identical for each airflow, the Bias table would become its own simpler version, fully emulating the behavior of an older system; hopefully it is close enough to yield good results, and simple enough that it is solvable. 

Here is the best example of how not to simplify the complex systems.  This is picked from some older bias adjusting discussions on the HPTuners’ forum:

“well..my cylinder bias temp is 1.0 across the board for now..and because they are all the same value my filter settings basically dont matter you would think this is a bad idea..but sometimes de-engineering GM and simplifying is a lot better than trying to use thoer whole dam slew of BS they throw in there..LOL”

Saturday, November 03, 2007

site updates

I just went through the site and fixed all the possible dead links, pictures, spreadsheets, etc. I could find, so the site is back to a useful state. It's entirely possible I missed stuff, so if you see anything broken, PLEASE LET ME KNOW.

I'll probably work on modifying the template, as the narrow column display is good for cheerleaders posting about their feelings, but not exactly fitting for all the graphs, charts, histograms and other crap tuning requires. So if the site looks goofy this weekend, just have patience and keep checking back.

Sunday, October 07, 2007

Temperature Modeling

Well, I'm back. I'm done with school, so I finally got time to do tuning stuff.

This is the first part of a larger thing I've been working on. The goal is both MAF and Speed Density tuning that works day, night, summer, winter, and at any altitude. Temperature is one of the three components needed.

Here's the paper:
DOWNLOAD (370kb)

The 'nice' version of the spreadsheet is coming soon, as I still gotta write up some instructions for it. If you must have it now, here's the DOWNLOAD (Excel 2003, 7.1Mb) and DOWNLOAD (Excel 2007, 3.7Mb)

Enjoy,
Marcin

Saturday, March 03, 2007

Natural limits and bad weather

So in the previous post someone asked me to post my spreadsheet for one of the pictures I posted. To be honest, I cooked it up really quick, and I think I nuked it at the end, so I had to make one from scratch again. This time however I had some fresh data from a LS2 with the Maximum VE tables upped into a reasonable territory. The problem with this data was that it was taken a day after the horrible tornados that went through The South recently, so maximum MAP for example was about 96kPa, while I've seen over 102kPa on this car before, so I know it's the weather, not a physical limitation of the car.

Also, since I've started dealing with LS2's, few limits became apparent: first it was the IFR table, then it was the GMVE, now it's the extra low airflow and airmass limits that I wrote about few days ago. All these limits got me thinking on what are the real limits of the stock computer. Afterall, with 63.95lb/hr of fuel I knew we'd run out of ability to describe fuel delivery, and 4.096 K*g/kPa on the GMVE table would limit the amount of airmass and airflow we could report.

Put all these things together, and I ended up with two spreadsheets: first, the correct version of what I created for the last writeup (yes, it was wrong! I'll correct it later), and a spreadsheet where I can convert gathered data into a much more comparable airflow and airmass figures, corrected to SAE conditions (99kPa, 25*C).

I'll start with explaining what I've done before and how it's all better now.
I took the Maximum VE values, and converted them to airmass, and then airflow values.
This shows that at extreme conditions of 188F IAT (why I picked these, I'll explain bit later) we'd get about 280g/sec of airflow at 6400rpm, which is also the limit expressed in other tables, so they make sense all together.



For exploratory purposes, I also added 2 'reverse' scenarios, for the pupose of seeing what kind of GMVE values one would get to achieve a certain airmass (or airflow in the second case).
Notice that with near max'ed out GMVE numbers, we'd get about 68lb/min airflow. If that sounds familiar, that's because it is. MAF's maximum number is 512g/sec which is the same damn limit. So this means, GM made the expressive powers of both VE and MAF tables equivallent, even for the worst conditions, which is the proper OEM thinking, always engineering for the worst possible scenario. So this means that no matter whether we use SD or MAF tuning, the limits are going to be the same.

The middle section (GMVE from airmass) was made becuase I wanted to see what valued I should expect from a well flowing big cam/heads setup, as I've seen some put down over 1.05g/cyl airmass. It's not exactly crucial, but it helps the total understanding.


Then I wanted to see how the numbers would change, if we made the aircharge temperatures slightly more optimistic, let's say about 80F (27C for these living in countries with a sane unit system), and I got these:



Turns out, that when temperatures are sane, we can get the same airflow as before, well below the GMVE table's limit! This is where a big bulb went off over my head. The reason why we've had so much problems with VE tuning in LS2, is becuase GMVE, while generally proportional to the old fashioned VE we're used to from LS1 computers, also reacts to pressure and temperatures! This means, unless we normalize pressures and temperatures while SD tuning, resulting GMVE are going to vary with the atmospheric conditions!

Yes, these statements require exlamation marks. In LS1 world, VE was nice to have, because it was temperature and pressure invariant. Here, we dont have this comfort anymore. OOPS, no wonder LS2's didn't want to easily converge on a stable GMVE table!

Good luck for my research, and bad luck for Alabama and Georgia, tornados hit them hard lately, and I just happened to send one guy who lives there to a dyno, to see what our recent extensive SD tuning managed to achieve. He wasn't happy, because the numbers were down from previous hacks performed by various pseudo tuners. So partially to cheer him up, and partially to find out just how much power can bad weather 'steal' from a car, I started some more number crunching.

Because these were dyno runs, I displayed all kinds of data against RPM. Temperatures, airmass, airflow, pressures, all got dumped into a table, as I didn't quite know yet what I'm going to need. Also because I wanted to get as close of numbers as possible, I grabbed data from the ECT vs IAT bias table. For these who havent played with it, it's a table that based on how fast the air is moving in the intake (airflow), the temperature used to calculate airmass (and thus airflow) would be weighted by different amount for IAT and ECT.



So first I calculated the temperature bias based on airflow and the temperatures. From that I was able to get the temperature that the computer (hopefully) uses to calculate other stuff.
Having that temperature, I was able to backcalculate GMVE values that gathered airmass figures would yield. To verify the correctness of my simulation, I calculated airflow using my new GMVE values, to compare against the airflow gathered directly from the computer. Error through the whole range is less than 0.7% in all cells except the edge ones, which is understandable, as we're using averages values, and on the edges we dont have data gathered from the entire range (ie. we're using 6800rpm to calculate airflow in that cell, but the data gathered from it would be calculcated from 6600-6800, so the average should be more like 6700). Either way, I can live with 0.7% error in my simulation.



With the GMVEs calculated for these particular conditions, I decided to see what the airflow and airmass would be like in SAE conditions. Low and behold, they would go up, quite significanly too. 2.5lb/min at peak airflow and 0.04g/cyl at peak airmass extra. I've been using a metric of 9hp per each 1lb/min of airflow for ballpark estimation, as it usually creates reasonable numbers, useful for more 'common sense' comparisons. So in the case of this car, we'd get 24hp correction.



Then I decided to yet again, calculate GMVE for the corrected airflow, to see how it would look like at these SAE conditions, and how far off it was from what we had, hoping we would see a correspondence to the AFR%Error logged.
Almost all new GMVE values ended up being about %2.4 off from what we calculated earlier. AFR%Errors are much more varied in both magnitude and direction of the correction. So that's not what cause these AFR swings. Where it really came from will be a whole different study.

Ok, so this was a lot of stuff... What's the point, what's the punchline here?

We cannot tune GMVE the same way we used for VE. I dont know how the hell I missed it the first time around, but that's what you get for theoretical tuning. You guys really oughtta buy me a GTO--Please paypal all your donations to marcinpohl at gmail dotcom ;)
Joking aside, but this is going to need another tool/spreadsheet/customPIDs or something creative like this. The new way of doing LS2 VE table is going to need taking into consideration not only current VE table and AFR%Error (or BEN's for EFILive folk), but also temperature and pressure. We will effectivelly have to convert the GMVE into VE, apply the correction there, and then convert it back to GMVE based on some conditions that the computer has to assume as standard values.
I will definitely make a tool for it, but not now, I really really oughtta get back to my thesis right about now.

MaximumVE spreadsheet DOWNLOAD
Bad weather correction DOWLOAD

Thursday, March 01, 2007

LS2 airflow uncorked?

I'm not sure if anyone noticed this before, but when you're tuning LS2's with the new funky GMVE units, they go up, reshape, but ultimately reach an early upper bound of about 2500. I always wondered about this, as it made no sense, most LS2's VE table and the resulting airflow would not reflect the real torque and horsepower gains.

Today, completely by accident I find a table called Maximum VE, sitting right there under Airflow->Dynamic Airflow. In EFILive, the symbol is {B2030}.

I open it up, and low and behold, it maxes out about 2500, with a peak at 4400-4800RPM, just like most LS2's peak torque. I quickly punch in some numbers into a spreadsheet, to see what kind of Dynamic Cylinder Torque am I going to see. Again, everything agrees with near stock LS2 numbers, around 0.85g/cyl airmass at peak.

This little spreadsheet also shows how much airflow you'd see with these airmass numbers at given RPM.

So I grabbed some recent logs from a well flowing, healthy, well tuned big cam LS2, and started charting max Dynamic Cylinder Air vs RPM. To make this task easier, I try to find a table that's already preconfigured for the same RPM intervals, as the VE Maximum table. Not only I found the VE Maximum table, but I also found few other tables that seem to pertain to the same problem: Maximum Airflow vs RPM, Maximum Airflow vs IGNV, and Maximum Airflow Delta vs TPS. They're all set up to deal with stockish power, 280g/sec (37lb/min) airflow, and small MAP and Airflow deltas. On the editor side of things, you can find them under Engine Diagnostics->General->Diagnostic Tests. In EFILive, the symbols are {C0803} to {C0806}

I quickly eyeballed what the numbers mean, and what they should be set to more realistically, and came up with this:

So this should work for most NA LS2's. I hope this is the limit, because it would explain a lot of issues I've been having tuning a large cam LS2, and the more airmass we'd get, the more timing would get pulled without a reason. Hopefully this is yet another Torque Managment issue, this time trying to save the engine from too much torque by pulling timing when hitting airmass/airflow limits. With this

The problem is that I still don't have a local access to a damn LS2! Anyone around Monterey wants to be my lab rat and get their car tuned in the meantime?

Anyway, I need you LS2 folks who have already braved the weird VE table and are running abyssmal timing to prevent it from Knock Retard, this might be your solution. I need you to change these limits that I posted pictures for above, and watch what happens to your Dynamic Airflow and Dynamic Cylinder Airflow. I'm predicting it's going to go up a significant amount. This means it might need a retune. Suddenly you'll be using deeper regions of timing tables, so please alter them accordingly.

Of course, this is all liability free, you're ready to blow up your engine, yadda yadda yadda, can't sue me stuff...

Please report back with your results, they're absolutely crucial as I don't have direct access to a LS2. The best way to do this would be to have a before and after pairs of logs and tunes, with the only change in between being the changes I recommended above. Remember that because you're going to 'uncork' your LS2 vehicle, you will probably experience lean conditions so please proceed carefully, set your PE ratios on the rich side with a healthy amount of safe margin.

The great thing about all this is that you will possibly be able to get more timing out of it, and get even more torque. So far I've had to cut down the timing on the big cam LS2 I've been helping with lately to below 20* to get rid of most, but not all knock. Without limits, the preemptive KR should disappar, airmass and airflow should skyrocket, timing would not have to be severly limited to push the airmass under the 'safe' limits.

This should really help. Airflow numbers should be realistic, torque should improve, and we'll all support the economy by buying new tires and clutches.

Got airflow?