PDA

View Full Version : Calc PID's lagging behind?



ferocity02
July 8th, 2013, 02:31 PM
So I have a calc pid for lambda, AFR, and BEN from my wideband. Lambda is calculated from EXT.AD1, and AFR and BEN are both calculated from lambda. Here are the expressions:

CALC.LAM_AEM1 = {EXT.AD1}*0.136643 + 0.683005

CALC.AFR_AEM1 = {CALC.LAM_AEM1}*14.222224

CALC.WO2BEN = {GM.EQIVRATIO}*{CALC.LAM_AEM1}

The weird thing is that AFR lags behind lambda and BEN by 1 frame. Is this possibly because I have AFR defined before lambda in my calc pids file?

I've attached my calc pids file and a log showing the issue.

Thanks!

joecar
July 8th, 2013, 03:45 PM
Make sure the CLC numeric order is the same as the pid dependency.

ferocity02
July 8th, 2013, 04:42 PM
Make sure the CLC numeric order is the same as the pid dependency.

I'm not sure what you mean by that. Could you clarify?

joecar
July 8th, 2013, 06:00 PM
...
The weird thing is that AFR lags behind lambda and BEN by 1 frame. Is this possibly because I have AFR defined before lambda in my calc pids file?
...
Yes...

the CLC numeric order must match the order of reference.

joecar
July 8th, 2013, 06:35 PM
. . .

*CLC-00-004
factor 0.0 2.0 .3 "1/{CALC.LAM_AEM1}"

*CLC-00-005
AFR 10.0 18.0 .2 "{CALC.LAM_AEM1}*14.222224"

*CLC-00-006
factor 0.0 2.0 .3 "{EXT.AD1}*0.136643 + 0.683005"

. . .

CALC.EQR_AEM1 F004 CLC-00-004 factor WO2-Analog "Wide Band EQR 1 - AEM"

CALC.AFR_AEM1 F005 CLC-00-005 AFR WO2-Analog "Wide Band AFR 1 - AEM"

CALC.LAM_AEM1 F006 CLC-00-006 factor WO2-Analog "Wide Band Lambda 1 - AEM"

. . .

CALC.LAM.AEM1 should have the lower CLC number since CALC.AFR_AEM1 and CALC.EQR_AEM1 depend on it...

i.e. like this:



. . .

*CLC-00-004
factor 0.0 2.0 .3 "{EXT.AD1}*0.136643 + 0.683005"

*CLC-00-005
factor 0.0 2.0 .3 "1/{CALC.LAM_AEM1}"

*CLC-00-006
AFR 10.0 18.0 .2 "{CALC.LAM_AEM1}*14.222224"

. . .

CALC.LAM_AEM1 F004 CLC-00-004 factor WO2-Analog "Wide Band Lambda 1 - AEM"

CALC.EQR_AEM1 F005 CLC-00-005 factor WO2-Analog "Wide Band EQR 1 - AEM"

CALC.AFR_AEM1 F006 CLC-00-006 AFR WO2-Analog "Wide Band AFR 1 - AEM"

. . .

ferocity02
July 8th, 2013, 06:41 PM
Makes perfect sense. Just tried it and it worked.

Thanks!

joecar
July 8th, 2013, 06:43 PM
i.e.

the CLC used by CALC.AFR_AEM1 references CALC.LAM_AEM1...

so the CLC used by CALC.LAM_AEM1 must numerically precede (be numerically lower) than the CLC used by CALC.AFR_AEM1;

same deal with the CLC used by CALC.EQR_AEM1.

joecar
July 8th, 2013, 06:44 PM
i.e. a calc pid must be fully defined (its CLC must appear already, i.e. have a lower CLC number) before it can be referenced in another calc pid.