How to limit Simulink PID block output for P, I, D seperatly?

24 views (last 30 days)
I have some C code describing a PID controller that I am transferring into the Simulink environment for tuning. I am trying to use the PID block so that I can use MATLAB Control Systems Toolbox to tune my PID controller.
However, my PID limits the (P + I) output to +-12; then it subtracts the D part. Finally, it saturates the final output to +-25. Note that it also performs clamping +-25 on the I part, which I know that the PID block can do.
How would I get the limit on the (P + I) to work in Simulink using a PID block? If it isn't possible, what's a better way to tune my controller?
Thanks!

Answers (1)

Reen
Reen on 22 Aug 2017
Instead of using the PID block in Simlunk, try building the PID controller yourself, since you'll have more flexibility in the way it works. Here's an example:
The system on the top is exactly the same as the one on the bottom (Note that in the Kd branch, the resulting transfer function from that little loop is 1000*s/(s+1000), which is how the PID block estimates the derivative to make it realizable).
Now that there is a custom PID flow, you can add in saturation to any branch or at the end. You can also add rate limiters, dead zones, etc, to each branch separately.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!