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

xEnable

BOOL

TRUE: Activates the defined operation FALSE: Aborts/resets the defined operation

LConC

Output

xBusy

BOOL

TRUE: Operation is running

LConC

xError

BOOL

TRUE: Error condition reached

LConC

Input

lrValue

LREAL

Represents the current value that should be differentiated

Differentiator_Base

lrCycleInterval

LREAL

Represents the elapsed time in [second]

Differentiator_Base

Output

lrOutputValue

LREAL

Represents the current derivative of the differentiator

Differentiator_Base

eErrorID

ERROR

ERROR.NO_ERROR

The current error.
Only valid if xError is TRUE.

Differentiator_Base

Input

lrWeightD1

LREAL

1

lrWeightD2

LREAL

0

lrWeightD3

LREAL

0

Properties:

Methods:

Structure: