DampingT1 (FB)

FUNCTION_BLOCK DampingT1

Functional Description

Timing filtering of an analog input signal

Typical application: filtering of a raw sensor value

Portrayal

../_images/DampingT1_FB.png

Interfaces

Inputs

Name

Datatype

Range

Init-Value

Function

rIn REAL    

Analog value input

Outputs

Name

Datatype

Range

Init-Value

Function

rOut REAL    

Filtered analog value output

Setpoints / Parameters

Name

Datatype

Range

Init-Value

Function

tTimeConstant TIME 5s... T#10s

Filter - Time constant

rInitValue REAL   100

Init-Value

eInitial eInit   eInit.InputValue

Selection of the initialization value

tInitDelay TIME   T#5s

Start delay - Initialization

Functional Description

General

The analog input signal rIn is checked for value changes at the sampling time interval (here: 1s, fixed setting).
If the actual value at input rIn at time t differs from the value at output rOut at time t-sampling time, the actual output value rOut at time t is calculated according to the following algorithm:


rOut = rOut*(t-sampling time) + ( ( *rIn - rOut*(t-sampling time) ) * ( sampling time / **tTimeConstant* ) )


Legend:
rOut = filtered analog value output at time point t
rOut (t-sampling time) = filtered analog value output at the time point t-sampling time
rIn = Analog value input at time point t
sampling time = 1s
tTimeConstant = Filter - time constant
t = current time

Rules for setting the filters - time constant tTimeConstant

tTimeConstant > ( sampling time * 5 )
tTimeConstant = 0: rOut = *rIn

../_images/DampingT1_Bild_1.png

Type of initialization eInitial

This setpoint / parameter defines the type of initialization of the analog value input rIn.
The initialization is performed once after each CPU restart.

The following options are possible:
Art

Initialization value

Notes

eInit.InitValue rInitValue

Configurable initial value

eInit.InputValue rIn

Input value

eInit.InputValueDelayed rIn

Delayed input value

The initialization is performed independent of this if the setpoint / parameter tTimeConstant has the value T#0s.

Visualization




Information

Element

Authors

Date

Version

Notes

Function

Adam Bartod 04.2016 1.0

Initial version

Programming

Adam Bartod 04.2016 1.0

Initial version

Test Jochen Reu 10.2017 1.0

Initial version

Documentation

Jochen Reu 10.2017 1.0

Initial version

Codesys

InOut:
Scope Name Type Initial Comment
Input rIn REAL  

Analog value input

tTimeConstant TIME TIME#10s0ms

Filter - Time constant

rInitValue REAL 100

Init-Value

eInitial eInit eInit.InputValue

Selection of the initialization value

tInitDelay TIME TIME#5s0ms

Start delay - Initialization

Output rOut REAL  

Filtered analog value output