State Space with Disturbance
4 views (last 30 days)
Show older comments
Hello, I am working on a project which involves disturbance term w in the state equation as below.
I want to convert this standard state space form which is Ax+Bu to use lqr function and then using R,Q to get K,S,e terms. Is there a way to obtain K,S,e in this case or how can I convert to standard form? A, B1, and B2 matrices are as below.
if true
% code
M1f= 1; %kg
M1r= 1; %kg
M2=2.9; %kg
J=2.18; %kgm²
l=3; %m
lf=1.5; %m
K1f=2717; %N/m
K1r=2717; %N/m
C1f=5; %N/m
C1r=5; %N/m
K2f=970; %N/m
K2r=970; %N/m
C2f=7.5; %Ns/m
C2r=7.5; %Ns/m
m61= -K2f/M1f;
m62= 0;
m63= K1f/M1f;
m64= 0;
m65= (-K2f*lf)/M1f;
m66= (-C1f-C2f)/M1f;
m67= 0;
m68= C2f/M1f;
m69= (-C2f*lf)/M1f;
m71= 0;
m72= -K2r/M1r;
m73= 0;
m74= K1r/M1r;
m75= K2r*(l-lf)/M1r;
m76= 0;
m77= (-C1r-C2r)/M1r;
m78= C2r/M1r;
m79= (C2r*(l-lf))/M1r;
m81= K2f/M2;
m82= K2r/M2;
m83= 0;
m84= 0;
m85= ((K2f*lf)-K2r*(l-lf))/M2;
m86= C2f/M2;
m87= C2r/M2;
m88= (-C2f-C2r)/M2;
m89= ((C2f*lf)-C2r*(l-lf))/M2;
m91= (-K2f*lf)/J;
m92= (K2r*(l-lf))/J;
m93= 0;
m94= 0;
m95= (-K2f*(lf^2)-K2r*((l-lf)^2))/J;
m96= (-C2f*lf)/J;
m97= (C2r*(l-lf))/J;
m98= ((C2f*lf)-(C2r*(l-lf)))/J;
m99= ((-C2f*(lf^2))-(C2r*((l-lf)^2)))/J;
A=[0 0 0 0 0 1 0 -1 0;0 0 0 0 0 0 1 -1 0;0 0 0 0 0 -1 0 0 0;0 0 0 0 0 0 -1 0 0;...
0 0 0 0 0 0 0 0 1;m61 m62 m63 m64 m65 m66 m67 m68 m69;...
m71 m72 m73 m74 m75 m76 m77 m78 m79;m81 m82 m83 m84 m85 m86 m87 m88 m89;...
m91 m92 m93 m94 m95 m96 m97 m98 m99];
B=[0 0 0 0;0 0 0 0;1 0 0 0;0 1 0 0;0 0 0 0;C1f/M1f 0 -1/M1f 0;0 C1r/M1r 0 -1/M1r;...
0 0 1/M2 1/M2;0 0 -lf/J (l-lf)/J];
B1=B(:,1:2);
B2=B(:,3:4);
C=[0 0 0 0 0 0 0 1 0;0 0 0 0 0 0 0 0 1];
D=[0 0];
end
Thank you in advance
0 Comments
Answers (1)
Tim Grunert
on 2 Mar 2018
Hello, just ignore B1 to use lqr(...) there is no impact from the controller to w anyway.
Maybe you need some feed forward for w and/or the setpoint to be statically exact. Or you use different approaches like lqi(...) instead.
0 Comments
See Also
Categories
Find more on Matrix Computations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!