LQR for MPC with input rate weight
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Paul
il 19 Ott 2021
Modificato: Paul
il 19 Ott 2021
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.
Risposte (0)
Vedere anche
Categorie
Scopri di più su Refinement in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!