Issues tuning pid using simulink

8 visualizaciones (últimos 30 días)
Paolo
Paolo el 30 de Nov. de 2023
Respondida: Sam Chak el 2 de En. de 2024
I'm trying to evaluate a closed loop system using Zigler nichols table for a Pid with G(s)= and k_p=5,16,k_i= 3,85 and k_d =1,72
But everytime I set a K_d > 1 i have the following error log by simulink
An error occurred while running the simulation and the simulation was terminated
Caused by: Derivative of state '1' in block 'untitled1/Sistema_analogico/Gs1' at time 11.225798821660552 is not finite. The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)
Where the simularion stops depends ow how large I set the k_d, i don t know how to fix this.
Thanks in advance for your help

Respuestas (1)

Sam Chak
Sam Chak el 2 de En. de 2024
Your question on the control problem went unnoticed for more than 1 month. The plant system has a zero (s = 0.1) in the right-half plane. Therefore, it is not easy to design a satisfactory ideal PID controller. You may have noticed that as the derivative gain approaches 1, the undershoot of the closed-loop system also grows infinitely large in the negative direction.
The example below illustrates four cases, with the first being the uncompensated system (stable but with unacceptably large undershoot), and the other three involving 'ideal' PID controllers. If a smaller undershoot is desired, you will need to explore other configurations of controllers.
%% Non-minimum Phase Plant
s = tf('s');
Gp = tf((- s + 0.1)/((s + 0.6)*(s + 8)))
Gp = -s + 0.1 ----------------- s^2 + 8.6 s + 4.8 Continuous-time transfer function.
%% OP's manually-tuned PID Controller (Ziegler–Nichols)
Gc1 = pid(5.16, 3.85, 0.6172) % with kd < 1 is selected
Gc1 = 1 Kp + Ki * --- + Kd * s s with Kp = 5.16, Ki = 3.85, Kd = 0.617 Continuous-time PID controller in parallel form.
Gcl1= minreal(feedback(Gc1*Gp, 1))
Gcl1 = -1.612 s^3 - 13.32 s^2 - 8.71 s + 1.006 --------------------------------------- s^3 + 9.148 s^2 + 3.83 s + 1.006 Continuous-time transfer function.
%% Auto-tuned PID Controller (Unspecified requirements)
Gc2 = pidtune(Gp, 'PID')
Gc2 = 1 Kp + Ki * --- s with Kp = 2.18, Ki = 2.23 Continuous-time PI controller in parallel form.
Gcl2= minreal(feedback(Gc2*Gp, 1));
%% Optimized 'ideal' PID Controller
kp = 0.0290818775069017; % P-gain
ki = 2.45979506934827; % I-gain
kd = 0.216673683005054; % D-gain
Gc3 = pid(kp, ki, kd)
Gc3 = 1 Kp + Ki * --- + Kd * s s with Kp = 0.0291, Ki = 2.46, Kd = 0.217 Continuous-time PID controller in parallel form.
Gcl3= minreal(feedback(Gc3*Gp, 1));
%% Plot Step response and data collection
Gcl = [Gp/dcgain(Gp), Gcl1, Gcl2, Gcl3];
for j = 1:4
sNFO(j) = stepinfo(Gcl(j)); % stored in sNFO structure
step(Gcl(j), 60) % simulate up to 60 sec
hold on
end
hold off
grid on
legend('Case 1: Uncompensated', 'Case 2: Z–N tuned PID', 'Case 3: Auto-tuned PI', 'Case 4: Optimized PID', 'location', 'E')
%% Table of Step-response Characteristics
myCell = [fieldnames(sNFO), permute(struct2cell(sNFO), [1 3 2])];
myTable = cell2table(myCell, "VariableNames", ["Performance Aspect", "Case 1", "Case 2", "Case 3", "Case 4"])
myTable = 9×5 table
Performance Aspect Case 1 Case 2 Case 3 Case 4 __________________ _______ _______ _______ _______ {'RiseTime' } 3.662 2.8299 21.4 11.753 {'TransientTime'} 6.9809 18.727 42.795 26.376 {'SettlingTime' } 9.8932 20.148 46.693 27.065 {'SettlingMin' } 0.90047 0.91668 0.90014 0.90376 {'SettlingMax' } 0.99978 1.2083 0.99981 1.02 {'Overshoot' } 0 20.832 0 2 {'Undershoot' } 473.94 161.23 50.338 49.091 {'Peak' } 4.7394 1.6123 0.99981 1.02 {'PeakTime' } 0.33387 0 91.299 35.244

Community Treasure Hunt

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

Start Hunting!

Translated by