prairiedog
Full Member level 2

I'm struggling to code PI control using the frequency domain formula specified by Autosar (AUTomotive Open System ARchitecture).
Taken from Specification of Floating Point Math Routines AUTOSAR CP R21-11 (pg. 48/100)
8.5.4.7.2 ‘PI’ Controller – Type1 with limitation (Implicit type)" [SWS_Mfl_00326].
Yn = Yn-1 + (K * Xn) - (K * (1 - dT/Tn) * Xn-1)
I'm lost with the equation's dT/Tn term. Y is the output, X is the input, K is gain.
Digging as best I can "Structure definitions for controller routines" between many docs gives:
----------------------------
Tn : Follow-up time. Physical unit [sec] describes the Follow-up time.
Tn is expressed in us and have a resolution of 1/10ˆ6
Tn is given by a reciprocal value (Tnrec) to avoid a division in the implementation
The time and time equivalent parameters in the equation / implementation are given
by:
dT : Time step = sampling interval. dT is expressed in us (micro seconds) and shall
have a resolution of 1/10ˆ6.
Tnrec _<size>, Tnrec_C : Reciprocal follow-up time = 1/ Tn. The result shall be Rounded towards Zero.
dT_<size> : Time step = sampling interval [10-6 seconds per increment of 1 data representation unit]
-----------------------------
If my (PI) sample rate is 3Hz or 333msec, then dT is 333,333 [usec].
Tn = "Follow up time" or I've seen it called "follow up time state variable". I don't know what this means.
I keep getting the (1-dT/Tn) term as massive negative value which does not work. Or dT=Tn gives a zero value.
Can anyone offer insight.
Taken from Specification of Floating Point Math Routines AUTOSAR CP R21-11 (pg. 48/100)
8.5.4.7.2 ‘PI’ Controller – Type1 with limitation (Implicit type)" [SWS_Mfl_00326].
Yn = Yn-1 + (K * Xn) - (K * (1 - dT/Tn) * Xn-1)
I'm lost with the equation's dT/Tn term. Y is the output, X is the input, K is gain.
Digging as best I can "Structure definitions for controller routines" between many docs gives:
----------------------------
Tn : Follow-up time. Physical unit [sec] describes the Follow-up time.
Tn is expressed in us and have a resolution of 1/10ˆ6
Tn is given by a reciprocal value (Tnrec) to avoid a division in the implementation
The time and time equivalent parameters in the equation / implementation are given
by:
dT : Time step = sampling interval. dT is expressed in us (micro seconds) and shall
have a resolution of 1/10ˆ6.
Tnrec _<size>, Tnrec_C : Reciprocal follow-up time = 1/ Tn. The result shall be Rounded towards Zero.
dT_<size> : Time step = sampling interval [10-6 seconds per increment of 1 data representation unit]
-----------------------------
If my (PI) sample rate is 3Hz or 333msec, then dT is 333,333 [usec].
Tn = "Follow up time" or I've seen it called "follow up time state variable". I don't know what this means.
I keep getting the (1-dT/Tn) term as massive negative value which does not work. Or dT=Tn gives a zero value.
Can anyone offer insight.