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

10 次查看(过去 30 天)
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)

回答(1 个)

Paul
Paul 2021-11-29
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 个评论
Jonathan Salfity
Jonathan Salfity 2021-11-29
@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 2021-11-30
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Robust Control Toolbox 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by