PID controller with limited output, anti-windup compensation and setpoint weighting

Library
Blocks/Continuous
Description
This block is a PID controller which takes several practical aspects of PID controller design into account: output limitation, anti-windup compensation, and setpoint weighing.
Further details are given in: Astrom K.J; Hägglund T.: PID controllers: Theory, Design and Tuning. Instrument Society of America, 2nd Ed., 1995.
Parameters

- k [-] : Gain of PID block (>=0) (k): Scalar.
- Ti [s] : Time constant of Integrator block (>0) (Ti): Scalar.
- Td [s] : Time constant of Derivative block (>=0) (Td): Scalar.
- yMax [-] : Upper limit of output (yMax): Scalar.
- yMin [-] : Lower limit of output (yMin): Scalar.
- wp [-] : Set-point weight for Proportional block (0..1) (wp): Scalar.
- wd [-] : Set-point weight for Derivative block (0..1) (wd): Scalar.
- Ni [-] : Ni*Ti is time constant of anti-windup compensation (>0) (Ni): Scalar.
- Nd [-] : The higher Nd, the more ideal the derivative block (>0) (Nd): Scalar.
Ports
- Port 1 at left position: implicit input fixedport numbered 1.
- Port 1 at bottom position: implicit input fixedport numbered 2.
- Port 1 at right position: implicit output fixedport numbered 1.