You are on page 1of 53

1

Lecture 7.1 - TMR4240 Spring 2007


Lecture 7, Spring 2007
TMR4240 Marine Control Systems
Department of Marine Technology,
Norwegian University of Science and Technology,
23 Feb 2007
Control System Design for
Dynamic Positioning
Part II
2
Lecture 7.1 - TMR4240 Spring 2007
Outline of this lecture
Part ILinear Quadratic (LQ) optimal control
Continuous-time regulator design
Tuning
Tracking and Non-zero set points
Integral action in LQ control
Certainty Equivalent (CE) control
Guidance

Part IIThruster allocation
General description of thruster allocation
Optimal allocation
Singularities

Part IIIConstrained control
Motivation and classification
Different approaches and examples
Anti-windup

Part IVMidterm hints

3
Lecture 7.1 - TMR4240 Spring 2007
Linear Quadratic Optimal Control
4
Lecture 7.1 - TMR4240 Spring 2007
Regulation and Tracking
When we design control systems, we typically deal with two kinds of
problems:

Regulation: Suppose that the plant output or its derivatives are initially
non-zero. Then, the regulation problem consists of designing the
control action that bring the plant output and its derivatives to zero,
i.e., bring the plant to zero state. DP is a particular example of this,
where the plant is perturbed from its zero conditions by disturbances.

Tracking: The plant output and/or its derivatives are required to follow
some prescribed functions. The tracking problem then consists of
designing the controller that achieves this. Trajectory tracking is one
example of this.
5
Lecture 7.1 - TMR4240 Spring 2007
Optimal control
Optimal control seeks the so-called optimal control policy u
OPT
(t) (control law), over
the time interval [t
0
,t
f
] such that

) ), ( ), ( ( min arg ) (
] , [ ), (
0
t t u t x V t u
f
t t t t u
OPT
e
=
Subject to

0 0
) ( x t x =
The functional V (i.e. function of a function), measures the deviations from
the desired performenace, and therefore it should be minimised.
Depending on the definition of the cost, this can be posed as a regulator or a
tracking problem.
The word ``Optimal here should only be interpreted with respect to the the
particular cost definedthe performance of an optimal controller can be far
from satisfactory if the cost does not capture the characteristics of the
physical problem!


) ), ( ), ( ( ) ( t t u t x f t x =
6
Lecture 7.1 - TMR4240 Spring 2007
Linear Quadratic (LQ) optimal control
In the case where the system is linear:
dt t u t u t x t x T x T x t t u t x V
T
t
t
T T
f
) ( ) ( ) ( ) ( ) ( ) ( ) ), ( ), ( (
0
R Q S + + =
}
And the cost functional is quadratic:
dt t u t u t x t x t t u t x V
T T
) ( ) ( ) ( ) ( ) ), ( ), ( (
0
R Q + =
}

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

For possition mooring we


need to add the restoring
forces due to the mooring
lines

38
Lecture 7.1 - TMR4240 Spring 2007
DP Control structure for low to
medium sea states
w

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

This model can be used to design your favorite controller: LQ,


PID,H-infinity, MPC, IMC, etc.
44
Lecture 7.1 - TMR4240 Spring 2007
| |
(
(
(

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

The bias must be


in the observer
even if we dont
use it in the
controller.
46
Lecture 7.1 - TMR4240 Spring 2007
What if we have a PID controller?

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

Then we can use the gains


from the LQ design with
added integrators.
47
Lecture 7.1 - TMR4240 Spring 2007
Reference trajectories
If our controller also needs to follow a specified trajectory, things get more
complex (and also complicated)

Something that we need to consider to the generation of the trajectories:
) (t
d

There are different ways of doing this:



1. Using filters to smooth the switching between waypoints
2. Using a vessel model
3. Using complex guidance systems that specify ) ( ), ( ), ( t t t
d d d


48
Lecture 7.1 - TMR4240 Spring 2007
Guidance system
Generates the desired trajectories (position, velocity and acceleration).

The waypoint generator establishes the desired way ponits according to mission,
operator decision, weather, fleet operations, amount of power available etc.
The waypoint management system updates the active waypoint based on the
current position of the ship.
The reference computing algorithms generate a smooth feasible trajectory based
on a reference model, the ship actual position, amount of power available, and the
active way point.

49
Lecture 7.1 - TMR4240 Spring 2007
Different approaches to path
generation
There are different ways of specifying the path

Filtering step signals
Using a simplified vessel model and simulation
Polynomial curve fitting
Numerical optimisation

50
Lecture 7.1 - TMR4240 Spring 2007
Filtering step signals
This is also called a refernce model approach. In this case both the path and the speed are
determined by the order and tunning of the filters. Typical filters are 2nd and 3rd order.
The response of the filters can be simulted so the reference trajectory is known in
advance. All this is done in discrete time.
) (s H
n
) (s H
e
) (s H

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

You might also like