MAF lookup bug ?

Testing and development of Megasquirt 3

Moderators: jsmcortina, muythaibxr

MAF lookup bug ?

Postby W126 » Sun Nov 12, 2017 1:22 am

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 325 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 15 times
W126
Helpful MS/Extra'er
 
Posts: 122
Joined: Sun Aug 24, 2014 10:32 am

Re: MAF lookup bug ?

Postby jsmcortina » Sun Nov 12, 2017 5:34 pm

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 supply, repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: viewtopic.php?f=104&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
jsmcortina
Site Admin
 
Posts: 33987
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK

Re: MAF lookup bug ?

Postby W126 » Mon Nov 13, 2017 9:45 pm

Hi James,

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

Jan
Attachments
MyTune.msq
(286.33 KiB) Downloaded 5 times
W126
Helpful MS/Extra'er
 
Posts: 122
Joined: Sun Aug 24, 2014 10:32 am

Re: MAF lookup bug ?

Postby jsmcortina » Tue Nov 14, 2017 5:39 am

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 supply, repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: viewtopic.php?f=104&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
jsmcortina
Site Admin
 
Posts: 33987
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK

Re: MAF lookup bug ?

Postby W126 » Tue Nov 14, 2017 6:25 am

Hi James,

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

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

Re: MAF lookup bug ?

Postby W126 » Fri Dec 22, 2017 8:56 am

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 184 times


A scatter plot MAF vs. MAF Volts shows a lot of spread.

scatter.JPG
scatter.JPG (58.43 KiB) Viewed 184 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 2 times
W126
Helpful MS/Extra'er
 
Posts: 122
Joined: Sun Aug 24, 2014 10:32 am

Re: MAF lookup bug ?

Postby theturbodog » Tue Dec 26, 2017 10:20 am

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.
theturbodog
MS/Extra Newbie
 
Posts: 18
Joined: Fri Mar 17, 2006 8:38 am
Location: Texas

Re: MAF lookup bug ?

Postby W126 » Wed Dec 27, 2017 2:14 am

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 140 times
W126
Helpful MS/Extra'er
 
Posts: 122
Joined: Sun Aug 24, 2014 10:32 am

Re: MAF lookup bug ?

Postby ashford » Wed Dec 27, 2017 6:04 am

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
ashford
Super MS/Extra'er
 
Posts: 1340
Joined: Sun Apr 27, 2008 4:29 pm

Re: MAF lookup bug ?

Postby W126 » Wed Dec 27, 2017 2:09 pm

interesting, I will make a high speed log.
W126
Helpful MS/Extra'er
 
Posts: 122
Joined: Sun Aug 24, 2014 10:32 am

Re: MAF lookup bug ?

Postby theturbodog » Thu Dec 28, 2017 8:18 am

[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.
theturbodog
MS/Extra Newbie
 
Posts: 18
Joined: Fri Mar 17, 2006 8:38 am
Location: Texas

Re: MAF lookup bug ?

Postby whittlebeast » Thu Dec 28, 2017 10:27 am

I did a scatter plot of MAPxRPM vs MAF and all looks fairly normal.
User avatar
whittlebeast
Super MS/Extra'er
 
Posts: 2151
Joined: Tue May 04, 2004 8:20 pm
Location: St Louis

Re: MAF lookup bug ?

Postby W126 » Sat Dec 30, 2017 10:50 am

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

Re: MAF lookup bug ?

Postby W126 » Sat Dec 30, 2017 10:52 am

@whittlebeast: What do you mean by "all looks fairly normal" ?
MAPxRPM and MAF voltage are two different things.
W126
Helpful MS/Extra'er
 
Posts: 122
Joined: Sun Aug 24, 2014 10:32 am

Re: MAF lookup bug ?

Postby whittlebeast » Sat Dec 30, 2017 11:13 am

User avatar
whittlebeast
Super MS/Extra'er
 
Posts: 2151
Joined: Tue May 04, 2004 8:20 pm
Location: St Louis

Re: MAF lookup bug ?

Postby W126 » Sat Dec 30, 2017 2:52 pm

the question is why I get different MAF values for same voltages.
W126
Helpful MS/Extra'er
 
Posts: 122
Joined: Sun Aug 24, 2014 10:32 am

Re: MAF lookup bug ?

Postby whittlebeast » Sat Dec 30, 2017 3:08 pm

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.
User avatar
whittlebeast
Super MS/Extra'er
 
Posts: 2151
Joined: Tue May 04, 2004 8:20 pm
Location: St Louis

Re: MAF lookup bug ?

Postby W126 » Sat Dec 30, 2017 3:29 pm

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 ?
W126
Helpful MS/Extra'er
 
Posts: 122
Joined: Sun Aug 24, 2014 10:32 am

Re: MAF lookup bug ?

Postby whittlebeast » Sat Dec 30, 2017 3:39 pm

That's my guess
User avatar
whittlebeast
Super MS/Extra'er
 
Posts: 2151
Joined: Tue May 04, 2004 8:20 pm
Location: St Louis

Re: MAF lookup bug ?

Postby W126 » Sat Dec 30, 2017 3:59 pm

but what's the meaning of a log file who's values are not the values used by MS ?
W126
Helpful MS/Extra'er
 
Posts: 122
Joined: Sun Aug 24, 2014 10:32 am

Next

Return to MS3 Development

Who is online

Users browsing this forum: No registered users and 1 guest