Confusing error when choosing the appropriate loop opening location for TuningGoal.Sensitivity()
2 ビュー (過去 30 日間)
古いコメントを表示
When trying to synthesise the controller matrices K and M to meet some requirements, the following error pops out on trying to use systune:
"Error using DynamicSystem/systune
Sensitivity goal: The identifier "z" does not match any loop opening location. Use "getPoints" to see
the list of valid loop opening locations."
However, getPoints(sys) returns:
"ans = 2×1 cell
'w'
'z'"
which shows 'z' to be a valid loop opening location. Note that there are two inputs and two outputs to the system, which might require multi channel w and z.
Why am I getting that error despite choosing a valid loop opening location?
R_f = 0.1;
L_f = 8*10^-3;
R_li = 20;
L_li = 15*10^-3;
R_lk = 40;
L_lk = 40*10^-3;
G_f = 1/350;
C_f =50*10^-6;
v_DQ_set = 311;
omega_s = 2*pi*50;
J = [0, 1; -1, 0];
R_V = 0.5;
X_V = 1;
Z = R_V*eye(2) - X_V*J;
R_line = 195*10^-3;
L_line = 0.61*10^-3;
A_tilde = [ -R_f/L_f, omega_s, -1/L_f, 0, 0, 0;
-omega_s, -R_f/L_f, 0, -1/L_f, 0, 0;
1/C_f, 0, -G_f/C_f, omega_s, 0, 0;
0, 1/C_f, -omega_s, -G_f/C_f, 0, 0;
0, 0, 1, 0, 0, 0;
0, 0, 0, 1, 0, 0];
B_u_tilde = [ 1/L_f, 0;
0, 1/L_f;
0, 0;
0, 0;
0, 0;
0, 0];
B_w_tilde = [ 0, 0;
0, 0;
1/C_f, 0;
0, 1/C_f;
-Z];
C_tilde = [ 0, 0, 1, 0, 0, 0;
0, 0, 0, 1, 0, 0];
D_u_tilde = zeros(2, 2);
D_w_tilde = zeros(2, 2);
K_tune = realp('K', [117.3, 1.1, 6.3, 0.4, 40, -7.3; -2.6, 117.2, -2.1, 12.9, 2.1, 72.5]);
K_tune.Maximum = 125;
K_tune.Minimum = -125;
M_tune = realp('M', [107.8, 3.3; -1.2, 104.7]);
M_tune.Maximum = 125;
M_tune.Minimum = -125;
Ac = A_tilde - B_u_tilde*K_tune;
Bc = B_w_tilde - B_u_tilde*M_tune;
Cc = C_tilde - D_u_tilde*K_tune;
Dc = D_w_tilde - D_u_tilde*M_tune;
sys = ss(Ac, Bc, Cc, Dc);
input_AP = AnalysisPoint('w');
output_AP = AnalysisPoint('z');
sys = output_AP*sys*input_AP
getPoints(sys)
CL0 = tunableSS('closed_loop', sys, 'full');
rho = 0.4;
pole_req = TuningGoal.Poles(5,0,inf);
maxsens = 1.5*tf(10^5, [1 10^5]);
freq_resp_req = TuningGoal.Sensitivity('z',maxsens);
pass_req = TuningGoal.Passivity('w', 'z', 0 ,rho);
[CL,fSoft,gHard] = systune(CL0,[pole_req, freq_resp_req, pass_req]);
3 件のコメント
Walter Roberson
2023 年 5 月 15 日
The documentation shows setting Open to be done on part of a getIOTransfer result, not directly on an analysis point. I do not know if that makes a difference.
採用された回答
Paul
2023 年 5 月 16 日
Hi Dhilen,
The error message shows up because CL0 does not include those analysis points
R_f = 0.1;
L_f = 8*10^-3;
R_li = 20;
L_li = 15*10^-3;
R_lk = 40;
L_lk = 40*10^-3;
G_f = 1/350;
C_f =50*10^-6;
v_DQ_set = 311;
omega_s = 2*pi*50;
J = [0, 1; -1, 0];
R_V = 0.5;
X_V = 1;
Z = R_V*eye(2) - X_V*J;
R_line = 195*10^-3;
L_line = 0.61*10^-3;
A_tilde = [ -R_f/L_f, omega_s, -1/L_f, 0, 0, 0;
-omega_s, -R_f/L_f, 0, -1/L_f, 0, 0;
1/C_f, 0, -G_f/C_f, omega_s, 0, 0;
0, 1/C_f, -omega_s, -G_f/C_f, 0, 0;
0, 0, 1, 0, 0, 0;
0, 0, 0, 1, 0, 0];
B_u_tilde = [ 1/L_f, 0;
0, 1/L_f;
0, 0;
0, 0;
0, 0;
0, 0];
B_w_tilde = [ 0, 0;
0, 0;
1/C_f, 0;
0, 1/C_f;
-Z];
C_tilde = [ 0, 0, 1, 0, 0, 0;
0, 0, 0, 1, 0, 0];
D_u_tilde = zeros(2, 2);
D_w_tilde = zeros(2, 2);
K_tune = realp('K', [117.3, 1.1, 6.3, 0.4, 40, -7.3; -2.6, 117.2, -2.1, 12.9, 2.1, 72.5]);
K_tune.Maximum = 125;
K_tune.Minimum = -125;
M_tune = realp('M', [107.8, 3.3; -1.2, 104.7]);
M_tune.Maximum = 125;
M_tune.Minimum = -125;
Ac = A_tilde - B_u_tilde*K_tune;
Bc = B_w_tilde - B_u_tilde*M_tune;
Cc = C_tilde - D_u_tilde*K_tune;
Dc = D_w_tilde - D_u_tilde*M_tune;
sys = ss(Ac, Bc, Cc, Dc);
input_AP = AnalysisPoint('w');
output_AP = AnalysisPoint('z');
sys = output_AP*sys*input_AP
getPoints(sys)
CL0 = tunableSS('closed_loop', sys, 'full')
Can a TunableSS object contain analysis points? I don't know, but getPoints(CL0) resulted in an error.
Even if the analysis points carried over from sys to CL0, both anlaysis points are outside the loop so might not be interesting from a design standpoint.
The analysis points are "doubled" because sys has two inputs and two outputs. That might cause other problems.
CL0 is a TunableSS object
whos CL0
rho = 0.4;
pole_req = TuningGoal.Poles(5,0,inf);
maxsens = 1.5*tf(10^5, [1 10^5]);
freq_resp_req = TuningGoal.Sensitivity('z',maxsens);
pass_req = TuningGoal.Passivity('w', 'z', 0 ,rho);
[CL,fSoft,gHard] = systune(CL0,[pole_req, freq_resp_req, pass_req]);
What is the purpose of creating CL0 as a TunableSS? I thought tunable objects are to be used in the build up of the input system to systune, which will yield a genss object.
doc page: Models with Tunable Coefficients
3 件のコメント
Paul
2023 年 5 月 16 日
AnalysisPoints can be added regardless of the underlying representation of the individual models to be connected. Here's one way to do this.
Create the model as in the original code using closed form expressions for closed loop system represented by:
xdot = A*x + Bu * u + Bw * w
y = C*x + Du * u + Dw * w
u = -K * x - M * w
R_f = 0.1;
L_f = 8*10^-3;
R_li = 20;
L_li = 15*10^-3;
R_lk = 40;
L_lk = 40*10^-3;
G_f = 1/350;
C_f =50*10^-6;
v_DQ_set = 311;
omega_s = 2*pi*50;
J = [0, 1; -1, 0];
R_V = 0.5;
X_V = 1;
Z = R_V*eye(2) - X_V*J;
R_line = 195*10^-3;
L_line = 0.61*10^-3;
A_tilde = [ -R_f/L_f, omega_s, -1/L_f, 0, 0, 0;
-omega_s, -R_f/L_f, 0, -1/L_f, 0, 0;
1/C_f, 0, -G_f/C_f, omega_s, 0, 0;
0, 1/C_f, -omega_s, -G_f/C_f, 0, 0;
0, 0, 1, 0, 0, 0;
0, 0, 0, 1, 0, 0];
B_u_tilde = [ 1/L_f, 0;
0, 1/L_f;
0, 0;
0, 0;
0, 0;
0, 0];
B_w_tilde = [ 0, 0;
0, 0;
1/C_f, 0;
0, 1/C_f;
-Z];
C_tilde = [ 0, 0, 1, 0, 0, 0;
0, 0, 0, 1, 0, 0];
D_u_tilde = zeros(2, 2);
D_w_tilde = zeros(2, 2);
K_tune = realp('K', [117.3, 1.1, 6.3, 0.4, 40, -7.3; -2.6, 117.2, -2.1, 12.9, 2.1, 72.5]);
K_tune.Maximum = 125;
K_tune.Minimum = -125;
M_tune = realp('M', [107.8, 3.3; -1.2, 104.7]);
M_tune.Maximum = 125;
M_tune.Minimum = -125;
Ac = A_tilde - B_u_tilde*K_tune;
Bc = B_w_tilde - B_u_tilde*M_tune;
Cc = C_tilde - D_u_tilde*K_tune;
Dc = D_w_tilde - D_u_tilde*M_tune;
sys = ss(Ac, Bc, Cc, Dc);
Now use connect. We have to augment the plant with the states as outputs to use connect
plant = ss(A_tilde,[B_w_tilde , B_u_tilde],[C_tilde;eye(6)],[D_w_tilde , D_u_tilde;zeros(6,4)],'InputName',{'w1' 'w2' 'u1' 'u2'},'OutputName',{'y1' 'y2' 'x1' 'x2' 'x3' 'x4' 'x5' 'x6'});
C1 = ss(-K_tune,'InputName',{'x1' 'x2' 'x3' 'x4' 'x5' 'x6'},'OutputName',{'ux1' 'ux2'});
C2 = ss(-M_tune,'InputName',{'w1' 'w2'},'OutputName',{'uw1' 'uw2'});
s = sumblk('%u = %ux + %uw',plant.InputName(3:4),C1.OutputName,C2.OutputName);
sys1 = connect(plant,C1,C2,s,{'w1' 'w2'},{'y1' 'y2'},{'u1' 'u2'})
getPoints(sys1)
Now sys1 is a genss model, with analysis points at u1 and u2. I don't know if those locations are where you want the analysis points; I'm just showing an example of how it works.
Verify that sys and sys1 have same reponse at the nominal values
bode(sys1,sys)
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!