PID Tuning via Ziegler Nichols Method
Show older comments
Hi all, I am trying to tune a PID using the Ziegler NIchols method, here is the transfer function :

I started following this video : https://www.youtube.com/watch?v=n829SwSUZ_c&t=1400s&ab_channel=ChristopherLum . I got to the part where he obtains the ultimate gain Ku from simulink. He set Kd=Ki=0 and only increased Kp until he got neutral oscilations. My problem is this : my value for "Ku" is 1.745 and my response looks like this :

And if I zoom in the waveform looks like this :

Which look nothing alike the waveforms I have seen online. Now if I increase my Kp above 1.8 the response of the system looks like this :

Now my question is: what am I doing wrong ? If I use that value for Ku=1.745 and continue with the calculations the response looks like this :

Which looks pretty wrong. So what I am doing wrong ? also if i try in matlab to plot the system response i get this plot :

Below is my block scheme and step input settings :

Accepted Answer
More Answers (2)
Hi @Tom
Regarding your original issue, you can improve the display of the waveform from the Simulink Scope by reducing the maximum step size in the Configuration Parameters dialog box. In the Simulink Editor, on the Modeling tab, click Model Settings.


By the way, I attempted to implement the Ziegler–Nichols tuning method on the initial unstable plant by determining the ultimate gain (
) until the output displays sustained oscillations. Surprisingly, the Ziegler–Nichols method, employing the 'some overshoot' criterion, successfully stabilizes the plant. However, it is noteworthy that the overshoot in this case amounts to 30%.
%% Plant (open-loop unstable)
Gp = tf(523500, [1 87.35 10470 0])
ToF = isstable(Gp) % 1 means stable, 0 means unstable
%% Ziegler–Nichols Gains
Ku = 1.747; % Find this Ultimate Gain
G = minreal(feedback(Ku*Gp, 1));
step(G, 1), grid on
[y, t] = step(G, 1);
h = detrend(y);
[~, peaks] = findpeaks(h, 'MinPeakProminence', (max(h)-min(h))/4);
Tu = mean(diff(t(peaks))) % Oscillation period
%% PID Controller synthesis with 'Some Overshoot' from Z–N Table
Kp = Ku/3;
Ti = Tu/2;
Td = Tu/3;
Ki = Kp/Ti;
Kd = Kp*Td;
Gc = pid(Kp, Ki, Kd)
%% Closed-loop system
Gcl = minreal(feedback(Gc*Gp, 1))
stepinfo(Gcl)
step(Gcl, 1), grid on
종혁
on 4 Dec 2024
0 votes
뽕빵삥ㅃ
ㅜㅇ뿡
Categories
Find more on PID Controller Tuning in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




