design error of closed loop linear quadratic gaussian(LQG) regulator
11 views (last 30 days)
%% defining LSSM
A=[ 0.6348 0.2593 0.4600
0.5413 0.4619 -2.1551
0.3717 -0.2875 -0.2284];
C=[0.775419018631805 -0.351536834549575 -2.22055248727544
-1.06763937573713 1.60044239999917 2.15337710223348
-0.0104624868533414 -0.872193358462870 1.95243821622811
0.169459415037054 -2.05534089971536 3.53024245136833];
[k n]=size(C); %dimension index
% E|[ w [w.' v.']|=|Q N|
% | v] | |N.' R|
[K,~]=lqry(SYS,Qw,Rw); % u = -Kx minimizes J(u) % [A,B] controllable
%lqry is the Create a linear-second-order (LQ)
%state-feedback regulator with output weighting using [A,B,C,D]
%Design of Kalman estimator
[Kest,L,~]=kalman(SYS,Q,R); % [A,C] observable
% Form LQG regulator = LQ gain + Kalman filter.
cl_sys=feedback(SYS,F); %error point
With a given LSSM condition [A,B,C,D]
I want to implement a closed loop with feedback by designing an LQG regulator.
LSSM is a data driven IO model that satisfies both controllability and observability.
An error occurs because the dimensions of SYS and F in the last code do not match.
Could you please explain what problem in control theory is causing this issue and how to fix the code?
Paul on 22 Apr 2022
I think there are a few issues with the code. First, the plant should have at least one input for the control and one input for the process noise. Second, the feedback() command to form clsys needs to use positive feedback, and it probably needs to use additional input arguments to specify the inputs/outputs of the the plant to connect to F.
This link has an example of the entire process. Feel free to post back with any additional questions after checking it out.
Also, there is a function called lqg() that might be of interest.
A few additional comments. Is that form for Qw really what's intended? I'm only asking because setting Q = C'*C (the transponse of Qw) is common for LQR designs when the cost function includes x'*Q*x, which is then y'*y. So maybe this problem really intends to use Qw = 1? Also, it's not clear why Q and R would be based on random numbers?