Lambda Calculation Error

This is a forum for discussing the development and testing of alpha MS2/Extra code. Documentation
(Runs on MS2 and Microsquirt)

Moderators: jsmcortina, muythaibxr

Lambda Calculation Error

Postby motthomas » Thu Jan 04, 2018 3:25 pm

Apologies if this is in the wrong section as it concerns the TS interface but as the mainController.ini is James & Kens then I thought this may be a better place for it. Please move if you feel necessary.

In a post on another thread last week (linked below) I recalled that there was an anomaly in the calculation of Lambda field within Tunerstudio and hence also the logged Lambda value. This is when using Lambda Settings in Project Properties.
http://www.msextra.com/forums/viewtopic.php?f=100&t=67245#p517695

I have been trying to get my head around a few other things recently and came across this anomaly again.

Lines 5306 & 5307 of the mainController.ini file read as follows:

Code: Select all
lambda1          = { afr1 / 14.7 }, "Lambda"
lambda2          = { afr2 / 14.7 }, "Lambda"


This means that if you are using a fuel that has a different stoichiometric ratio than 14.7:1, the lambda value displayed and logged will be incorrect even though you have taken care to enter the correct sensor calibration and correct stoichiomentric ratio for your fuel in the General Settings -> Stoichiomentric AFR field in TS.
Right now, this has had me over on a number of logs taken during a dyno session meaning that my fuel tables have been calibrated to a different Lambda than intended.

Why is this calculation coded in this manner? Given the fact that you have the flexibility to enter the stoich ratio in General Settings, it would seem logical for TS to pull this value to use in the calculation of Lambda rather than using a coded value? My readings are only out by a few percent but this calculation makes the Lambda value useless if using E85 or Methanol fuel.

Can this calculation please be changed to use the Stoich AFR which the user inputs in General Settings?


Also related, I have been unable to find a difinitive answer in the .ini so hoping someone can confirm. It stands to reason that the controller uses AFRTarget in AFR to calculate inj PW when Incorporate AFRTarget is enabled regardless of the Project Properties Settings in TS. How is the AFR Target that the controller uses calculated when Lambda is selected in TS Project Properties? Does this also use 14.7 or does it use the user Stoichiometric AFR?
i.e. Assume I am using Lambda within TS and I have Incorporate AFRTarget enabled and a Stoichiometric AFR of 14.2 entered. If at a particular speed/load point I have entered Lambda 1.0 in the AFR Table 1, will the AFR Target that is used in the fuel calculations, "outpc.afrtgt1 = gl_afrtgt1" be 14.7 or 14.2?

For reference, I am running MS2E_3.4.2 firmware and TunerStudioMS Ultra v3.0.28.
motthomas
Helpful MS/Extra'er
 
Posts: 86
Joined: Wed Aug 24, 2011 2:06 am

Re: Lambda Calculation Error

Postby racingmini_mtl » Thu Jan 04, 2018 4:51 pm

The MS2 never sees or uses lambda. The Lambda values are only displayed in TunerStudio using the (potentially erroneous) transformations in the ini that you mention (and possibly others but I'd have to check the ini). The MS2/extra firmware uses AFR values everywhere.

Jean
jbperf.com Main site . . . . . . . . . . . . . . . . . . . . . . jbperf.com Forum
Image
racingmini_mtl
Super MS/Extra'er
 
Posts: 8041
Joined: Sun May 02, 2004 6:51 am
Location: Quebec, Canada

Re: Lambda Calculation Error

Postby motthomas » Fri Jan 05, 2018 1:00 am

racingmini_mtl wrote:The MS2 never sees or uses lambda. The Lambda values are only displayed in TunerStudio using the (potentially erroneous) transformations in the ini that you mention (and possibly others but I'd have to check the ini). The MS2/extra firmware uses AFR values everywhere.

Jean


Thanks Jean. Yes I figured that the MS2 wouldn't see lambda and that the conversion is done in TS. If you could confirm the Lambda/AFR table transformation calculation that would be great!
motthomas
Helpful MS/Extra'er
 
Posts: 86
Joined: Wed Aug 24, 2011 2:06 am

Re: Lambda Calculation Error

Postby motthomas » Fri Jan 12, 2018 9:37 am

Hi Jean (or others),

Any update on the Lambda/AFR table transformation? I am trying to bottom out some strange fuelling data I have and I'd like to confirm what inputs are actually being fed into the fuelling equation so I can work it back and see if there are any issues.
motthomas
Helpful MS/Extra'er
 
Posts: 86
Joined: Wed Aug 24, 2011 2:06 am

Re: Lambda Calculation Error

Postby motthomas » Mon Jan 15, 2018 10:56 am

For info, the latest MS3 firmware calculates the correct Lambda using the user input stoich AFR. It is still unclear to me how the Lambda target from the table is transferred to AFRtgt for the fuel PW calculation.

Code: Select all
Line 14590:    lambda1          = { afr1 / stoich }, "Lambda"
   Line 14591:    lambda2          = { afr2 / stoich }, "Lambda2"
   Line 14592:    lambda3          = { afr3 / stoich }, "Lambda3"
   Line 14593:    lambda4          = { afr4 / stoich }, "Lambda4"
   Line 14594:    lambda5          = { afr5 / stoich }, "Lambda5"
   Line 14595:    lambda6          = { afr6 / stoich }, "Lambda6"
   Line 14596:    lambda7          = { afr7 / stoich }, "Lambda7"
   Line 14597:    lambda8          = { afr8 / stoich }, "Lambda8"



Also, another error I spotted in my search is the calculation of the Boost Gauge in Bar. I recall this error being flagged up on the MS3 and it has been corrected in the latest MS3 firmware release. However, it has so far not been corrected on the latest MS2/E firmware beta release. Can the correction of division of kPa by 101.33 to get Bar please be corrected to division by 100 in the next MS2/E release?

Code: Select all
Line 5474:     boostbar = { (map - barometer) / 101.33}
motthomas
Helpful MS/Extra'er
 
Posts: 86
Joined: Wed Aug 24, 2011 2:06 am

Re: Lambda Calculation Error

Postby motthomas » Wed Jan 17, 2018 3:13 pm

OK, I managed to get out to the bike this evening and tested the AFRtgt1 conversion from Lambda.
My tests show that AFRtgt1 uses 14.7 as the multiplier regardless of what the stoichiometric AFR is set to. I still cannot find any trace of this conversion happening within mainController.ini. My suspicion is that this conversion happens within TS as the lambda value typed into the AFR target table auto-corrects to a number that when multiplied by 14.7 gives an AFR figure correct to one decimal place. i.e. 0.9 (13.23 AFR @ 14.7 stoich) gets corrected to 0.898 (13.2AFR @ 14.7 stoich). Perhaps this query is directed at Phil and EFI Analytics then?

This basically means that unless you are using a fuel with a stoichiometric ratio of 14.7:1, the Lambda project property is useless and only serves to provide incorrect information to the fuelling equation when using Incorporate AFR and also to provide incorrect feedback. I have to ask, has the Lambda property never been tested before? Surely I cannot be the only person preferring to use Lambda as opposed to AFR?

Can I please request that the Lambda property is either fixed so that it works as it should or else removed altogether?
motthomas
Helpful MS/Extra'er
 
Posts: 86
Joined: Wed Aug 24, 2011 2:06 am

Re: Lambda Calculation Error

Postby SwedCharger-67 » Thu Jan 18, 2018 12:50 am

I'm following this topic with great interest.
I've never used anything but Lambda with my E85 engine. However, I've only briefly switched on "include AFR target" and cannot say if it seems to function correctly with Lambda.
Martin, Sweden
Mopar 512 cui, 8.4 liters, high compression, fuel E85, full sequential control by MS3X, burning rubber just blipping the throttle... :D
SwedCharger-67
Helpful MS/Extra'er
 
Posts: 99
Joined: Sun Dec 23, 2012 2:20 pm
Location: Nordmaling, Sweden

Re: Lambda Calculation Error

Postby motthomas » Thu Jan 25, 2018 6:04 am

SwedCharger-67 wrote:I'm following this topic with great interest.
I've never used anything but Lambda with my E85 engine. However, I've only briefly switched on "include AFR target" and cannot say if it seems to function correctly with Lambda.


I see you are running MS3 which looks like it at least calculates the lambda feedback correctly. I would be interested if you were able to do a test to find out if the lambda target in TS still uses 14.7 as the multiplier for AFRtgt. I just set the Lambda target table to 1.0, idled the engine and observed AFRtgt1. Then changed the lambda target to 0.95 and observed the change in AFRtgt1. It should be pretty obvious.

Is there any interest in this from the developers side? Can you confirm or deny any of the observations I have made so far?
motthomas
Helpful MS/Extra'er
 
Posts: 86
Joined: Wed Aug 24, 2011 2:06 am


Return to MS2/Extra Development

Who is online

Users browsing this forum: No registered users and 2 guests