MAF lookup bug ?

Testing and development of Megasquirt 3

Moderators: jsmcortina, muythaibxr

W126
Experienced MS/Extra'er
Posts: 153
Joined: Sun Aug 24, 2014 10:32 am

MAF lookup bug ?

Post by W126 »

Hi,

the MAF lookup (mapping MAF voltage to MAF) seems buggy to me.
I have sorted a log file by MAF voltage and got different MAF values for identical voltages.
Then I made a Tuner Studio custom channel "MafCurve" which does a MAF lookup in the
MAF Flow Curve and compared that to the MAF values.
MafCurve = { tableLookup(array.mafflow, array.mafv, maf_volts) }, "g/s";
The max error in this log is 24% !.
error.jpg
error.jpg (45.29 KiB) Viewed 851 times
FW 1.5.1

I had to cut the log.
Attachments
2017-11-11_20.49.39.cut.msl.zip
(686.17 KiB) Downloaded 36 times
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: MAF lookup bug ?

Post by jsmcortina »

Please attach your MSQ.
There could be a number of factors here, ones that spring to mind:
- the datalog points are not synchronised with the actual calculation.
- the curve is linearly interpolated which might not be exactly the same as your comparison curve.

I did a scatter plot in MegaLogViewer of MAF vs. MAFvolts and it give a "fat" line, showing a bit of a spread.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
W126
Experienced MS/Extra'er
Posts: 153
Joined: Sun Aug 24, 2014 10:32 am

Re: MAF lookup bug ?

Post by W126 »

Hi James,

thank you for your reply.
Attached you'll find my tune.

Jan
Attachments
MyTune.msq
(286.33 KiB) Downloaded 25 times
jsmcortina
Site Admin
Posts: 39585
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Re: MAF lookup bug ?

Post by jsmcortina »

I looked at your log again and your tune. Nothing is jumping out as incorrect. You have a 50% lag enabled on MAF. So the value will rarely match the instantaneous table lookup due to the smoothing. This will be especially visible during transients.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
W126
Experienced MS/Extra'er
Posts: 153
Joined: Sun Aug 24, 2014 10:32 am

Re: MAF lookup bug ?

Post by W126 »

Hi James,

thank you for your analysis.
The 50% lag is the default.
Which lag factor do you recommend for MAF ?

Jan
W126
Experienced MS/Extra'er
Posts: 153
Joined: Sun Aug 24, 2014 10:32 am

Re: MAF lookup bug ?

Post by W126 »

Hi James,

I made a new log with MAF lag factor 100.
Still there are significant deltas between logged and calculated MAF.
The max error is 67%.
error.JPG
error.JPG (27.37 KiB) Viewed 710 times
A scatter plot MAF vs. MAF Volts shows a lot of spread.
scatter.JPG
scatter.JPG (58.43 KiB) Viewed 710 times
I don't want to claim that this is a bug, I simply want to understand it.

[ I had to cut the log ]

Regards,
Jan
Attachments
2017-11-18_09.57.00_cut.msl.zip
(497.73 KiB) Downloaded 20 times
theturbodog
MS/Extra Newbie
Posts: 20
Joined: Fri Mar 17, 2006 8:38 am
Location: Texas

Re: MAF lookup bug ?

Post by theturbodog »

I couldn't quite tell from the msq/msl, but my guess would be this variance is caused by MAT correction or MAT air density table corrections(In 1.4.x/1.5.x firmware I've noticed that MAT air density correction table has an effect on MAF even though it's greyed out in TS and is meant for speed density). Correction would give several MAF values for each voltage, but what I don't know is whether the log value is the raw MAF calculation before corrections or if it is post correction.
W126
Experienced MS/Extra'er
Posts: 153
Joined: Sun Aug 24, 2014 10:32 am

Re: MAF lookup bug ?

Post by W126 »

I don't think so.
There is no MAT dependency visible in the zoomed scatter plot.
Air correction is between 97% and 103% through the whole log.
There should be no air correction at all with MAF.
mafmat.JPG
mafmat.JPG (86.58 KiB) Viewed 666 times
ashford
Super MS/Extra'er
Posts: 1603
Joined: Sun Apr 27, 2008 4:29 pm

Re: MAF lookup bug ?

Post by ashford »

also when in maf mode i think it also uses map sampling as maf sampling, that will add a bit of smoothing as well.

for giggles try out map/maf logging in high speed loggers once, it will blow your mind how sensitive it is
W126
Experienced MS/Extra'er
Posts: 153
Joined: Sun Aug 24, 2014 10:32 am

Re: MAF lookup bug ?

Post by W126 »

interesting, I will make a high speed log.
theturbodog
MS/Extra Newbie
Posts: 20
Joined: Fri Mar 17, 2006 8:38 am
Location: Texas

Re: MAF lookup bug ?

Post by theturbodog »

[quote="W126"]
There should be no air correction at all with MAF.
[/quote]

Right, at least that's the desire anyway. What I had to do to get my MAF to behave somewhat like I expected it to was to zero out all the air correction factors both for MAT air density and MAF/MAT correction. Even though the air density temp corrections shouldn't affect MAF they do for me. You can easily test this by increasing/decreasing the air density correction factor to large/small values and you can see large AFR swings from it.
whittlebeast
Super MS/Extra'er
Posts: 2221
Joined: Tue May 04, 2004 8:20 pm
Location: St Louis
Contact:

Re: MAF lookup bug ?

Post by whittlebeast »

I did a scatter plot of MAPxRPM vs MAF and all looks fairly normal.
W126
Experienced MS/Extra'er
Posts: 153
Joined: Sun Aug 24, 2014 10:32 am

Re: MAF lookup bug ?

Post by W126 »

@theturbodog: Air correction cannot be zeroed out, it's disabled in MAF mode.
W126
Experienced MS/Extra'er
Posts: 153
Joined: Sun Aug 24, 2014 10:32 am

Re: MAF lookup bug ?

Post by W126 »

@whittlebeast: What do you mean by "all looks fairly normal" ?
MAPxRPM and MAF voltage are two different things.
whittlebeast
Super MS/Extra'er
Posts: 2221
Joined: Tue May 04, 2004 8:20 pm
Location: St Louis
Contact:

Re: MAF lookup bug ?

Post by whittlebeast »

W126
Experienced MS/Extra'er
Posts: 153
Joined: Sun Aug 24, 2014 10:32 am

Re: MAF lookup bug ?

Post by W126 »

the question is why I get different MAF values for same voltages.
whittlebeast
Super MS/Extra'er
Posts: 2221
Joined: Tue May 04, 2004 8:20 pm
Location: St Louis
Contact:

Re: MAF lookup bug ?

Post by whittlebeast »

My guess is this is an issue with data packets may not be synced in the data log. Try logging way faster if on MS3.
W126
Experienced MS/Extra'er
Posts: 153
Joined: Sun Aug 24, 2014 10:32 am

Re: MAF lookup bug ?

Post by W126 »

Tunerstudio is at the max, I could try SD card logging.
If I understand you correctly, your guess is the logged value is not the value actually used by MS ?
whittlebeast
Super MS/Extra'er
Posts: 2221
Joined: Tue May 04, 2004 8:20 pm
Location: St Louis
Contact:

Re: MAF lookup bug ?

Post by whittlebeast »

That's my guess
W126
Experienced MS/Extra'er
Posts: 153
Joined: Sun Aug 24, 2014 10:32 am

Re: MAF lookup bug ?

Post by W126 »

but what's the meaning of a log file who's values are not the values used by MS ?
Post Reply