Design PI regulator with constrictions

8 visualizaciones (últimos 30 días)
Alejandro Fernández
Alejandro Fernández el 23 de Oct. de 2020
Editada: Sam Chak el 19 de Ag. de 2022
Hi, I needed to know if anyone knows how to carry out the next design of a PI C(s) regulator using the rltool or similar tool. I explain below what what I need to do.
  • Start from a step input that can vary in a range of +-20.
  • The output of the controller can only be within the range of +-2.
  • The output of the regulator can only be between values of +-2.
  • An over-shoot of less than 5% must be present at any time and the settling time must be less than 1s but never less than 0.5s.
The main problem I have is that I don't see a way to implement Simulink's saturation block in the rltool options... or if someone knew how to link the variables so that what I calculate in rltool would be reflected in the transfer function of Simulink's controller would also be of great help to me.
Thank you very much for everything.
  2 comentarios
Mathieu NOE
Mathieu NOE el 23 de Oct. de 2020
hi
A rrot locus analysis assumes that the entire loop is a LTI system.. you cannot include non linear elements like a saturation block.
If I were you, i would run first the rltool without taking into account the saturation block , and then refine if necessary your PID with the saturation block in the loop. there are also time domain optimisation techniques available that take the linear and non linear terms into the optimisation loop. there is a GA optimisation tool for PID
Alejandro Fernández
Alejandro Fernández el 23 de Oct. de 2020
Ok! Thank you for all you help :D

Iniciar sesión para comentar.

Respuestas (1)

Sam Chak
Sam Chak el 19 de Ag. de 2022
Editada: Sam Chak el 19 de Ag. de 2022
Proposal #1: Linear compesator
If the restriction on the output of the compensator can be relaxed a little bit from to , then the problem can be easily solved by having only a Linear Proportional Gain.
Introducing the Integral action will make the system output to track reference signal, . Since the system output should be 10 times smaller than the reference signal, we want the kind of compensator that can introduce a non-zero steady-state error, .
The closed-loop system is given by
.
Applying the Final Value theorem, the Linear Proportional Gain can be determined by solving
.
s = tf('s');
Gp = 10/(s + 10) % Plant
Gp = 10 ------ s + 10 Continuous-time transfer function.
Gc = 1/9 % Compensator
Gc = 0.1111
Gcl = minreal(feedback(Gc*Gp, 1)) % Closed-loop system
Gcl = 1.111 --------- s + 11.11 Continuous-time transfer function.
tau = 2;
[u, t] = gensig('square', tau, 4);
lsim(Gcl, 20*u, t), grid on % System Output signal
Gu = minreal(feedback(Gc, Gp))
Gu = 0.1111 s + 1.111 ---------------- s + 11.11 Continuous-time transfer function.
lsim(Gu, 20*u, t), grid on % Compensator output signal
Proposal #2: Nonlinear compesator
If that trade-off is not acceptable, then a nonlinear proportional gain can be proposed. Designing a continuous nonlinear function requires some imaginations and a little trial-and-error. The idea is to have smaller values of when the error , so that the output of the compensator does not exceed . If , then . Using a Fuzzy Logic System could simplify the design task. In this proposal, a relatively simple Gaussian function is used for the continuous nonlinear function.
Edit: To replace the previous complicated hyperbolic tangent function with the single-hump Gaussian function.
e2 = linspace(-2, 2, 401);
kp1 = 1/(9*1.7);
kp2 = 1/9;
Kp = (kp2 - kp1)*exp(-(e2/0.8).^2) + kp1;
plot(e2, Kp, 'linewidth', 1.5)
grid on, xlabel('Error between Actual y(t) and Desired y(t)'), ylabel('K_p')
Because the Proportional compensator is nonlinear, the ode45() function is used. The system output converges at around 0.6 sec, and all criteria are met.
[t, x] = ode45(@system, [0 2], 0);
subplot(211)
plot(t, x, 'linewidth', 1.5)
grid on, xlabel('t'), ylabel('y(t)')
subplot(212)
r = 20;
e1 = r - x;
e2 = 0.1*r - x;
kp1 = 1/(9*1.7);
kp2 = 1/9;
Kp = (kp2 - kp1)*exp(-(e2/0.8).^2) + kp1; % nonlinear gain
u = Kp.*e1;
plot(t, u, 'linewidth', 1.5)
grid on, xlabel('t'), ylabel('u(t)')
function dxdt = system(t, x)
% construction of nonlinear gain Kp
r = 20; % Reference signal
e1 = r - x; % Error signal (as seen in the Summation point in the Simulink)
e2 = 0.1*r - x; % Error between Actual y(t) and Desired y(t)
kp1 = 1/(9*1.7);
kp2 = 1/9;
Kp = (kp2 - kp1)*exp(-(e2/0.8)^2) + kp1;
u = Kp*e1; % nonlinear proportional compensator
% the dynamics
dxdt = - 10*x + 10*u; % the system
end

Community Treasure Hunt

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

Start Hunting!

Translated by