lqr controller with saturation for closed loop system
Afficher commentaires plus anciens
Hi, I want to add saturation to regulate the output of the lqr controller. I wonder how to add saturation and wanna check if the input to the plant is really regulated in between +-1. I also tried simulink but it shows not desired results.
I'll really appreciate if you can help. thanks!
the code for lqr is below:
% LQR
%%%%%%%%%%
s = tf('s');
Gs = 4000/(s*(s+10)*(s+20));
[A,B,C,D]=tf2ss(Gs.Numerator{1}, Gs.Denominator{1});
st = 0.06;
Gd=c2d(Gs,st);
[Ad,Bd,Cdl,Ddl]=tf2ss(Gd.Numerator{1}, Gd.Denominator{1});
Q = blkdiag(0.1,0.1,100);
R =0.001;
[K,P]=dlqr(Ad,Bd,Q*st,R/st);
sys12 = ss(Ad-Bd*K,Bd,Cdl,Ddl,st);
N12=1/dcgain(sys12);
sysfin = ss(Ad-Bd*K,Bd*N12,Cdl,Ddl,st);
figure;
step(sysfin)
3 commentaires
Junhwi
le 12 Déc 2023
Paul
le 13 Déc 2023
Hi Junhwi,
Can this statement be clarified: "I wonder how to add saturation and wanna check if the input to the plant is really regulated in between +-1."
I think I understand the second part, which is that for your code above you want to check if the input the plant is between -1 and +1 for a unit step input. Is that correct? And if the plant input is not between those bounds, you want to add a saturation function on the output of the controller to ensure the input to the plant stays within those bounds?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur State-Space Control Design 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!
