MAF implementation, ideas and discussion

Testing and development of Megasquirt 3

Moderators: jsmcortina, muythaibxr

subwoofer
Super MS/Extra'er
Posts: 884
Joined: Sat Apr 30, 2011 12:34 pm
Location: Sandefjord, Norway

Re: MAF implementation, ideas and discussion

Post by subwoofer »

One observation from my own setup: Cleaning the MAF severely changed the transfer function! But so far not to the point where it actually matches the data sheet... Cleaning it appears to have improved bandwidth or slew rate - or both - the pulsatile region worked even better than with just upgrading to 1.3a8.

I suspect part of the problem to be the placement of the MAF with respect to the crankcase breather pipe. The distance is probably less than 3" and the engine (getting tossed out next week and replaced with another that has just as many miles on it but hopefully no leaking water jacket gasket) is a heavy breather. I suspect oil from the crankcase to be contaminating the sensor during reversion. I will move the MAF, reclean and report back.
Joachim
1974 Jensen-Healey
1990 VW Caravelle Syncro - running MS3+X
2014 Ford Fiesta EcoBoost
GDP
MS/Extra Newbie
Posts: 16
Joined: Mon Mar 04, 2013 6:07 pm

Re: MAF implementation, ideas and discussion

Post by GDP »

Hello, I have a question but I'm new to MS and apologize up front if I sound stupid or just have no idea of how the code works. I resently had the chance to work with an other ems that instead if VE tables it has pulse width table, at first I didn't like it becuase I was so use to VE tables, after tuning the car that night I was think well at the end of the day on a hardware level ve is just the pw at any given load anyway so really not much difference. In the past I've worked with both maf and sd setups and if not for the same reasons in this thead maf's work great up until you have revertion or run out of resilolution, for years now I've stuck with SD because of how much easier it is to tune, I attribute this to the fact that the map uses a 3d table instead of the maf 2d table, looking in TS it still looks like a 2d table, so not much has changed. SD has the advantage of being able to use a given ve cell to rpm no matter if its correct or not, what I mean is lets say at 2500 rpm to have bad revertion with a maf car, this extra air give you lets say for example 4.1v, well since maf's can only add fuel as adc's go up (2d table) you get a rich scenario, with sd same car 2500 rpm and what ever map voltage is you will be in a cell that you define the ve.

Okay so I'm sure most of you know all this, so my question is it posiable to do a 3d table for maf, maf volts to rpm and have the table be pulse widths? seems to me to be the best tracing signal in a 3d table imo, better than map sensor.
subwoofer
Super MS/Extra'er
Posts: 884
Joined: Sat Apr 30, 2011 12:34 pm
Location: Sandefjord, Norway

Re: MAF implementation, ideas and discussion

Post by subwoofer »

GDP wrote:Hello, I have a question but I'm new to MS and apologize up front if I sound stupid or just have no idea of how the code works. I resently had the chance to work with an other ems that instead if VE tables it has pulse width table, at first I didn't like it becuase I was so use to VE tables, after tuning the car that night I was think well at the end of the day on a hardware level ve is just the pw at any given load anyway so really not much difference. In the past I've worked with both maf and sd setups and if not for the same reasons in this thead maf's work great up until you have revertion or run out of resilolution, for years now I've stuck with SD because of how much easier it is to tune, I attribute this to the fact that the map uses a 3d table instead of the maf 2d table, looking in TS it still looks like a 2d table, so not much has changed. SD has the advantage of being able to use a given ve cell to rpm no matter if its correct or not, what I mean is lets say at 2500 rpm to have bad revertion with a maf car, this extra air give you lets say for example 4.1v, well since maf's can only add fuel as adc's go up (2d table) you get a rich scenario, with sd same car 2500 rpm and what ever map voltage is you will be in a cell that you define the ve.
For oddities, there is a trim table, indeed in 3D. The MAF itself is a "2D" device, it has a transfer function from air mass to voltage. I strongly disagree to that SD is easier to tune than MAF, but I guess it's a matter of preference.
GDP wrote:Okay so I'm sure most of you know all this, so my question is it posiable to do a 3d table for maf, maf volts to rpm and have the table be pulse widths? seems to me to be the best tracing signal in a 3d table imo, better than map sensor.
Fuel tables in PWs will not happen, that would be a step or two back towards Planet Stone Age. Have you given any thought to the difference when changing injectors with a modeling approach vs a PWs directly programmed? Just to give one example.
Joachim
1974 Jensen-Healey
1990 VW Caravelle Syncro - running MS3+X
2014 Ford Fiesta EcoBoost
GDP
MS/Extra Newbie
Posts: 16
Joined: Mon Mar 04, 2013 6:07 pm

Re: MAF implementation, ideas and discussion

Post by GDP »

For mostly stock to mild builds maf's have for me always worked fantastic but when I went radical, air turbulence and intake harmonics along with revertion made me give up on maf, it was these type of setups that I found sd to be much easier to tune.

As for the fuel trim table, I didn't know it had one until you said it, does the ve2 table use the map or maf as the trace?

Using your modeling example I can see you are correct. After some rethought, is it possible to have the maf update a ve table, then use the ve table for fueling.
subwoofer
Super MS/Extra'er
Posts: 884
Joined: Sat Apr 30, 2011 12:34 pm
Location: Sandefjord, Norway

Re: MAF implementation, ideas and discussion

Post by subwoofer »

GDP wrote:For mostly stock to mild builds maf's have for me always worked fantastic but when I went radical, air turbulence and intake harmonics along with revertion made me give up on maf, it was these type of setups that I found sd to be much easier to tune.
I suggest you read this thread from the start. :RTFM: Thanks to the work of shauer and jsmcortina the MAF implementation in pre1.3a8 is radically different from what went before. Hot cam, normally aspirated 4-banger on ITBs is about as difficult to tune as it gets and the new code handles it. The modern MAF is actually a very accurate device with high bandwidth and the laws of physics still apply, any limitation to the use of MAFs is in the ECU hardware and software.
GDP wrote:As for the fuel trim table, I didn't know it had one until you said it, does the ve2 table use the map or maf as the trace?
The ordinary trim table is VE1, enabled in the MAF options dialog. This uses MAFload for load. The reason for using MAFload and not MAF voltage is simply that you would need an enormous number of rows in the table to use voltage directly, where only a narrow diagonal strip would actually be used. This has been explained in detail elsewhere on the boards.

Nothing is stopping you from using VE2 and any load axis you want for corrections, up until pre1.3a7 I used VE2 in alpha-n mode for corrections on my setup. Be warned that the is a bug (or misfeature) in TunerStudio that causes VEAL to misbehave badly if you try to autotune that setup. Using the ordinary corrections table everything works as it should.
GDP wrote:Using your modeling example I can see you are correct. After some rethought, is it possible to have the maf update a ve table, then use the ve table for fueling.
No such possibility that I know of, but why would you? The MAF will give a better tune over time since it actually measures air mass instead of calculating it from a lot of correction factors that may or may not be correct.
Joachim
1974 Jensen-Healey
1990 VW Caravelle Syncro - running MS3+X
2014 Ford Fiesta EcoBoost
Peter Florance
Super MS/Extra'er
Posts: 3653
Joined: Fri Apr 02, 2004 8:40 pm
Location: Virginia Beach, VA
Contact:

Re: MAF implementation, ideas and discussion

Post by Peter Florance »

subwoofer wrote:
GDP wrote:Hello, I have a question but I'm new to MS and apologize up front if I sound stupid or just have no idea of how the code works. I resently had the chance to work with an other ems that instead if VE tables it has pulse width table, at first I didn't like it becuase I was so use to VE tables, after tuning the car that night I was think well at the end of the day on a hardware level ve is just the pw at any given load anyway so really not much difference. In the past I've worked with both maf and sd setups and if not for the same reasons in this thead maf's work great up until you have revertion or run out of resilolution, for years now I've stuck with SD because of how much easier it is to tune, I attribute this to the fact that the map uses a 3d table instead of the maf 2d table, looking in TS it still looks like a 2d table, so not much has changed. SD has the advantage of being able to use a given ve cell to rpm no matter if its correct or not, what I mean is lets say at 2500 rpm to have bad revertion with a maf car, this extra air give you lets say for example 4.1v, well since maf's can only add fuel as adc's go up (2d table) you get a rich scenario, with sd same car 2500 rpm and what ever map voltage is you will be in a cell that you define the ve.
For oddities, there is a trim table, indeed in 3D. The MAF itself is a "2D" device, it has a transfer function from air mass to voltage. I strongly disagree to that SD is easier to tune than MAF, but I guess it's a matter of preference.
GDP wrote:Okay so I'm sure most of you know all this, so my question is it posiable to do a 3d table for maf, maf volts to rpm and have the table be pulse widths? seems to me to be the best tracing signal in a 3d table imo, better than map sensor.
Fuel tables in PWs will not happen, that would be a step or two back towards Planet Stone Age. Have you given any thought to the difference when changing injectors with a modeling approach vs a PWs directly programmed? Just to give one example.
I think GDP brings up a good point; the fueling algorithm needed depends on the application. I still do Alpha-N some times; when even MAP is not a reliable signal at certain points due to setup. I think it's great that big strides are being made in MAF implementation, but I would not kill myself to use MAF (or even Speed Density) where another algorithm is better for that setup. But for the most part, SD is still the best algorithm for me to get just about any competition car running well (normally road race or autocross car). That is subject to change as MAF code gets better and easier to use.

BTW, I saw someone on the MoTeC forum refer to shauer's work on ITB etc. Reminded me that you guys are doing great work up here and finally getting some "street cred" for it. :)
Peter Florance
PF Tuning
81 BMW Euro 528i ESP Car
60-2 Wheel LS2 Coils, Low Z Inj
Co-Driver 1999 BMW E46 DSP car.
hardline
Master MS/Extra'er
Posts: 503
Joined: Mon Sep 08, 2008 8:37 pm
Location: Peoria, IL

Re: MAF implementation, ideas and discussion

Post by hardline »

shauer wrote:.....
Here is my latest trim table after a weekend of tuning using VEAL and then incorporating the VEAL corrections into the maf flow curve. As you can see I have it within almost +/- 5% now. There is still some fine tuning to do.
.....
Could you put together a how-to on this? I am drawing a blank here. Perhaps it is just lack of sleep though....
2000 ZX2 : Sequential COP, MS3 + MS3X + TinyIOx, PWM Returnless Fuel, Flex Fuel, Variable Geometry Intake Manifold, Garrett GTX2863R .82AR housing @ 15 psi
subwoofer
Super MS/Extra'er
Posts: 884
Joined: Sat Apr 30, 2011 12:34 pm
Location: Sandefjord, Norway

Re: MAF implementation, ideas and discussion

Post by subwoofer »

I can only speak for myself, but I have had success with this approach: http://msextra.com/forums/viewtopic.php ... 4&p=360825

The scatter plots WILL be noisy, so you just have to guesstimate from the density of the cloud at any particular voltage. It should get you very close in two or three iterations, though.
Joachim
1974 Jensen-Healey
1990 VW Caravelle Syncro - running MS3+X
2014 Ford Fiesta EcoBoost
hardline
Master MS/Extra'er
Posts: 503
Joined: Mon Sep 08, 2008 8:37 pm
Location: Peoria, IL

Re: MAF implementation, ideas and discussion

Post by hardline »

Pulled a long datalog yesterday. Here is the results of that link. Not sure on where to go from here
graph.png
2000 ZX2 : Sequential COP, MS3 + MS3X + TinyIOx, PWM Returnless Fuel, Flex Fuel, Variable Geometry Intake Manifold, Garrett GTX2863R .82AR housing @ 15 psi
subwoofer
Super MS/Extra'er
Posts: 884
Joined: Sat Apr 30, 2011 12:34 pm
Location: Sandefjord, Norway

Re: MAF implementation, ideas and discussion

Post by subwoofer »

Plotted that way, you see how much scatter you have for a given mass flow, I hadn't thought of that view. :oops:

Plot MAF voltage as X-axis and repost, I'll try to help you from there, but the idea is to multiply the mass flow value for a given voltage by MAFcorr2, then divide by 100. That should put that point "right on the money". In theory at least... :D
Joachim
1974 Jensen-Healey
1990 VW Caravelle Syncro - running MS3+X
2014 Ford Fiesta EcoBoost
hardline
Master MS/Extra'er
Posts: 503
Joined: Mon Sep 08, 2008 8:37 pm
Location: Peoria, IL

Re: MAF implementation, ideas and discussion

Post by hardline »

OK, Here is the view you requested.
graph2.png
Also, here is the intake tract. Not my exact car, but I am still running a stock intake tract.

Image
2000 ZX2 : Sequential COP, MS3 + MS3X + TinyIOx, PWM Returnless Fuel, Flex Fuel, Variable Geometry Intake Manifold, Garrett GTX2863R .82AR housing @ 15 psi
subwoofer
Super MS/Extra'er
Posts: 884
Joined: Sat Apr 30, 2011 12:34 pm
Location: Sandefjord, Norway

Re: MAF implementation, ideas and discussion

Post by subwoofer »

I would say that it looks like it is probably OK around idle and up to about 1500mV. Ramp in to an increment of 12% or so at 1900mV, then ramp it back out till you are back a no correction at 2900mV.

Not having the raw logs, I can't correct the curve for you, but anyway; this is the principle.
Joachim
1974 Jensen-Healey
1990 VW Caravelle Syncro - running MS3+X
2014 Ford Fiesta EcoBoost
subwoofer
Super MS/Extra'er
Posts: 884
Joined: Sat Apr 30, 2011 12:34 pm
Location: Sandefjord, Norway

Re: MAF implementation, ideas and discussion

Post by subwoofer »

hardline wrote:Pulled a long datalog yesterday. Here is the results of that link. Not sure on where to go from here
graph.png
I think you just stumbled across the solution to properly correcting the flow curve... I'll have a think, but defining the transfer function in reverse just might be the solution for autotuning the flow curve. Stay tuned, a way to go about it may appear suddenly.
Joachim
1974 Jensen-Healey
1990 VW Caravelle Syncro - running MS3+X
2014 Ford Fiesta EcoBoost
subwoofer
Super MS/Extra'er
Posts: 884
Joined: Sat Apr 30, 2011 12:34 pm
Location: Sandefjord, Norway

Re: MAF implementation, ideas and discussion

Post by subwoofer »

subwoofer wrote:I would say that it looks like it is probably OK around idle and up to about 1500mV. Ramp in to an increment of 12% or so at 1900mV, then ramp it back out till you are back a no correction at 2900mV.

Not having the raw logs, I can't correct the curve for you, but anyway; this is the principle.
Reading what I wrote yesterday again, I see that my head was not properly screwed on. You should take out 12% at 1900mV, not add it. Long week at work...
Joachim
1974 Jensen-Healey
1990 VW Caravelle Syncro - running MS3+X
2014 Ford Fiesta EcoBoost
shauer
Experienced MS/Extra'er
Posts: 364
Joined: Wed Oct 05, 2005 10:39 am
Location: Rochester, NY USA
Contact:

Re: MAF implementation, ideas and discussion

Post by shauer »

My approach is a variation on the same theme already discussed.

I like to use VEAL to make adjustments to the VE trim table. Once VEAL has produced a stable trim table I then turn VEAL off. Then I drive and collect log files using the new trim table. Once I have several log files (maybe a couple hours of driving time) I plot the VE1 vs. MAF Volts as well as plot any remaining EGO correction taking place. I get a set of scatter plots similar to this:
maf_tuning_2.png
I then look at the VE trim correction applied across the MAF voltage range as well as any significant amount of EGO correction that may still exist and pick a percentage correction to apply to that portion of the MAF calibration curve.

Once I make the adjustments I set the trim table back to all 100% and start the process all over again.

Based on the plot I show above you can see where I need to apply some correction between about 2.0 and 2.4 volts on my MAF curve.

You can also see how 1.9 volts on my MAF is a difficult to tune area with a wide range of trim table corrections needed depending on RPM where that MAF readings is generated. That flow at 1.9 volts is used at high load / low RPM as well as low load / mid RPM like highway cruising. I have a wide range of correction needed which is most likely caused by the placement of the MAF sensor or similar mechanical or air flow issues. I'm still working on that area.

Another thing, make corrections based on regions of operation where the MAF voltage is as stable as possible. For example, a MAF reading of 2.0 volts on my engine is stable when read at an RPM greater than 2500 but I also use the 2.0 volt reading in a heavy oscillating area like low RPM and high load. You want to apply corrections based on data gathered where the MAF integration is mostly using just the voltage you are making the correction to.

For example, in the log shown below I would not make calibration curve correction decisions based on the heavy oscillating area shown in the middle of the screen shot. Instead I would pick areas of operation like the ones to either side and make those corrections and then see what the result is in the heavily oscillating areas. In one case, I made some corrections to the areas between 2.5 and 3.0 volts using data from a high RPM low load region. Not only did I correct the tune error in this region but I also improved the area shown in the middle of the screen shot below because some of the oscillations in the MAF reached that same level even at low RPM / high load.
MafInteg1.png
I hope some of this makes sense. It seams obvious to me to do it but it's harder to put into words.
Steve Hauer
http://www.77e21.info
1977 BMW 320i with MAF, COP, IAC, Sequential fuel and spark, MS3 knock sensing
MS3 / MS3X / V3 mainboard, MS3 V1.5 a4
nismoautoxr
Super MS/Extra'er
Posts: 2631
Joined: Sun May 29, 2011 10:28 am
Location: birmingham ,Alabama. U.S.A.

Re: MAF implementation, ideas and discussion

Post by nismoautoxr »

hi guys, is there any type MAF that is better than any other at dealing with reversion ? I am currently using a frequency MAF and pile driver has been a great help in my implementation of it but I think it is dealing poorly at lower RPM and high load situations and am not sure its the best MAF sensor to be using in my case .

Specifics about the configurations is as follows:

Most of the pertinent info on cam and engine are below in the signature
engine is making 375hp/361 tq to the wheels
running 93 octane pump gas.
firmware is 1.3RC1

Here is the current msq but still in progress.
Ricky-
1995 Nissan 240sx, 403 LS strokerv8 N/A 6speed trans
MS3&MS3X v.3.0 PCB
42lb/hr Hi-Z inj.,230/232 @.050 on 114LSA cam
sequential fuel and sequential spark
LS3/LSA card MAF sensor
97 Mazda MX5
MS3 2002 vvt motor
.60 trim T4 Turbo at 15 PSI
shauer
Experienced MS/Extra'er
Posts: 364
Joined: Wed Oct 05, 2005 10:39 am
Location: Rochester, NY USA
Contact:

Re: MAF implementation, ideas and discussion

Post by shauer »

nismoautoxr wrote:hi guys, is there any type MAF that is better than any other at dealing with reversion ? I am currently using a frequency MAF and pile driver has been a great help in my implementation of it but I think it is dealing poorly at lower RPM and high load situations and am not sure its the best MAF sensor to be using in my case .
In order to deal with reversion your MAF sensor needs to be able to detect reverse flow. I don't know if your frequency MAF sensor can do this or not. Even if it does, I'm not sure if James was ever able to incorporate the frequency based integration per spark event into the code or not.

You need to be able to detect and measure the reverse flow pulses and then take them into account when calculating the total air flow per spark event. This is what most of this thread was discussing as well as the work that was done to implement this with voltage based sensors. Again not sure if James was ever able to do the same for frequency.

It is possible you may want to consider converting to a voltage based sensor that has reverse flow detection.

Read through my posts again in this thread. There are a lot of examples showing low RPM high load reversion and pulsation through the MAF sensor. Sounds similar to your issues.
Steve Hauer
http://www.77e21.info
1977 BMW 320i with MAF, COP, IAC, Sequential fuel and spark, MS3 knock sensing
MS3 / MS3X / V3 mainboard, MS3 V1.5 a4
subwoofer
Super MS/Extra'er
Posts: 884
Joined: Sat Apr 30, 2011 12:34 pm
Location: Sandefjord, Norway

Re: MAF implementation, ideas and discussion

Post by subwoofer »

nismoautoxr wrote:hi guys, is there any type MAF that is better than any other at dealing with reversion ? I am currently using a frequency MAF and pile driver has been a great help in my implementation of it but I think it is dealing poorly at lower RPM and high load situations and am not sure its the best MAF sensor to be using in my case .
As far as I know, all Bosch HFM5 MAFs use the same sensing element and electronics, just using different tube diameters and plugs. HFM5 is the MAF both Steve (shauer) and I use, and even with the insane reversion pattern of the Wasserboxer, the HFM5 and MS3 are able to cope.

The OEMs have different preferences as to plugs, but all plugs and pins are easily available from Bosch. My favorite source is http://www.finjector.com/en/home/ in Finland, they stock all sorts of weird connectors.

I suspect that the OEM solution to reversion traditionally was physical. The Zetec in my Mondeo has a Helmholtz resonator between the throttle body and the MAF, I suspect it to be a fix for this particular problem.
Joachim
1974 Jensen-Healey
1990 VW Caravelle Syncro - running MS3+X
2014 Ford Fiesta EcoBoost
subwoofer
Super MS/Extra'er
Posts: 884
Joined: Sat Apr 30, 2011 12:34 pm
Location: Sandefjord, Norway

Re: MAF implementation, ideas and discussion

Post by subwoofer »

Bringing this thread back up to thank all involved in getting this up and running. My corrections table is now +/- 1% after a session with VEAL. :yeah!: :yeah!: :yeah!:

When all this started back at 1.2.0 MAF corrections were a mess, and we were routinely seeing correction factors of 50% and more. Those days are thankfully gone, MAF is now definitely ready for prime time.

Thanks Steve, thanks James, thanks Ken, thanks to all the others voicing opinions and questions!
Joachim
1974 Jensen-Healey
1990 VW Caravelle Syncro - running MS3+X
2014 Ford Fiesta EcoBoost
tr3abob
MS/Extra Newbie
Posts: 1
Joined: Wed Apr 17, 2019 2:03 pm
Location: Fort Wayne Indiana

Re: MAF implementation, ideas and discussion

Post by tr3abob »

Is there an all inclusive manual that I can download that shows a newby how to setup a MAF sensor, from start to finish, on an engine that is currently running a good SD tune? I have a 1959 Triumph TR3A that I put Megasquirt full sequential fuel injection and ignition on about 6 years ago. I have MS3 with MS3 Expansion and Daughter boards running the latest firmware and both TunerStudio Ultra and Megalog Viewer HD. I have been reading all I can about MAF and thoroughly understand the concept but a lot of the procedures leave out essential information or assume too much prior knowledge. I am using a GM frequency sensor that came from a 2001 Pontiac Bonneville in a smaller diameter tube and I know it will read higher freqs than when it was on the Bonneville for the same airflow. I am also using the procedure where you autotune VE1 and then adjust the curve and then set VE1 back to 100's and go again. I also see references to a MAF Calibrate button in Tunerstudio under the Tools tab but that no longer exists in the latest version so I can't change the MAF curve by using MAFAnalyzer and creating a new maffactor.inc and loading it into the Megasquirt. I just feel like I am missing something and can't quite put my finger on it. I am attaching a tune and log from that tune and also the procedure I was trying to use. The chart picture was in the document but it made it too big. As you can see in the last paragraph of that procedure, after where the chart was, the author completely glosses over HOW he did the manual process. That is why I feel I need a start to finish, point by point, procedure. My car ran well up to the point where I realized that I put my upper frequency limit too low and hit that limit a number of times so I have to change that. Thanks for any help.
Bob Maassel
Attachments
2019-04-22_12.57.30.msl
MAF with 7200 HZ limit which is too low.
(385.55 KiB) Downloaded 35 times
2019-04-17_09.41.27 goodmafrun.msq
Tune with 7200 HZ MAF limit
(272.69 KiB) Downloaded 32 times
Using TunerStudio for MAF.rtf
Procedure I found online which is the closest I've found to a step by step but still incomplete.
(50.68 KiB) Downloaded 46 times
Picture of chart in procedure.
Picture of chart in procedure.
chart.jpg (131.54 KiB) Viewed 849 times
Post Reply