determine engine load with MAP or MAF??

Free and Open Source Engine Management discussions excluding more specific things on this board.
User avatar
Hentai
LQFP144 - On Top Of The Game
Posts: 302
Joined: Sun Jul 18, 2010 2:35 pm

Re: determine engine load with MAP or MAF??

Post by Hentai »

Even if you have a transfer function for the maf, doesn't mean it will be the same once you connected the maf to piping.
MAFs output changed based on the piping infront and behind them, I know this from experience of tuning various maf based systems.
Also to make a maf based system work in a way where it dervices the correct fuel based off the transfer function, you MUST have proper fuel injector settings.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: determine engine load with MAP or MAF??

Post by Fred »

Clue, what you want is cylinder fill, you don't care how you get it, there are at least three ways to determine that number, and mixtures thereof.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
settra
DIP8 - Involved
Posts: 29
Joined: Tue Jan 14, 2014 6:05 pm

Re: determine engine load with MAP or MAF??

Post by settra »

so, here is where i am at:
for the sake of my point, i will refer with RPM, to camshaft revs.

with the MAF signal, and the transfer function you can have MAF = air grams / s Going into the engine.
knowing the rpm of the CAMSHAFT, you know how many revs. the camshaft does per second . revs = (rpm /60 ).
so, if MAF/4 = the air on each cylinder /s , THEN the air sucked on each cylinder per rev would be : ( MAF/4)(RPM/60) grams/s

knowing the grams of air, and knowing what ratio you want, you can spray exactly the grams of fuel needed.
am i correct? it seems like i am correct ....

but there are always problems, and all this things are not ideal, so you will not get the air fuel ratio you need... that is where the wideband sensor comes in place... but how could i use it on the above formula, to correct the fuel???


also. in all the above, there dosent seem to be , any need of any kind of table... is that ok??
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: determine engine load with MAP or MAF??

Post by Fred »

You're correct, at a glance, and the missing table is Lambda. Additionally, your transfer curve for the MAF sensor may have non-linearities that you need to tune.

Use your wideband ONLY for open-loop tuning until you have a near perfect tune and code that allows it.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
settra
DIP8 - Involved
Posts: 29
Joined: Tue Jan 14, 2014 6:05 pm

Re: determine engine load with MAP or MAF??

Post by settra »

Fred wrote: Additionally, your transfer curve for the MAF sensor may have non-linearities that you need to tune.
?? isin't the transfer function supposed to be factory made?? i will just take it as it is??.. (or uyoy mean that the factory function will have mistakes on some readings ? )
Fred wrote:
Use your wideband ONLY for open-loop tuning until you have a near perfect tune and code that allows it.
what do you mean the missing table is lambda?? i was thinking this :
IF Ag (air grams per revolution, per cylinder) = (MAF/4)/(RPM/60) , then, if you want AFR say, 1/14 :
Fg (fuel grams, per revolution , per cylinder) = Ag/14 .

AND if you are in close loop, you will have a constant reading from the widband : Z = (1/15 or whatever your real AFR is )
so, to add the correction you would say :
Fg = Ag/14 + (1/14 + Z) ???

that is if you are on close loop.... can you shed some light on the tables please ? :P
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: determine engine load with MAP or MAF??

Post by Fred »

Yeah, 14 is a bad number!! At high load you'll want 12.5 or so, and at light loads up to 18 or so, and all sorts in between.

Transfer depends on plumbing and pulsations of the original installation.

Do not attempt closed loop.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
Hentai
LQFP144 - On Top Of The Game
Posts: 302
Joined: Sun Jul 18, 2010 2:35 pm

Re: determine engine load with MAP or MAF??

Post by Hentai »

settra wrote:
Fred wrote: Additionally, your transfer curve for the MAF sensor may have non-linearities that you need to tune.
?? isin't the transfer function supposed to be factory made?? i will just take it as it is??.. (or uyoy mean that the factory function will have mistakes on some readings ? )
Unless you are using a setup that hasn't been changed at all, stock car, stock maf, no piping changes from factory. Even if you have the orginal maf transfer function off that vehicle, if there are changes to the piping than the transfer function will end up needing to be tuned.
superlen
DIP8 - Involved
Posts: 25
Joined: Tue Aug 20, 2013 9:52 pm

Re: determine engine load with MAP or MAF??

Post by superlen »

Settra,

It looks like from your original post you have started to figure it out. Here's a really good book that covers a lot of this as well. There's nothing in here that you can't get form this forum or the people frequenting it, but the book is organized really well & will help solidify your thoughts/ideas. http://www.amazon.com/Engine-Management ... 1932494421

It appears that you already have a grasp of the critical function of the ecu. That is: measure the amount of air in (WEIGHT) & match it with the correct amount of fuel (again in Weight). How much air can be found by multiple ways, but four are commonly used:

1. Alpha-N, prediction of volume airflow (cfm or whatever units you want) based upon throttle position(alpha) and engine rpm(n). This will need a table of TP vs RPM that matches your engine. This table will kick out volume airflow. You then use the volume airflow and the air temperature (density changes with temp) to figure out the mass of air flowing into the engine. Once you have mass, fuel can easily be calculated based on the AFR you are after. (As noted in earlier posts, ideally it's not always 14.7, but that's a good place to start testing your code)

2. Speed-Density (MAP). Similar to Alpha_N in that we are predicting the volume air flow based upon measuring something. However, in this case Manifold Pressure instead of TP is used along with RPM. Again you need a table (commonly called your VE table) that matches your engine. If you have your table tuned nicely, this is all you ever need to run your engine well. No closed loop really needed. Closed loop can sometimes be looked upon as a crutch, but I think it does have it' places. One downside of MAP is if you change the efficiency of your engines ability to pump air in any way...new cam, header, intake, throttle body, ect. your VE table will need to be tweaked to account for the change.

3. AFM (Air flow meter as seen primarily in old late 70s L-jettronic systems). This style is different than the above two in that we are not measuring some other variables such as TPS or MAP and *predicting* airflow based on a table, we are measuring the airflow DIRECTLY. The AFM gives a reading of volume airflow. (Note: It's not linear, you still need a transfer function to equate voltage out to volume flow). You still need to correct for air temp to get mass, but it's one step closer than if you used Alpa-N or MAP. At first glance, this seems great as it makes your software easier. However, the mechanical AFM itself has several negatives such as: it's mechanical and prone to wear, springs weaken, carbon wiper traces wear, it's highly restrictive, takes up a shitload of room in the engine compartment, looks like hell....ect.

4. MAF - As you know, but I'll describe for others who come along, MAF measures the actual MASS of air flowing into the engine. Woot Woot! This sounds great. That's exactly what we want, no prediction, no temperature correction, just read one sensor calibrated in grams/sec...divide it by our target lambda (say 12.5 when we stomp the pedal) & dump the requisite amount of fuel. Poof! my 12yr old could probably code this with a minecraft script...... Sadly, it's not just that simple. If these sensors worked flawlessly, it would be. However, the suffer from problems as well. Others mentioned them above, with the primary problem being that the transfer function changes depending on how you physically plumb then in front of your throttle body. Extra turns, tight turns, long pipes, ect all affect the transfer function. In addition, they have had mechanical issues with how they work with hot wire elements getting dirty, ect that cause them to be less reliable long term than say MAP or alpha-N. Airflow reversion during certain times of the cycle can fool them as well depending on the installation. All of this can be worked around, but you just have to realize that they are not a one stop solution.

Ok..enough rambling. I hope this helps clarify your thoughts some more.

Lenny
settra
DIP8 - Involved
Posts: 29
Joined: Tue Jan 14, 2014 6:05 pm

Re: determine engine load with MAP or MAF??

Post by settra »

thanks allot for the extensive reply m8 :) i think i have figured out how to work fuel, based on MAF, and i know that the trnasfer function will need allot of tuning, since i anyway cannot find an "OEM" transfer function for any of the MAF sensors i can find... :/

i would really like if i could understand how MAP based fuelling works...

appart from the engine load (which i suppose could be something like MAP/RPM)

i know that MAP gives you the pressure. and based on the presure, and the IAT , you work some magic, and translate it to Grams. but, how do you know how much of those grams are going to enter the valves??? :/ how do you set the "timing window" ??
also, the IAT, would anyway need some tuining , since i do not think i will be able to find its curve that easy anyway...

all the above seem to be sleeping my grasp... :/ that is why i am thinking of going with MAF..
superlen
DIP8 - Involved
Posts: 25
Joined: Tue Aug 20, 2013 9:52 pm

Re: determine engine load with MAP or MAF??

Post by superlen »

You'll need to revisit some physics. :)

Namely the ideal Gas Law..... PV = nRT

Understand this & you can write a function similar to FI_Air_Mass(.....) below.
This function takes pressure (P) & volume(V) & intake air temp (T) and solves for n (number of moles) using the ideal gas law and then converts the moles to micrograms.

--this is cut/paste from my code where I'm calculating PW

-- FI.ICAM (instantaneous cylinder air mass in ugrams)
-- FI.ICAV (instantaneous cylinder air volume in cc's )
(this is how much air is currently filling the cylinder each stroke - note its rarely the swept volume of cylinder)
(as the engine (normally aspirated at least) never is that efficient & this varies with rpm)
(if the current VE was 100% then ICAV would be = to engine displacement/# of cylinders.)
(if a turbo under lots of boots, the ICAV would be LARGER than displacement/#cyl as we're stuffing extra air)
-- FI.ICPW (instantaneous cylinder pulse width)
-- Engine.IAT (intake air temp)
-- Engine.MAP (manifold pressure)


// correct the volume reading for air temperature
// returns ugrams of air/cylinder/intake stroke
FI.ICAM = FI_Air_Mass(Engine.MAP, Engine.IAT, FI.ICAV);

// calculate the static pulse width (1 cylinder, no Vsag or Opening time), ug->us
FI.ICPW = pulse_width_for_given_air_mass(FI.ICAM);

-- now you would adjust for different enrichments, target AFR, dead time of injectors, ect.

Note: I think many programmers actually use PV=nRT to pre-calculate what the FCPW (full cylinder pulse width) would be at what's called STP. (Standard Temperature and Pressure, 100kPa & 25C) & then shrink from that based on run time readings. This is to save the math overhead done during realtime operation. I just do the math as I have plenty of processing cycles.

I'm not sure what Fred does, but MS I *think* does this as I see people talking about "base pulse" or something similar and that sounds like a pre-calculated pulse to me.

As to your question of how many of those grams reach the cylinders.....All of them! If a gram of air goes in the intake, it makes it to the cylinder. MAF reads all cylinders so you have to divide by 4,6,8,ect. If you have an air leak in your intake, then EXTRA air sneaks in that your MAF or your MAP table is unaware of and you get a lean condition as your ecu had no idea some was leaking.

Lenny
Post Reply