How to programmatically tune this closed loop system with desired response time and robustness?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jack York
el 31 de Oct. de 2020
Comentada: Siddharth Jawahar
el 3 de Nov. de 2020
I have a closed loop system with a transfer function:
I can pid tune using the tuner app and specify robustness and response time or bandwidth and phase margin. I would like to do this programmatically so it can retune for slightly different input coeffiecients in the transfer function. The tranfer function coefficients are applied programmatically, I have linearized the system and saved it to a variable ClosedPID. I can output the step response of this system using step(ClosedPID). I am trying to use the pidTuner function to open to tuner and update the block but it I don't know how to programmatically change phase margin and bandwidth and apply it to the block. On top of this the plant it uses is slightly different and doesn't produce the same PID values even after manualy entering in the phase margin and bandwidth values. I am wondering what I am doing wrong.
TLDR; How can I programmatically automate the process of:
Clicking on the PID controller in simulink
Clicking Tune... (next to Transfer Function Based)
Entering Xrad/s for bandwidth and Ydeg for phase margin (where X and Y are numbers I choose)
Update block
0 comentarios
Respuesta aceptada
Siddharth Jawahar
el 2 de Nov. de 2020
Editada: Siddharth Jawahar
el 3 de Nov. de 2020
Hi Jack,
You can do the list of actions you mentioned by using the pid, pidtuneOptions, pidtune functions. As an example, using a similar third order system you have shown, you can do something like this:
sys = tf(1,[1 3 3 1]);
C_0 = pid(1,1,1); % Parallel form PID controller object with initial gains
gm = 0.80 % Gain margin
pm = 45 % Phase margin
opts = pidtuneOptions('PhaseMargin',pm,'DesignFocus','disturbance-rejection');% Set your tuning options
[C,info] = pidtune(sys,C_0, gm,opts);
>> C
C =
1
Kp + Ki * --- + Kd * s
s
with Kp = 1.99, Ki = 1.11, Kd = 0.885
Continuous-time PID controller in parallel form.
>> info
info =
struct with fields:
Stable: 1
CrossoverFrequency: 0.8000
PhaseMargin: 45
5 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre PID Controller Tuning en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!