errors with musyn -- Plant must have at least <> inputs and <> outputs

10 vues (au cours des 30 derniers jours)
Jonathan Salfity
Jonathan Salfity le 28 Nov 2021
Commenté : Paul le 30 Nov 2021
4 states, 1 input, 4 outputs.
Attempting to find a robust controller using musyn, but coming across this error message
```
Error using uss/musyn (line 74)
P must have at least 2 inputs and 5 outputs.
```
Code below:
% PLANT MODEL
g = ureal('g', 9.8, 'percentage', 80);
mcart = ureal('mcart', 1.0, 'percentage', 80);
mpole = ureal('mpole', 0.1, 'percentage', 80);
l = ureal('l', 2*0.5, 'percentage', 80);
M = mcart + mpole;
a = g /(l*(4.0/3 - mpole/(mpole+mcart)));
A = [0 1 0 0; 0 0 a 0; 0 0 0 1; 0 0 a 0];
b = -1/(l*(4.0/3 - mpole/(mpole+mcart)));
B = [0;1/mcart; 0; b];
C = [1 0 0 0; 0 1 0 0; 0 0 1 0; 0 0 0 1];
D = [0; 0; 0; 0];
% MAKE SS
P = ss(A, B, C, D);
P.StateName = {'cart pos (m)';'car vel (m/s)';...
'pole angle (\theta)';'pole angular vel (\theta/s)'};
P.InputName = {'force'};
P.OutputName = {'x'; 'xdot'; 'theta'; 'thetadot'};
% ROBUST ANALYSIS
nY = 4;
nU = 1;
[Krob, ~, gamma_inf] = musyn(P, nY, nU)

Réponses (1)

Paul
Paul le 29 Nov 2021
The plant model has 4 outputs and 1 input. If you look at
doc musyn
you'll see that the second (nY) and third inputs (nU) are the number of measurements (y) from and control inputs (u) to the plant. But the plant has additional inputs (w) and outputs (z) that define the the closed loop transfer function for optimization. So the plant has to have at least 2 inputs and 5 outputs altogether, which is what the error message is saying.
Having said all that, are you sure musyn is the correct function to use? I'm asking because
a) the comment says "Robust Analysis" and musyn is used for robust design, and
b) the outputs from the call to musyn don't seem to match any of the signatures on doc page.
  4 commentaires
Jonathan Salfity
Jonathan Salfity le 29 Nov 2021
@Paul -- thanks for the follow up. I searched around and found some good examples, i looked at these two and modified my code like below:
I think I'm getting what I want, except I didnt realize Krob is a ss, is there a K matrix that gets output for use in state feedback ?
https://www.mathworks.com/help/robust/ug/robust-controller-for-spinning-satellite.html
https://www.mathworks.com/help/robust/gs/using-mixsyn-for-h-infinity-loop-shaping.html
% To achieve good reference-tracking and disturbance-rejection performance,
% shape S to be small inside the control bandwidth,
% which means choosing W1 large at low frequency, rolling off at high frequency.
% For this example, specify W1 with:
wS = makeweight(33, 5, 0.5); % sensitivity
% For robustness and noise attenuation,
% shape T to be small outside the control bandwidth,
% which means choosing W3 large at high frequency.
wT = makeweight(0.5,20,20); % complementary sensitivity function
wKS = []; % w to u, control effort
P = augw(G_unc, wS, wKS, wT);
nmeas = 4;
ncont = 1;
[Krob, G_uncCL_Perf, info] = musyn(P, nmeas, ncont)
Paul
Paul le 30 Nov 2021
I don't think you can get a state feedback solution, but it's been a long time since I did any mu synthesis stuff and so could very well be wrong.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Robust Control Toolbox dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by