Why does h2syn double the number of states?

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

When you say the additional states corresponding to the dynamic compensation, that means the states of the controller dynamics itself, correct? I guess I am not used to the concept of a dynamic controller.
What I meant is that I am basically trying to simulate the response of the closed loop system, which has lets say 4 states, but the "CL" matrix has 8. I'm guessing the first 4 states correspond to the plant, and the next 4 correspond to the controller dynamics?
Yes, the four additional states are the states of the controller dynamics.
I'm pretty sure, but not positive, that the states of CL would be ordered such that the first four are the states of the plant and the second four are the states of the controller. The documentation and a quick experiment seem to confirm this hypothesis, but you should try to verify yourself.
Thank you for your help Paul!
One last thing (I'm new to robust control as you can tell), if I have a system of the form
with no disturbance input and no performance output, how could I use these two functions? Or can I just "add" some disturbance input and a performance output to my system? Can I choose them to be anything I want?
hinfsyn and h2syn both find the controller, K(s), that optimizes a norm of the closed loop transfer function matrix from the disturbance inputs, w, to the performance outputs, z. So not having w or z in the plant wouldn't make sense if using those functions.
The disturbance inputs and perfomance outputs have to be defined in such a way that minimizing the norm of the closed loop transfer function from w to z results in the closed loop system meeting the control system design objectives, e.g., time constants, disturbance rejection, stability margins, decoupling, etc. Maybe there are examples in the Robust Control Toolbox that would be helpful.
Ali
Ali on 29 Apr 2022
Edited: Ali on 29 Apr 2022
Thanks again Paul!
For anyone reading this in the future... CL does contain the states of the plant first, then the states of the controller. This can be seen from the documentation where it says CL = lft(P,K) (where P is the plant and K is the controller). The documentation of lft() explains the rest, where the lft function forms the star product sys of the two models (or arrays) sys1 and sys2:
The resulting system sys maps the input vector [w1 ; w2] to the output vector [z1 ; z2].
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.
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)

Categories

Find more on Control System Toolbox in Help Center and File Exchange

Products

Release

R2022a

Asked:

Ali
on 28 Apr 2022

Edited:

on 2 May 2022

Community Treasure Hunt

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

Start Hunting!