Why does h2syn double the number of states?

11 views (last 30 days)
Ali
Ali on 28 Apr 2022
Edited: Paul on 2 May 2022
I am learning about robust control, and getting started with the robust control toolbox.
When I try to use the h2syn() or the hinfsyn() functions, the resulting CL system, has double the number of states of my original system. Why is that? What do those new states correspond to? And how can I recover the response of my original states with this new CL system?

Accepted Answer

Paul
Paul on 28 Apr 2022
Hey Ali,
Both of those functions produce a dynamic controller that has the same number of states as the plant. So the resulting CL system will have twice the number of states as the plant P with the additional states corresponding to the dynamic compensation.
What do you mean by "recover the response of my original states"?
  7 Comments
Paul
Paul on 29 Apr 2022
I'm not sure that you can count on lft preserving the order of the states, unless the doc page says that explicitly, which I did not see. But it does seem to work that way.
Keep in mind that one can always define the outputs of P to include the state variables, in which case the outputs of CL will also be those same physical quantities, even if the states of CL are reordered or even redefined by a similarity tranformation. So you don't have to rely on the specific internal realization of CL. Instead, define the inputs/outputs of P, and therefore CL, to be the quantities you care about.
Paul
Paul on 30 Apr 2022
Edited: Paul on 2 May 2022
Here is a simple example of H-infinity control using the so-called mixed-sensitivity method for reference tracking.
Start with a simple, second order plant, like a mass-spring-damper system with force as in input
sys = ss(tf(1,[1 1 1]));
sys.InputName = 'u';
sys.OutputName = 'y';
Augment the plant with a first order acutator model with tau = 0.005.
Add the reference command as an input.
Add the tracking error as an ouput.
Conect the actuator to the plant. Include an analysis point at the plant input for analysis later.
sys = connect(sys,tf(1,[.005 1],'InputName','uc','OutputName','u'),sumblk('e = r - y'),{'r' 'uc'},{'y' 'e'},'u');
Check the poles and zeros of the plant and actuator
zpk(sys('e','uc'))
ans = From input "uc" to output "e": -200 --------------------- (s+200) (s^2 + s + 1) Continuous-time zero/pole/gain model.
Define frequency-dependent weights for the error signal and the output. Use a constant weight on the actuator input.
Ws = tf(10*[1/300 1],[1 .001]); % error
Wc = tf([1 .001],40*[1/300 1]); % output
Wu = .0001; % control
Plot the magnitude of the weights, Ws and Wc cross each other at < 0 dB as they should. That crossing point is at 20 rad/sec, which we'll expect to be the bandwidth of the closed loop system.
bodemag(Ws,Wc,{.1,1000}),grid
Augment the plant with the weights.
Weights = append(ss(Wc),ss(Ws),Wu);
Weights.InputName = {'y' 'e' 'uc'};
Weights.OutputName = {'yw' 'ew' 'uw'};
sys = connect(sys,Weights,{'r' 'uc'},{'y' 'yw' 'ew' 'uw' 'e'});
The inputs and outputs of sys are now
sys.InputName
ans = 2×1 cell array
{'r' } {'uc'}
sys.OutputName
ans = 5×1 cell array
{'y' } {'yw'} {'ew'} {'uw'} {'e' }
Design the H-infinity controller
[K,~,gamma] = hinfsyn(sys({'yw' 'ew' 'uw' 'e'},:),1,1);
The poles and zeros of the controller are
zpk(K)
ans = 6.0467e06 (s+300) (s+200) (s^2 + s + 1) ---------------------------------------------------- (s+1121) (s+336.5) (s+0.001) (s^2 + 344s + 5.199e04) Continuous-time zero/pole/gain model.
We see that the zeros of K are cancelling the poles of the plant and actuator. I think this is common with this approach for a stable system where no disturbances are injected internal to the plant. Basiically, the conroller is cancelling the plant poles and replacing them with a pole near the origin and fast real pole/zero pair.
Form the closed loop system with r as the input and y as the output
CL = lft(sys({'y' 'e'},:),K);
The step response of the closed loop system shows a time constant close to 0.05 = 1/20, consistent with the selection of Ws and Wc
step(CL),grid
The effect of Ws on the shaping of the error, or sensitivity, transfer function is readily seen
bodemag(1-CL,inv(Ws))
The effect of Wc on the shaping of the output, or complementary sensitivity, is readily seen
bodemag(CL,inv(Wc))
The open loop transfer function at the input to the plant is
L = getLoopTransfer(CL,'u',-1);
It too is shaped by Wc
bode(L,inv(Wc)),grid
It has the desired shape of high gain at low frequency, rolling off at high frequency, and a nice slope through the gain crossover frequency region.
The stability margins look good
s = allmargin(L)
s = struct with fields:
GainMargin: 15.1435 GMFrequency: 206.6703 PhaseMargin: 82.4245 PMFrequency: 18.4801 DelayMargin: 0.0778 DMFrequency: 18.4801 Stable: 1
Verify the gain margin. As expected increasing the loop gain by the gain margin yields two poles on the imaginary axis at the phase cross-over frequency of 207 rad/sec.
damp(lft(sys({'y' 'e'},:),min(s.GainMargin)*K))
Pole Damping Frequency Time Constant (rad/seconds) (seconds) -1.00e-03 1.00e+00 1.00e-03 1.00e+03 -5.00e-01 + 8.66e-01i 5.00e-01 1.00e+00 2.00e+00 -5.00e-01 - 8.66e-01i 5.00e-01 1.00e+00 2.00e+00 -2.00e+02 1.00e+00 2.00e+02 5.00e-03 -1.05e-03 + 2.07e+02i 5.07e-06 2.07e+02 9.55e+02 -1.05e-03 - 2.07e+02i 5.07e-06 2.07e+02 9.55e+02 -2.74e+02 1.00e+00 2.74e+02 3.65e-03 -3.00e+02 1.00e+00 3.00e+02 3.33e-03 -4.26e+02 1.00e+00 4.26e+02 2.35e-03 -1.10e+03 1.00e+00 1.10e+03 9.08e-04

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!