LQR for MPC with input rate weight

8 ビュー (過去 30 日間)
aurochs
aurochs 2021 年 10 月 15 日
コメント済み: aurochs 2021 年 10 月 20 日
Referring to MATLAB's documentation https://www.mathworks.com/help/mpc/ug/using-terminal-penalty-to-provide-lqr-performance.html# . Different to the example, my MPC has zero input weight, R (versus 1 in the example) and 1.83 input rate weight, mpcobj.Weights.MVRate (versus 1e-5). I followed the step-by-step instruction, but I couldn't get the value of DC gain of mpcobject and K of LQR to be the same (as I should get if I follow the instruction). This is the code I used:
A = [1 0;0.1 1];
B = [0.1;0.005];
C = eye(2);
D = zeros(2,1);
Ts = 0.1;
plant = ss(A,B,C,D,Ts);
Q = eye(2);
R = 0;
[K,Qp] = lqry(plant,Q,R);
L = chol(Qp);
newPlant = plant;
set(newPlant,'C',[C;L],'D',[D;zeros(2,1)]);
newPlant = setmpcsignals(newPlant,'MO',[1 2],'UO',[3 4]);
p = 3;
m = p;
mpcobj = mpc(newPlant,Ts,p,m);
ywt = sqrt(diag(Q))';
uwt = sqrt(diag(R))';
mpcobj.Weights.OV = [ywt 0 0];
mpcobj.Weights.MV = uwt;
mpcobj.Weights.MVRate = 1.83;
Y = struct('Weight',[0 0 1 1]);
U = struct('Weight',uwt);
setterminal(mpcobj,Y,U);
setoutdist(mpcobj,'model',ss(zeros(4,1)));
setEstimator(mpcobj,[],eye(2));
mpcgain = dcgain(ss(mpcobj));
fprintf('\n(unconstrained) MPC: u(k)=[%8.8g,%8.8g]*x(k)',mpcgain(1),mpcgain(2));
fprintf('\n LQR: u(k)=[%8.8g,%8.8g]*x(k)\n\n',-K(1),-K(2));
I suspect that this is due to the LQR isn't considering the input rate in its cost function calculation. I tried modifying R to be the value of 1.83^2 [(mpcobj.Weights.MVRate)^2] but the gains (K and mpcgain) are still not the same. Please advise the correct method to get the equivalent LQR for my MPC. Thank you.
  6 件のコメント
Paul
Paul 2021 年 10 月 19 日
編集済み: Paul 2021 年 10 月 19 日
Yes, you're clear on the first two parts.
As to the third part ... the clsys is the result of wrapping the static feedback gains around the augmented plant. However, the augmented plant contains that integrator, which is not part of the real plant. To control the real plant, which does not include an integrator, we need a compensator that inlcudes the integrator and the feedback of that integrator through K3 in order to realize the same loop. It's just a block diagram manipulation. If still unclear on why the compensator is defined the way it is, I suggest you draw the block diagram with the discrete integrator in series with the plant, and then add K1, K2, and K3 feedbacks. Draw a box around the plant, then show that the remainder of the diagram, which is the compensator, must be defined as I've shown.
Note that the "control" input to the augmented plant is delta-u, but the control input to the real plant is u, which is the output of the compensator.
aurochs
aurochs 2021 年 10 月 20 日
Thanks Paul! Really appreciate your effort in explaining the answer.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeRefinement についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by