Professional Documents
Culture Documents
Or for
) , [
0
e t t
The optimal control problem defined like this is called a regulator problem because it
tries to steer the state to zero and keep it there.
) ( ) ( ) ( t u t x t x B A + =
7
Lecture 7.1 - TMR4240 Spring 2007
Infinite-time LQR
8
Lecture 7.1 - TMR4240 Spring 2007
LQR Solution
9
Lecture 7.1 - TMR4240 Spring 2007
LQR for non-zero set points
10
Lecture 7.1 - TMR4240 Spring 2007
LQR for non-zero set points
11
Lecture 7.1 - TMR4240 Spring 2007
LQR for non-zero set points
12
Lecture 7.1 - TMR4240 Spring 2007
Tuning
The matrix Q weighs the size of the state. Usually we choose it
diagonal. If the entries or Q are large numbers, then small deviation of
the state from zero will cause the cost to increase significantlythus
the control will be tight (high gain).
The Matrix R weighs the control. Usually we choose it diagonal. If the
entries of this matrix are large, then the control action will be small
opposite to what happens with Q. If we want to increase the size of the
control action we can reduce the entries of this matrix.
Limiting cases:
If Q is very small, the problem is often call a minimum energy control.
If R is very small the problem is called a cheap control (the control is
cheap so we dont care about using large control actions.)
13
Lecture 7.1 - TMR4240 Spring 2007
LQR for non-zero set points
14
Lecture 7.1 - TMR4240 Spring 2007
LQR for non-zero set points
15
Lecture 7.1 - TMR4240 Spring 2007
LQR for non-zero set points
16
Lecture 7.1 - TMR4240 Spring 2007
Tracking
The non-zero set point LQR provides a fist step towards tracking, because
once we are getting close to a set point, we can change to a new set-
point.
In this case, we only give the controller the new set point, and the
trajectories followed by the state of the system depend on the tuning of
the regulator, i.e. it is not a true tracking because we do not follow a
specifies trajectory.
Sp2: y
d2
The actual
trajectory depend
on the tuning of
the LQR
Sp1: y
d1 Sp3: y
d3
x
2
x
1
In this example,
which state has a
heavier penalty in
the Q matrix ?
This approach to tracking may be acceptable depending on the particular application.
17
Lecture 7.1 - TMR4240 Spring 2007
A proper trajectory tracking problem
Sp2: y
d2
The actual trajectory
Sp1: y
d1
x
2
x
1
Desired trajectory
We not only specify the set point, but also the trajectory the system has
to follow on the way
In most problems this trajectory is known is advance.
18
Lecture 7.1 - TMR4240 Spring 2007
LQT (LQ-Tracking)
For the system
We seek the control that minimizes the following cost:
With
Desired state
trajectory
19
Lecture 7.1 - TMR4240 Spring 2007
A model-following solution for regulation
In this case, the desired trajectories are given by an autonomous model. Therefore,
we can augment the system with the states of the autonomous model and the
plant or controlled system and design a LQR for the augmented model and
penalize the deviations of the states of the original system from the states of
the autonomous system.
Reference system
Controlled system
Augmented system
20
Lecture 7.1 - TMR4240 Spring 2007
Integral action in LQ control
LQ control does not guarantee integral action per s, in
general.
Therefore, offsets and constant disturbances may not be
rejected in steady state.
Integral action needs to be enforced in the controller design.
21
Lecture 7.1 - TMR4240 Spring 2007
Integral action by adding integrators
Constant
disturbance
22
Lecture 7.1 - TMR4240 Spring 2007
Integral action by adding integrators
23
Lecture 7.1 - TMR4240 Spring 2007
Tracking with integral action
Once we added integral action, non-zero set point tracking can
be achieved as follows
24
Lecture 7.1 - TMR4240 Spring 2007
Output feedback LQ design
25
Lecture 7.1 - TMR4240 Spring 2007
Observer-based control
26
Lecture 7.1 - TMR4240 Spring 2007
CE-LQ / LQG control
For unconstrained linear systems, the separation principle establish that the
closed-loop system will be stable.
27
Lecture 7.1 - TMR4240 Spring 2007
Integral action in output feedback
regulators
28
Lecture 7.1 - TMR4240 Spring 2007
Integral action in output feedback
regulators
29
Lecture 7.1 - TMR4240 Spring 2007
Integral action in output feedback
regulators
Here we assume that either w or n have a bias component, which can be
represented in the observer by either an input or output disturbance.
30
Lecture 7.1 - TMR4240 Spring 2007
Output feedback tracking
31
Lecture 7.1 - TMR4240 Spring 2007
Output feedback tracking option 1
32
Lecture 7.1 - TMR4240 Spring 2007
Output feedback tracking option 2
This option introduces an error in the observer, which decays with the
dynamics of the observer. Option 1, does not produce this since the input
affects the plant and the observer in the same wayoption 1 is generally
superior.
33
Lecture 7.1 - TMR4240 Spring 2007
Proposed exercise 1
For a mass-spring-damping system
m
k
b
X(t)
F(t)
1. Obtain a state space model where the state is the position and velocity of the mass
2. Implement a simulink block diagram with some values of m,k,b (Example 1,1,1)
3. Design a LQR controller where u(t) is the force applied to the system. Use the lqr function of
MATLAB. Test controller by giving a particular initial condition to the system different values
of Q and R (look at the control and the states when you do this.)
4. Design a non-zero set point controller that takes the system to Xd
5. Add a disturbance constant force. What happens
6. Add integral action to your controller.
7. Can you reduce your controller to a PID controller?
8. Repeat 3-6 but assuming that you only measure position
34
Lecture 7.1 - TMR4240 Spring 2007
Proposed exercise 2
For a mass-spring-damping system of exercise 1
m
k
b
X(t)
F(t)
1. Obtain a state space model where the state is the position and velocity of the mass
2. Implement a simulink block diagram with some values of m,k,b (Example 1,1,1)
3. Choose an appropriate sampling time and discretize the system
4. Simulate both the continious and sicrete time models and compare their reponses.
5. Design a LQR controller for the discrete time systems where u(t) is the force applied to the
system. Use the dlqr function of MATLAB. Test controller by giving a particular initial
condition to the system different values of Q and R (look at the control and the states when you
do this.)
35
Lecture 7.1 - TMR4240 Spring 2007
Some references for LQ control
36
Lecture 7.1 - TMR4240 Spring 2007
Part III LQ design of DP Systems
37
Lecture 7.1 - TMR4240 Spring 2007
Control plant model (review)
(
env
GNC
Guidance Navigation Control
Osclillatory wave-
induced motion
total motion
This model is typically used to design control and observers.
Modelled as filtered
white noise
Modelled as a
Wiener process
v
Measurement noise
Modelled as
Gaussian white
noise
ctrl
env
Control
Algorithm
Osclillatory wave-induced
motion and noise are removed
by the wave filter and
therefore not considered in
contrlol design.
Total motion
v
Measurement noise
ctrl
Observer
b
, ,
LF LF
DP Controller
Guidance
System
d d d
, ,
Desired
motion
39
Lecture 7.1 - TMR4240 Spring 2007
DP Control structure for severe sea
states
w
env
Control
Algorithm
No wave filter!
Total motion
v
Measurement noise
ctrl
Observer
w LF LF
b
, ,
DP Controller
Guidance
System
d d d
, ,
Desired
motion
40
Lecture 7.1 - TMR4240 Spring 2007
A model for control design
)) ( ), ( ( ) ( t u t x t x F =
=
LF
LF
t x
) (
(
(
(
=
b
) (
LF
LF
t x
(
(
(
(
) (
LF
LF
t x
(
(
(
t
t
t
y
x
t u ) (
Different options for the state
definition depending on the
observer used and the VOC.
For simplicity of tuning the
controlled variable for
control design is the vector
of the forces and moment
the control allocation then
commands the actutators to
provide the demanded
control action
Extreme seas
When the bias b is not part of the
state for control design, the
controller must have integral action.
41
Lecture 7.1 - TMR4240 Spring 2007
Vessel parallel reference frame
A trick to eliminate the non-linearity due to the kinematic transformation is
to consider the vessel parallel reference frame.
R ) (
T
p
=
| |
T
e n =
(
(
(
=
~
1 0 0
0 cos sin
0 sin cos
) (
0 ,
u |
R
The vessel parallel coordinates can be defined (Fossen 2002, p92):
R ) ( =
| |
T
r v u =
42
Lecture 7.1 - TMR4240 Spring 2007
Vessel parallel reference frame
Then
M G M D M
1 1 1
+ + =
=
p
p
R R R
R R
~
+ =
+ =
) ( ) ( ) (
) ( ) (
T T
T T
p
Thus
Assuming
slow turning
0 ~
| |
(
=
(
= = =
+ =
1 1 1
, , ,
M
0
B
D M G M
I 0
A
B A
u x
x x
T
p
43
Lecture 7.1 - TMR4240 Spring 2007
LTI state-space control design model
Then using
M G M D M
1 1 1
+ + =
=
p
p
The
transformation to
the VPRF does
not affect the
restoring terms.
(
=
(
= =
(
=
+ =
1 1 1
, , ,
M
0
B
D M G M
I 0
A
B A
u x
u x x
p
k k k
LF
pLF
b v q
LQ-DP with bias in the controller
env
Total motion
v
ctrl
Observer
(
(
(
LF
pLF
Guidance
System
pd
) (
T
R
K
LQ gains
Total env loads: wind, waves (1st
and 2nd order), current
) (
T
R
d
45
Lecture 7.1 - TMR4240 Spring 2007
| |
(
LF
pLF
k k
v q
LQ-DP by adding integrators
env
Total motion
v
ctrl
Observer
(
(
(
LF
pLF
Guidance
System
pd
) (
T
R
I
k
LQ gains
}
pLF
env
Total motion
v
ctrl
Observer
(
(
(
LF
pLF
Guidance
System
pd
) (
T
R
I I
d
p
k K
k K
k K
=
=
=
v
q
PID Controller
pLF
Swithicing
way points
) (t
d
51
Lecture 7.1 - TMR4240 Spring 2007
Using a vessel model
The time derivatives of the desired position can be specified as
Then we can use simplified reference models based on the
vessel model to generate the speed and heading:
The input of these models can be generated via feedback using
PI control:
52
Lecture 7.1 - TMR4240 Spring 2007
Using a vessel model
PID
53
Lecture 7.1 - TMR4240 Spring 2007
Proposed exercise 3
Design and simulate a DP control systems using
LQ techniques (Fossen, 2002, p209):
1. Design a LQR controller where u(t) is the force applied to the ship. Use the lqr function of
MATLAB. Test controller by giving a particular initial condition to the system different values
of Q and R (look at the control and the states when you do this.)
2. Design a non-zero set point controller
3. Add integral action to your controller.
4. Can you reduce your controller to a PID controller?
5. Repeat 3-6 but assuming that you only measure position.
6. Use the Motion RAOS of Assignment 1 part 1, or filter white noise to simulate wave induced
motion in the 3DOF, and add a wave filter to the observer.
m Lpp E m 76 ; 6 591 . 4 = =
(
(
(
=
9 7454 . 3 0 0
0 6 2831 . 8 0
0 0 6 3222 . 5
E
E
E
M
(
(
(
=
8 1894 . 4 6 3933 . 4 0
6 3933 . 4 5 7229 . 2 0
0 0 4 0242 . 5
E E
E E
E
D