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?
    29 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    MathWorks Support Team
    
 il 3 Lug 2025
  
    
    
    
    
    Modificato: MathWorks Support Team
    
 il 17 Ott 2025 alle 21:26
            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?
Risposta accettata
  MathWorks Support Team
    
 il 3 Ott 2025 alle 0:00
        
      Modificato: MathWorks Support Team
    
 il 17 Ott 2025 alle 21:26
  
      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 Commenti
  Paul
      
      
 il 19 Lug 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
    
 il 7 Ott 2025 alle 15:14
				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.
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su PID Controller Tuning in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!










