24.01.2015 Views

PLC Programming

  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The Util.lib library<br />

The input IN is of the type INT. All values are initialised anew when the BOOLean input RESET is<br />

TRUE.<br />

The output MN contains the minimum, MX of the maximum value from IN. AVG describes the<br />

average, that is the expected value of IN. All three outputs are of the type INT.<br />

Block in FBD:<br />

STATISTICS_REAL<br />

VARIANCE<br />

This function block corresponds to STATISTICS_INT, except that the input IN is of the type REAL like<br />

the outputs MN, MX, AVG.<br />

VARIANCE calculates the variance of the entered values.<br />

The input IN is of the type REAL, RESET is of the type BOOL and the output OUT is again of the type<br />

REAL.<br />

This block calculates the variance of the inputted values. VARIANCE can be reset with<br />

RESET=TRUE.<br />

The standard deviation can easily be calculated as the square root of the VARIANCE.<br />

10.17.4 Controllers<br />

PD<br />

The PD controller function block:<br />

ACTUAL (actual value) and DESIRED (desired or nominal value) as well as KP, the proportionality<br />

coefficient, are all input values of the type REAL. TV is of the type DWORD and contains the<br />

derivative action time in msec. Y_OFFSET, Y_MIN and Y_MAX are of type REAL and are used for the<br />

transformation of the manipulated variable within a prescribed range. MANUAL, of type BOOL,<br />

switches to manual operation. RESET is of the type BOOL and serves to reset the controller.<br />

Y = KP ⋅ (∆ + TV δ∆/δt) + Y_OFFSET whereby ∆=SET_POINT-ACTUAL<br />

Y is also limited to the allowed range between Y_MIN and Y_MAX. If Y exceeds this range,<br />

LIMITS_ACTVE, a BOOLean output variable, becomes TRUE. If no limitation of the manipulated<br />

variable is desired, Y_MIN and Y_MAX are set to 0.<br />

If MANUAL is TRUE, then the regulator is suspended , that is Y is not altered (by the controller), until<br />

MANUAL becomes FALSE, whereby the controller is re-initialized.<br />

10-54 CoDeSys V2.3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!