Академический Документы
Профессиональный Документы
Культура Документы
Abstract
The control problem in dynamic positioning is presented. A detailed description of vessel model and disturbances is given. Multivariable frequency analysis is applied to plant and disturbance model. In particular, singular value analysis and relative gain array is considered. Criteria for assessing nominal performance, robust stability and robust performance is given. PID, H2 and H1 controllers are designed. All satisfy robust stability. Only the H2 and H1 designs satisfy nominal performance. Robust performance is not satis ed for any of the designs, due to the fact that uncertainty was not explicitly taken into account during design. This could have been done in H1 . Time simulations of all three designs are provided. They show good rejection of disturbances for H2 and H1 .
Preface
This report summarizes a project work in the course 43917 Multivariable frequency analysis. The main reference is: Sigurd Skogestad, Multivariable feedback control | Analysis and design using frequencydomain methods, University of Trondheim - NTH, 1994. Other references are cited.
Acknowledgement
Contents
1 Introduction and problem statement
1.1 What the problem is all about 1.2 Inputs and outputs . . . . . . 1.2.1 Disturbances . . . . . 1.2.2 Measurements . . . . . 1.2.3 Noise . . . . . . . . . . 1.2.4 Controlled outputs . . 1.2.5 Setpoints . . . . . . . 1.2.6 Manipulated inputs . . 1.3 Control objective . . . . . . . 1.4 Sources of model uncertainty . 1.5 Expected control problems . . 1.6 Simpli cations . . . . . . . . . 2.1 2.2 2.3 2.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1 1 1 1 2 2 2 2 2 2 3 3
2 Vessel model
Kinematics . . . . . . . . . . . . . . Low frequency vessel model . . . . . High frequency wave model . . . . . Current model . . . . . . . . . . . . . 2.4.1 Varying velocity and direction 2.4.2 Simpli ed linearized model . . Thruster model . . . . . . . . . . . . Measurement model . . . . . . . . . . Total vessel model . . . . . . . . . . Numerical values and scaling . . . . . Thruster con guration . . . . . . . .
. 4 . 5 . 6 . 6 . 6 . 7 . 7 . 8 . 8 . 9 . 10
3 Analysis
3.1 Gain and phase element by element . . . . . . . . . . . . . . . . . . . 12 3.2 Poles and zeros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.3 Singular value analysis . . . . . . . . . . . . . . . . . . . . . . . . . . 19 ii
12
4.1 Performance weights and uncertainty weights . 4.1.1 Selection of We . . . . . . . . . . . . . 4.1.2 Selection of WI . . . . . . . . . . . . . 4.1.3 Selection of Wr and Wd . . . . . . . . 4.2 Structure used in analysis . . . . . . . . . . . 4.3 Robust stability . . . . . . . . . . . . . . . . . 4.4 Nominal performance . . . . . . . . . . . . . . 4.5 Robust performance . . . . . . . . . . . . . . 5.1 PID controller . . . . . . 5.1.1 Design . . . . . . 5.1.2 Simulations . . . 5.2 H2 controller . . . . . . 5.2.1 Design . . . . . . 5.2.2 Simulations . . . 5.3 Results from analysis . 5.3.1 PID . . . . . . . 5.3.2 H2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
analysis
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . .
21
21 21 21 22 22 24 25 25 26 26 27 29 29 30 33 33 33
5 Controller design
26
6 H1 controller design
36
41 43
Figures
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 Control problem . . . . . . . . . . . . . . . . . . . . . . . . . . Frames of reference . . . . . . . . . . . . . . . . . . . . . . . . Block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . Thruster con guration . . . . . . . . . . . . . . . . . . . . . . Amplitude of elements in G (j!) . . . . . . . . . . . . . . . . . Phase of elements in G (j!) . . . . . . . . . . . . . . . . . . . Amplitude of elements in Gd(j!) . . . . . . . . . . . . . . . . Phase of elements in Gd (j!) . . . . . . . . . . . . . . . . . . . Singular values of G (j!) and Gd (j!) . . . . . . . . . . . . . . Relative gain array of G (s)T y . . . . . . . . . . . . . . . . . . Performance weight . . . . . . . . . . . . . . . . . . . . . . . . Disturbance weight . . . . . . . . . . . . . . . . . . . . . . . . Control system with weights . . . . . . . . . . . . . . . . . . . General block diagram . . . . . . . . . . . . . . . . . . . . . . Structure for analysis . . . . . . . . . . . . . . . . . . . . . . Structure for assessing RS . . . . . . . . . . . . . . . . . . . . PID controller . . . . . . . . . . . . . . . . . . . . . . . . . . . PID controller: Step in reference signals . . . . . . . . . . . . PID controller: Step in disturbance . . . . . . . . . . . . . . . H2 controller . . . . . . . . . . . . . . . . . . . . . . . . . . . Weights in H2 design . . . . . . . . . . . . . . . . . . . . . . . Weight on control action . . . . . . . . . . . . . . . . . . . . . H2 controller: Step in reference signals . . . . . . . . . . . . . H2 controller: Step in disturbance . . . . . . . . . . . . . . . . (M ) (solid) and (M ) (dashed) | robust stability of PID . . (N22 ) | nominal performance of PID . . . . . . . . . . . . . (N ) (solid) and (N ) (dashed) | robust performance of PID iv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 4 9 11 15 16 17 18 19 20 21 22 23 23 24 24 26 27 28 29 29 30 31 32 33 33 34
28 29 30 31 32 33 34 35 36
(M ) (solid) and (M ) (dashed) | robust stability of H2 . . (N22 ) | nominal performance of H2 . . . . . . . . . . . . . . (N ) (solid) and (N ) (dashed) | robust performance of H2 H1 controller . . . . . . . . . . . . . . . . . . . . . . . . . . . H1 controller: Step in reference signals . . . . . . . . . . . . . H1 controller: Step in disturbance . . . . . . . . . . . . . . . (M ) (solid) and (M ) (dashed) | robust stability of H1 . . (N22 ) | nominal performance of H1 . . . . . . . . . . . . . (N ) (solid) and (N ) (dashed) | robust performance of H1
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
34 35 35 36 37 38 39 39 40
Tables
1 2 3 4 5 6 7 8 Bis system . . . . . . . . . . . . . . . Poles and zeros of elements in G (s) . Poles and zeros of elements in Gd (s) Numerical values in PID controller . for PID controller . . . . . . . . . . for H2 controller . . . . . . . . . . Results from H1 controller design . . for H1 controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 13 14 26 33 34 36 39
?
CONTROLLER
commanded thrust
? ? ?
SURFACE VESSEL
measurements of position and course
1.2.2 Measurements
Vessel position, (x; y). Vessel course, . Wind speed and direction.
1.2.3 Noise
High frequency noise is present in all measurements.
1.2.5 Setpoints
Vessel position and course.
2 Vessel model
Most of this section is taken from 1]. Background material may also be found in 2].
2.1 Kinematics
To describe the motion of the vessel we will need two coordinate systems: A vessel xed frame of reference, xB yB zB , called B . An earth xed frame of reference, xyz, called 0. These are shown in gure 2.
roll,
xB
pitch, sway,
surge,
p zB
yaw,
yB v
heave,
y z
Figure 2: Frames of reference Three degrees of freedom are of importance in dynamic positioning: surge sway yaw Velocites may be expressed in B , i.e.
0 1 u B =@ v C A r
4
(1)
These velocities cannot be integrated in B to give position and orientation, but will have to be transformed to 0. 0x 1 0 10 1 _ cos sin 0 u B C B C B y _ C _ =B sin cos 0 = J ( ) = (2) @ A@ v C A @ A 0 0 1 r _
)=
+ wL
(3)
0 1 uL B C L = @ vL A rL 0 1 uC B C C = @ vC A rC
is the current velocity, L is a vector of control forces and moment, and wL is a vector (of zero-mean Gaussian white noise processes) describing unmodelled dynamics and disturbances. Now, we assume
(4)
where xG is the x-coordinate of the center of gravity of the vessel. The damping matrix is given by 0 Yv Nv 0 Yr C A Nr
(5)
Suppose
0 1 xd B = @ yd C A d
d
is the desired position and orientation, d , and the earth xed frame of reference is oriented so that d = 0. Then J ( ) I . We then have the following state space model: _ L = AL xL + BL x 5
L
+ EL wL
(6)
where
0 A= 0
!)
(12) (13)
where wV and w are zero-mean Gaussian white noise processes. Transformed to B we get
C C
uC = VC cos( C L H ) vC = VC sin( C L H ) r_C = wr Note that rC is a non-physical quantity. We then have the following state space model: _ C = EC wC x where xC = (VC ; C ; rC )T ; wC = (wV ; w ; wr )T ;
C C
(17)
EC = I
)( L0 )(
L0
C C
L L
H H
~ C wC ; =E
(21) (22) ) C L0 ) A
L0
where and
wc = VC
0 cos( C 0 B ~ EC = @ sin( C0 1
(23)
(25)
Assuming pitch controlled thrusters, commanded thrust is given by (26) com = TKu where u 2 R r (r individual thrusters), given by u = (jp1jp1; jp2jp2; : : : ; jprjpr ; )T (27) is the control variable. pi (i = 1; : : : ; r) are the so-called pitch ratios. K is a diagonal matrix of thruster force coe cients, i.e K = diag fK1(n1); K2(n2); : : : ; Kr (nr )g : (28) We note that the force coe cients depends on the propeller revolution, ni . The matrix T 2 R 3 r describes the geometric con guration of the thrusters, and is perfectly known.
0 1 1 0 0 0 B T =@ 0 0 1 1 1 `1 `2 `3 `4 `5
1 0 C A `6
1
(29)
Ax + Bu + Ew Cx + n
L
T; x T; x = xL H
T T;
0 1 0 10 1 0 _L x A 0 B xL C B L L B C B C B _ H A = @ 0 AH 0 A@ xH A + @ @x
_L
0 0 Athr
AthrTK
0 0
1 0 1 E 0 C C Au + B @ 0 EH C Aw ;
0 0
(36)
T T; w = wC ; wH
(37) (38)
EC =
A block diagram is given in gure 3.
0 !: ~C M 1D E
_ H xH wH - EH - x 6 AH
d
. . . . . . . . . . . . . . . . . . . . . . . . . . .. .
wC - EC u - K - T - - Athr _L BL
6
d
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
- ?- x_ L 6
d d
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
xL
AL
0 0 0:0933 0:0073 C A 0 0:1882 0:3310 All quantities with double prime ( )00 are scaled with the so-called bis system 1], see table 1.
Unit Length Mass Moment of intertia Time Reference area Position Angle Linear velocity Angular velocity Linear acceleration Angular acceleration Force Torque
0 0:0367 B 00 ~ 0 A =@
r0 r0 L2 q
(water density
vessel displacement)
G (s) Gd(s)
(41) (42)
u1 u2 u3
Figure 4: Thruster con guration
u5 u4
11
3 Analysis
3.1 Gain and phase element by element
Plot of gain and phase of elements in G is shown in gures 5 and 6. Plot of gain and phase of elements in Gd is shown in gures 7 and 8.
Poles of Gd (s):
-1.1664e-01 -1.0000e-10 -3.5603e-02 -1.3168e-02 -3.1416e-01 -3.1416e-01 -3.1416e-01 -3.1416e-01 -3.1416e-01 -3.1416e-01
+ + + -
12
Gij 1 Poles
Zeros Steady state gain 2 Poles 13 Zeros Steady state gain 3 Poles Zeros Steady state gain
None None 0 -2.0000e-01 -1.0000e-10 -3.5603e-02 -1.1664e-01 -1.3657e-01 1 -1.0000e-10 -3.5603e-02 -1.1664e-01 -2.0000e-01 -2.3545e-02 1
None None 0 -2.0000e-01 -1.0000e-10 -3.5603e-02 -1.1664e-01 -1.3657e-01 1 -1.0000e-10 -3.5603e-02 -1.1664e-01 -2.0000e-01 -2.3545e-02 1
None None 0 -1.0000e-10 -1.1664e-01 -2.0000e-01 -3.5603e-02 -1.0371e-01 1 -1.0000e-10 -3.5603e-02 -2.0000e-01 -1.1664e-01 -4.5224e-02 1
None None 0 -1.0000e-10 -1.1664e-01 -2.0000e-01 -3.5603e-02 -1.0699e-01 1 -2.0000e-01 -1.0000e-10 -3.5603e-02 -1.1664e-01 -4.8496e-02 1
None 0 None
None 0
Gd;ij 1 Poles
Zeros Steady state gain 2 Poles Zeros Steady state gain 3 Poles Zeros Steady state gain
-1.0000e-10 -1.3168e-02 None 1 -1.1664e-01 -3.5603e-02 -1.0000e-10 -1.2405e-01 1 -3.5603e-02 -1.1664e-01 None -1.4410e+00
14
80 60 40 20 0 20 40 60 80 0:01
0
0:1
1 rad/s]
1
10
10
80 60 40 20 0 20 40 60 80 0:01
0
0:1
1 rad/s]
1
10
10
80 60 40 20 0 20 40 60 80 0:01
0
0:1
1 rad/s]
1
10
10
80 60 40 20 0 20 40 60 80 0:01
0
0:1
1 rad/s]
1
10
10
80 60 40 20 0 20 40 60 80 0:01
0
0:1
1 rad/s]
1
10
10
80 60 40 20 0 20 40 60 80 0:01
0
0:1
1 rad/s]
1
10
10
80 60 40 20 0 20 40 60 80 0:01
0
0:1
1 rad/s]
1
10
10
80 60 40 20 0 20 40 60 80 0:01
0
0:1
1 rad/s]
1
10
10
80 60 40 20 0 20 40 60 80 0:01
0
0:1
1 rad/s]
1
10
10
80 60 40 20 0 20 40 60 80 0:01
0
15
0:1
1 rad/s]
1
10
10
80 60 40 20 0 20 40 60 80 0:01
0:1
1 rad/s]
1
10
10
80 60 40 20 0 20 40 60 80 0:01
0:1
1 rad/s]
1
10
10
80 60 40 20 0 20 40 60 80 0:01
0:1
1 rad/s]
1
10
10
80 60 40 20 0 20 40 60 80 0:01
0:1
1 rad/s]
1
10
10
80 60 40 20 0 20 40 60 80 0:01
0
0:1
1 rad/s]
1
10
10
0:1
1 rad/s]
1
10
10
0:1
1 rad/s]
1
10
10
0:1
1 rad/s]
1
10
10
0:1
1 rad/s]
1
10
10
\G11 (j!)
\G12 (j!)
\G13 (j!)
\G14 (j!)
\G15 (j!)
0:1
1 rad/s]
1
10
10
0:1
1 rad/s]
1
10
10
0:1
1 rad/s]
1
10
10
0:1
1 rad/s]
1
10
10
0:1
1 rad/s]
1
10
10
\G21 (j!)
\G22 (j!)
\G23 (j!)
\G24 (j!)
\G25 (j!)
\G31 (j!)
\G32 (j!)
\G33 (j!)
\G34 (j!)
0:1
1 rad/s]
1
10
10
0:1
1 rad/s]
1
10
10
0:1
1 rad/s]
1
10
10
0:1
1 rad/s]
1
\G35 (j!)
16
0:1
1 rad/s]
1
10
10
10
10
0:1
1 rad/s]
1
10
10
(j!)j (dB)
(j!)j (dB)
20 00 20 40 60 80 0:01
0:1
rad/s]1
10
10
20 00 20 40 60 80 0:01
(j!)j (dB)
0:1
rad/s]1
10
10
20 00 20 40 60 80 0:01
80 60 40
80 60 40
80 60 40
80 60 40 20 00 20 40 60 80 0:01
d;11
d;12
jG
jG
jG
d;13
0:1
10
10
0:1
rad/s]1
10
10
80 60 40 20 00 20 40 60 80 0:01
80 60 40 20 00 20 40 60 80 0:01
80 60 40 20 00 20 40 60 80 0:01
80 60 40 20 00 20 40 60 80 0:01
(j!)j (dB)
(j!)j (dB)
d;21
d;22
d;23
(j!)j (dB)
jG
jG
jG
0:1
rad/s]1
10
10
0:1
rad/s]1
10
10
0:1
rad/s]1
jG
d;24
(j!)j (dB)
(j!)j (dB)
(j!)j (dB)
d;31
d;32
d;33
(j!)j (dB)
jG
jG
jG
80 0:01
0:1
rad/s]1
10
10
80 0:01
0:1
rad/s]1
10
10
80 0:01
jG
d;34
(j!)j (dB)
17
10
10
0:1
rad/s]1
10
10
80 60 40 20 00 20 40 60
80 60 40 20 00 20 40 60
80 60 40 20 00 20 40 60 0:1
80 60 40 20 00 20 40 60 80 0:01 0:1
rad/s]1
10
10
rad/s]1
10
10
90 90
90 90
90 90
90 90
00
00
00
00
(j!)
(j!)
d;12
d;11
\G
\G
\G
\G
270
270
d;13
270
d;14
180
180
(j!)
180
(j!) rad/s]1
90
90
90
rad/s]1
10
10
0:1
rad/s]1
10
10
0:1
10
10
0:1
rad/s]1
10
10
90 90
90 90
90 90
90 90
00
(j!)
(j!)
d;22
d;21
\G
\G
\G
\G
270
270
d;23
270
d;24
180
180
(j!)
180
(j!) rad/s]1
90
90
90
(j!)
(j!)
d;32
d;31
\G
\G
\G
\G
270
270
d;33
270
d;34
180
180
(j!)
180
(j!)
18
rad/s]1
10
10
0:1
rad/s]1
10
10
0:1
10
10
0:1
rad/s]1
10
10
90 90
90 90
90 90
90 90
0 90
0 90
0 90
rad/s]1
10
10
0:1
rad/s]1
10
10
rad/s]1
10
10
0:1
rad/s]1
10
10
G (j! ) (dB)
10
-1
10
10
! rad/s]
20 10
-10
-20
-30
-40 -2 10
10
-1
10
10
! rad/s]
Figure 9: Singular values of G (j!) and Gd (j!) From this plot we immediately see that a bandwidth of 0.08 rad/s will be reasonable to reject the constant disturbance. We also see that it will not be possible to reject the disturbance caused by wave induced forces. 19
j 11 (j!)j
j 13 (j!)j
0
j 12 (j!)j
-2
10 2
-2
-2
10 2
10 2
j 21 (j!)j
0 -2
0 -2
j 23 (j!)j
0
j 22 (j!)j
0 -2
10 2
10 2
10 2
j 31 (j!)j
0 -2
0 -2
j 33 (j!)j
0
j 32 (j!)j
0 -2
10
10
10
20
analysis
In this section, criteria for robust stability, nominal performance and robust performance are given. In the next section, we will perform some controller designs, and check whether these criteria are met.
10
jWe(j!)j
10
10
10 -4 10
-1
10
-3
10
-2
! rad/s]
10
-1
10
10
10
4.1.2 Selection of WI
The weight on input uncertainty, WI re ects 5% uncertainty at low frequency and 100% uncertainty at high frequencies. The region of transition is chosen somewhat arbitrarily. Thus, + 0:5s I WI (s) = 1 (44) 1 + 10s 5 5 21
jWI (j!)j
10
-1
10 -4 10
-2
10
-3
10
-2
! rad/s]
10
-1
10
10
10
Rejection of disturbances caused by water current is thus more emphasized than response to set point changes, as the former part of the controller action is considered more important. This is discussed further in section 7. The disturbance from waves is given little weight, as this disturbance cannot be compensated.
w=
r !; d
(47) (48)
z = Wee ;
22
z
e
d -W - G
d
- WI y -
r - W - 6 y- C
r
c
u -? - G
c
-?
c
K=C
(49)
the block diagram in gure 13 can be transformed into the general structure of gure 14.
u u
P
K
0
y y
-z
0 0 0 B P = @ WeG WeWr
Wr
WeGdWd Gd Wd
WI 1 WeG C A G
(50)
In this analysis the controller a given, and we will consider the following: robust stability | is the closed loop system stable when uncertainty is considered ? nominal performance | do we really achieve the desired performance ? robust performance | do we achieve the desired performance when uncertainty is considered as well ? We consider structured uncertainty | diagonal on the input, and will have to be used. 23
w
In gure 15 N is given by
-z
WI C (I + GC ) 1 Gd W(52) d We(I + GC ) 1 Gd Wd
(54) (55) (56)
(51) ! (53)
(57)
1
M = N11 =
u
WI CG (I + CG )
(58)
24
< 1;
8!;
(59) (60)
where
N22 =
)k1 < 1;
^ (N )
< 1;
0
P
8k k1 8!
1;
where ^=
P
25
5 Controller design
5.1 PID controller
5.1.1 Design
We will use a PID controller in each degree of freedom, combined with T y as a decoupler/thruster allocation function. As the RGA analysis shows, there is not much coupling between the surge motion and the two other, sway and yaw. There is, however, coupling between the sway and yaw motion. We will not expect satisfactory performance with a PID controller. The control structure is shown in gure 17.
d
-Gd (s)
c
c (s)
j d;j
1 C A
(64)
with
Numerical values are given in table 4. Table 4: Numerical values in PID controller j Kp;j Ti;j Td;j j 2 x 4:74 10 50 33.33 0.1 y 2:53 10 1 50 33.33 0.1 2 50 33.33 0.1
26
5.1.2 Simulations
Two di erent simulations were performed: Smooth step in reference signals Step in water current Results of these simulations are shown in gures 18 and 19.
2 2 1.5 1.5
0.5
0.5
x(t)
y(t)
20 40 60 80 100 120 140 160 180 200
-0.5
-0.5
-1
-1
-1.5
-1.5
-2 0
t s]
-2 0
20
40
60
80
t s]
100
120
140
160
180
200
0.1
1.5
0.05
1
0
0.5
(t)
u (t)
20 40 60 80 100 120 140 160 180 200
-0.05
-0.1
-0.5
-0.15
-1
-1.5
-0.2
-2 0
t s]
-0.25 0
20
40
60
80
t s]
100
120
140
160
180
200
27
1.5
1.5
0.5
0.5
x(t)
y(t)
20 40 60 80 100 120 140 160 180 200
-0.5
-0.5
-1
-1
-1.5
-1.5
-2 0
t s]
-2 0
20
40
60
80
t s]
100
120
140
160
180
200
2
0.14
1.5
0.12
1
0.1
0.5
(t)
u (t)
20 40 60 80 100 120 140 160 180 200
0.08
-0.5
0.06
-1
0.04
-1.5
0.02
-2 0
t s]
0 0
20
40
60
80
t s]
100
120
140
160
180
200
28
5.2 H2 controller
5.2.1 Design
The control structure is shown in gure 20.
d
-Gd (s)
u
6
c
-CH (s)
2
- G (s) - ? y
c
Figure 20: H2 controller Using the routine h2syn in Matlab, an H2 -optimal controller was designed. A balanced realization of this controller has 15 states. We used weights as shown in gure 21.
z
We
Wu d - Wd - Gd
y r - Wr - 6 C
b
-G
-?
b
Figure 21: Weights in H2 design The values of these weights were selected identical to the weights of the analysis. However, instead of weighting input uncertainty, we imposed a weight on control action: s I Wu(s) = 1 + 10 (65) 3s 5 5 A plot of this weight is shown in gure 22.
29
10
jWI (j!)j
10 -4 10
-1
10
-3
10
-2
! rad/s]
10
-1
10
10
10
5.2.2 Simulations
Two di erent simulations were performed: Smooth step in reference signals Step in water current Results of these simulations are shown in gures 23 and 24.
30
1.5
1.5
0.5
0.5
x(t)
y(t)
20 40 60 80 100 120 140 160 180 200
-0.5
-0.5
-1
-1
-1.5
-1.5
-2 0
t s]
-2 0
20
40
60
80
t s]
100
120
140
160
180
200
0.1
1.5
0.05
1
0
0.5
(t)
u (t)
20 40 60 80 100 120 140 160 180 200
-0.05
-0.1
-0.5
-0.15
-1
-1.5
-0.2
-2 0
t s]
-0.25 0
20
40
60
80
t s]
100
120
140
160
180
200
31
1.5
1.5
0.5
0.5
x(t)
y(t)
20 40 60 80 100 120 140 160 180 200
-0.5
-0.5
-1
-1
-1.5
-1.5
-2 0
t s]
-2 0
20
40
60
80
t s]
100
120
140
160
180
200
0.3
1.5
0.25
1
0.2
0.5
(t)
u (t)
20 40 60 80 100 120 140 160 180 200
0.15
-0.5
0.1
-1
0.05
-1.5
-2 0
t s]
0 0
20
40
60
80
t s]
100
120
140
160
180
200
32
0.08
0.06
0.04
0.02
0 -4 10
10
-3
10
-2
! rad/s]
10
-1
10
10
10
-3
10
-2
! rad/s]
10
-1
10
10
5.3.2 H2
The following results were obtained (table 6): 33
2.5
1.5
0.5
0 -4 10
10
-3
Figure 27: (N ) (solid) and (N ) (dashed) | robust performance of PID Table 6: for H2 controller RS NP RP 0.31 0.23 > 1 Figure 28 to 30 shows the result of the analysis as a function of frequency.
0.6
! rad/s]
10
-2
10
-1
10
0.5
0.4
0.3
0.2
0.1
0 -4 10
10
-3
10
-2
! rad/s]
10
-1
10
10
34
0.25
0.2
0.15
0.1
0.05 -4 10
10
-3
10
-2
! rad/s]
10
-1
10
10
2.5
1.5
0.5
0 -4 10
10
-3
! rad/s]
10
-2
10
-1
10
35
6 H1 controller design
6.1 Design
The control structure is shown in gure 31.
d
-Gd (s)
c
Figure 31: H1 controller Identical weights to the H2 case were used, and the output from the algorithm is shown in table 7. A balanced realization of the resulting controller has 17 states. Table 7: Results from H1 controller design
Test bounds: gamma 10.000 5.100 2.650 1.425 0.812 0.506 0.353 0.277 0.238 0.2000 < gamma <= 10.0000 yinf_eig -5.2e-18 -6.8e-16 0.0e+00 -1.7e-13 -6.0e-15 -2.0e-13 -4.7e-17 -4.2e-15 -7.3e-17 nrho_xy 0.0005 0.0019 0.0072 0.0250 0.0785 0.2122 0.4779 0.8901 1.3889# p/f p p p p p p p p f hamx_eig 1.0e-05 1.0e-05 1.0e-05 1.0e-05 1.0e-05 1.0e-05 1.0e-05 1.0e-05 1.0e-05 xinf_eig -1.5e-16 -1.3e-12 -7.1e-13 -1.2e-15 -2.0e-13 -4.6e-15 -4.1e-13 -4.1e-14 1.3e-16 hamy_eig 1.0e-05 1.0e-05 1.0e-05 1.0e-05 1.0e-05 1.0e-05 1.0e-05 1.0e-05 1.0e-05
0.2766
6.2 Simulations
Two di erent simulations were performed: Smooth step in reference signals Step in water current Results of these simulations are shown in gures 32 and 33. 36
1.5
1.5
0.5
0.5
x(t)
y(t)
20 40 60 80 100 120 140 160 180 200
-0.5
-0.5
-1
-1
-1.5
-1.5
-2 0
t s]
-2 0
20
40
60
80
t s]
100
120
140
160
180
200
1.5
0.5
(t)
u (t)
20 40 60 80 100 120 140 160 180 200
-0.5
-1
-0.25
-1.5
-0.3 -0.35 0
-2 0
t s]
20
40
60
80
t s]
100
120
140
160
180
200
37
1.5
1.5
0.5
0.5
x(t)
y(t)
20 40 60 80 100 120 140 160 180 200
-0.5
-0.5
-1
-1
-1.5
-1.5
-2 0
t s]
-2 0
20
40
60
80
t s]
100
120
140
160
180
200
0.25
1.5
0.2
0.5
0.15
(t)
u (t)
0.1 0.05
-0.5
-1
-1.5
-2 0
20
40
60
80
t s]
100
120
140
160
180
200
0 0
20
40
60
80
t s]
100
120
140
160
180
200
38
6.3
for H1 controller
Table 8: for H1 controller RS NP RP 0.22 0.15 > 1
The weights of chapter 4 were used, and the following results obtained (table 8):
0.3
0.25
0.2
0.15
0.1
0.05
0 -4 10
10
-3
10
-2
! rad/s]
10
-1
10
10
0.14
0.12
0.1
0.08
0.06
0.04 -4 10
10
-3
10
-2
! rad/s]
10
-1
10
10
39
0 -4 10
10
-3
10
-2
! rad/s]
10
-1
10
10
40
Saturation in control variables is not experienced in any of the designs. A few comments on tasks that were not performed: Nominal stability of the control system should have been considered. Simulation should not be trusted to indicated unstable poles, especially slow ones. An analysis of robust performance with respect to input uncertainty (sensitivity) could have been interesting. We would then have established maximum uncertainty possible as a function of desired steady-state accuracy. The design should have taken into account that high frequency thruster usage (due to wave induced motion) should be avoided. In this case we used a very simple method, putting little weight on wave disturbances. More weight should also be put on the control action at high frequencies. Analysis of plant and disturbances could have been more detailed. In particular, the closed loop disturbance gain matrix (CLDG) could have been considered. Concluding remarks: Nominal performance and robust stability were easily established with H2 and H1 designs. Simulations showed good disturbance rejection. Robust performance could not be established. This, however could be obtained with an explicit description of uncertainty in the design phase. Next phase would then be a optimal controller. General comments to the project work: Interesting Time consuming. Much time was spent on the rst few chapters. Matlab can sometimes be very trying. Much time was spent guring out what went wrong and why. The documentation of the control toolbox is limited. There is de nitely a need for design examples in the book.
References
1] T. I. Fossen, Guidance and Control of Ocean Vehicles. John Wiley and Sons Ltd., 1994. 2] J. G. Balchen, N. A. Jenssen, E. Mathisen, and S. S lid, \A dynamic positioning system based on Kalman ltering and optimal control," Modeling, Identi cation and Control, vol. 1, pp. 135{163, 1980. 3] O. M. Faltinsen, Sea Loads on Ships and O shore Structures. Cambridge: Cambridge University Press, 1990. 42
A Program code
A.1 project.m
% % % % % % % % % project.m Project work 43917 Multivariable frequency analysis $Id$ This is the main file with menu selections etc. K_pp M_pp % from Fossen (1994), in Bis system T_pp = 1.0000 0 0 0 1.0000 1.0000 0 -0.3937 -0.3937 0 1.0000 0.4514 0; 1.0000; 0.3215; ]; m g = 4e6; = 9.81; % mass % acceleration of gravity kg] m/s^2]
= diag( =
print_to_file = 1; project_title = 'Project work 43917'; project_items = str2mat( 'Update model', ... 'Analysis' ); project_cmds = str2mat( 'model', ... 'analysis'); choices('project_window', project_title, project_items, project_cmds);
];
A_tilde_pp =
43
D_pp
= -M_pp*A_tilde_pp*1;
A.2 model.m
% % % % % % % % % model.m Project work 43917 Multivariable frequency analysis $Id$ This file defines the vessel model
T K M D
= = = =
diag( 1 1 L]) * T_pp; m*g * K_pp; % muliply by force m * diag( 1 1 L]) * M_pp * diag( 1 1 L]); m/sqrt(L/g) * diag( 1 1 L]) * D_pp * diag( 1 1 L]);
% low frequency model epsilon = 1e-10; A_L = % small numerical work-around eye(3,3); -inv(M)*D
];
B_L =
% high frequency model K_wx K_wy K_wpsi omega_0 zeta = = = = = 3; 2; 4/180*pi; 2*pi*0.1; 0.5; % % % % max displacement in x m] max displacement in y m] max displacement in psi rad] dominating wave frequency
A_H_tilde =
0, 1; -omega_0^2, -2*zeta*omega_0 ]; A_H_tilde, zeros(2,2), zeros(2,2); zeros(2,2), A_H_tilde, zeros(2,2); zeros(2,2), zeros(2,2), A_H_tilde ];
% total vessel model A A_L, zeros(6,6), zeros(6,6), A_H, zeros(3,6), zeros(3,6), A_thr = zeros(6,5); zeros(6,5); -A_thr*T*K ]; C_L, C_H, zeros(3,3); ]; = B_L; zeros(6,3); ];
A_H
= =
44
% thruster model T_x T_y T_psi A_thr = 5; = 5; = 5; = diag( -1/T_x, -1/T_y, -1/T_psi]);
% scaling of plant and disturbances D_d D_u D_e = diag( = diag( = diag( 0.5 1 1 1 ]); 1 1 1 1 1 ]); 1/5 1/5 1/(3/180*pi) ]);
% linearized current model beta_C0 psi_L0 = 45/180*pi; = 0; cos(beta_C0-psi_L0); sin(beta_C0-psi_L0); 0 ]; zeros(3,1); inv(M)*D*E_C_tilde ];
% build system matrices (scaled) %G_xL = pck(A_L,eye(6),eye(6),zeros(6,6)); %G_tauL = pck(A_thr,-A_thr*T*K,eye(3),zeros(3,5)); %G_s = mmult(D_e,C_L,G_xL,B_L,G_tauL,D_u); G_s Gd_s = sysbal(pck(A,B*D_u,D_e*C,zeros(3,5))); = sysbal(pck(A,E*D_d,D_e*C,zeros(3,4)));
E_C_tilde =
E_C
A.3 analysis.m
% % % % % % % % % % analysis.m Project work 43917 Multivariable frequency analysis $Id$ This file contains frequency analysis of plant, disturbance model etc.
analysis_title = 'Analysis'; analysis_items = str2mat( 'Poles/zeros etc', 'RGA', 'SVD' ); analysis_cmds = str2mat( 'analysis_pz', ... 'analysis_RGA', ... 'analysis_SVD' );
mag,phase] = bode(Aijm,Bijm,Cijm,Dijm,1,omega); if dc<0 % dc gain will probably be infinite for some elements phase = phase-360; end; clf; semilogx(omega,20*log10(mag)),grid; axis_scaling_amp; label = 'G', num2str(i), num2str(j), 'omega_abs' ]; xlabel('frequency'); ylabel(label); if print_to_file, print('-deps', label); unix( 'ps2frag ', label, '.eps']); end; disp('Press a key'); pause; clf; semilogx(omega,phase), grid; axis_scaling_phase; label = 'G', num2str(i), num2str(j), 'omega_phase' ]; xlabel('frequency'); ylabel(label); if print_to_file print('-deps', label); unix( 'ps2frag ', label, '.eps']); end; disp('Press a key'); pause; end; end;
45
% % analysis_pz.m % $Id$ % for i=1:3, for j=1:5, disp( 'G', num2str(i), num2str(j), ':']); Aij,Bij,Cij,Dij] = unpck(sel(G_s,i,j)); Aijm,Bijm,Cijm,Dijm] = minreal(Aij,Bij,Cij,Dij,1e-5); disp('Poles:'); eig(Aijm) disp('Zeros:'); tzero(Aijm,Bijm,Cijm,Dijm) disp('Gain:'); dc = dcgain(Aijm,Bijm,Cijm,Dijm)
for i=1:3, for j=1:4, disp( 'Gd', num2str(i), num2str(j), ':']); Aij,Bij,Cij,Dij] = unpck(sel(Gd_s,i,j)); Aijm,Bijm,Cijm,Dijm] = minreal(Aij,Bij,Cij,Dij,1e-5); disp('Poles:'); eig(Aijm) disp('Zeros:'); tzero(Aijm,Bijm,Cijm,Dijm) disp('Gain:'); dc = dcgain(Aijm,Bijm,Cijm,Dijm) mag,phase] = bode(Aijm,Bijm,Cijm,Dijm,1,omega); if dc<0 % dc gain will probably be infinite for some elements phase = phase-360;
end; clf; semilogx(omega,20*log10(mag)),grid; axis_scaling_amp; label = 'Gd', num2str(i), num2str(j), 'omega_abs' ]; xlabel('frequency'); ylabel(label); if print_to_file, print('-deps', label); unix( 'ps2frag ', label, '.eps']); end; disp('Press a key'); pause; clf; semilogx(omega,phase), grid; axis_scaling_phase; label = 'Gd', num2str(i), num2str(j), 'omega_phase' ]; xlabel('frequency'); ylabel(label); if print_to_file print('-deps', label); unix( 'ps2frag ', label, '.eps']); end; disp('Press a key'); pause; end; end;
for i=1:3, for j=1:3, subplot(3,3,(i-1)*3+j); vplot('liv,m',sel(RGA,i,j)),grid; axis( 1e-3 1e1 -2 2]); ylabel( 'lambda',num2str(i),num2str(j)]); end; end; print('-deps','RGA'); unix('ps2frag RGA.eps');
% % analysis_SVD.m % $Id$ % G_omega = frsp(G_s, omega); Gd_omega = frsp(Gd_s, omega); U, S, V] = vsvd(G_omega); Ud, Sd, Vd] = vsvd(Gd_omega); clf; vplot('liv,d',dB(S)),grid; ylabel('plant'); xlabel('frequency'); print('-deps','SVD_G_omega'); unix('ps2frag SVD_G_omega.eps'); clf; vplot('liv,d',dB(Sd)),grid; ylabel('disturbance'); xlabel('frequency'); print('-deps','SVD_Gd_omega'); unix('ps2frag SVD_Gd_omega.eps'); % plant % disturbances
46
G_omega
= frsp(mmult(G_s,pinv(T)),
omega);
% plant
subplot(3,3,1);
disp('Press a key'); pause; systemnames inputvar outputvar input_to_C_s input_to_G_s input_to_Gd_s = = = = = = 'G_s Gd_s C_s'; ' r(3); d(4)]'; ' G_s+Gd_s; C_s]'; ' r-G_s-Gd_s]'; ' C_s]'; ' d]';
= = = = = = = =
0.1; -15*3.16e-3; 1/0.02; 1/0.03; 0.1; -8*3.16e-2; 1/0.02; 1/0.03; = 0.1; -2; 1/0.02; 1/0.03;
sysoutname = 'T_s'; cleanupsysic = 'yes'; sysic; tfinal t tau r d y clf; vplot(sel(y,1,1),sel(r,1,1)),hold; plot( 0 tfinal], 1 1],'--'); plot( 0 tfinal], -1 -1],'--'); axis( 0 tfinal -2 2]),hold off; xlabel('time'); ylabel('x'); if print_to_file, print('-deps','PIDref_x'); unix('ps2frag PIDref_x.eps'); end; disp('Press a key'); pause; vplot(sel(y,2,1),sel(r,1,2)),hold; plot( 0 tfinal], 1 1],'--'); plot( 0 tfinal], -1 -1],'--'); axis( 0 tfinal -2 2]),hold off; xlabel('time'); ylabel('y'); if print_to_file, print('-deps','PIDref_y'); unix('ps2frag PIDref_y.eps'); end; disp('Press a key'); pause; vplot(sel(y,3,1),sel(r,1,3)),hold; plot( 0 tfinal], 1 1],'--'); plot( 0 tfinal], -1 -1],'--'); axis( 0 tfinal -2 2]),hold off; xlabel('time'); ylabel('psi'); = = = = = = 200; 0:tfinal; 10; vpck( (1-exp(-t/tau))',(1-exp(-t/tau))',(1-exp(-t/tau))'],t); vpck( zeros(tfinal+1,1),zeros(tfinal+1,3)],t); vdcmate(trsp(T_s,transp(sbs(r,d)),tfinal));
47
= nd2sys(conv( Ti_x 1], Td_x 1]), ... conv( Ti_x 0], alpha_x*Td_x 1]), Kp_x); = nd2sys(conv( Ti_y 1], Td_y 1]), ... conv( Ti_y 0], alpha_y*Td_y 1]), Kp_y);
c_y
c_psi = nd2sys(conv( Ti_psi 1], Td_psi 1]), ... conv( Ti_psi 0], alpha_psi*Td_psi 1]), Kp_psi);
%G_001 = var2con(vebe('abs',frsp(mmult(G_s,pinv(T)),0.01))); %C_s = mmult(pinv(T), pinv(G_001), daug(c_x, c_y, c_psi)); C_s = mmult(pinv(T), daug(c_x, c_y, c_psi));
print('-deps','PIDcurr_psi'); unix('ps2frag PIDcurr_psi.eps'); end; disp('Press a key'); pause; vplot(sel(y,4:8,1)),hold; xlabel('time'); ylabel('controller'); if print_to_file, print('-deps','PIDcurr_u'); unix('ps2frag PIDcurr_u.eps'); end;
vplot(sel(y,4:8,1)),hold; xlabel('time'); ylabel('controller'); if print_to_file, print('-deps','PIDref_u'); unix('ps2frag PIDref_u.eps'); end; disp('Press a key'); pause;
r d y clf;
vplot(sel(y,1,1)),hold; plot( 0 tfinal], 1 1],'--'); plot( 0 tfinal], -1 -1],'--'); axis( 0 tfinal -2 2]),hold off; xlabel('time'); ylabel('x'); if print_to_file, print('-deps','PIDcurr_x'); unix('ps2frag PIDcurr_x.eps'); end; disp('Press a key'); pause; vplot(sel(y,2,1)),hold; plot( 0 tfinal], 1 1],'--'); plot( 0 tfinal], -1 -1],'--'); axis( 0 tfinal -2 2]),hold off; xlabel('time'); ylabel('y'); if print_to_file, print('-deps','PIDcurr_y'); unix('ps2frag PIDcurr_y.eps'); end; disp('Press a key'); pause; vplot(sel(y,3,1)),hold; plot( 0 tfinal], 1 1],'--'); plot( 0 tfinal], -1 -1],'--'); axis( 0 tfinal -2 2]),hold off; xlabel('time'); ylabel('psi'); if print_to_file,
48
clf; for i=1:3, disp( 'CLOOP', num2str(i), num2str(i), ':']); Aii,Bii,Cii,Dii] = unpck(sel(GC_s,i,i)); Aiim,Biim,Ciim,Diim] = minreal(Aii,Bii,Cii,Dii,1e-5); disp('Poles:'); eig(Aiim) disp('Zeros:'); tzero(Aiim,Biim,Ciim,Diim) disp('Gain:'); mag,phase] = bode(Aiim,Biim,Ciim,Diim,1,omega); subplot(211); semilogx(omega,20*log10(mag)),grid; subplot(212); semilogx(omega,phase), grid; disp('Press a key'); pause; end; % % controller_H2 % % $Id$
% % now, specify interconnections, using sysic % % first, specify weights % % weight on the disturbance wdC = nd2sys(1, 1 1e-2], 1e-2); Wd_s = daug( wdC, 1e-4, 1e-4, 1e-4 ); % weight on the reference signal Wr_s = 0.1*eye(3); % weight on the control error we_x = nd2sys( 1 8e-2], 1 1e-5], 1/1.1); we_y = we_x; we_psi = we_x; %we_x = nd2sys( 1 1e-1], 1 1e-5], 1/2); %we_y = nd2sys( 1 1e-1], 1 1e-5], 1/2); %we_psi = nd2sys( 1 1e-1], 1 1e-5], 1/2); We_s = sysbal(daug( we_x, we_y, we_psi )); % weight on the control wu = nd2sys( 1 0], 1 1e-3], 1); Wu_s = sysbal( daug(wu, wu, wu, wu, wu) ); % now, specify interconnections using sysic C3_s = pck( ], ], ],pinv(T));
K_s, N_s] = h2syn(P_s,3,3,-1); systemnames inputvar outputvar input_to_G_s input_to_Gd_s input_to_K_s input_to_C3_s sysoutname cleanupsysic sysic; = = = = = = = 'G_s Gd_s K_s C3_s'; ' r(3); d(4)]'; ' G_s+Gd_s; C3_s]'; ' C3_s]'; ' d]'; ' r-G_s-Gd_s]'; ' K_s]';
49
= = = = = =
systemnames inputvar outputvar input_to_G_s input_to_C3_s input_to_Wu_s input_to_Wd_s input_to_Gd_s input_to_Wr_s input_to_We_s sysoutname cleanupsysic
= = = = = = = = = =
'G_s C3_s Gd_s We_s Wd_s Wu_s Wr_s'; ' r(3); d(4); u_p(3)]'; ' Wu_s; We_s; Wr_s-G_s-Gd_s]'; ' C3_s]'; ' u_p]'; ' C3_s]'; ' d]'; ' Wd_s]'; ' r]'; ' Wr_s-G_s-Gd_s]';
vplot(sel(y,1,1),sel(r,1,1)),hold; plot( 0 tfinal], 1 1],'--'); plot( 0 tfinal], -1 -1],'--'); axis( 0 tfinal -2 2]),hold off; xlabel('time'); ylabel('x'); if print_to_file, print('-deps','H2ref_x'); unix('ps2frag H2ref_x.eps'); end; disp('Press a key'); pause; vplot(sel(y,2,1),sel(r,1,2)),hold; plot( 0 tfinal], 1 1],'--'); plot( 0 tfinal], -1 -1],'--'); axis( 0 tfinal -2 2]),hold off;
= 'P_s'; = 'yes';
xlabel('time'); ylabel('y'); if print_to_file, print('-deps','H2ref_y'); unix('ps2frag H2ref_y.eps'); end; disp('Press a key'); pause; vplot(sel(y,3,1),sel(r,1,3)),hold; plot( 0 tfinal], 1 1],'--'); plot( 0 tfinal], -1 -1],'--'); axis( 0 tfinal -2 2]),hold off; xlabel('time'); ylabel('psi'); if print_to_file, print('-deps','H2ref_psi'); unix('ps2frag H2ref_psi.eps'); end; disp('Press a key'); pause; vplot(sel(y,4:8,1)),hold; xlabel('time'); ylabel('controller'); if print_to_file, print('-deps','H2ref_u'); unix('ps2frag H2ref_u.eps'); end; disp('Press a key'); pause; r d y clf; vplot(sel(y,1,1)),hold; plot( 0 tfinal], 1 1],'--'); plot( 0 tfinal], -1 -1],'--'); axis( 0 tfinal -2 2]),hold off; xlabel('time'); ylabel('x'); if print_to_file, print('-deps','H2curr_x'); unix('ps2frag H2curr_x.eps'); end; disp('Press a key'); pause; vplot(sel(y,2,1)),hold; plot( 0 tfinal], 1 1],'--'); plot( 0 tfinal], -1 -1],'--'); axis( 0 tfinal -2 2]),hold off; xlabel('time'); ylabel('y'); if print_to_file, print('-deps','H2curr_y'); unix('ps2frag H2curr_y.eps'); = vpck( zeros(tfinal,1),zeros(tfinal,1),zeros(tfinal,1)],1:tfinal); = vpck( ones(tfinal,1),zeros(tfinal,3)],1:tfinal); = vdcmate(trsp(T_s,transp(sbs(r,d)),tfinal),30);
end; disp('Press a key'); pause; vplot(sel(y,3,1)),hold; plot( 0 tfinal], 1 1],'--'); plot( 0 tfinal], -1 -1],'--'); axis( 0 tfinal -2 2]),hold off; xlabel('time'); ylabel('psi'); if print_to_file, print('-deps','H2curr_psi'); unix('ps2frag H2curr_psi.eps'); end; disp('Press a key'); pause; vplot(sel(y,4:8,1)),hold; xlabel('time'); ylabel('controller'); if print_to_file, print('-deps','H2curr_u'); unix('ps2frag H2curr_u.eps'); end; % % controller_H_inf % % $Id$ % % first, specify weights % % weight on the disturbance wdC = nd2sys(1, 1 1e-2], 1e-2); Wd_s = daug( wdC, 1e-4, 1e-4, 1e-4 ); % weight on the reference signal Wr_s = 0.1*eye(3); % weight on the control error we_x = nd2sys( 1 8e-2], 1 1e-5], 1/1.1); we_y = we_x; we_psi = we_x; %we_x = nd2sys( 1 1e-1], 1 1e-5], 1/2); %we_y = nd2sys( 1 1e-1], 1 1e-5], 1/2); %we_psi = nd2sys( 1 1e-1], 1 1e-5], 1/2); We_s = sysbal(daug( we_x, we_y, we_psi )); % weight on the control wu = nd2sys( 1 0], 1 1e-3], 1); Wu_s = sysbal( daug(wu, wu, wu, wu, wu) );
50
% now, specify interconnections, using sysic % C3_s = pck( ], ], ],pinv(T)); systemnames inputvar outputvar input_to_G_s input_to_C3_s input_to_Wu_s input_to_Wd_s input_to_Gd_s input_to_Wr_s input_to_We_s sysoutname cleanupsysic sysic; = = = = = = = = = = 'G_s C3_s Gd_s We_s Wd_s Wu_s Wr_s'; ' r(3); d(4); u_p(3)]'; ' Wu_s; We_s; Wr_s-G_s-Gd_s]'; ' C3_s]'; ' u_p]'; ' C3_s]'; ' d]'; ' Wd_s]'; ' r]'; ' Wr_s-G_s-Gd_s]';
clf; vplot(sel(y,1,1),sel(r,1,1)),hold; plot( 0 tfinal], 1 1],'--'); plot( 0 tfinal], -1 -1],'--'); axis( 0 tfinal -2 2]),hold off; xlabel('time'); ylabel('x'); if print_to_file, print('-deps','Hinfref_x'); unix('ps2frag Hinfref_x.eps'); end; disp('Press a key'); pause; vplot(sel(y,2,1),sel(r,1,2)),hold; plot( 0 tfinal], 1 1],'--'); plot( 0 tfinal], -1 -1],'--'); axis( 0 tfinal -2 2]),hold off; xlabel('time'); ylabel('y'); if print_to_file, print('-deps','Hinfref_y'); unix('ps2frag Hinfref_y.eps'); end; disp('Press a key'); pause; vplot(sel(y,3,1),sel(r,1,3)),hold; plot( 0 tfinal], 1 1],'--'); plot( 0 tfinal], -1 -1],'--'); axis( 0 tfinal -2 2]),hold off; xlabel('time'); ylabel('psi'); if print_to_file, print('-deps','Hinfref_psi'); unix('ps2frag Hinfref_psi.eps'); end; disp('Press a key'); pause; vplot(sel(y,4:8,1)),hold; xlabel('time'); ylabel('controller'); if print_to_file, print('-deps','Hinfref_u'); unix('ps2frag Hinfref_u.eps'); end; disp('Press a key'); pause; r d y clf; = vpck( zeros(tfinal,1),zeros(tfinal,1),zeros(tfinal,1)],1:tfinal); = vpck( ones(tfinal,1),zeros(tfinal,3)],1:tfinal); = vdcmate(trsp(T_s,transp(sbs(r,d)),tfinal));
= 'P_s'; = 'yes';
K_s, N_s, gfin] = hinfsyn(P_s,3,3,0.2,10,0.05,-1); disp('Press a key'); pause; systemnames inputvar outputvar input_to_G_s input_to_Gd_s input_to_K_s input_to_C3_s sysoutname cleanupsysic sysic; tfinal t tau r d y = = = = = = = = = = = = = 'G_s Gd_s K_s C3_s'; ' r(3); d(4)]'; ' G_s+Gd_s; C3_s]'; ' C3_s]'; ' d]'; ' r-G_s-Gd_s]'; ' K_s]';
51
vplot(sel(y,1,1)),hold; plot( 0 tfinal], 1 1],'--'); plot( 0 tfinal], -1 -1],'--'); axis( 0 tfinal -2 2]),hold off; xlabel('time'); ylabel('x'); if print_to_file, print('-deps','Hinfcurr_x'); unix('ps2frag Hinfcurr_x.eps'); end; disp('Press a key'); pause; vplot(sel(y,2,1)),hold; plot( 0 tfinal], 1 1],'--'); plot( 0 tfinal], -1 -1],'--'); axis( 0 tfinal -2 2]),hold off; xlabel('time'); ylabel('y'); if print_to_file, print('-deps','Hinfcurr_y'); unix('ps2frag Hinfcurr_y.eps'); end; disp('Press a key'); pause; vplot(sel(y,3,1)),hold; plot( 0 tfinal], 1 1],'--'); plot( 0 tfinal], -1 -1],'--'); axis( 0 tfinal -2 2]),hold off; xlabel('time'); ylabel('psi'); if print_to_file, print('-deps','Hinfcurr_psi'); unix('ps2frag Hinfcurr_psi.eps'); end; disp('Press a key'); pause; vplot(sel(y,4:8,1)),hold; xlabel('time'); ylabel('controller'); if print_to_file, print('-deps','Hinfcurr_u'); unix('ps2frag Hinfcurr_u.eps'); end;
% first, specify weights % % weight on the disturbance wdC = nd2sys(1, 1 1e-2], 1e-2); Wd_s = daug( wdC, 1e-4, 1e-4, 1e-4 ); % weight on the control error we_x = nd2sys( 1 8e-2], 1 1e-5], 1/2); we_y = we_x; we_psi = we_x; We_s = sysbal(daug( we_x, we_y, we_psi )); % weight on the reference Wr_s = 0.1*eye(3); % weight on input uncertainty wI = nd2sys( 1 5e-1], 1 1e1],1); WI_s = daug( wI, wI, wI, wI, wI );
systemnames inputvar outputvar input_to_G_s input_to_C_s input_to_WI_s input_to_Wd_s input_to_Gd_s input_to_Wr_s input_to_We_s sysoutname cleanupsysic sysic; omega N_omega M_omega N22_omega
= = = = = = = = = =
'G_s Gd_s We_s Wd_s WI_s Wr_s C_s'; ' u_Delta(5); r(3); d(4)]'; ' WI_s; We_s]'; ' C_s+u_Delta]'; ' Wr_s-G_s-Gd_s]'; ' C_s]'; ' d]'; ' Wd_s]'; ' r]'; ' Wr_s-G_s-Gd_s]';
52
= 'N_s'; = 'yes';
A.5
% % % % % % % mu_PID $Id$
analysis
% input uncertainty Delta = 1 1; 1 1; 1 1; 1 1; 1 1]; % fictitious performance uncertainty Delta_p = 7 3]; % robust stability mu_RS, dvec, sens, pvec] = mu(M_omega,Delta); clf; vplot('liv,m',sel(mu_RS,1,1),vnorm(M_omega)); xlabel('frequency'); if print_to_file, print('-deps','muPIDRS'); unix('ps2frag muPIDRS.eps'); end; disp( 'mu for RS: ',num2str(pkvnorm(sel(mu_RS,1,1)))]); disp('Press a key'); pause; % nominal performance - full matrix/no need to calculate mu clf; vplot('liv,m',vnorm(N22_omega)); xlabel('frequency'); if print_to_file, print('-deps','muPIDNP'); unix('ps2frag muPIDNP.eps'); end; disp( 'mu for NP: ',num2str(max(vunpck(vnorm(N22_omega))))]); disp('Press a key'); pause; % robust performance mu_RP, dvec, sens, pvec] = mu(N_omega, Delta; Delta_p]); clf; vplot('liv,m',sel(mu_RP,1,1),vnorm(N_omega)); axis( 1e-4 1 0 3]) xlabel('frequency'); if print_to_file, print('-deps','muPIDRP'); unix('ps2frag muPIDRP.eps'); end; disp( 'mu for RP: ',num2str(pkvnorm(sel(mu_RP,1,1)))]);
% % %
$Id$
% weight on the disturbance wdC = nd2sys(1, 1 1e-2], 1e-2); Wd_s = daug( wdC, 1e-4, 1e-4, 1e-4 ); % weight on the control error we_x = nd2sys( 1 8e-2], 1 1e-5], 1/2); we_y = we_x; we_psi = we_x; We_s = sysbal(daug( we_x, we_y, we_psi )); % weight on the reference Wr_s = 0.1*eye(3); % weight on input uncertainty wI = nd2sys( 1 5e-1], 1 1e1],1); WI_s = daug( wI, wI, wI, wI, wI ); C3_s = pck( ], ], ],pinv(T)); = = = = = = = = = = = 'G_s Gd_s We_s Wd_s WI_s Wr_s C3_s K_s'; ' u_Delta(5); r(3); d(4)]'; ' WI_s; We_s]'; ' C3_s+u_Delta]'; ' Wr_s-G_s-Gd_s]'; ' C3_s]'; ' K_s]'; ' d]'; ' Wd_s]'; ' r]'; ' Wr_s-G_s-Gd_s]';
53
systemnames inputvar outputvar input_to_G_s input_to_K_s input_to_WI_s input_to_C3_s input_to_Wd_s input_to_Gd_s input_to_Wr_s input_to_We_s sysoutname cleanupsysic sysic;
= 'N_s'; = 'yes';
% % % %
omega
= logspace(-4,1,50);
% input uncertainty Delta = 1 1; 1 1; 1 1; 1 1; 1 1]; % fictitious performance uncertainty Delta_p = 7 3]; % robust stability mu_RS, dvec, sens, pvec] = mu(M_omega,Delta); clf; vplot('liv,m',sel(mu_RS,1,1),vnorm(M_omega)); xlabel('frequency'); if print_to_file, print('-deps','muH2RS'); unix('ps2frag muH2RS.eps'); end; disp( 'mu for RS: ',num2str(pkvnorm(sel(mu_RS,1,1)))]); disp('Press a key'); pause;
% first, specify weights % % weight on the disturbance wdC = nd2sys(1, 1 1e-2], 1e-2); Wd_s = daug( wdC, 1e-4, 1e-4, 1e-4 ); % weight on the control error we_x = nd2sys( 1 8e-2], 1 1e-5], 1/2); we_y = we_x; we_psi = we_x; We_s = sysbal(daug( we_x, we_y, we_psi )); % weight on the reference Wr_s = 0.1*eye(3); % weight on input uncertainty wI = nd2sys( 1 5e-1], 1 1e1],1); WI_s = daug( wI, wI, wI, wI, wI ); C3_s = pck( ], ], ],pinv(T)); = = = = = = = = = = = 'G_s Gd_s We_s WI_s Wr_s Wd_s C3_s K_s'; ' u_Delta(5); r(3); d(4)]'; ' WI_s; We_s]'; ' C3_s+u_Delta]'; ' Wr_s-G_s-Gd_s]'; ' C3_s]'; ' r]'; ' K_s]'; ' Wd_s]'; ' d]'; ' Wr_s-G_s-Gd_s]';
54
% nominal performance - full matrix/no need to calculate mu clf; vplot('liv,m',vnorm(N22_omega)); xlabel('frequency'); if print_to_file, print('-deps','muH2NP'); unix('ps2frag muH2NP.eps'); end; disp( 'mu for NP: ',num2str(max(vunpck(vnorm(N22_omega))))]); disp('Press a key'); pause; % robust performance mu_RP, dvec, sens, pvec] = mu(N_omega, Delta; Delta_p]); clf; vplot('liv,m',sel(mu_RP,1,1),vnorm(N_omega)); xlabel('frequency'); axis( 1e-4 1 0 3]); if print_to_file, print('-deps','muH2RP'); unix('ps2frag muH2RP.eps'); end; disp( 'mu for RP: ',num2str(pkvnorm(sel(mu_RP,1,1)))]);
systemnames inputvar outputvar input_to_G_s input_to_K_s input_to_WI_s input_to_Wr_s input_to_C3_s input_to_Gd_s input_to_Wd_s input_to_We_s sysoutname cleanupsysic
= 'N_s'; = 'yes';
sysic; % nominal performance - full matrix/no need to calculate mu omega N_omega M_omega N22_omega = logspace(-4,1,50); = frsp(N_s,omega); = sel(N_omega,1:5,1:5); = sel(N_omega,6:8,6:12); clf; vplot('liv,m',vnorm(N22_omega)); xlabel('frequency'); if print_to_file, print('-deps','muHinfNP'); unix('ps2frag muHinfNP.eps'); end; disp( 'mu for NP: ',num2str(max(vunpck(vnorm(N22_omega))))]); disp('Press a key'); pause; % robust performance mu_RP, dvec, sens, pvec] = mu(N_omega, Delta; Delta_p]); clf; vplot('liv,m',sel(mu_RP,1,1),vnorm(N_omega)); xlabel('frequency'); if print_to_file, print('-deps','muHinfRP'); unix('ps2frag muHinfRP.eps'); end; disp( 'mu for RP: ',num2str(pkvnorm(sel(mu_RP,1,1)))]);
% input uncertainty Delta = 1 1; 1 1; 1 1; 1 1; 1 1]; % fictitious performance uncertainty Delta_p = 7 3]; % robust stability mu_RS, dvec, sens, pvec] = mu(M_omega,Delta); clf; vplot('liv,m',sel(mu_RS,1,1),vnorm(M_omega)); xlabel('frequency'); if print_to_file, print('-deps','muHinfRS'); unix('ps2frag muHinfRS.eps'); end; disp( 'mu for RS: ',num2str(pkvnorm(sel(mu_RS,1,1)))]); disp('Press a key'); pause;
55