No logro estabilizar mi sistema por PID
6 次查看(过去 30 天)
显示 更早的评论

A pesar de aplicar de todo no se logra estabilizar
0 个评论
回答(1 个)
Sam Chak
2025-7-19
编辑:Sam Chak
2025-7-19
For learning purposes, I am providing a demo below to illustrate that an ideal Proportional-Derivative (PD) controller can be designed to stabilize the unstable 3rd-order system. The effectiveness of this approach stems from the fact that only the proportional and derivative terms in the denominator carry negative signs.
First, we need to construct a target closed-loop transfer function (Tcl) around the stable accelerative term,
. Subsequently, we can calculate the desired PD gains from the stable proportional and derivative terms of Tcl.
%% Unstable 3rd-order system
Gp = tf(-19.81, [1, 0.5, -392.4, -196.2])
[num, den] = tfdata(Gp, 'v')
%% Convert Gp to state-space model (Note that B(3) = num(4). It is an input signal amplifier gain)
sys = compreal(Gp);
sys = ss(sys.A', sys.C', sys.B', sys.D')
%% Target Closed-loop TF (This will give us a stable critically-damped response)
wn = den(2)/3; % find natural freq using conservation of accelerative gain
Tcl = tf(wn^3, [1, 3*wn, 3*wn^2, wn^3]) % based on Hurwitz Polynomial for 3rd-order critically-damped
figure(1)
step(Tcl), grid on
%% Calculate the proportional and derivative gains
% Solve 3*wn^2 = -392.4 + den(4)*Kd for Kd
Kd = (23549/60)/num(4); % Why divide by num(4)? Because den(4) amplifies desired control input signal
% Solve wn^3 = -196.2 + den(4)*Kp for Kp
Kp = (211901/1080)/num(4);
%% Ideal PD Controller (not realizable in practice, but can be fun for learning)
Gc = pid(Kp, 0, Kd)
%% Checking the coefficients of the numerator
Gap = series(Gc, Gp) % whether -392.4 + 392.5 = 3*wn^2 and -196.2 + 196.2 = wn^3 (not zero!)
%% If the above step is correct, then we can apply feedback to find the Closed-loop TF
Gcl = feedback(Gc*Gp, 1)
figure(2)
step(Gcl), grid on
%% Since Gcl is stable and the zero of Gcl lies on the LHS of s-plane, it can be cancelled out using a Pre-filter
[num, den] = tfdata(Gcl, 'v')
%% Pre-filter
Gf = tf(den(4), num(3:4))
%% Filtered Closed-loop
Fcl = minreal(series(Gf, Gcl)) % verify if Fcl == Tcl
figure(3)
step(Fcl), grid on
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!


