I have a problem where I need to limit the output of a PID controller, so it needs to "monitor" two values.
I have a swinging system, say a pendulum swinging with angle phi. I want to reduce this swinging with an other system, this is a gyroscope. The reduction is proportional to the RATE of a precession angle (alpha)of the gyroscope, so phi_reduced = phi - A* alpha_dot, A is some proportional gain.
In an ideal case we would monitor the difference of phi and zero as the error, and use a PID controller to determine the torque controlling the gyro angle. This is all implemented as shown below in the image, and works like a charm but now there is a limiting factor: the maximum precession (gyroscope) angle is limited to 150 degrees... At the moment, without the limiting, this maximum gyro angle is like 1500 degrees, so that is a problem.
So I have to limit the torque that controls the gyroscope that this limit is not exceeded. How can I do so without creating two PID controllers "fighting" with each other (one increasing, one decreasing)?
For a simple implementation of limits, the saturation block, as in am304s answer is alright. But you should know what you do. Saturating PID controllers can cause an integral wind-up which should be considered (without having a deeper look into your model, whether it could actually happen).
To be on the save side, use the saturation option of the PID controller block and include an anti-wind-up method, if needed.