Differentiator_LinearFourPointApproximation (FB)ΒΆ
FUNCTION_BLOCK Differentiator_LinearFourPointApproximation EXTENDS Differentiator_Base
The function block uses recent values to approximate the derivation of a value with respect to time.
The last three values are recorded and used together with the current value and the elapsed time to estimate the derivation. The approximation is based on a linear approximation. This is extended to consider the last two and the current derivation. A weighted sum of these three derivatives is output.
Note
The sum of the weights should give 1.
By default, this function block mimics the behavior of Differentiator_BackwardDifference.
- InOut:
Scope
Name
Type
Initial
Comment
Inherited from
Input
xEnableBOOLTRUE: Activates the defined operationFALSE: Aborts/resets the defined operationLConC
Output
xBusyBOOLTRUE: Operation is runningLConC
xErrorBOOLTRUE: Error condition reachedLConC
Input
lrValueLREALRepresents the current value that should be differentiated
lrCycleIntervalLREALRepresents the elapsed time in [second]
Output
lrOutputValueLREALRepresents the current derivative of the differentiator
eErrorIDERROR.NO_ERROR
The current error.Only valid ifxErrorisTRUE.Input
lrWeightD1LREAL1
lrWeightD2LREAL0
lrWeightD3LREAL0
Properties:
CurrentDerivative, inherited from Differentiator_Base
OutputValue, inherited from Differentiator_Base
Methods:
CyclicAction, inherited from Differentiator_Base
CyclicCall, inherited from Differentiator_Base
Reset, inherited from Differentiator_Base
ResetAction, inherited from Differentiator_Base
Structure: