Confusing error when choosing the appropriate loop opening location for TuningGoal.Sensitivity()

3 views (last 30 days)
When trying to synthesise the controller matrices K and M to meet some requirements, the following error pops out on trying to use 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
Generalized continuous-time state-space model with 2 outputs, 2 inputs, 6 states, and the following blocks: K: Tunable 2x6 matrix, 2 occurrences. M: Tunable 2x2 matrix, 2 occurrences. w: Analysis point, 1 channels, 2 occurrences. z: Analysis point, 1 channels, 2 occurrences. Type "ss(sys)" to see the current value and "sys.Blocks" to interact with the blocks.
getPoints(sys)
ans = 2×1 cell array
{'w'} {'z'}
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]);
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.
  3 Comments
Dhilen Chin
Dhilen Chin on 15 May 2023
I tried opening by doing
output_AP.Open = 1;
However the same error message still occurs. What is TuningGoal.Sensitivity() expecting for the 'location' argument?
Walter Roberson
Walter Roberson on 15 May 2023
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.

Sign in to comment.

Accepted Answer

Paul
Paul on 16 May 2023
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
Generalized continuous-time state-space model with 2 outputs, 2 inputs, 6 states, and the following blocks: K: Tunable 2x6 matrix, 2 occurrences. M: Tunable 2x2 matrix, 2 occurrences. w: Analysis point, 1 channels, 2 occurrences. z: Analysis point, 1 channels, 2 occurrences. Type "ss(sys)" to see the current value and "sys.Blocks" to interact with the blocks.
getPoints(sys)
ans = 2×1 cell array
{'w'} {'z'}
CL0 = tunableSS('closed_loop', sys, 'full')
Tunable continuous-time state-space model "closed_loop". This model has 2 outputs, 2 inputs, 6 states, and 64 tunable parameters. Type "ss(CL0)" to see the current value.
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
Name Size Bytes Class Attributes CL0 2x2 1343 tunableSS
but the doc page for systune indicates the input system should be a genSS object.
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]);
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.
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.
  3 Comments
Paul
Paul on 16 May 2023
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'})
Generalized continuous-time state-space model with 2 outputs, 2 inputs, 6 states, and the following blocks: AnalysisPoints_: Analysis point, 2 channels, 1 occurrences. K: Tunable 2x6 matrix, 1 occurrences. M: Tunable 2x2 matrix, 1 occurrences. Type "ss(sys1)" to see the current value and "sys1.Blocks" to interact with the blocks.
getPoints(sys1)
ans = 2×1 cell array
{'u1'} {'u2'}
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)
Dhilen Chin
Dhilen Chin on 17 May 2023
Dear Paul, thank you very much for the assitance! The connet function is exactly what I'm looking for as I'm confused of how to connect the plant with the controller while introducing evlautation points in the closed loop. This is very helpful!

Sign in to comment.

More Answers (0)

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!