FB_PT1
PT1 element for smoothing of input values.
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 already 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= 5 s):
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 0 s means that the output value directly follows the input value multiplied by Kp. |
VAR_INPUT
fIn : LREAL;
fKp : LREAL := 1;
tT1 : TIME := t#10s;
tCycletime : TIME := t#10ms;
bSetActual : BOOL;
fIn: Input Value.
fKp: Amplifying-factor, preset value: 1.
tT1: Damping-time, preset value: 10s.
tCycleTime: PLC-cycle-time, preset value: 10ms.
bSetActual: Sets the output fOut directly to the input-value fIn.
VAR_OUTPUT
fOut : LREAL;
fOut: Output-Value.