2

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)?

See image for clarification Simulink setup

Jonas
  • 121,568
  • 97
  • 310
  • 388
Jasper
  • 2,389
  • 4
  • 25
  • 40

2 Answers2

2

Work out what your maximum torque should be to give you the desired maximum angle, and add a Saturation block on the output of your PID controller, parameterised with the previously computed value of maximum torque.

am304
  • 13,758
  • 2
  • 22
  • 40
2

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.

enter image description here

Community
  • 1
  • 1
Robert Seifert
  • 25,078
  • 11
  • 68
  • 113
  • Good point. I almost mentioned it in my answer, but it looks like the OP is using an older release, before this new PID controller block you mention was introduced (just by looking at the screenshot). – am304 Jul 24 '15 at 09:47
  • @am304 but isn't this feature pretty old? – Robert Seifert Jul 24 '15 at 09:48
  • Not sure. I think the new PID block is only a few years old (R2011 sounds about right). I can't remember if the previous incantation of the PID block had any built-in feature for saturating the output. – am304 Jul 24 '15 at 09:50