Why does PID controller block output non-zero values even when the P, I, and D gains are set to 0, when using MATLAB R2023b?

9 vues (au cours des 30 derniers jours)
I am trying to use a PID controller block. The P, I, and D gains are all set to 0, and the input to the block is finite (between -60 and 10 for the first ~60 seconds). The PID controller is set to discrete time with sample time of 10 seconds and the output of the controller is saturated between 5000 and 10000. The integrator and filter are initialized to 4000 each. Despite the gains being 0, the output is still non-zero and keeps on oscillating between 5000 and 10000. Why is the output non-zero despite zero gains?

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 3 Oct 2025
Modifié(e) : MathWorks Support Team le 17 Oct 2025
When using the PID Controller block with all P, I, and D gains set to zero, the output can still be non-zero if the integrator and filter initial conditions are non-zero. This is because:
- With zero I gain, the integrator initial condition acts as a constant offset in the output.
- With zero D gain, the filter initial condition can cause the output to oscillate.
To ensure the output is zero when all the gains are zero, set the integrator and filter initial conditions to zero.
For more information, see the
.
  5 commentaires
Paul
Paul le 19 Juil 2025
Hey Sam,
Some gains scheduled to zero at certain operating conditions? Maybe. I'd be curious to see an example of that. Maybe there's a case where the plant is transitioning from unstable to stable that causes one or two gains to change sign?
But all three gains scheduled to zero, as discussed in this thread, at any operating condition sounds problematic.
Suyash
Suyash le 7 Oct 2025
Hi everyone, thank you for your comments and contributions to this post. As pointed out by Sam in the first comment, the integrator gain is applied on the input before the integration, for both externally supplied and internally supplied gains. Therefore, the initial condition is not subject to the integrator gain and therefore, the integration can result in a non-zero value even when the integrator gain is zero. Similarly, even when D gain is zero, the output can still be non-zero when the filter initial condition is a non-zero value.
The equation in the documentation here shows this, however, we will consider improving this to show how initial condition is incorporated.
Hope this helps! Let me know if you have any more questions.

Connectez-vous pour commenter.

Plus de réponses (0)

Produits


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by