Saturday, December 30, 2006

VE-IFR transformation

In many cases, we don’t have the full set of information needed to create the fully correct, reality reflecting tables for everything. The final fueling decision is a series of multiplications and divisions, thus allowing for ‘the fudge factor’—we can account for imprecisions by artificially altering other values. MAP and TEMP are fed from sensors, so short of upgrading the sensors themselves, we don’t have a way to influence their precision. AFR is just an arbitrary divider that we can verify with a wideband oxygen sensor. As long as that sensor is properly calibrated, there’s nothing to fudge there either. VE or GMVE, paired up with IFR are very frequently used to make up for imprecisions. VE is not easily measured, and IFR as my recent fuel pressure investigations indicate, is more complicated that we originally thought. IFR however can be calculated, if we have enough data for it. So if we have all variables except VE and IFR, and we can calculate IFR, we should be able to arrive at a reasonably realistic VE. Since VE is such a crucial table, it’s worth the extra effort to arrive at the higher precision version of it.

Let’s start with understanding of what a good tune is: a collection of final fueling decisions that result in desired target AFR. No matter how much fudging in tables is involved, it’s possible to arrive at it the final figures in an infinite number of combinations—that’s what most ‘professionals’ tune, they do not concern themselves with the truthfulness of numbers, just with the final resulting AFR. While effective, I’d like to enhance our ability to arrive at the precise numbers that reflect reality.

Fuel decisions are nothing else but a set of Injector Pulse Widths calculated for every possible condition encountered in our engine. We calculate them using the formula:

IPW = GMVE*MAP/(AFR*IFR*TEMP)


So to convert from one set of parameters that creates a good tune, to another set of parameters that yield the same IPW’s, this must be true:

IPWnew = IPWold

So we expand both sides of this equality:

GMVEnew * MAPnew /(AFRnew * IFRnew * TEMPnew) = GMVEold * MAPold / (AFRold * IFRold * TEMPold)

And then solve it for the new GMVE:

GMVEnew = GMVEold * (MAPold/MAPnew) * (AFRnew/AFRold) * (IFRnew/IFRold) * (TEMPnew/TEMPold)

We notice that if the tune is good, if it preserves the final fueling, target AFRs will be the same, thus:

(AFRnew/AFRold) = 1

Temperatures are also the same across the full range, TEMPnew/TEMPold = 1

Same goes for MAP ranges, MAPold/MAPnew = 1

This simplifies the main equation to:

GMVEnew =GMVEold * (IFRnew/IFRold)

Also notice that since

GMVE = Vol * VE / R

and Vol and R are constants, thus:


VEnew =VEold * (IFRnew/IFRold)


This means this transformation applies to both VE and GMVE forms, allowing the same logic and methodology to be applied to LS1/LS6 and the newer LS2 computers.

The important thing to remember here is that while these equations work for singular values, these dependencies must be true across the full table.

IFRold-3D version

The easiest way to visualize that is by employing the histograms. We’re all used to looking at the VE table and IFR tables, that’s nothing new. Here, in order to multiply them all out just like the formulas would suggest, all the variables in question must be describing the same temporal instance in the engine. Then in order to perform the calculation, we also must have it in the same units. IFRold is the traditional IFR table, but viewed not in a traditional 2D way, referenced against Manifold Vacuum, but on the same axis as the VE table. How do we view it this way? The easiest way is to log GM.INJFLOW, and then make a custom histogram, starting with your basic BEN histogram, but then changing the data to be working on GM.INJFLOW, not BENs. This will give you a VE-like view of what injector flow the computer uses to calculate the final fueling. Displaying of the actual histogram is optional, it’s not mandatory for the final transformation to work, but it does help to understand what we’re doing here, and why do we need to grow a whole new dimension on a simple IFR table.



IFRnew

The tricky part is how we arrive at the IFRnew. As I found out from the Under (Fuel) Pressure write-up, Fuel Pressure varies not only based on Manifold Vacuum, but also on RPM and even smaller factors, like the Battery Voltage. Thus, to obtain the most realistic IFR table, we also must create a histogram that takes these variables into consideration, and then shape it just like the IFRold histogram we created in previous paragraph, to be able to do an element-wise division, for the final calculation. Just like IFRold histogram, this one is also optional, and one purely for educational purposes.

First we must log the Fuel Pressure. Hardware and setup necessary to do that is beyond the scope of this write-up, as it’s been wonderfully described in TAquickness’ document . Once we have CALC.FUEL_PRESSURE (or whatever other name you gave it, I’m going to use this name in this document for clarity), we need to create another custom PID that calculates the injector flow based on the injector rating, Manifold Vacuum, and the Fuel Pressure.

EFILive’s custom PID infrastructure allows us to do all this, and even have multiple units for the same entity.

First we add few units to calc_pids.txt:

*UNITS

#Code System Abbr Description

#-------- ---------- -------- -------------------------------------------------------------

PSI Imperial PSI "Pounds Per Square Inch"

KPA Metric KPA "kilo Pascals"

GPS Metric gps "grams per second"

LBPM Imperial lbpm "pounds per minute"

unit Metric unit "unit"


Then we create calculated PIDs for converting FP gauge voltage to PSI and KPA. This example uses GM.EGRS as the source of FP voltage, as per example in TAquickness write-up. If you have it hooked up through the external inputs, please refer to his manual how to adjust this PID definition.

*CLC-00-001

PSI 0.00 100 .2 "({GM.EGRS}*25)-12.5"

KPA 0.0 700 .1 "(({GM.EGRS}*25)-12.5)*6.89475728"
Now we must calculate our own CALC.INJFLOW which is calculated from GM.MANVAC and CALC.FUEL_PRESSURE. Notice that in order for the calculations to make sense, they all are converted to kPa.
*CLC-00-002

GPS 0.0000 30 .4 "42*0.125997778*sqrt(({GM.MANVAC.kPa}+{CALC.FUEL_PRESSURE.KPA})/(3*100))"

LBPM 0.000 200 .3 "42* sqrt(({GM.MANVAC.kPa}+{CALC.FUEL_PRESSURE.KPA})/(3*100))"
Notice that this is the place where we must hardcode the value for the rated flow and pressure of the injectors.

The 42 at the beginning is an example of a popular 42 lb/hr injector. This is where you insert the rating of the injector in lb/hr, and the conversion to g/sec is done for you. The rated fuel pressure is at the end, that’s the (3*100). Most injectors I’ve seen are rated at 3bar, and to convert from bar to kPa you just multiply by 100. So unless you have some really unusual injectors, you most likely will not need to change this, this is just for your information.

There are two versions of the same PID, this way we can display the calculated injector flow in both popular units for easier understanding.

Now set up another histogram, again with the usual VE axis (I like to use the BEN histogram as a starting point), and replace BEN’s with the CALC.INJFLOW.



Marcin Transformation Factor

We have now two histograms of IFR—one is the IFRold, and the second is IFRnew. We can create another calculated PID that will divide the two tables on element-by-element basis.

*CLC-00-003

unit 0.000 10 .3 "{CALC.INJFLOW.GPS}/{GM.INJFLOW.gps}"

And finish it off with the PRN section that binds all the previous definitions into coherent entities:

# ==============================================================================

*PRN - Parameter Reference Numbers

# --------------------------------

# See sae_generic.txt for more information on the *PRN section

#

#Code PRN SLOT Units System Description

#------------------------- ---- ------------ ---------------- ---------------- ------------------------------------------

CALC.FUEL_PRESSURE F001 CLC-00-001 "PSI,KPA" Fuel "Fuel Pressure"

CALC.INJFLOW F002 CLC-00-002 "GPS,LBPM" Fuel "Injector Flow from Fuel Pressure"

CALC.MARCIN F003 CLC-00-003 unit Fuel "Marcin Transform"


With the complete setup, we should create the final histogram—yes you guessed it again, on the same VE-like axis. This time, we use CALC.MARCIN for the data to histogram. You should get a histogram that has a bunch of values near 1.0. The more your Fuel Pressure was varying from the theoretical based pressure we used to use with the old IFR spreadsheet, the farther away from 1.0 the corrections are going to be. This histogram is mandatory.



IFRnew-2D

The other important thing that you can get from all these calculated PIDs, is the automatic creation of your new, Fuel Pressure based IFR. All you need to do is create another histogram, with CALC.INJFLOW as data, and GM.MANVAC as rows with 0..80kPa range with 5kPa step. This histogram is also mandatory. This is what you’re going to paste into {B4001} table.

Now you can copy the whole CALC.MARCIN table, and multiply it out with your existing VE {B0101} table, transforming it to account and agree with the IFR table that we just build in the paragraph above. Together, the new VE and IFR should preserve the final fueling, which if you had it perfect to start with, should carry over to the new setup.




Conclusions

While not instantly mind blowing, these concepts and tools have some deep consequences. Now you are able to convert any VE into another VE based on a different, hopefully better, IFR settings. This means, if you have a tune done by some hack tuner that jacked up your VE and IFR arbitrarily, you can log Fuel Pressure, and painlessly and without full VE tuning sessions, transform into a much cleaner, saner and meaningful, closer to reality VE and IFR tables.

Another application is playing with Fuel Pressure, or installing a new Fuel Pressure Regulator, on your already well tuned configuration. Normally, you’d have to start from scratch, and tuning VE yet another time. This allows you to be able to play with the FPR much more, looking for the perfect base and rising rate to compromise between good low pulse width idle quality, and regulating FP so at WOT you have a safe amount of fuel provided to the injectors. You can just try yet another IFR setup and see what it will do to your VE with no need for slow, ticket-prone retunes.

If you suspect your fuel system isn’t up to task, logging fuel pressure and histogramming it as described in this write-up will also show you the deficiencies. At this point you can either chose to just use the transformation described and account for the deficiencies, or go shopping for a more capable system. The important part here is, you don’t have to guess and eyeball anymore, you can quantify it and see it in black and white.

Side notes and Commentary

All of this is done in EFILive, no spreadsheets, no custom code, just utilizing a well designed infrastructure. This little exercise demonstrates just how powerful it can be. About 12hrs before I had the first functional Transformation Matrix, I never set up a custom PID. So it cannot be that difficult either.

On the other hand, we have HPTuners. I got some data with logged fuel pressure voltage, and while I was able to convert the voltage into actual Fuel Pressure, converting from BARO and MAP into MANVAC turned out to be outside of its reach. I’ve spent hours experimenting with it, trying to get it to work, with no results. I tried to refer to some other more hardcore HPTuners users out there, and not only they weren’t able to set it up, It also turned out to be really difficult to exchange the custom PIDs, as there is no clear configuration file containing such info. If anyone knows how to deal with these issues with HPTuners, please let me know, I’d love to have another version of document that explains it in HPTuners terms.

I highly recommend learning to harness the power of custom PIDs and custom histograms; this is how the raw data turn into information.

Special thanks goes out to a prof of mine, Mathias Kolsch, who in the process of teaching me Computer Vision, gave me lots of new tools and ideas, some of which directly contributed to this particular transformation method.

Big thanks also go out to TAquickness and Tordne, who had the insight to set up fuel pressure logging, and patience to explain all the EFILive intricacies to me, as well as being crazy enough to let me test my theories on their cars.

On a more personal note, this is probably going to be the last writeup for another 6 months, as I must finish my masters degree and write a thesis. I'd rather be tuning, but oh well. This isn't a complete retirement, I am trying to take some classes in which I could spend improving my tools (Human Computer Interaction), and learn more math to spot and analyze relationships in data (Data Analysis and Simulation) so there will be updates, just nothing huge.

Keep warm, and happy New Years,
Marcin

Tuesday, December 26, 2006

Fuel Pump sizing

My fuel pump pressure post gave me a lot to think about, and few people had some interesting questions as well. One of the simplest, yet most important questions was 'is the fuel pump holding up?' I looked around, and amazingly, I have not found much information on how to estimate how much fuel your fuel pump needs to be able to pump so injectors can keep with the demand.

Most fuel pumps are rated in how many Liters of fluid they can pump an hour. I'm not exactly sure why they'd go with a volume flow rating, when injectors are mass flow rated. The easy way around it is to convert one to the other, which should be easy, as mass=density*volume. Of course there are various types of gas, so the density specific to particular types of petrol will differ, but the generally we should be close to desired rating. I found numbers of 690g/L to 770g/L, so I'm going to use 730 for an easy average. These translate to 0.690kg/m^3, 0.770kg/m^3 and 0.730kg/m^3 respectively, for the more traditional measure of densities.

This spreadsheet converts the rated flow of the pump into units comparable with the units used for injectors, and then divides the flow of the pump by the number of injectors, to see if the flow provided to each injector is larger than what the injector would flow at WOT at standard LSx 58psi fuel pressure.

It's all very simple, but the funny part is that once I started plugging in typical fuel pump flows, the per injector flows were very closely matched to the flows provided by the popular injector sizes!


190 lb/hr fuel pump outputs just above what SVO red tops need.
255 lb/hr fuel pump outputs just above what SVO green tops need.
350lb/hr fuel pump outputs just above what Mototron 60's need.

I'm not sure if it's coincidence or not, but it works so nicely, it's a really easy 'rule of thumb' to match injectors with pumps for a well balanced system.

Here's the DOWNLOAD if you want to play with more specific options.

More fuel system investigations coming soon.
Stay tuned,
Marcin

Thursday, December 21, 2006

IFR spreadsheet for Logged Fuel Pressure

Here's the new, promised IFR spreadsheet that calculates IFR table accounting for the variable Fuel Pressure.

DOWNLOAD

This is NOT a replacement for the old IFR spreadsheet! This is only for people who set up their Fuel Pressure sender units to log. If you don't have such a setup, continue using the old one.

Remember that this will only work if you log your fuel pressure first against a variety of driving conditions. I'm not going to describe how to log it, as I've already seen it set up as the EGR voltage, or as the separate input (just like a wideband). HPTuners and EFILive setups differ as well, so deal with it appropriately. I don't have resources to describe every possible combination of hardware and software here, and this is a more advanced thing to do anyway, so I'd rather not give people a false sense of assurance.

One important note: remember that most pressures in the GM PCM are absolute. IFR for some strange reason, is based not on MAP just like about anything else, but on Manifold Vacuum. In EFILive this is easy, MANVAC is just another PID to pick. In HPTuners, I haven't seen it yet. I tried to make it with a custom PID of BARO-MAP, and then use it to create a custom histogram of the new MANVAC-like PID against the Fuel Pressure PID. Easier said than done, after many hours and help from people that know HPT in and out, I just gave up. This is what you get for hacking custom PIDs into HPT at the last moment, and not having them as a part of design and infrastructure from the get go.
Anyway... If anyone figures out how to get FP vs MANVAC histogram going in HPT without major hacks, please let me know, right now it's a bloody mess.

Just like I mentioned in the last writeup, FP apparently varies even within the same MAP range, making tuning IFR against the logged Fuel Pressure closer to The Truth(TM) but still not perfect. For now, we're still stuck dealing with the VE table making up for non-MAP related IFR variations.

Next up: transforming VE's using the new IFR without retuning.
Stay tuned,
Marcin

Sunday, December 17, 2006

Under (Fuel) Pressure

After a year and a half of using the IFR spreadsheet, I came to the conclusion that while it is not wrong as far as the information given, it leaves much to be desired when it comes to truly reflecting reality. The biggest problem it has is the lack of expressing how fuel pressure differs at various loads (Manifold Vacuum).

Unexplainably high VE values on some cars made me think that even though we 'fixed' some old-school arbitrary IFR choices, we're still fudging somewhere, because there's no reason for the theoretical VE numbers to be that high.
Once I created the equations for airflow I realized that the only spot where the 'fudge factor' could occur would be the IFR. The rest of terms in the eqations is either logged (MAP, temps, RPM) or not exactly changable (number of cylinders, cylinder displacement). In the meantime, TAQuickness and few others started working on a simple setup that would allow us to log fuel pressure alongside all the usual PIDs, not just a simple gauge you can look at at idle.
Eventually all the experiments came together, and provided me with some very interesting data. The car from which the logs discussed here come from is running 42lb/hr@3bar injectors running at 63psi. On the table and chart below, the
values calculated using the standard IFR spreadsheet are labled IFRcalc (pink dots, values on blue background). The other data series is calculated from logged Fuel Pressure (comes in as a EGR voltage, so it's evgs in the table) which then gets converted to PSI for easy lookup/calculations (marked FP).
Once we know the nominal flow of the injectors and the real Fuel Pressure, we can calculate the real flow of injectors (labeled IFRfromFP, blue dots, yellow background in the table)
As you can see, the blue dots are nowhere near pink dots. Apparently measuring the fuel pressure at idle (no load) doesn't give you the best numbers. That's fine, that means you just need to reconfigure IFR for new FP, right? Wrong!
Not only the FP numbers going in aren't close to what they are, they are also non-linear. We need to update the IFR spreadsheet to be able to take various FP inputs, depending on the MAP. Easy enough I think, and quickly make some adjustments to the spreadsheets.



The Fuel Pressure drop seemed significant enough that I wanted to understand it deeper, it didn't just seem to be some underpowered aftermarket junk part, but a more complex issue. I wasn't quite convinced that the Fuel Pressure drop was solely a function of MAP/Manifold Vacuum. So I started graphing FP against various entities to get a better feel for it.
There was an obvious relationship between MAP/Manifold Vacuum and FP, as we already have seen with the data above.
I graph it against RPM, and there's another definite relationship. Now I'm confused--how can it be, if the crucial IFR table is purely manifold pressure based?



Another popular view is airmass based, like the timing tables, I thought, maybe it's load/compression/torque dependent, afterall that's when the most air gets consumed.



I graph FP vs DynCylAir and I keep getting the same shape drop when I did when I graphed it against RPM. Why not do a 3D graph of FP vs RPM and DynCylAir? I'm starting to see a cleaner relationship, the more DynCylAir coupled with RPM the less FP we get.




So I'm thinking: DynCylAir is like torque, and DynAir is like horsepower, and TQ and HP are bound through RPM, so why not graph DynAir vs FP?



BINGO! This graph seems to be very linear, with a high degree of confidence.
But then I start to think what does this mean--why higher Airflow makes the Fuel Pressure drop so consistently linear? Obvieously more airflow needs more fuel flow, they're coupled through the AFR, RPM just enforces the time intervals to do the fuel injection in, and IFR tailors it to the injector size and fuel pressure.
From the Speed Density paper I've discovered that:

AIRFLOW=CYL
*RPM*IPW*AFR*IFR/120
and we know that
IFR=IFR(rated)*sqrt(FP/FP(rated))

which for the purpose of this discussion(meaning keeping everything else constant) means that Airflow is directly proportional to RPM, and the square root of Fuel Pressure. This is not what this graph says, at least with the given precision. This graph, even though introduces a lot more noise for the high Airflow values, still seems to lay along a straight line. So the possible explanation might be that because we're using a fairly small range of FP values, we don't get see the curve that would result from a square root relationship.
Another explanation comes from the way I obtained the data for the Airflow vs FP graph itself; I histogrammed the Airflow into 5g/sec bins, to equalize the number of samples along the axis, because it's hard to log large number of samples in higher airflow ranges on the street. If I fit a line to a large number of samples, mostly in the lower ranges, the fit would be good there, but the scarse upper range data would be largely ignored. While the histogramming first gets rid of the weighing to the large number of samples problems, it potentially loses a lot of precision, in our case enough to not be able to tell which type of relationship it is.

So this investigation leaves us with more questions than answers:
  1. Why does the FP drops so much more than it officially supposed to (proportional only to MAP)
  2. If the FP is so well proportioned to Airflow, is that by design or by accident?
  3. Even if I log FP precisely for my fuel system and adjust IFR values directly based on that, the swings if FP values within the same MAP range (since that's all we can differenciate by in the IFR table), are still significant.



    The only table that's able to account for the RPM swings is VE. This is not what I wanted to achive here, I wanted to free the VE table to be the 'catch all fudge table' and have it become the true theoretical Volumetric Efficiency. So where else could I move the fudging duty to?
The good part is that now we know just how bad our fuel systems are when trying to hold up to a moderate (400lb/min of airflow ain't that much, I've seen cam-only LS2's flowing 450+) power. Throw in a better flowing system, more cubes, or god forbid any forced induction, and our FP shrinks down in the moments when we need it most--WOT. So, if you want to impulse buy anything this xmas, I highly recommend a return fuel system with a manifold pressure referenced fuel pressure regulator.


This investigation started really small, I just wanted to see how badly does the Fuel Pressure drop and what effect it has on the IFR. Now I see the shortcomings of the fuel systems, computer's inability to express all the changes that take place, and shortcomings of my own IFR spreadsheet (new version coming up shortly).

There will definitely be a lot of other stuff coming out of these observations, as this is very scary, considering how much trust we put in aftermarket pumps, and they simply fall short of expectations. I've always told people to get bigger injectors and run with a healthy margin left. Apparently I didn't know just how right I was--in this case running with IFR falling 10psi from what your computer knows about yields 9% less fuel delivered! When you're trying to get your AFR within 1-2%, 9% error in one of your data is going to seriously monkey wrench your system.

So this xmas, be afraid, be very afraid...



New IFR spreadsheet, and then automatic translation of your VE based on the new IFR are going to be the next targets of attack for me toolwise.

Stay tuned,
Marcin

Why tune VE?

This is a post in one of the forums, I usually don't like to duplicate information, but singular forums posts tend to get lost in the noise, so I'm posting it up here as this is something that should be very clear to everyone that's trying to tune their car.

The question was:
Does this (VE tuning) gain me anything performance wise?


This is a very good question, I'm glad someone is trying to understand what it is that VE tuning is actually about, not just how to do it.

1. Without VE being perfect, you'll never be able to find out proper timing. When computer detects the tiniest tendency to run lean, it will be very trigger happy to pull timing with usually no good reason. Thus, if your VE is on the lean side (and it usually is, after all that's what adding better flowing parts is about--flowing more air) you will get a lot of knock in random spots, and no amount of pulling timing yourself will cure it, causing your car run like poo.
2. Sudden transitions are hard to get right. Without VE being dead on, you are making it almost impossible to get right. Bad transitions cause knock, which lingers around, doesn't last just when going over the areas that aren't perfectly tuned. I've seen knock last over 5 secs. If you're a drag racer, that's diminished performance for half of your run. That's why it's also important to tune not just some of the VE, but ALL of it.
3. When your car develops a problem, you will notice it. If your VE is well done. airflow numbers will be down, knock will appear, but you know it's not the fault of the bad tune, but a result of some hardware component failing.
4. When VE is perfect, it is meaningful. If you add a part that supposed to improve engine's breathing, your VE will go up, and if you get it tuned perfectly before and after, you will know just how well the part works, and for what MAP/RPM range.
5. With perfect VE, your airmass and airflow numbers will be meaningful as well. with their close correspondence to torque and horsepower respectively, you can optimize your powerband.
6. Perfect VE enforces other tables to be meaningful as well. For example, to obtain the same proper fueling with wrong VE, you will have to hack either your IFR or PE numbers. With all of them perfect and meaningful, when you want a 12.9AFR, you can just command it in PE and it will happen, instead of taking stabs in the dark hoping that some arbitrary PE will make it happen by accident.
7. Since VE dictates airmass and airflow, everything based off such tables will work better as well. Shift tables for automatics need to know how much power you're really making. If you're lying about VE, then this power estimation is also wrong, making the transmission misbehave.

In general, VE in itself is important. A lot of other things are derived by calculations based on numbers calculated from VE. It really ends up being a domino effect. If VE is meaningful and proper, then it forces other things to meaningful and proper as well. But if you botch/ignore VE, then the bad effects will propagate, making the entire tune a major hack, making the car drive horribly, and sending the tuner chasing his tail. You pick which domino effect you'd rather experience.

In the long run it's really just easier to do it Right.

Monday, December 04, 2006

Unscrewing a bad tune, Part 2

Sunday mornings are usually connected to fuzzy slippers, eggs and bacon, extra long lounging session in the tub...but not today. Barely did I sit down in front of my computer, I was asked to look at some Forced Induction tunes. The guy asking these questions was rather skeptical about the correctness of some examples he's received. Of course, the people who he got the tunes were claiming their turbo setups running well.

So I dove into one of the tunes, and all the usual marks of a bad tune were there: arbitrary IFR, untouched VE and MAF curves, super aggressive PE triggers. The whole tune was pretty much based on the PE table, assuming identical boost and airflow at the same RPM, and ignoring all other variables. The car supposedly was running well at 10psi, making me wonder if I can learn something from it. In order to do that, I decided to 'unscrew' the hacked up tune. If the measured AFR was correct, that would indicate that the final fueling decisions were made correctly, despite the wrong input data. Since this is a staple of every 'pro' tuner out there, I decided to see if it's possible to see if two wrongs can make a right.

Since the car was running in MAF mode, and the MAF signal completely maxed out by applying some healthy 10psi, I knew that the airflow figures are going to be wrong. While looking at the IFR table, I learned that the injector flow values were completely arbitrary. PE was the only real tuning device, and the resulting Pulse Width was the only non-wrong, non-fake value in the whole setup. Thus, task 1: calculate the IPW.



This part is easy, I thought. Plug in the wrong numbers, in my case 59lb/min of airflow (max'ed out MAF), 41.3lb/hr injectors, 11.15 PE value for 6400rpm which was the redline, into my VE2IPW calculator and be done. I realized that's no so easy, as my VE2IPW calculator is optimized for working with Speed Density data, not MAF. There is no field for Airflow, only its components, and Airflow gets calculated dynamically behind the scenes. I looked into the Speed Density paper for some equations, but they were no help either, as they also expected either VE, GMVE, or rho (air density), and I didn't have any of them available. If you want the hairy math details, read the updated paper. If you don't, here's a short version:

IPW=120*Airflow/(Cyl*RPM*AFR*IFR)

This means now we can calculate Pulse Width directly from the airflow number, no matter what the source of it might be, MAF or Dynamic Airflow are both fully viable sources. In the case of the hacked up FI tune I knew the car ran on maxed out MAF, so I just used the maximum value from the MAF table, 59.8 lb/hr. Few quick unit conversions and simple math operations later, I arrive at the IPW at 6400RPM: 18.9 msec.



OK, so now what? I figured I wanted to first see what the numbers would really look like if the tune was done properly. I inversed the formula to calculate the Airflow from IPW:

Airflow= IPW*Cyl*RPM*AFR*IFR/120

The big change this time I wasn't going to go with fake, ridiculous PE and arbitrary IFR. I found out what the injectors really were, calculated their flow against the fuel pressure I was told the car ran at (48.5 lb/hr). I used the AFR values from what the car supposedly ran at, 12.0AFR. Again, do some unit conversions, and out pops out the real value for airflow we should get: 576g/sec (75.6 lb/min), which is beyond the max value storable in the MAF table. So yet again, MAF being useless on Forced Induction comes out again.

Then I decided to compare this estimation of the real airflow with one of my older spreadsheets (INJsize.xls) to see how close the two are.

So I quickly punched in 8 cylinders, 5.3L (it was a truck tune), 6400rpm redline, 100%VE, and 10psi of boost. The result says 576.7 g/sec (76.1 lb/min) of airflow. That's within 1% I was happy to see consistency between the two completely different methods arriving at the same conclusion. Of course, a quick glance at the injector sizing spreadsheet pointed out that he needs almost 100% of fuel flow capacity of 48.5 lb/min injectors, and that to make it go down to 80%, he'd need to flow about 60 lb/min. Another popular myth busted--you can't run much of a FI setup on the popular 42 lb/hr (@3bar) injectors, need to step up to something bigger.



I'm posting the updated Speed Density paper HERE, and the example 'bad2good' spreadsheet HERE.

happy unscrewing bad tunes,
Marcin

Saturday, November 04, 2006

Terminology and Confusion, part 2 (OLvsCL)

Open Loop vs Closed loop tuning is another huge source of misunderstanding. Partially because it's just few terms out of a huge body of Control Theory (PID also comes from the same area), without understanding the rest of the principles and theory behind it. Another reason is because of how people use it, it's almost always referred to as 'OLSD', as if it was one thing, which it is not.

Open Loop and Closed Loop are just a methods of control of fueling. OL is basically a system with no feedback. Think of a sprinkler system that sprays the lawn whether it needs it or not. To contrast that, you have CL--a system which takes the output if its own operation as in input for the next round of calculations. In practical terms, it would be a sprinkler system with a ground wetness sensor, and only activating the sprinkler system if the ground is dry. The good part is not wasting water when the lawn doesn't need any more. The bad part is that we actually need sensors, threshold levels, hysteresis models, and other scientific junk, just to keep the damn lawn from drying out. This is definitely a place to consider effort vs benefit.

So what does it mean for a car? The main benefit of OL control is the direct relationship between what you tell it to do and what it does. It will do exactly what you tell it to, which is good if you tell it the right thing, and potentially catastrophic if you don't. That's why most tuning is done in OL--you want to see exactly how much airflow (MAF or VE) and which commanded AFR (OLFA or PE table) yields a particular AFR. This is the entire logic behind tuning--once commanded and resulting PE agree 100%, you can back calculate the airflow from displacement, pulse widths, injector flow rate, RPM, MAP, IAT and AFR. This is how you obtain airflow characteristics of an engine, no matter if it's with MAF or SD approaches.

Once you obtained that airflow characteristic, you could continue running in OL, and all the environmental changes would show up as change in airflow numbers. In SD, VE table is calibrated in what I call GMVE units, which take temperature and barometric pressure into account. This means that if that pressure or temperature changes, it is easily recalculated to current conditions. In MAF mode it's even simpler, more airmass cools the hot element of the MAF sensor better, automatically giving you a new, adjusted reading. Both models work just in any condition. (this is an answer to all the 'do I have to retune for weather?' questions that show up at least 3-4 times a week on forums)

So if it works so well, then why would we ever need CL one might ask? Doing math for all these models is great, everything agrees, but in practice, things like airflow measurement, or air fuel ratio measurement are an inherently difficult problem. Tuners drive around and scan and know what to adjust when. Normal people dont do that, they hop in and just want it to work, without scanning, analysis, and reflashing their car's computer. Thus, CL became that automatic tuner. It looks at data from different sensors, and if it consistently points at a new better setting, it adjusts. It's a perpetual feedback loop, not so commonly refered to as the Closed Loop. This model of course has its limits. While it will adjust to things like weather changes, or driving through the Rockies, it will not adjust for racing camshafts, huge heads, changes of displacement, and other significant changes to the airflow. Car's computer is willing to adjust, but also must be able to detect hardware failures. To a computer, airflow reading way out of its usual range is flagged as an abnormal event that should be looked at, while to a human it just might mean we put some heads on it. Computer has no way of knowing which one it is, we must tell it.

If you read and understood the last two paragraphs, you might have noticed, that a human tuner, and CL mechanisms (fuel trims) have the same function: to observe and adjust airflow changes. If you think about it, what we usually call the OL tuning method, is really CL--except that the mechanisms doing the adjustments are not automatic and computerized, but human, and done outside of the system.

This brings me to conclusions: in part 1 of this writeup we learned that MAF mode doesn't really work off MAF alone, and now we learned that Open Loop is a human powered Closed Loop.
I think what happened here is that we got lost somewhere between lack of technical understanding, and the traditional American tendency to polarize and zealotize (is this even a word?) concepts. This isn't your usual Coke vs Pepsi, Chevy vs Ford, Republicans vs Democrats war of ideologies. Reality is complex, and simple models are just too simple to describe it. That's why when we want a flexible system we end up doing hybrids, as there usually is no 'one size fits all' solution.

So the lesson from this is to learn, explore, and never be afraid to look at an alternative solution, as in more cases than not, you'll both be right and wrong at the same time, just for different set of parameters. There are very few absolute rights and wrongs, but if you are comfortable with all the alternatives, then at least you have a good chance of picking the best solution for your application, your purpose, your environment. If you're a tuner that always wants to run on the rugged edge and get as close as possible to 100% of potential, you probably want OL-SD. For a daily driver that doesn't get scanned too often, CL-MAF or CL-SD are the way to go. If you're bracket racer and you want as much consistency and control as possible, OL-MAF will probably yield you the desired effect.

Don't be a close minded zealot--just because a buddy with a fast ride told you something, doesn't mean it's going to work for you.

Wednesday, October 18, 2006

Terminology and Confusion, part 1

A lot of big words get thrown around on all the forums, but how many people actually understand what they're saying? Once you actually read into their posts or problems, it quickly becomes obvious that they either don’t know what they're saying, or they just answered their own questions without knowing it.

The usual example: MAF tuning vs. SD tuning.
MAF tuning is not a _pure_ MAF tuning. During sudden changes in throttle input, or any other MAP jumps, the PCM prefers to refer to the VE table for airflow lookup/calculation. If you're not sure how VE table express airflow can, I highly recommend reading my 'How Speed Density Works' paper. If this was a "pure" MAF system, ALL requests would come from the MAF and MAF alone.

GM decided to make it into a hybrid system. Why would they do that, might you ask? MAF can deliver very precise, low noise signals, providing simple devices that can be easily calibratable to different applications, and have a reasonable range and resolution. But it also has a problem with not having the cleanest signal when not much airflow is going through the MAF sensor, or failing to deliver a smooth, universal airflow. Speed Density calculations however are just that--math. It's not dependent on physical conditions, thus not affected by the non-uniform airflow at lower MAF frequencies. As long as all the necessary sensors (RPM, IAT, MAP) are healthy, and all the lookup values (VE, displacement, IFR) are correct, the airflow numbers are going to calculated correctly, despite physical conditions like low, or reverse airflow. The PCM itself is very much airflow source agnostic and it uses whichever source is better suited, or at least yields less erroneous values. Another neat side-effect of having both Speed Density and MAF working together side by side, that if you detect MAF failure (DTC codes P0102 or P0103), the computer seamlessly falls back onto then pure Speed Density mode, so you can safely drive it to the mechanic.

So to all the MAF pundits: you can complain about SD all you want, but the truth is, you're running in SD at least part of the time you run your car, as there is no such thing as 'pure' MAF move on our PCMs.

Some smart guys saw it as strength, an advantage to this dual-source approach, and SD tuning became a reality. Turn off MAF, run in pure SD, and dial in your VE, so it precisely describes the breathing capability of your setup. What do we do with MAF then? After 4000rpm it's going to take over completely, and we're going to be ignoring our new perfect VE! That's when I figured out how to 'map' the airflow calculated from the VE table onto the MAF frequency-based scale. This way we have brought back the dual-mode capability to the system, just like the system is designed to work, but now it has new data, tailored to our application. Because of that single source of airflow data, if the PCM decides to jump from MAF to VE based airflow, the airflow numbers should be smooth fit, not causing wrong air mass readings (that's used to look up timing advance, which in effect can cause bucking), or airflow, which in effects causes knock, or at least hesitation, making for a terrible drivability.

An alternative, interesting approach was to use AFR%Error to manipulate MAF airflow numbers, to establish the new MAF calibration. While theoretically it should yield an identical result as it would with my Dynamic Airflow onto MAF frequency mapping, the reality is too fuzzy, and often yields discrepancies significant enough to cause the engine to get different numbers than it should have. While I do not recommend this method for MAF tuning, I _highly_ recommend using it to verify the VE tune, as well as to observe daily environmentally influenced fluctuations.

Another note to MAF pundits: If you claim that MAF is better purely on basis of not being able to get SD working correctly, you might want to watch out for your 'MAF' tune (I put it in quotes because it's still a hybrid with SD). Every time you get on the gas more vigorously, your untuned VE table will rear its ugly head, and give you an AFR spike, bucking, knock that's hard to reproduce, hesitation on takeoff and general unpleasantry. There is no escape from doing VE on these systems. Even the most hard-headed MAF tweakers out there have given up, and modify at least the idle areas of VE as without that, making the car idle is somewhere between difficult and impossible.

To farther prove my point about the MAF having very different characteristics on low vs. high airflow situations, let me demonstrate a typical spread of samples from < 5000Hz, and above 6000Hz.






As you can notice, the scatter is quite significantly higher in the lower frequency areas (look at R^2 values). I use different sets of parameters to filter out noise for these two distinct regions, because of their different characteristics, I use 5500Hz as the usual boundary between high and low noise areas. I had a very large smile on my face, when I downloaded LS2 and LS7 stock tunes, and saw not one, but two MAF tables, switching at 5800Hz! Apparently GM also has two different sets of filtering parameters for the two distinct characteristics of MAF and the signal quality based on airflow.

In the end, remember what SD or MAF is: a source for airflow figures. If the PCM doesn't care where it gets the numbers from, why would you?

Most of the arguments out there stem from lack of understanding of how they work, and what are their limitations and applications. There are a lot of myths out there, i.e. SD not being able to compensate for altitude or temperatures. This is just plainly not true, as that's precisely why MAP and IAT sensors are there for. MAF has problems with the small upper airflow limit, and reversion on some setups, so it's not perfect either. Understand both, use what works better for you.

Part 2 is going to be an Open and Closed Loop, should be up in few days.
Hope this helps,

Marcin

Tuesday, September 26, 2006

Tuning Methodology

Someone brought it up on the forums, and it's a good thing, so I'm reposting it for the sake of completeness on my site.

1. Try to keep tuning sessions as close to repeatable as possible, same gas, same route, same time (like driving to/from work) work great. This way you get approximately the same amount of samples in the same temperature range. If the weather is particularly extreme (super hot, extra humid) take a note of it, expect your values to skew one way.

2. Long steady inputs--I can't stress this enough, this is #1 reason why most people never get their numbers straight. If you get on the throttle--hold it. If you get off throttle, don't half-ass, lift completely--this way it's easy to filter unwanted (transients/not steady airflow) cells. In HPTuners, there's now way to ask for a derivative of anything, so there's no way to know if you're accelerating or decelerating. EFILive has 'filter out if value changed more than X %' capability

3. Warm up the WHOLE car, don't just look at the coolant temperature. Fuel warms up too. If you don't believe me, go scan for a while, and then go fill up with new fuel, and continue scanning, I promise you your trims are gonna go nuts. Fuel temperature affects atomization, which affects how complete is the burn, which affects the resulting AFR. The rule of thumb here is 15 minutes of normal driving before you log for VE.

4. No lugging it in tall gears (5-6th). Laziness gets the best of you, and you end up tooling around at 1500rpm in 6th, give it more gas, it knocks. While it's not a real dangerous knock, but it will show up in your logs, and you might end up pulling timing where you really didn't need it. Avoid doing it in general, not just for tuning, if you need to accelerate, downshift.

5. Be creative -- use the environment. Hills are GREAT for getting the more extreme cells. how else you're gonna get these 20kPa at 4000rpm cells without decelerating? (you can always use a real dyno, like Dyno Dynamics)

6. Be observant, learn the ways of your car. There are things that are particular to every car, and the most seasoned tuner won't notice them, simply because they don't have the milage on your car you do. Use it to your advantage. My car, for example, has random knock 1600-2000 rpm; it's just tight suspension on lousy roads, making things rattle and set of knock sensors. If you give it more throttle and it binds up, then there's no knock, but driving gently makes it rattle. Pure 100octane and lame timing won't cure it either.

7. Organize, label, and take notes on your logs. Temp/pressure/humidity/terrain often explain a lot of goofyness in the logs. once I was chasing what I thought was an intake leak, but it turned out to be that the guy lived in some serious hills. During a 20 minute commute between work and home, his WOT MAP would drop from 100kPa to 93kPa max. I didn't know that, he didn't tell me. It took us a while to sort it out.

8. Tuning is science--don't ever forget about that. Repeatability, changing one thing at the time, taking notes, not falling into routine or assumptions, all these boring things psychotic science teachers tried to drill into your heads in high school--they weren't cool, but they were right, so deal with it.

9. Keep your hardware fresh and clean. If you see AFR scatter more than usual, check your filters. If you see MAP not getting up to where it used to be in the same conditions as before--your cat might be clogged up. If you installed headers and you're tuning for them and it's starting to converge on some new numbers but then out of nowhere they go crazy on you--retorque header bolts, something might have gotten loose after few heat cycles, etc.

Saturday, September 23, 2006

LS2 VE tuning spreadsheet

I've started reading LS2/GTO/Vette boards, and a lot of people seem to have a problem with tuning their VE, simply because it's different than what they're used to with LS1.
The funny part is that the form we see in LS2's is not functionally any different from the old form. It's just different numbers, but the shape of the 3d surface is the same. Now that my Speed Density paper is out, we know that the factor is exactly R/CylinderVolume. However, because it is a linear factor, mutiplying the VE table by AFR%Error should be the same, no matter what factor is there. So viewing the table in the traditional VE is more for information than actual functionality.

Theo ne new thing I'm trying with this spreadsheet is to see how people use them:
Do you want everything on one tab?
Do you want step by step on different tabs?
Do you want everything on one tab, with multiple copies of the setup, so you can keep track of progress?

Leave comments, send email/IMs or whatever, I just wanna know how I should make them for the future.

DOWNLOAD

Enjoy,
Marcin

How Speed Density works

This is the most important work I've ever done, or at least it feels like it. It takes you from sensor data through calculating pulse widths, and all the forms of VE and their particular meaning.

I feel particularly proud, because it all makes sense so far with everything else we've been discovering how these cars run, how the PCM operates and explains a lot of peculiarities of the model GM decided to employ.

The understanding of concepts helped me tremendously. Some things you take for granted, others you just kinda understand, but this puts it all in black and white, solid, precise numbers that show you what and how you wanna run in your car.

I tried to make it as universal as possible, but because of the GM-particular VE form (that I refer to as GMVE) a lot of the paper deals with that. However, the rest is just about universal. Some of the language like ECT (coolant temp) or IAT (aircharge temp) might not be universal, but I tried to explain what they all mean at least at one point, so you can change IAT to AIT if that's what you're used to.

The cool part is that I have gotten some data that confirms the formulas. I've logged all the sensor data necessary, and tried to calculate data normally we'd obtain through PIDs. Cylinder Airmass seems to be very close, with less than 2% error through the whole range of values. Other values dont seem to be that far off either. Considering how many filters there are on anything airflow related, I consider this to be a very good result completely backing up my work.

Due to the fact I needed a lot of math formulas displayed nicely, I had to put it in a Word document, and not a webpage. If you know a way to easily convert it over to a webpage, please let me know, until then, it's just a paper.
DOWNLOAD

I also include a spreadsheet with stock 2004 Z06 values, and convert them to other forms using my math, side by side with the originals.
DOWNLOAD

I hope you guys like it, cause this was a shitload of work.
Enjoy,
Marcin

Saturday, September 09, 2006

Cylinder Volume Spreadsheet

This is so simple I'm embarrassed to post it. At the same time, I've seen it messed up too many times to be unaddressed.

Math:
Cylinder Volume= Pi * radius^2 * height
Engines:
Cylinder Volume= Pi * (bore/2)^2 * stroke


To justify releasing it, I integrated a trick where if you so far have tuned your VE but haven't changed your Cylinder Volume, I also give you a number to multiply your entire VE by. This way you don't have to retune the whole VE again.

Also, the inputs are in inches (unfortunatelly popular with the LSx crowd) but it gives you output in Liters, which are the units to be used in HPT's Cylinder Volume field.

DOWNLOAD

enjoy,
Marcin

Wednesday, September 06, 2006

Rated fuel pressure on SVO 42s is...

Rated fuel pressure on SVO 42s is 43.5psi (3bar). End of argument.

Here's a proof:
flowsheet

So apparently my empirical experiments year and a half ago were right 3bar it is.
and now we know better...

UPDATE:
I got another one from another friend, so here's more examples on a typical flow spread

svo42s_2

Wednesday, August 30, 2006

Unscrewing a Bad Tune

This is something I keep happening time over time: you build up your car, you get a mail tune, or a dyno tune done by some hack, and you hate how the car drives and performs, so you save your pennies, get yourself a tuning package, and you try to do it all yourself. This is exactly how I started, and back then there was little in terms of writeups. These days the problem is that there's too many writeups, and some of them are better than others, however, as a newbie, you have no way of telling. Another big question that keeps coming up is 'What do I do first?' which is a great question, however there's no good answer to, as that depends on what's screwed up.

So this writeup is pieced together from a long collections of emails and forums posts.

1. Set IFR to your injectors and fuel pressure. Please measure it,
see if it holds fairly stable when you give it some gas, you might be able to find a weak spot or a deficiency in your fuel system.
2. Set Primary VE to something that makes sense. Start with a known good tune for a similar camshaft, heads, and headers. It doesn't have to match perfectly, as every car is different regardless, but it will get you in a good starting position.
It wont be perfect, but it should be much closer to what you need than a stock tune.
3. If you have older car with Primary and Secondary VE tables, then do an 'adaptive copy' (just
copy the relevant rows) of the new Primary VE to Secondary VE , or use http://www.marcintology.com/tuning/VE2bar.xls
to do it for you
(http://redhardsupra.blogspot.com/2006/02/new-ve-tuning-spreadsheet_03.html
has a description of what does it do)
4. Copy high and low octane spark tables from that 'good' tune into yours. If you can't find a good one, I like to start with 02+ Z06 spark tables, as they account for more compression, better flowing heads and a higher lift cam, which makes it closer to what most modded cars have.
5. Blend in the idle areas of spark with values that start at 36* at low rpm and end at about 30-32* at your rpm/cylinder airmass.
6. Use the same blended values in idle areas of spark in the "idle
spark in gear" table. If you have an automatic, also copy it over to "idle spark in park/neutral".
7. Copy RAF drive table over from a good known tune. Again, just like in #3, it won't be perfect, but will be closer than stock. If you dont have a well tune RAF example, up the RAF values in the usual range of ECT by about 3g/sec.
8. Put the car in SD (MAF Fail Frequency set to 0Hz). Start it up, verify
that it goes into SD by reading DTC's (it should throw P0103). if it
doesnt, turn it off, start it again, sometimes it takes 2 or 3 starts.

At this point, you have 2 processes to go through: RAF and VE. VE
has multiple ways of doing it, and of course everyone claims their to
be the best, I'll show you the simplest one that should work perfect
to get the initial 'daily drivability' to be really good, and can be done on any car as it uses stock oxygen sensors.

If the car doesn't die, start driving around, logging for LTFT and
STFT and O2s on both banks. (default setup will do that if you're unsure of what to log, just hit 'reset' in the 'Display Table')

Again, these procedures only make sense in SD, so make sure you're truly in SD.
One trick is to set the codes to set SES light upon the MAF faliure, this
way when MAF fails (aka SD takes over) you get the SES light. I refer
to it by now as the SD light ;)

Drive around in SD, let's get the daily drivability done first, so
keep it under 3-4krpm (depending on gearing and powerbands) logging
fuel trims.

Once you get about 25 samples per cell across the whole range you're
trying to tune, stop, save the log. Then open up the VE2bar.xls I
mentioned earlier, and copy and paste the appropriate tables into it.
Let it do it's thing, and copy the results out of the full- and half- resolution tables, and apply them to the corresponding VE tables. On the
beginning do 'paste special--% full' so it will get big changes done
quickly. Once you get much closer to the target (less than 5% off) I do 'paste
special--%half' so the changes are more subtle and you dont 'overshoot.'
This spreadsheet is made so once you get some values within that -4 to
0 range, it doesn't try to adjust them. The reason for it is that if
you'll tune it perfectly for 0%, you'll have what I call a 'knifeedge'
tune, a tune that will run rich or lean depending on atmospheric
conditions, and as such, will be unpredictable. Once we're a little
bit on the rich side, computer treats is as the same safe set of
settings, and will not try to preemptively pull timing, like it would
if some of the tune was on the lean side.

Once you get a correction done, save it to a new copy of your tune,
flash it, and then reset the fuel trims (that's in the live controls
section of the scanner).
Go for a 10-15 min drive. Because of the reset, the fuel trims will
initially go nuts. That's good, that means it's learning aggresively, and
trying to find it's new set of 'happy' settings. Stop the car, turn
it off, start it up again, do NOT reset fuel trims now, just start
another logging session. The second session has dual function:
1. It verifies that the changes made sense, and they do work better
than the previous setup.
2. It gathers data for another iteration of the VE tuning.

If you gather enough data (it's very useful to set the 'minimal cell
count' to 25 on the LTFT and STFT charts, this way nothing will show
up until you get 25 samples, which guarantees a clean, consistent
dataset) just start looping through the process of
scan/calculate/adjust/flash/reset/ride to adjust until the fuel trims
will all come back in the -4 to 0 range.

Once that's done, do RAF:
1. Scan from full cold start to full warm. Turn off fans for this
purpose to let the car warm up to ~220F. Scan for ECT and STIT.
2. Create a custom histogram of ECT vs STIT, and display the gathered data in it.
3. Do "Paste--Add" the resulting table to the corresponding RAF table.
4. Wait till next time the car is fully cold, and redo the whole
process again. Repeat until the STITs are <0.1g/sec>
throughout the whole range.
5. (automatics only) You get to redo the whole process again, but not in Park, but in Drive, as the RAF tables in Park/Neutral are little different.

If the car doesn't want to idle with the initial settings, you have to
ballpark the VE some more. Usually you're overfueling (which is made
very visible by a 'surging' idle) so cut down the idle range VE values
by 10% (select the cells in question, put it 0.9 and press * to bring it down to 90% of previous values), flash, try again, until it's reasonable enough to do a real VE scan which will get the VE tables set precisely. The whole goal of this 'ballparking' is to get it close enough that it can idle on its own, thus allowing us to gather data for a proper adjustment.

If you're familiar with tuning VE with OL and WB, then you can do that
instead, but it's really not much different, just few extra steps.

Enjoy,
Marcin


Monday, August 21, 2006

From Airflow to Pulse Widths

Ultimately, the function of the PCM is simple: measure airflow, and provide engine with enough fuel to match that airflow.

As just about anything in life, it's easier said than done. Airflow measurement is a notoriously tricky subject, and injecting fuel with a constant size injector against wildly varying pressures in the manifold isn't exactly easy either.
However, the principles of Physics always hold. Things like density, ideal gas law, proportions, and timing allow us to approximate the duration at which we want to hold the injector open. Putting all these things together, I was able to come up with a model that can approximate the pulse widths based on airflow fairly accurately. The concepts however weren't trivial, so I decided to make a full standalone application to demonstrate these concepts.

The real motivation behind this project were people, miserably failing at understanding the relationships between airflow, fuel, pressures, temperatures and all the other important. I am not the teacher type, and I do not take pleasure at explaining the same basics over and over, and have them doubt me. I remove doubt by introducing physics and quantification of entities involved.

So here it is, my first GUI application. I've always sucked as a coder, but the new VB express 2005 I must say made my life easier on this project.

During the development I tried to remember everything that annoys me about most applications, and keeping that in mind, I tried to avoid it. There is no annoying 'calculate' button, the whole application is 'live'--every time you change a value, all the results and prerequisite intermediate steps get updated. Another annoyance of Windows programs is the inability of looking at more than one instance of what I'm playing with at the same time, thus: the Clone button, which gives you another instance of the program, for your 'compare and contrast' pleasure. Also, there's no limits (beyond available memory) to how many you can look at simultaneously. Defaults make sense, I made it with SVO 30s and stock cube LS1's in mind, but of course all of this can be changed to any value you want. I checked it by trying values describing BPU'ed Supras and stockish S2000's and they all make sense too.

So the most basic mode of operation is to check if what my setup flows can be supplied with enough fuel at my operational AFR, temps, altitudes and RPM range. This is simple, merely adjust the numbers for your hardware, and you will get the pulse width needed to complete a full injection cycle. If it's bigger than the duration of the cycle, you're in trouble (one of fields will go red/yellow to alter that you're past the limits). If it's in the safe zone, you can start playing with it. Here's some questions it can answer:
  • How much higher can I rev with these injectors?
  • Is my fuel system big enough to handle heads and cam?
  • Why do Forced Induction setups eat so much more gas?
  • What if one of my injectors flows 10% off others, what kind of conditions are gonna be in that cylinder?
  • If I go racing to some good Density Altitude track, what kind of fuel consumption can I expect?
  • Why do I run lean when I went to more cubes?
and so on... This is a useful litttle utility, especially for educating yourself on what makes injectors work harder, what kind of hardware is really needed to race safely, and what conditions are desirable.


I'm planning on expanding this utilty to have a more precise Air Density calculations, helpers for injector sizing and cylinder displacement, etc.
Please comment, report bugs, give me ideas, etc.

The only problem with this software is that it requires Dot Net 2.0 on your computer. Most HPT users already have it on their computers, and if not, please download/update what you need.

DOWNLOAD HERE

enjoy, Marcin

Saturday, July 01, 2006

Powerband Modeling

I've been looking at various dyno graphs lately, and I realized they all got pretty much the same shape. In the meantime I've been reading about how LS6 and FAST intakes are the restrictions, and how they really shape the powerband. My curiosity was peaked how could one part have so much influence on what we get out of a system with so many other parts.
Another important reason behind this inquiery was trying to figure out if making huge peaky cams really makes any sense, can we take advantage of the extra power we get, since all the power seems to show up at the very upper end of the rpm spectrum.

Let's start with few assumptions:
LS6 intake--peak HP (from now on refered to as PH) occurs at 6200rpm, peak TQ (PT) at 4600rpm.
FAST intake--PH is at 6500rpm, PT is at 5200rpm

Let's run through the logic using the LS6 intake's properties.

From most dyno's I've seen, peak torque was about 430lb/ft @ 4600rpm, so let's start with that:
HP=TQ*RPM/5252 and TQ=5252*HP/RPM

HP(TQ=430, RPM=4600)=430*4600/5252=376.6 hp

So if 430@4600rpm is the peak torque value, let's say we design a cam that can hold it all the way to PH, we'd have a flat line, dictating the HP numbers through the RPM dependancy.
with that in mind, we know HP must peak at 6200rpm, so we have:
PH=HP(TQ=430, RPM=6200)=430*6200/5252=507.6 hp

That's the max hp we'll get with this setup. again, let's assume this setup (cam, heads, whatever else is necessary) can carry on that airflow all the way to 6800rpm (a realistic shiftpoint for most LS1's)

With HP curve now being flat to 6800rpm, your torque at redline (RT) will be:
RT=TQ(HP=507.6, RPM=6800)=5252*507.6/6800=392 lb/ft


So we have points for RPM={4600, 5252(freebie), 6200, 6800} which is quite perfect, as the spacing of the T56 usually keeps RPMs above 4600. If you go below that, you're really not utilizing your powerband, but that's a whole different story for another time, thus I will ignore such cases for the sake of this writeup.

Now let's take a look at the same thing, but with FAST intake. Of course, the logic would be the same, just with different peak points, so I did a quick spreadsheet and this is what it looks like side by side for comparison. I know that FAST usually puts out bit more power than LS6, but this is just for comparison's sake.



Notice that both cases make the same power until 6200rpm. It's past 6200, where FAST starts to shine. Just because it extended the full torque a bit longer (only 300rpm), it quickly translates into significant.

But these are just few points. what does it look like once put into a dyno-like graph?
I used my old powerband optimization spreadsheet to demonstrate the two cases.
I used the points from the tables above, and whatever values in between got filled out by Excel's very nice Edit->Fill->Series->Trend->Linear trick (just highlight the range with end values and empties in between first).

Here's what I got (I mangled the pictures a bit to make them smaller for ease of comparison):


On the left, we got the LS6 numbers highlighted, on the right, the FAST.
I also decided to go to 7000rpm instead of 6800rpm in previous part, just to see a bigger change from the power 'up top' power. And the results are...disappointing. FAST, even though by looking at the absolute numbers did pick up quite a bit of power, it did so on such a small portion of the powerband, that the average comes out nowhere near as impressive: 461 vs 467 hp average. that's 6 hp difference on a 460+ hp car. You'll probably get better gains by ignoring free donuts in the office for a week before the race ;)

So how do we make FAST worth the money? Shorter gears would help quite a bit, as we'd have less intervals total if we started at 5000 not 4600rpm, so we'd spend relatively speaking more time on the improved portion of the powerband.

Now, the real gains will be different of course, because FAST doesn't just extend the peak power, but also adds a decent amount throughout the whole powerband, and that's when the big gains would show up in black in white. However, this is a study of shape-shifting powerbands, not adding airflow/compression.

The real value of this little exercise is in quantifying gains that apply only to a portion of a powerband. The real problem lays with the numbers from 4600 to 6200rpm, the range between peak torque and peak horsepower. They're the ones that lower our average HP in the race powerband, and they're the ones to have much greater improvements than optimizing the seldom-visited 6200+rpm territory.

The short version: don't spend your money on mods that shift your power until later, until you already fixed everything else that adds power before peak HP.

Sunday, June 25, 2006

Boost Perspective

After looking at some tunes and logs of turbo systems, I realized that people don't adjust their NA tune to the new reality of forced induction. I mean, they know to adjust their target AFR and go easy on timing, but what I'm talking about is not knowing _when_ to switch over to the boosted settings.

In a normal NA setup you usually trigger PE with >60%TPS@ and 15kPa MAP, which is very tame, but sensible.



Boost doesn't happen purely as a function of throttle input and rpm, it is really a side effect of increased load and airflow, which are results of throttle and rpm. With these few indirections involved, you should not rely on just TPS/RPM triggers.

First you must figure out WHEN does the boost hit.
In a first attempt, I just looked at the common LTFT scan with all data loaded, and it looks like MAP, which is the closest thing we got to a boost measurement in this log, maxes out very early.



I wanted to see in context what happens before, during and after MAP maxing out, thus I just played the log in the charts window, concentrating on TPS, RPM, MAP, DynAir, and DynCylAir.



In the chart above we see that even at 84% TPS and 2700RPM we've already maxed out the MAP! this is great news as it means a quick and easy spoolup of the turbo. It also means that whatever data we'll get from this log qualifies as ballparkish at best, as we will not know the true MAP reading, which is taken into consideration for each Airflow estimate. (this log is done in Speed Density)

Another boost situation, and a similar result:



Very similar numbers (74%TPS and 2650RPM), yet we're already getting 0.80g/cyl of compression, which is a great PEAK result for most cammed NA cars, while we're getting it partial throttle and <2700rpm!!!



Airflow readings hit a flatline at about 58lb/min and stay there until redline. What the real readings are, we won't know until everything is calibrated correctly with a 2barSD setup.
The amazing part about this graph is the torque/compression: 1.24g/cyl!!! I have not seen a NA stock cube motor do that ever. Another great part about it, is that it peaks late (5300rpm) and doesn't drop off much at the redline, suggesting a fantastic powerband.
Again, due to the fact we're looking at maxed out readings, this is all pure ballpark, no specific numbers.

So now that we know that we the car is healthy, the boost hits early, hits hard (for a basic non-intercooled 5psi kit) and carries way more power that we can currently harness all the way to 6200rpm.

Remember at the beginning of this article we were talking about triggers? They were optimized for little torque (0.80g/cyl is a nice number for a small cam, 0.90 for bigger cam, and 1.0+ for a nice head/cam setup), and hitting that torque late on the powerband (LS6 intake usually forces it to be between 4400-4800RPM).
Now, we have a whole different paradigm on our hands. This setup maxes out at 1.26g/cyl at 5300rpm, with going into boost at a very early 2650RPM already pushing 0.80g/cyl.
Let's try to pinpoint where the triggers should be:




This histogram shows how much compression/torque/air in cylinder we get at different RPM intervals. Looks like somewhere around 2100rpm we can already hit 0.80g/cyl (note this histogram shows max values) which normally is amount of torque we'd be prepared (as in triggered PE mode) at 4400-4800RPM.

Based on this information, we set Delay RPM to 2100RPM.

Now let's look at how much throttle input does it take to cause a full 1 bar absolute pressure (101.3kPa) which is 1bar MAP's max value:



Somewhere at mid 30s %TPS we can already achieve boost, thus:
Set PE Enable MAP at 35%

Now the only table left is the PE Enable TPS table. We already know that we need only 35% to make things dangerous, now we need to tell the PCM how soon on the powerband that can occur, thus we graph MAP vs RPM:



We see at 2000RPM we already generate 90kPa MAP pressure, thus:
Set the PE Enable TPS table to 35% starting at 2000rpm, and for safety's sake, let's pick 20% all the way at the redline, and blend between them for a sensible curve.

Hopefully this demonstrates how you have to watch out for the new conditions created by your new modifications. Also, I posted a lot of configurations of custom histograms, which while not precise with the data gathered, it provides plenty of trending information to make it a worthwhile exploration.
Another thing I know I haven't explained yet, is my liberal use of horsepower/airflow/DynAir and compression/torque/DynCylAir. It's another writeup in the making, but for now you just have to take it for granted, so go ahead, push the 'I Believe' button and enjoy your new safer ride.

If you have any boost logs taken with a well tuned, well set up (2/3bar MAP sensor, 2/3bar SD mode/CustomOS) please send it to me, as I'd love to have a followup article to this one.
If you use the information in this article and you notice that things work better/worse, please let me know, I'd like to know how it works out in a day-to-day operation, as I don't have access to the Camaro with the STS setup anymore.

Thursday, June 22, 2006

Roadracing logs analysis

So Dennis went racing to Summit Point and brought me some logs. For the underinformed crowd, this is a full fledged, although home made Camaro race car. Less than 2900lbs with fuel and driver, probably upwards of 420rwhp, huge wheels with roadracing slicks, aero, the works, you get the idea. He said that last time he was out, only one car was able to pass him, out of 50 or so at the track. NICE!

We've been tuning this thing for a while using EFILive and the blackbox logging capability and it's been coming along nicely. Dennis is happy with the power because he has no traction in 2nd gear if he floors it, even with the big slicks on. But on the roadcourse, 2nd is rarely used, so all this power should come in very useful.

So this is my newbie attempt at hacking the data into somewhat readable and hopefully educational graphs.

First I wanted to see if the car is healthy, and if it does what it supposed to do, so I checked injectors: pulse width never went past 12 and duty cycle never went past 60%, so I'm going to skip these boring graphs.
Next is Air Fuel Ratio when going partial throttle and full blast.



It looks reasonable, car goes into PE mode as MAP/RPM values increase, as these are the PE triggers.

What made me a bit curious though is why was the spread of AFR at WOT so large:



I thought to myself, maybe I'm looking at the wrong thing, throttle is just the input, intake manifold pressure (MAP) is the effective dictator of what amount of air is going to get pushed in, as well as it's used in Speed Density airflow calculations. So I graphed it another way to see if there is a difference:



I dont see any frankly. we still get 0.7 to 1.0 point spread in AFR final values. I started to wonder what could be the culprit behind it. From experience, I know that a lot of information is to be extracted from plotting raw MAF signals and look at the noise levels, as an indicator of trouble. Here's what I came up with:



Damn it Dennis, clean your air filter! :)
The areas circled are noise, the signal has a very strong signature and range, but this is more than usual amount of noise. So if you ever see anything like this, go shake off dust, chunks of rubber from tires of cars in front of you, dead birds, whatever you got in there. Here we're gonna let him get away, as this log was the last one of all the sessions so stuff probably accumulated over the course of 2 days.

I did notice one more thing: maximum pressure in the intake dropped as the RPMs increased. Does this mean that we cannot feed air into the engine fast enough? Is this a sign of a bottleneck? Is it the intake manifold? Or is a just the overlap of the cam letting some air in and out fast enough that it shows up as never quite reaching the peak pressure values? Take a look:




Ok, so with all the checkups of the stuff that might make the car blow up (there's another boring graph or timing but that's really dead on the money), we started talking about more unscientific, but definitely tangible aspects of tuning. This track has a long straight, on which you could really scream through 4th (3.42 gear M6) up to 6500rpm, or try to shift a bit early to a not so dramatic 4400 rpm in 5th. But apparently, at 4400rpm in 5th, combination of greatly increased air resistance and falling off the powerband(cammed LS1 are the VTEC of pushrod V8's, they're very rev-dependent) leaves so little horsepower left that the acceleration is dismal. So of course, another debate of longer gears and 3-4 or shorter gears and using 3-4-5 at the track. This dispute is to be solved numerically, as quickly as I get done with chores and errands and finish rewriting my shiftpoint/gearing optimizing spreadsheet in C++ with increased precision, added air resistance and more gears.
For now we just get to look at what it looks like in terms of air consumed at various speeds:



You can clearly see that after shifting to 5th, you only get 30lb/min of airflow, out of ~45 possible at higher revs. while normally this would be only a slight annoyance, at greater speeds it becomes absolutely detrimental.
Let's do a simple example: if at greater speed it takes you 150hp to just fight off the air resistance, and you have 450hp max, then you have 300hp left for actual acceleration. If you shift early and you're left making 300hp and still using 150hp to just cut through air, then you have 150hp left for acceleration. Combine that with taller gearing of 5th gear versus 4th, and you are effectively stuck with 1/3 of accelration you'd get in 4th!

And here's the biggest discovery of this datalog: I was watching Formula 1 the British Grand Prix from Silverstone, where with smaller engines these guys spend over 70% of the track going WOT!!! I never thought of measuring that, but now that I have the data, why not, right?
But of course, I tried to run this idea through some people, and they brought up a good point: how do you define the proportions? is it measured as:

  • "wot acceleration"/"total number of samples"

  • "wot acceleration"/"acceleration but not wot"

  • "wot acceleration"/"number of samples in which car was not-braking"



I went with simple version and went with the first choice, as it provided me with what I think describes the issue best: how often around the track do we get to actually utilze the car's power to full potential?

I had few logs, and the results varied from about 19% to 22%.

Now this is LOW! And this is a very well suspensioned, well driven, light car on a lot of rubber! I expected a lot more, afterall this is a track with a pretty hefty straight (150mph+ max).

Some time ago on www.frrax.com (<--- awesome site, btw, if you haven't been there yet, go visit!) I did a quick calculations of how much does having extra 10hp on a 280average hp car help in actually decreasing times, and It came back with something suprisingly, yet laughably small, like 0.1 sec if we get to use that 10hp for 10 secs! So not only we dont get to use the extra power very often, but even when we do, it doesn't have that much influence.

So does adding power to amateur roadrace cars mostly increase chances of blowing up, and does next to nothing when it comes to actually reducing lap times?


Sunday, April 09, 2006

IFR tweaking Jihad

A lot of people lately been asking me about IFR tweaking. I couldn't believe that after all these years of using VE with great results people still used the old hacks.

So these are two things I've written up to people about it. The first one is short and purposefully silly visual, the other one is more technical. I hope this will once for all put the end to all stupid IFR tweaking.

Take one:
So let's say you're mixing cement... ;)

Your shovel can move 1 pound of cement per second to the mixer (or whatever that's called) in which you supposed to mix cement and water in 1/13 ratio. You have a hose going to the mixer that you believe delivers 13lb/sec of water. however, the hose is clogged, and you don't know about it. All you know is that your mixture despite your best effort is a bit off. So instinctively, instead of checking what's wrong with the hose, you decide to grab a bigger or smaller shovel depending if your mixture is too watery or too solid to compensate for the change in amount of water.
In the end, did you get the right mixture? yes.
Did you get the right amount of it? No!

This is exactly what IFR tweaking does to your engine. Instead of looking at the source of the problem, you just try to make up for it somewhere else.

Take Two:
All the mods you do, all they do is increase the Volumetric Efficiency
(aka. be able to cram more air in, increase airflow). However,
the idiot tuners, they keep the Volumetric Efficiency table (which
exists exactly for this purpose) unaltered! So with more airflow and
same amount of fuel, you're basically making your car run leaner, first to the point where it makes more power, but eventually it goes well into the dangerous territory.

Here's a scenario to demonstrate this in numbers:
To keep the AFR sane, you gotta tell the computer to dump more fuel.
You can't do it directly, as most of this stuff is calculated dynamically or proportionally, so you just lie about the size of the injectors. This way every fueling operation is proportioned to the new 'size.'

So let's say you had 39lb/min of air coming in, and you're trying to
keep a 13.0 AFR (easy numbers example)
All the injectors have to deliever 39/13=3lb/min of fuel. there's
8 of them, so they flow 3/8 lb/min (0.375). Injectors are usually
rated in lb/hr so this is 0.375lb/min*60 min/hr=22.5lb/hr of fuel.
You don't want to operate your injectors at 100% as they will simply
overheat at one moment and stop sending fuel at all, exploding your motor.
80-85% duty cycle is the safe range in which most injectors can operate
without deminished reliability. So you want 22.5/0.80=28lb/hr
injectors. Oh, what do you know, that's a typical airflow and a
typical injector size in a stockish but tuned LS1! See, all these
numbers come from somewhere, and if you have enough equations for it,
you can see it how got there.

But to get back to IFR bullshiting...
Now let's say you put some swanky exhaust/lid/intake on your car, and
it flows 44lb/min of air, not 39. But if you don't touch VE table,
now you're gonna get 44/39 *13=14.666AFR!!! That's very dangerously
lean! So far we've been dumping up to 39lb/min relatively worth
of fuel. If we say we have injectors smaller by the ratio of 44/39,
it will automatically try to make the injector work harder, by
commanding more pulse width. The trick the 'IFR tweakers' rely on
is that the injecotrs didn't really get smaller, so now we're
commanding bigger pulse width on the same injector as before, effectly
spraying more fuel!
So it does what we wanted, right? Wrong! Pulse widths don't
scale linearly, so you're not really aiming for the right amount of
more fuel, you just know you're spraying more than before. This of it
as a sharp shooting competition but you're blindfolded and have a
helper that can only tell you 'up/down' or 'left/right' while what you
need is '30mm to the right and 3mm down.' You can see why the results
of such tunes are so crappy.

Then you toss in a cam with a naturally steepy VE (inefficient at lower
pressures, and very efficient under high pressure), and the whole IFR
tweaking scheme falls apart.
IFR has only one dependent variable(MAP), VE has two (MAP,
RPM). This means IFR can describe what VE could, except that it has
to consider RPM to be constant. Thus when tuning with IFR, you will
command the same amount of fuel whether you're at 1000rpm or 7000rpm.
big cams have VERY different flow characteristics at such broad rpm range,
and therefore IFR will never be able to reflect the precision
necessary to reflect such changes.

Another numeric exercise to demonstrate this:
A stock cam has about 50% VE at idle, and about 90% at WOT.
A nice big cam has 30% VE at idle, and up to 120% at WOT.
So to make a big cam idle nicely with an unmolested VE you're gonna have to
seriously bullshit about the size of your injector sizes, as you're needing only 30/50(60%) of fuel you used to need.
On the other end of the spectrum, you will need 120/90(133%) more fuel than before. So you lie some more about the injectors, making your IFR table look very sharp and jagged, what in reality is a nice smooth progression.
The real problem is that the IFR table has only one axis (pressure at the fuel rail) and only 17 values. VE table has 380 cells on two axis. If the natural VE dictated by the characteristics of the cam shaft is very sensitive to RPM (and most aftermarket ones are very sensitive) you will not be able to have the computer dump appopriate amount of fuel in all possible situations. So you have to simply your tune (that's why people do it), and tune it either for decent drivability (and have it horribly lean up top) or optimize it for power, and have it stall 5 times every time you try to get in/out of the pitlane.

IFR tuning to VE tuning is what carbs have become to electronic fuel
injection. They both get the job done, just one is way more flexible
than the other.