Problem with pidtune function

5 visualizaciones (últimos 30 días)
Collin Lightfoot
Collin Lightfoot el 28 de Abr. de 2024
Comentada: Sam Chak el 1 de Mayo de 2024
For the following code I keep getting just an integral element to my controller even though I am specifying PID. I need PID to get the response I'm looking for but unsure of what I'm doing wrong. tfp4 comes from a state space which I am sure is correct and isn't causing any errors that should effect my response.
[C,info] = pidtune(tfp4, 'PID')
tuned = feedback(C*tfp4, 1);
t = linspace(0, 100, 1000);
u = 3*pi/180*heaviside(t);
[y42, t42] = lsim(tuned, u, t);
y42 = y42*180/pi;
figure()
plot(t42, y42)
  2 comentarios
Paul
Paul el 28 de Abr. de 2024
will be difficult for anyone to help w/o the tfp4 model, which can be saved in a .mat file and added to the question using the Paperclip icon in the Insert menu.
If I had to guess, I'd say that pidtune is able to meet its internally generated design goals with just the integral control; the call to pidtune isn't specifying any design goals in particular, i.e., the resopnse you're looking for.
Collin Lightfoot
Collin Lightfoot el 28 de Abr. de 2024
Thanks. I’ll try setting some response parameters and see if that gets me anywhere.

Iniciar sesión para comentar.

Respuesta aceptada

Sam Chak
Sam Chak el 29 de Abr. de 2024
According to the documentation, if the tuning algorithm can achieve satisfactory performance and robustness using a lower-order controller than what is specified for the desired PID controller type, the pidtune function will return a 'C' controller with fewer actions than specified. In your case, 'C' could be an Integral-only controller, even though the type is 'PID'.
Additionally, if no performance specifications are provided, the algorithm will choose a crossover frequency based on the plant dynamics and automatically design for a target phase margin of 60°
%% 4th-order transfer function plant (tfp4)
num = [-1 4 6 4 1];
den = [ 1 4 6 4 1];
Gp = tf(num, den)
Gp = -s^4 + 4 s^3 + 6 s^2 + 4 s + 1 ------------------------------ s^4 + 4 s^3 + 6 s^2 + 4 s + 1 Continuous-time transfer function.
%% Attempt to implement a PID Controller
% C0 = pidstd(1, 1, 1e-6); % baseline controller
% [C, info] = pidtune(Gp, C0)
[C, info] = pidtune(Gp, 'PID')
C = 1 Ki * --- s with Ki = 0.667 Continuous-time I-only controller.
info = struct with fields:
Stable: 1 CrossoverFrequency: 1 PhaseMargin: 90.0000
%% Closed-loop system
Gcl = feedback(C*Gp, 1)
Gcl = -0.6667 s^4 + 2.667 s^3 + 4 s^2 + 2.667 s + 0.6667 ------------------------------------------------------ s^5 + 3.333 s^4 + 8.667 s^3 + 8 s^2 + 3.667 s + 0.6667 Continuous-time transfer function.
%% Plot results
subplot(211)
step(Gp, 10), grid on, legend('Original Plant')
subplot(212)
step(Gcl), grid on, legend('Compensated Plant with I-only controller', 'location', 'East')
  3 comentarios
Collin Lightfoot
Collin Lightfoot el 1 de Mayo de 2024
Thank you!
Sam Chak
Sam Chak el 1 de Mayo de 2024
You're welcome! If you have additional questions on how to improve the performance, feel free to ask.

Iniciar sesión para comentar.

Más respuestas (0)

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by