Google
 
Web NASIOC.com

View Full Version : Math majors and tuners question...


Houdini
12-05-2004, 08:02 PM
Okay check this out and let me know if my math/theory is wrong. I've wrote a log parser in perl that gathers the average AFR for a given load site it them compares that value against a desired AFR table on per load site basis and calculates the percentage it is off from the desired AFR. I should be able to apply that percentage to the current MAF modifier in the fuel map and get the correct AFR or rather a little closer. Let me show you some numbers.

This is the data for my 3500/90% load site. Ignore your urge to argue about the target AFR and ignore how i get my values - its just an example.

9.760000 <- richest value
9.940000(26) <- average AFR (samples)
10.290000 <- leanest value
11.410000 <- target AFR
1.470000 <- difference from target AFR.

With the following information we can calculate the percentage its too rich like this.

1.47/11.41 = 0.128834355828 or 12.8834355828%

So if my MAF voltage modifier from my stage 2 base map is 4 then.

0.128834355828 * 4 = 0.515337423312

4 - 0.515337423312 = 3.484662576688

So the MAF modifier would be 3.5.

Any thought good or bad? Is my method valid?

Hitokiri
12-06-2004, 12:37 PM
I was going to write something along these lines for Hydra people as sort of a user tunable version of autotune where you can manually select where changes to the map would be made.

I don't think your method of calculating change in you maf correction based on AFR is the right way to go about working on an autotune type of program. I am not familiar with what your "MAF modifier" actually is, but you cant necessarily equate a change in AFR to a change in MAF voltage in any way. MAF voltage is not linear with flow and in most cases requires look up tables in the ECU to arrive at an answer taking into account other sensors such as IAT. (I really have no idea exactly how subaru does it but thats my guess) It might end up as a step in the right direction such that if you itterated on it you might converge to the target AFR you want. an Autotune program would usually work from fuel pulse numbers. You could try calculating the change in fuel PWM you would need to hit your target AFR at a given RPM and Airflow and then apply that to the map and itterate.

Todd

bboy
12-06-2004, 04:12 PM
MAF voltage is very tricky. It's not linear. To do as you state (which by the way is quite interesting) you would need to fit a curve to the MAF voltage, then work that function back into you Perl script. It' not terribly difficult, but you'll have to find someone with MatLab or Mathematica to "derive" a function that fits the MAF curve.

The MAF sensor is an incredibly sensitive device, measuring out to 4 significant digits, covering from 0-~300 g/sec. There are MAF tables out there in g/sec; I don't know where get one for the denso MAF sensor. You would plot the data, fit a curve (function) to it, and plug it in to your correction.

You'd be better off in C or C++ for computational speed if you are trying to do this on the fly. You could "call" the C program from Perl if need be.

I'm sorry I can't offer more, you are out of my league.

cgerald1
12-10-2004, 09:46 PM
Sound like a problem for minitab :-)

Houdini
12-11-2004, 11:23 AM
MAF voltage is very tricky. It's not linear. To do as you state (which by the way is quite interesting) you would need to fit a curve to the MAF voltage, then work that function back into you Perl script. It' not terribly difficult, but you'll have to find someone with MatLab or Mathematica to "derive" a function that fits the MAF curve.

The MAF sensor is an incredibly sensitive device, measuring out to 4 significant digits, covering from 0-~300 g/sec. There are MAF tables out there in g/sec; I don't know where get one for the denso MAF sensor. You would plot the data, fit a curve (function) to it, and plug it in to your correction.

You'd be better off in C or C++ for computational speed if you are trying to do this on the fly. You could "call" the C program from Perl if need be.

I'm sorry I can't offer more, you are out of my league.

The script does not work in realtime. It mearly parses the log and determines if a load site is rich, lean, or within tolerance (.15) and then suggest add or remove fuel. Determinine that amount is the hard part. I found out the hard way that adjusting the the fuel map based on the percent it is off by to the fuelmap value is flawed. For example say you have a load site with a low fuel map value like 0.1 and the it is off by say 5% from the desired AFR. Doing the math then the new fuel map value would be 0.095. rounding that nuimber out to something that the utec will accept would be 0.1 which wouldnt change anything. I'm thinking that I need to figure out the modified MAF value to AFR ratio on a per row basis. Correct me if I'm wrong in assuming that AFR will change due to volumetric effiency even if the MAF value remains the same.