How do I code Ziegler-Nichols Tuning Method to find PID control constants?
    조회 수: 51 (최근 30일)
  
       이전 댓글 표시
    
I need to use the Ziegler-Nichols Tuning rules to determine the PID control constants for the following system to meet a settling time ts ≤ 5 sec, an overshoot of Mp ≤ 50%, and zero steady state error to a unit step function input.
System: PID control = Kp((Ti*Td*s^2+Ti*s+1)/(Ti*s))
And plant open loop transfer function = 10/(2*s^3+12*s^2+22*s+12)
PID control and plant function are in series with negative feedback loop.
For PID control tuning rules are as follows, Kp=0.6*Kr, Ti=0.5*Pcr, Td=0.125*Pcr
I appreciate your help.
댓글 수: 3
  kerem
 2024년 3월 13일
				transfer fonksiyonu verilen bir sistem için PID katsayıları nasıl belirleyebilirim?
  Sam Chak
      
      
 2024년 3월 13일
				Hi @kerem
I suggest posting a new question and providing the transfer function of the given Plant. However, it is important to note that not all types of transfer functions can be stabilized by a PID controller. PID controllers are typically most effective for linear systems of 2nd-order or lower.
답변 (1개)
  Sam Chak
      
      
 2024년 7월 7일
        It is now time to provide a conclusion for this control problem. In the Ziegler-Nichols 2nd method, the critical gain  can be determined from the Routh–Hurwitz criterion. Simulating the closed-loop system will cause the output to exhibit sustained oscillations. From the oscillations, the critical period
 can be determined from the Routh–Hurwitz criterion. Simulating the closed-loop system will cause the output to exhibit sustained oscillations. From the oscillations, the critical period  can be found using the findpeaks() command.
 can be found using the findpeaks() command.
 can be determined from the Routh–Hurwitz criterion. Simulating the closed-loop system will cause the output to exhibit sustained oscillations. From the oscillations, the critical period
 can be determined from the Routh–Hurwitz criterion. Simulating the closed-loop system will cause the output to exhibit sustained oscillations. From the oscillations, the critical period  can be found using the findpeaks() command.
 can be found using the findpeaks() command.While the Ziegler-Nichols-tuned PID gains do not strictly satisfy the settling time requirement, it is possible to employ a heuristic approach to quickly tune the PID gains. However, this heuristic approach may not always lead to the optimal solution.
Ziegler-Nichols Second method
%% Process Plant, Gp
s       = tf('s');
Gp      = 10/(2*s^3 + 12*s^2 + 22*s + 12)
%% Find Critical Gain, Kcr (determined by Routh-Hurwitz criterion)
Kcr     = 12;
Gc      = pid(Kcr);
Gcl     = minreal(feedback(Gc*Gp, 1));  % closed-loop system
[y, t]  = step(Gcl, 10);
figure(1)
plot(t, y), grid on, xlabel('t'), ylabel('y(t)'), title('Step Response')
%% Find Critical Period, Pcr
[pk, lo]= findpeaks(y, t);
Pcr     = lo(2) - lo(1)
%% Apply Ziegler-Nichols Tuning Rules
Kp      = 0.6*Kcr;
Ti      = 0.5*Pcr;
Td      = 0.125*Pcr;
%% PID controller in standard form
Gc      = pidstd(Kp, Ti, Td)
%% Closed-loop system
Gcl     = minreal(feedback(Gc*Gp, 1))
figure(2)
nfo     = stepinfo(Gcl);
disp(nfo.SettlingTime)
disp(nfo.Overshoot)
step(Gp,  10), hold on
step(Gcl, 10), grid on, hold off
xline(nfo.SettlingTime, '--', sprintf('Settling Time: %.3f sec', nfo.SettlingTime), 'color', '#7F7F7F', 'LabelVerticalAlignment', 'bottom')
legend('Original System', 'Closed-loop System', '')
Rational number PID gains
%% PID Controller
kp  =  9/10;
ki  = 18/25;
kd  =  1/8;
Tf  =  5/12;
Gc  = pid(kp, ki, kd, Tf)   % PID controller
Gcl  = minreal(feedback(Gc*Gp, 1))   % closed-loop system
figure(3)
step(Gp),  hold on
step(Gcl), grid on
S    = stepinfo(Gcl);
xline(S.SettlingTime, '--', sprintf('Settling Time: %.3f sec', S.SettlingTime), 'color', '#7F7F7F', 'LabelVerticalAlignment', 'bottom')
legend('Original System', 'Closed-loop System', '')
댓글 수: 0
참고 항목
카테고리
				Help Center 및 File Exchange에서 PID Controller Tuning에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!






