FB_PT1
PT1 element for smoothing of input variables.
This function block is active continuously. The output fOut always follows the input value fIn multiplied by Kp with an exponential curve:
If Kp is 1 the output value directly follows the input value. fOut has reached 63% of the input value after the time tT1 has elapsed, after 3 x tT1 the value is 95%.
The mathematical formula is:
The following time-discrete formula is used for the calculation in the PLC:
With a continuously changing input fIn, fOut behaves as follows (fIn= 0..33000, Kp= 1, T1= 5s ):
Note on damping times: Since this function block is a time-discrete model of a PT1 element, it only works correctly if the damping time is significantly longer than the set cycle time. To be on the safe side, if a damping time is entered that is less than twice the set cycle time it is internally set to zero. A damping time of 0s means that the output variable directly follows the input variable multiplied by Kp.
VAR_INPUT
fIn : LREAL;
fKp : LREAL := 1;
tT1 : TIME := t#10s;
tCycletime : TIME := t#10ms;
bSetActual : BOOL;
fIn: Input value.
fkP: Gain factor, preset value: 1.
tT1: Damping time, preset value: 10 s.
tCycleTime: PLC cycle time, preset value: 10 ms.
bSetActual: Sets the output fOut directly to the input value fIn.
VAR_OUTPUT
fOut : LREAL;
fOut: Output value.
Requirements
Development environment | Required PLC library |
---|---|
TwinCAT from v3.1.4020.32 | Tc2_BABasic from v3.1.0.0 |