Setting a Specific Formula for PID Controller in Simulink (Matlab)
Afficher commentaires plus anciens
I need to add a PID Controller to a Simulink Project with formula 1/(s+4.54) but I couldn't find the proper constants for the formula.
I tried looking at the different types of PID crack Controller libraries. I also tried finding the constants by solving the equation but couldn't.
Réponses (2)
Sam Chak
le 9 Nov 2023
0 votes
Hi @nora
Use the Transfer Funtion block instead.
4 commentaires
dorrin
le 9 Nov 2023
I posted the question on Stackoverflow and saw it here today (Maybe it's automatically reposted?).
Is it possible to use the PID Tuning feature to get the function
? This is the project I have to build:

The step response looks okay, no overshoot and settles within 6 seconds. Are the performance requirements satisfied?
% Plant
Gp = tf(30, [1 30 0])
% Compensator
Gc = tf(4, [1 4.54])
% Pre-filter
Gf = tf(1, [1 1])
% Closed-loop system
Gcl = feedback(Gc*Gp, 1)
% Closed-loop system with Prefilter
Gclf = Gf*Gcl
% Plot Step response
step(Gclf, 10), grid on
stepinfo(Gclf)
If you intend to use a PID controller to make the system behave similarly to the designed compensator, you'll need to make some slight modifications to the control loop configuration. The system under the PID controller should have the same settling time.
% Plant
Gp = tf(30, [1 30 0])
Gpp = feedback(Gp, 1);
% PID Controller
kp = 0.266920333340203;
ki = 0.516920333340203;
kd = -0.111860942402338;
Tf = 0.483633519278621;
Gc = pid(kp, ki, kd, Tf)
% Closed-loop system
Gcl = feedback(Gc*Gpp, 1)
% Plot Step response
step(Gcl, 10), grid on
stepinfo(Gcl)
Catégories
En savoir plus sur PID Controller Tuning dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


