Nonlinear Control and Aerospace Applications 2x1
Nonlinear Control and Aerospace Applications 2x1
Carlo Novara
Politecnico di Torino
Tel. +39 011 0907019
Email: [email protected]
Course organization
Lectures:
◮ schedule:
⋆ lectures: Wednesday, 14:30-17:30
⋆ backup lectures: Monday, 8:30-11:30 (when needed)
◮ theory
◮ examples/exercises
◮ simulations.
Lab exercises:
◮ schedule: Thursday, 8:30-10 (not all weeks)
◮ exercises/problems/design
◮ use of Matlab/Simulink.
Bibliography
Course introduction
1 Nonlinear systems
1 Analysis: dynamic system properties; state equations; stability
concepts; Lyapunov stability.
2 Control design: linearization and gain scheduling; feedback
linearization; sliding mode control; nonlinear model predictive control;
extended Kalman filter.
2 Aerospace
1 General topics: coordinate reference systems; rotations and
translations; rigid body attitude kinematics and dynamics; orbital
dynamics.
2 Aerospace applications/case studies will be about spacecraft
orbit/trajectory control; spacecraft attitude control; aircraft flight
control.
Dynamic systems
Carlo Novara
Politecnico di Torino
Dynamic systems - General definition
Examples:
– vehicles
– mechanical systems
– electrical circuits
– aircrafts
– spacecrafts, satellites
– stock market
– animal population
– atmosphere
– planet systems
– and so on...
• Variables:
– : angular position
– : angular velocity
– : applied torque.
• Parameters:
– : mass
– : length
– : gravity acceleration.
Dynamic systems - Variables and signals
1
T(t)
-1
0 5 10 15 20 25 30 35 40
t
20
0
(t)
-20
0 5 10 15 20 25 30 35 40
t
1
(t)
-1
0 5 10 15 20 25 30 35 40
t
system
• Fundamental variables:
– Input : variables which influence the time evolution of the system.
– Output : measured.
• Input types:
– Command inputs: their behavior can be chosen by the human user.
– Disturbances: their behavior is independent on the human user; they
cannot be chosen.
Dynamic systems - A classic example: pendulum
• Variables:
– : angular position
– : angular velocity
– : applied torque.
• Parameters:
– : mass
– : length
– : gravity acceleration.
• Input:
• Output: we can choose e.g. .
2
+ +
where .
% Parameters
m=1; l=0.8;
J=m*l^2; K=9.81*m*l; beta=0.6;
tau=0.01;
a1=2-tau*beta/J; a2=-1+tau*beta/J; a3=-tau^2*K/J; b=tau^2/J;
% Initial conditions
theta=[pi/4;pi/4];
% Time evolution
for k=1:1998
T(k)=sin(0.01*k);
theta(k+2)=a1*theta(k+1)+a2*theta(k)+a3*sin(theta(k))+b*T(k);
end
Dynamic systems - A classic example: pendulum
K 1
• Pendulum equation: (t ) sin (t ) (t ) T (t )
J J J
• Variables:
– : mass horizontal position
– : force applied to the mass.
• Parameters:
– : body mass
– : friction coefficient
– : elastic constant.
Dynamic systems – Example: RLC oscillator in series
• Variables:
– : generator tension
– : capacitance tension
– : current in the circuit.
s
• Parameters:
– : resistance
– : inductance
– : capacitance. c
• Variables:
– : generator current
– : capacitance tension
– : inductance current. R L C
s
• Parameters: c
– : resistance
– : inductance
– : capacitance.
1 dV (t )
iS (t ) iR (t ) iL (t ) iC (t ) VC (t ) iL (t ) C C
R dt
diL (t )
L VC (t )
dt
Dynamic systems – Analogy between systems
• Mass-spring-damper system:
d 2i (t ) di (t ) 1 dV (t )
L 2
R i (t ) s
dt dt C dt
b(t) z(t)
Dynamic systems – Aerospace examples
MD
d
Earth
Fc
Lorenz attractor
• Lorenz system. Simplified atmosphere
model:
State equations
where
– : state
– : input
– : output
– : order of the system.
x (t ) (t )
x(t ) 1 R 2
x2 (t ) (t )
we have x1 (t ) x2 (t )
k 1 state
x2 (t ) J sin x1 (t ) J x2 (t ) J u (t ) equations
y (t ) x1 (t )
x2
Note: f ( x, u; t ) f ( x, u ) k 1 , f : R3 R2
sin( x1 ) x2 u
J J J
h( x, u; t ) h( x1 ) x1 , h : R R
di (t )
• Kirchhoff’s equations: VS (t ) Ri (t ) L VC (t ) 0
dt
i (t ) C dVC (t )
dt
The input is u(t ) VS (t ) R . Suppose that y (t ) i (t ) 2VS (t ) R.
2
Choosing
x (t ) i (t )
x(t ) 1 R2
x2 (t ) VC (t )
we have R 1 1
x1 (t ) x 1 (t ) x 2 (t ) u (t )
L L L
state
x (t ) 1 x (t ) equations
2 C
1
y (t ) x1 (t ) 2 2u (t )
Note: f : R 3 R 2 , h : R 2 R
State equations – Example: electric motor
we have R Ke 1
x
1 x1 x 2 u
L L L
state
x K t x x equations
2 J 1 J 2
y x2
• The state of a system is a set of variables that represent the system at any
given time.
• If the state of a system is known at a given time, then any future value of any
system variable can be computed in function of this state and the input signal.
• The state is a set of internal variables: The state is usually not measured. The
measured variable (the output ) can be a non-invertible function of .
State equations – Discussion
x2
x(t dt ) integrating
from 0 to T
x1
• Nonlinear system:
x (t ) f x (t ), u (t ); t
y (t ) hx(t ), u (t ); t
• Linear system:
x (t ) A(t ) x(t ) B (t )u (t )
y (t ) C (t ) x(t ) D (t )u (t )
x (t ) f x(t ), u (t ); t
y (t ) hx(t ), u (t ); t
x (t ) f x(t ), u (t )
y (t ) hx(t ), u (t )
• Forced system:
• Autonomous system:
x (t ) f x(t )
y(t ) h x(t )
x (t ) f x(t ), u (t ); t
t 0,
y (t ) hx(t ), u (t ); t
differential equations
x(t 1) f x(t ), u (t ); t
t 0,1,2,...
y (t ) hx(t ), u (t ); t
where: u (t ) R nu : input
n
y (t ) R y : output
Stability concepts
Carlo Novara
Politecnico di Torino
Solution of a dynamic system - Definition
20
10
0
1
x
-10
-20
0 5 10 15 20 25 30 35 40
time [s]
40
20
0
2
x
-20
-40
0 5 10 15 20 25 30 35 40
time [s]
Definition. The set of points in the state space generated by the solution
is called the trajectory (or orbit) of the system corresponding to the input
signal u(t) and the initial condition x(0).
x2 trajectory
x ( 0) x(t )
x1
Solution (trajectory) of a dynamic system – Examples of pendulum solutions (trajectories)
x2
p x p (t )
x (0)
x ( 0) x(t )
x1
Solution stability – Definitions
0, 0 :
x 0 x p 0 x t x p t , t 0
x2
x p (0)
x(t )
x ( 0) x p (t )
x1
x2
x p (0)
x ( 0)
x p (t ) x(t )
per
for t
x1
x2
x p (0)
x ( 0) x(t )
x p (t )
x1
Rationale:
x2 0
k
sin( x1 ) x2 0
J J
0, 0 :
x ( 0) x x(t ) x , t 0
x2
x ( 0)
x(t )
x1
x2
x ( 0)
x1
x(t )
x2
x ( 0)
x1
Equilibrium states of a dynamic system – Example: pendulum equilibrium states
(Simply) stable equilibrium ( , ) (0,0) As. stable equilibrium ( , ) (0,0)
non-damped pendulum (β=0)
damped pendulum (β>0)
free evolution (T(t)=0)
free evolution (T(t)=0)
• In the case of LTI system, stability does not depend on the particular
solution. Stability is not a property of a single solution but of the
system itself:
one solution is stable
and for ;
or with .
Definition. A dynamic system is BIBO stable if, for any bounded initial
condition and any
bounded input: ||u(t)|| < Mu < , t 0,
the resulting output is bounded: ||y(t)|| < My < , t 0.
My
Mu
u(t) y(t)
-Mu -My
t t
(marginal) stability
or
instability
BIBO instability
x (t ) u (t )
y (t ) x(t )
x(t ), u (t ), y (t ) R
Carlo Novara
Politecnico di Torino
Outline
1 Introduction
2 Phase portrait
5 Chaotic systems
6 Fractals
2 Phase portrait
5 Chaotic systems
6 Fractals
Introduction
2 Phase portrait
5 Chaotic systems
6 Fractals
Phase portrait
Introduction
Method:
◮ Plot the trajectory of the second-order system in a 2-dimensional plane,
representing the state space. This plane is called the phase plane (or,
sometimes, state plane).
◮ Plot different trajectories corresponding to different initial conditions.
ẋ = f (x) (1)
ẋ1 = f1 (x1 , x2 )
ẋ2 = f2 (x1 , x2 ).
Phase portrait
Example
ẍ + x = 0.
x(t) = x0 cos t
ẋ(t) = −x0 sin t.
It follows that
x2 + ẋ2 = x20 .
x2 + ẋ2 = x20 .
Phase portrait
Vector fields
x2
f (x1 , x2 ) =
0.2(1 − x21 )x2 − x1
a vector field on a sphere
Phase portrait
Singular points
dx2 f2 (x1 , x2 )
= .
dx1 f1 (x1 , x2 )
The equation f (x) = 0 defines the singular points of the phase plane.
◮ It follows that the singular points are the system equilibrium points (or
fixed points).
Phase portrait
Singular points
Phase portrait
Methods for constructing the phase portrait
Phase portrait
Example: a satellite control system
ẋ1 = x2
−U x1 > 0
ẋ2 = 0 x1 = 0
U x1 < 0.
Phase portrait
Example: the Van der Pol oscillator
The Van der Pol system is an oscillator with a nonlinear damper. The
state equations are the following:
ẋ1 = x2
ẋ2 = µ(1 − x21 )x2 − x1 .
One equilibrium point: (x̄1 , x̄2 ) = (0, 0) ← unstable. Note that the
trajectories are bounded.
Phase portrait
Example: the undamped pendulum
ẋ1 = x2
ẋ2 = − Jk sin x1 .
Phase portrait
Example: the damped pendulum
ẋ1 = x2
ẋ2 = − Jk sin x1 − Jβ x2 .
2 Phase portrait
5 Chaotic systems
6 Fractals
ẋ = Ax
λ1,2 < 0 ⇒ all modes converge λ1,2 > 0 ⇒ all modes diverge
⇒ the solutions converge ⇒ the solutions diverges
λ1 < 0 < λ2 or λ2 < 0 < λ1 ⇒ one mode converges, the other diverges
⇒ some solutions converge, others diverge
Re(λ1 ) < 0 ⇒ the solutions converge Re(λ1 ) > 0 ⇒ the solutions diverge
center
1 Introduction
2 Phase portrait
5 Chaotic systems
6 Fractals
2 Phase portrait
5 Chaotic systems
6 Fractals
Chaotic systems
Chaotic systems
Bifurcations and chaos
For certain values of the parameters, there are many equilibria (stable and
unstable), many limit cycles/tori, very close to each other → chaos.
Chaotic systems
Chaotic systems
Example: the Lorenz system
The Lorenz system is a simplified mathematical model for atmospheric
convection:
ẋ1 = σ(x2 − x1 )
ẋ2 = x1 (ρ − x3 ) − x2
ẋ3 = x1 x2 − βx3
where xi are variables related to atmospheric temperature, pressure
and velocity, and σ, ρ and β are parameters.
Chaotic systems
Example: the logistic map
The logistic map is a simple discrete-time demographic model, defined
by the difference equation
x(k + 1) = rx(k)(1 − x(k))
where x ∈ [0, 1] represents the ratio of existing population to the
maximum possible population and r is a parameter.
2 Phase portrait
5 Chaotic systems
6 Fractals
Fractals
The trajectories of a chaotic system have a fractal structure. Fractals
are “strange” geometric objects.
Dimensions of geometric objects:
1 Introduction
2 Phase portrait
5 Chaotic systems
6 Fractals
Linearization
Carlo Novara
Politecnico di Torino
Linearization - Introduction
Linearization - Preliminaries
f f
x (t ) f ( x , u ) x u
x ( x ,u ) u ( x ,u )
f f x (t ) x (t )
x (t ) x u u
x
( x ,u ) ( x ,u ) f (x, u ) 0
h h
y (t ) h( x , u ) x u
x ( x ,u ) u ( x ,u )
h h
y (t ) y (t ) h( x , u ) x u u
x ( x ,u ) ( x ,u )
Linearization - Definition
• An equilibrium point is
x2 0
k
sin( x1 ) x2 0
J J
f1 f1
x 0 1 0 1
x2
A k k
1
cos( x1 )
f 2 f 2
x J J (0,0,0) J J
1 x2 (0,0,0)
f1
u 0
B 1 , C 1 0 , D 0
f 2
J
u (0,0,0)
f1 f1
x x2 0 1 0 1
A 1 k k
f 2 f 2
J cos( x )
J ( , 0, 0) J
1
J
x1 x2 ( ,0, 0)
f1
u 0
B 1 , C 1 0, D 0
f 2 J
u ( , 0,0 )
Carlo Novara
Politecnico di Torino
Outline
1 Introduction
4 Advanced topics
1 Introduction
4 Advanced topics
Introduction
Introduction
1 Introduction
4 Advanced topics
Positive definite functions
Definition
A function V : Rnx → R is locally positive definite if, for some ball
.
BR = {x : kxk ≤ R},
V (x) = 0, x = 0
V (x) > 0, x =
6 0, x ∈ BR .
Definition
A function V : Rnx → R is positive semi-definite if
V (x) = 0, x = 0
V (x) ≥ 0, x =
6 0, x ∈ BR .
Definition
A function V : Rnx → R is negative definite if −V is positive definite. A
function V : Rnx → R is negative semi-definite if −V is positive
semi-definite.
Lyapunov functions
Consider an autonomous system with state x ∈ Rnx :
ẋ = f (x). (1)
Lyapunov functions
Definition
A function V : Rnx → R is a Lyapunov function for the system (1) if, in
.
some ball BR = {x : kxk ≤ R},
(i) V is positive definite and has continuous partial derivatives;
(ii) V̇ is negative semi-definite.
1 Introduction
4 Advanced topics
Remark. Global stability of a point implies that this point is the only
equilibrium of the system.
Equilibrium point stability
Example: local marginal stability
θ̈ + θ̇ + sin θ = 0.
4 Advanced topics
Invariant sets
Definition
A set G ⊆ Rnx is an invariant set for a dynamic system if every solution
which starts from G remains in G for all future times.
All these approaches are not general. They allow us to find Lyapunov
functions only in particular cases.
Control design based on Lyapunov’s Direct Method
There are two main ways of using Lyapunov’s direct method for
control design:
1 The first one consists in hypothesizing one form of control law and
then finding a Lyapunov function to justify the choice.
2 The second one, conversely, requires hypothesizing a Lyapunov function
candidate and then finding a control law to make this candidate a real
Lyapunov function.
Both of them are based on trial and error procedures.
Systematic design procedures have been developed only for some
classes of nonlinear systems (sliding, adaptive, physically based
control).
Carlo Novara
Politecnico di Torino
Outline
1 Introduction
2 Control problems
1 Introduction
2 Control problems
u
r C plant y
Introduction
Open-loop (feedforward) control structure:
d
r controller plant y
r controller plant y
2 Control problems
Control problems
Consider a nonlinear system described by
ẋ = f (x, u, t)
(1)
y = h(x)
These qualities are often in conflict. Control design must account for
trade-offs, such as stability/robustness, stability/performance,
cost/performance, command activity/performance, etc.
1 Introduction
2 Control problems
1 Introduction
2 Control problems
◮ Gain scheduling
1 The plant is linearized around several working points, to obtain several
local LTI models.
2 A linear feedback controller is designed for each LTI model → set of
controllers.
3 Some interpolation function is designed to obtain a unique controller,
able to schedule the various controllers of the set.
Methods of Nonlinear Control Design
Feedback linearization
◮ The nonlinear plant is transformed into a linear system by means of
some (nonlinear) transformation realized via feedback.
◮ Standard linear design techniques are used to complete the control
design.
◮ Linearization is exact (different from local linearization).
Gain scheduling
Carlo Novara
Politecnico di Torino
Outline
1 Introduction
2 Gain scheduling
3 Examples
Control of a tank reactor
Stabilization of the inverted pendulum
4 Discussion
1 Introduction
2 Gain scheduling
3 Examples
Control of a tank reactor
Stabilization of the inverted pendulum
4 Discussion
Introduction
Approach:
◮ The plant is linearized around several operating points, to obtain
several local LTI models.
◮ A linear feedback controller is designed for each LTI model → set of
controllers.
◮ Interpolation functions are designed to obtain a unique controller, able
to schedule the various controllers of the set.
◮ The designed GS controller applied to the nonlinear plant is tested in
simulation.
Introduction
1 Introduction
2 Gain scheduling
3 Examples
Control of a tank reactor
Stabilization of the inverted pendulum
4 Discussion
Gain scheduling
Consider the system
ẋ = f (x, u, w)
(1)
y = h(x)
◮ f and h are differentiable functions on suitable domains Df , Dh ;
◮ x ∈ Rnx is the state, u ∈ Rnu is the command input and y ∈ Rny is
.
the output; for simplicity, n = nx ;
◮ w ∈ Dw ⊆ Rnw is a measured signal, called the scheduling variable:
⋆ an external variable or a function of x;
⋆ used to determine the operating points.
Choose a set of operating points for the scheduling variable:
Assume that, for each w̄ ∈ Dw , a pair (x̄, ū) exists, such that (x̄, ū, w̄)
is an equilibrium point of (1). In particular,
Gain scheduling
The nonlinear system (1) can be linearized around each operation
point (x̄i , ūi , w̄i ). Define the relative variables
. . . .
x̃i = x − x̄i , ũi = u − ūi , w̃i = w − w̄i , ỹi = y − h(x̄i ).
where i = 1, . . . N and
. .
∂f ∂f
A(w̄i ) = ∂x (x̄ ,ū ,w̄ ) , B(w̄i ) = ∂u (x̄ ,ū ,w̄ ) ,
i i i i i i
. .
∂f ∂h
E(w̄i ) = ∂we (x̄ ,ū ,w̄ ) , C(w̄i ) = ∂x (x̄i ,ūi ,w̄i ) .
i i i
Ki (e) ≡ K (pi ; e)
Gain scheduling
Gain scheduling
The linear controllers can be designed using any technique (e.g., PID,
eigenvalue placement, LQR, H∞ , loop shaping,...).
An effective option is represented by PID’s: they have a simple
structure, with only 3 parameters. Letting s be the Laplace variable, a
PID controller is of the form
cI
K(s) = cP + + cD s.
s
The parameters are functions of the scheduling variable:
2 Gain scheduling
3 Examples
Control of a tank reactor
Stabilization of the inverted pendulum
4 Discussion
ẋ1 = x2
ẋ2 = − Jk sin x1 − Jβ x2 + J1 u
u = ū − K(x − x̄)
1 Introduction
2 Gain scheduling
3 Examples
Control of a tank reactor
Stabilization of the inverted pendulum
4 Discussion
Discussion
Advantages and drawbacks of gain scheduling
Advantages:
◮ simple basic idea;
◮ suitable for both state and output feedback;
◮ effective in many practical applications.
Drawbacks:
◮ heuristic design;
◮ stability guarantees under slow variations of the scheduling variables;
◮ difficult or even not feasible design and implementation when the
number of scheduling variables/operating points is large.
Feedback linearization
Carlo Novara
Politecnico di Torino
Outline
1 Introduction
2 Differential geometry
3 Input-state linearization
4 Input-output linearization
6 Advanced topics
7 Discussion
1 Introduction
2 Differential geometry
3 Input-state linearization
4 Input-output linearization
6 Advanced topics
7 Discussion
Introduction
Introduction
A simple example
Consider a fluid in a tank with level h. The control input is the flow u
into the tank.
The dynamics of the tank is described by the following equation:
d p
V (h) = u − a 2gh
dt
Rh
where V (h) = 0 A(z)dz is the fluid volume, A(z) is the cross section
of the tank and a is the cross section of the outlet pipe.
Introduction
A simple example
Since
h
d d d
Z
V (h) = V (h)ḣ = ḣ A(z)dz = ḣA(h)
dt dh dh 0
the tank equation becomes
p
ḣA(h) = u(t) − a 2gh.
ḣ = v.
Introduction
We will answer this question for both the cases of state feedback and
output feedback:
◮ Input-state linearization. Linearization is performed via state feedback.
◮ Input-output linearization. Linearization is performed via output
feedback.
2 Differential geometry
3 Input-state linearization
4 Input-output linearization
6 Advanced topics
7 Discussion
Differential geometry
Lie derivatives
Definition
A function f (x) is smooth if it has continuous partial derivatives of any
required order.
Definition
Let h : Rn → R be a smooth scalar function, and f : Rn → Rn be a
smooth vector field on Rn . The Lie derivative of h with respect to f is a
.
scalar function defined by Lf h = ∇h f ∈ R.
∂h ∂h
The gradient ∇h = ∂h∂x = [ ∂x1
· · · ∂x n
] is a row vector; f is a
column vector; Lf h = ∇h f is a scalar.
Recursive computation:
L0f h = h
Lif h = Lf (Li−1 i−1
f h) = ∇(Lf h)f, i = 1, 2, . . .
Differential geometry
Lie brackets
Definition
Let f and g be two vector fields on Rn . The Lie bracket of f and g is a
third vector field, defined by
.
[f, g] ≡ adf g = ∇g f − ∇f g = Lf g − Lg f ∈ Rn .
∇f = ∂f ∂f ∂f
∂x = [ ∂x1 · · · ∂xn ] is a square matrix; g is a column
vector; ∇f g is a column vector. The symbol ad means “adjoint”.
Recursive computation:
ad0f g = g
adif g = [f, adi−1
f g], i = 1, 2, . . .
Differential geometry
Lie brackets
◮ Jacobi identities:
[V, [W, X]] + [W, [X, V ]] + [X, [V, W ]] = 0
L[V,W ] X = LV LW X − LW LV X.
Differential geometry
Diffeomorphisms
Definition
A function φ : Rn → Rn , defined in a region Ω, is a diffeomorphism if it is
smooth, and its inverse φ−1 exists and is smooth.
Lemma
Let φ be a smooth function defined in a region Ω ⊆ Rn . If the Jacobian
matrix ∇φ is non-singular at a point x ∈ Ω, then φ defines a local
diffeomorphism in a neighborhood of x.
Differential geometry
Involutive vector fields
Definition
A linearly independent set of vector fields {f1 , . . . , fm } is involutive in Ω if
there are scalar functions αijk : Ω ⊆ Rn → R such that
m
X
[fi , fj ](x) = αijk (x)fk (x), ∀i, j.
k=1
Involutivity means that the Lie bracket of any pair of functions from
the set {f1 , . . . , fm } can be expressed as a linear combination of
functions of this set.
Differential geometry
Involutive vector fields
rank [f1 (x) · · · fm (x)] = rank [f1 (x) · · · fm (x) [fi , fj ](x)]
Observations:
◮ a set of constant vector fields is always involutive, since the Lie bracket
of two constant vectors is 0.;
◮ a set composed of a single vector is involutive, since [f, f ] = 0.
1 Introduction
2 Differential geometry
3 Input-state linearization
4 Input-output linearization
6 Advanced topics
7 Discussion
Input-state linearization
Definition
A single-input nonlinear system of the form (1) is input-state linearizable if
there exists a region Ω ⊆ Rn , a diffeomorphism φ : Ω → Rn , and a
nonlinear feedback control law
u = α(x) + β(x) v
Input-state linearization
Linearizability
Definition
The controllability matrix is defined as
h i
n−1
Mc (x) = g, adf g, . . . , adf g .
Theorem
The nonlinear system (1) is input-state linearizable if and only if there
exists a region Ω such that the following conditions hold:
1. rankMc (x) = n, ∀x ∈ Ω;
2. the columns of Mc (x) are involutive in Ω.
Lg Lif z1 = 0, i = 0, . . . , n − 2. (2)
Input-state linearization
Procedure
∇z1 adif g = 0, i = 0, . . . , n − 2
(3)
∇z1 adfn−1 g 6= 0.
Lnf z1 1
α(x) = − , β(x) = .
Lg Ln−1
f z 1 Lg Ln−1
f z 1
1
It can be proven that involutivity ⇒ ((2) ⇔ (3)).
(3) are used instead of (2), since adif g have already been computed.
2
It can be proven that controllability ⇒ Lg Lfn−1 z1 6= 0.
Input-state linearization
Control scheme
Input-state linearization
Example: control of a flexible-joint mechanism
Since the nonlinearities appear in the first equation, while the control
input u enters in the second one, there is no obvious way of designing
a large range controller.
Input-state linearization
Example: control of a flexible-joint mechanism
x2
0
− M gL sin x1 − k (x1 − x3 ) 0
f (x) = I I , g(x) =
0 .
x4
k 1
J (x1 − x3 ) J
This matrix is full-rank. The vector fields {g, adf g, ad2f g, ad3f g} are
constant and thus involutive. ⇒ The system is input-state linearizable.
Input-state linearization
Example: control of a flexible-joint mechanism
IJ
β(x) = k .
Input-state linearization
Example: control of a flexible-joint mechanism
1 Introduction
2 Differential geometry
3 Input-state linearization
4 Input-output linearization
6 Advanced topics
7 Discussion
Input-output linearization
ẋ = f (x) + g(x)u
(4)
y = h(x)
ẏ = v.
Input-output linearization
Lg Lγ−1
f h(x) 6= 0.
y (γ) = v.
Input-output linearization
µ̇ = Aµ + Bv
y = µ1
0 1 0 ··· 0
0
0 0 1 ... 0 0
..
. . .
.. .. . . . . . . ..
A= B= .
.
0 0 ··· 0 1
0
0 0 ··· 0 0 1
Input-output linearization
Relative degree
Definition
The integer γ ≤ n is the relative degree of the system (4) in Ω.
Input-output linearization
Normal form
ψ̇ = w(µ, ψ)
y = µ1 .
The new state, called the normal state, is (µ, ψ), where
.
µ = (µ1 , . . . , µγ ) = (y, ẏ, . . . , y (γ−1) ) external dynamics
ψ ∈ Rn−γ . internal dynamics.
Input-output linearization
Normal form
Input-output linearization
Zero dynamics
Definition
The zero-dynamics of the system (4) in Ω is defined by
µ̇ = 0
(6)
ψ̇ = w(0, ψ)
Definition
The system (4) is locally asymptotically minimum phase at x̄ if ψ = 0 is a
locally asymptotically stable equilibrium point of (6).
Input-output linearization
Regulation
Consider the system (4) and its normal form (5), with
a(µ, ψ) = Lγf h(x), b(µ, ψ) = Lg Lfγ−1 h(x).
Define the control law
feedback
u= 1
−Lγf h(x) +v
Lg Lfγ−1 h(x) linearization
(7)
linear
v = −Kµ
control
Theorem
Assume that the system (4) has a locally asymptotically stable
zero-dynamics. Then, the closed-loop defined by (4) and (7) is locally
asymptotically stable.
Input-output linearization
Tracking
Consider the system (4) and its normal form (5), with
a(µ, ψ) = Lγf h(x), b(µ, ψ) = Lg Lfγ−1 h(x).
Input-output linearization
Tracking
Define the control law
feedback
u= 1
−Lγf h(x) +v
Lg Lfγ−1 h(x) linearization
(8)
linear
v = K µ̃ + r(γ)
control
Theorem
Assume that the solution of the equation
Input-state linearization
A general control scheme
2 Differential geometry
3 Input-state linearization
4 Input-output linearization
6 Advanced topics
7 Discussion
ẏ = ẋ1 = α(x2 − x1 − ρ)
.
ÿ = α(ẋ2 − ẋ1 − ρ′ ẋ1 ) ← ρ′ = dρ/dx1
= α (x1 − x2 + x3 + u − (1 + ρ′ )ẋ1 )
= α (x1 − x2 + x3 + u − α(x2 − x1 − ρ)(1 + ρ′ ))
.
Defining the external state µ = (µ1 , µ2 ) = (y, ẏ) and the control law
v
u = −x1 + x2 − x3 + α(x2 − x1 − ρ)(1 + ρ′ ) +
α
the external dynamics is transformed into an LTI system.
The internal dynamics can be found as follows:
µ1 = y = x1
µ2 = ẏ = ẋ1 = α(x2 − x1 − ρ(x1 )) = α(x2 − µ1 − ρ(µ1 ))
u = −x1 + x2 − x3 + v
With the above ρ(x1 ) and α, it is loc. marg. stable for R = 0 or loc.
as. stable for R > 0.
ÿ = −β ẋ2 − Rẋ3
= −β(x1 − x2 + x3 + u) + R(βx2 + Rx3 )
= −βx1 + β(1 + R)x2 + (R2 − β)x3 − βu
.
Defining the external state µ = (µ1 , µ2 ) = (y, ẏ) and the control law
1 2 v
u = −x1 + (1 + R)x2 + (R − β)x3 −
β β
With the above ρ(x1 ) and α, it is loc. as. stable (for any R).
ẏ = ẋ1 = α(x2 − x1 − ρ)
ÿ = α (x1 − x2 + x3 − α(x2 − x1 − ρ)(1 + ρ′ ))
y (3) = a(x) + αu.
.
Defining the external state µ = (µ1 , µ2 , µ3 ) = (y, ẏ, ÿ) and the control
law
u = (−a(x) + v)/α
the external dynamics is transformed into an LTI system.
No internal dynamics.
Remark. Lg Lγ−1
f h(x) = α 6= 0, ∀x ⇒ the stability and tracking error
theorems hold globally.
1 Introduction
2 Differential geometry
3 Input-state linearization
4 Input-output linearization
6 Advanced topics
7 Discussion
Control of non-minimum phase systems
For such systems, we do not look for asymptotic zero errors but for
“small” tracking errors. Three approaches:
◮ If possible, choose another output, which yield a stable zero-dynamics
and such that accurate tracking of the new output implies accurate
tracking of the original output.
◮ Differentiate the output n times, neglecting the terms containing the
input in the intermediate steps.
◮ If possible, modify the plant to obtain a stable zero-dynamics.
ẋ = f (x) + g(x)u
(9)
y = h(x)
Lg Lfγ1 −1 h1 (x)
(γ )
Lγf 1 h1 (x)
y1 1
..
= .. . ..
+B(x)u, B(x) = .
. . .
(γny ) γn y γny −1
y ny Lf hny (x) Lg Lf hny (x)
Control of MIMO systems
.
Let Ω = ∩i Ωi and suppose that B(x) is invertible on Ω. Then, the
control law
v1 − Lγf1 h1 (x)
..
u = B(x)−1
.
γn
vny − Lf y hny (x)
yields ny equations of the simple form
(γi )
yi = vi .
1 Introduction
2 Differential geometry
3 Input-state linearization
4 Input-output linearization
6 Advanced topics
7 Discussion
Discussion
Comparison with conventional linearization
Most results in feedback linearization (FL) are local, in the sense that
they hold in “some region” of the state space Ω ∈ Rn .
However, there are relevant differences wrt conventional linearization
(CL, based on Taylor expansion):
◮ In FL, the linearization is exact on the whole region Ω. In CL, the
linearization is approximated.
◮ Also in cases where CL works, FL usually yields a better control
performance.
Discussion
Advantages and drawbacks of feedback linearization
Advantages:
◮ strong theoretical foundations and results;
◮ deep system analysis: the problems related to an unstable
zero-dynamics hold for all approaches (linear and nonlinear).
◮ exact linearization;
◮ high control performance (if the model is accurate).
Drawbacks:
◮ assumption of model affine in u;
◮ results are in some sense local;
◮ problems in the case unstable zero-dynamics;
◮ input/state/output constraints not accounted for;
◮ trade-off performance-command activity difficult to manage;
◮ possible lack of robustness.
Nonlinear control and aerospace applications
Carlo Novara
Politecnico di Torino
Outline
1 Introduction
3 Robustness properties
6 Discussion
1 Introduction
3 Robustness properties
6 Discussion
Introduction
This system has relative degree γ = 2 and, with R > 0, an as. st.
internal dynamics.
The following parameter values are assumed: R = 0.1, α = 10.4,
β = 16.5.
Simulation results:
3 Robustness properties
6 Discussion
ẋ = f (x) + g(x)u
(1)
y = h(x)
ψ̇ = w(µ, ψ)
y = µ1 .
where γ is its relative degree. The new state is (µ, ψ), with
.
µ = (µ1 , . . . , µγ ) = (y, ẏ, . . . , y (γ−1) ) external dynamics
ψ ∈ Rn−γ . internal dynamics.
Definition
The sliding surface is
.
S(t) = {x ∈ Rn : s(x, t) = 0}
Typical choices:
ηs
σ(η s) = 1+|ηs|
σ(η s) = tanh(η s)
σ(η s) = sat(η s).
. ˙ . . . , ỹ (γ−1) ),
Writing the tracking error as µ̃ = (µ̃1 , . . . , µ̃γ ) = (ỹ, ỹ,
the sliding mode control law becomes
1 (γ)
u= r − a(x) + kγ µ̃γ + . . . + k2 µ̃2 +k1 σ(η s) .
b(x)
Sliding mode control
Summary
Results
S(t) is globally attractive: x(t) → S(t) in finite time.
S(t) is an invariant set: x(τ ) ∈ S(τ ) ⇒ x(t) ∈ S(t), ∀t ≥ τ .
On S(t) the tracking error converges to 0: ỹ(t) → 0 as t → ∞.
If the internal dynamics is glob. as. stable and the reference r is
bounded for all t, the state x is also bounded for all t.
Feedback linearization:
They are the same, except the last term. In sliding mode control, the
term k1 σ(η s) increases the robustness of the controller.
Input-state linearization
Control scheme
1 Introduction
3 Robustness properties
6 Discussion
Robustness properties
Suppose that the system to control is not exactly known. In normal
form, the system is described by
Robustness properties
Results
S(t) is globally attractive: x(t) moves close to S(t) in finite time.
If x(τ ) is close S(τ ), then x(t) remains close to S(t), ∀t ≥ τ .
Close to S(t) the tracking error is “small”.
If the internal dynamics is glob. as. stable and the reference r is
bounded for all t, the state x is also bounded for all t.
1 Introduction
3 Robustness properties
6 Discussion
This system has relative degree γ = 2 and, with R > 0, an as. st.
internal dynamics.
The following parameter values are assumed: R = 0.1, α = 10.4,
β = 16.5.
The true nonlinearity ρ(x1 ) is a piece-wise linear function. The
nonlinearity used for control design is ρ̂(x1 ) = −1.16x1 + 0.041x31 .
Case study: control of the Chua circuit
Variant 1: γ = 2
Simulation results:
3 Robustness properties
6 Discussion
Lg Lfγ1 −1 h1 (x)
(γ )
Lγf 1 h1 (x)
y1 1
..
= .. . ..
+ B(x)u, B(x) =
. . .
(γn ) γ n γny −1
y ny y Lf y hny (x) Lg Lf hny (x)
The definition of the sliding surface is the same as above, except that
s : Rn+1 → Rny and ki ∈ Rny ×ny .
Assuming invertibility of B(x), the sliding mode control law is
(γ)
u = B(x) −1
r − a(x) + kγ µ̃γ + . . . + k2 µ̃2 + k1 σ(η s) .
1 Introduction
3 Robustness properties
6 Discussion
Discussion
Advantages and drawbacks of sliding mode control
Advantages:
◮ solid theoretical foundation and results;
◮ robustness to model uncertainty and disturbances;
◮ high control performance.
Drawbacks:
◮ assumption of model affine in u;
◮ problems in the case unstable zero-dynamics;
◮ input/state/output constraints not accounted for;
◮ trade-off performance-command activity difficult to manage;
◮ possible high frequency control action;
◮ in general, high command activity.
Nonlinear Control and Aerospace Applications
Carlo Novara
Politecnico di Torino
(non-negativity)
(positive homogeneity)
(triangular inequality)
• Consider a vector .
norm:
norm:
,…,
weighted norm: ,
is a diagonal matrix.
norm:
norm:
norm:
,…,
Norms – Vector norms in Matlab
norm: norm(f)=norm(f,2)=3.7417
norm: norm(f,1)=6
norm: norm(f,inf)=3
norm:
norm:
norm:
∈ℝ
norm:
norm:
norm:
∈ℝ
1.5 1.5
1 1
f(t)2
f(t)
0.5 0.5
0 0
-0.5 -0.5
0 2 4 6 8 10 0 2 4 6 8 10
t t
2
2
f 2
f (t ) dt dt 2
2
area of the red region energy of f
0 0
f
max f (t ) max f (t ) 1 largest value of f (t ) amplitude of f
tR t[0,2]
1.5 1.5
1 1
f(t)2
f(t)
0.5 0.5
0 0
-0.5 -0.5
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
t t
2 1 1
f f (t ) dt e dt e6t
2 6 t
6 0 6
2
0 0
f
max f (t ) max e3t 1
tR tR
Norms – Signal norms: examples
1.5
1
1
f(t)2
f(t)
0 0.5
0
-1
-0.5
0 2 4 6 8 10 0 2 4 6 8 10
t t
2
f 2
f (t ) dt sin(t ) 2 dt unbounded 2 norm
2
0 0
f
max f (t ) max sin(t ) 1 bounded norm
tR tR
7
x 10
10000 10
f(t)2
f(t)
5000 5
0 0
-1 -0.5 0 0.5 1 -1 -0.5 0 0.5 1
t t
2
f 2
f (t ) dt (t )dt 1 bounded 2 norm
2
0 0
f
max f (t ) max (t ) unbounded norm
tR tR
Norms – Signal norms in Matlab
dt=0.0001;
t=0:dt:10;
f=exp(-3*t)’;
norm(f)*sqrt(dt) % L2 norm
norm(f,1)*dt % L1 norm
weighted norm: ,
dt=0.0001;
t=0:dt:10;
f=exp(-3*t)’;
Carlo Novara
Politecnico di Torino
Outline
1 Introduction
2 Basic notions
3 Minimization
1 Introduction
2 Basic notions
3 Minimization
Introduction
What is optimization?
◮ practical point of view: finding the best solution to a problem;
◮ mathematically: finding the minimum (or maximum) of a function.
Optimization is an extremely important discipline in most fields:
◮ physics and engineering;
◮ economy, finance and management;
◮ logistic and transportation;
◮ energy and environment;
◮ medicine and biology;
◮ ordinary life;
◮ etc ...
Control design can be seen as an optimization problem: we have to
design the controller in order to
◮ minimize the tracking error;
◮ minimize the effects of disturbances.
Optimization is fundamental in model predictive control.
1 Introduction
2 Basic notions
3 Minimization
Basic notions
Univariate function f : R → R; unique minimum.
×10 4
3
f (x)
-1
f (x∗ )
function
-2 global minimum
local maximum
local minimum
-3
-40 -30 -20 -10 0 10 20
x∗ x
2500
f (x)
function
global minimum
2000
global minimum
1500
1000
500
0
-20 -15 -10 -5 0 5 10
x∗1 x∗2 x
Basic notions
Univariate function f : R → R; infinite number of minima.
×10 8
2
f (x)
function
1.8
global minima
1.6
1.4
1.2
0.8
0.6
0.4
0.2
0
-20 -15 -10 -5 0 5 10 15
3.5
f (x)
3
function
global constrained minimum
2.5
1.5
0.5
-0.5
-1
-1.5
-2
-40 -30 -20 -10 0 10 20
x∗ x
Basic notions
Univariate function f : R → R; constrained optimization.
3.5
f (x)
3
function
global constrained minimum
2.5
1.5
0.5
-0.5
-1
-1.5
-2
-40 -30 -20 -10 0 10 20
x∗ x
3.5
f (x)
3
function
global constrained minimum
2.5
1.5
0.5
-0.5
-1
-1.5
-2
-40 -30 -20 -10 0 10 20
x∗ x
Alternative notation:
x∗ = arg min f (x) = −20
subject to: − 20 ≤ x ≤ 15
Basic notions
Multivariate function f : Rn → R; constrained optimization.
3
f (x1 , x2 )
-1
-2
20
-20
10 20
-40 -10 0
x2 -40 -30 -20
x1
n o
⊤
X = x = [x1, x2 ] : −45 ≤ x1 , x2 ≤ 20 ⊂ R2
x∗ = arg minf (x) =?
x∈X
f (x∗ ) = minf (x) =?
x∈X
Basic notions
Multivariate function f : Rn → R; constrained optimization.
20 4
10 3
0
2
-10
x2
1
-20
0
-30
-1
-40
-2
-40 -30 -20 -10 0 10 20
x1
n o
⊤
X = x = [x1, x2 ] : −45 ≤ x1 , x2 ≤ 20 ⊂ R2
−30
x∗ = arg minf (x) =
x∈X −30
f (x∗ ) = minf (x) = −2
x∈X
Basic notions
Feasibility
2 Basic notions
3 Minimization
Minimization
A simple univariate example
It follows that
x∗ = arg minf (x) = −5
x∈R
f (x∗ ) = minf (x) = −460.
x∈R
Minimization
Minimization
A simple bivariate example
20 4 20 4
10 3 10 3
x+
o
0
x 0
2 2
-10 -10
xo
x2
x2
1 1
-20 -20
0 0
-30 -30
-1
x∗ -1
-40 -40
-2 -2
-40 -30 -20 -10 0 10 20 -40 -30 -20 -10 0 10 20
x1 x1
↑ ↑
local minimum found global minimum found
Minimization
Important is the class of convex functions:
◮ for these functions every local minimum is a global minimum;
◮ numerical algorithms can find a global minimum.
80 8
10 3
60
7
0 40
2 6
20
-10 5
x2
x2
1 0
4
-20
-20
0
3
-40
-30
-60 2
-1
-80 1
-40
-2 -100
-40 -30 -20 -10 0 10 20 -100 -80 -60 -40 -20 0 20 40 60 80 100
x1 x1
↑ ↑
non-convex function convex function
Carlo Novara
Politecnico di Torino
Outline
1 Introduction
3 Mathematical formulation
5 NMPC properties
8 Discussion
1 Introduction
3 Mathematical formulation
5 NMPC properties
8 Discussion
Introduction
1 Introduction
3 Mathematical formulation
5 NMPC properties
8 Discussion
Nonlinear model predictive control
ẋ = f (x, u) (1)
x(tk ), tk = Ts k, k = 0, 1, . . .
u(τ ) = u(t + Tc ), τ ∈ [t + Tc , t + Tp ].
where 0 ≤ Ts ≤ Tc ≤ Tp .
Nonlinear model predictive control
In this prediction, u is an open-loop input, in the sense that it is a
generic input, which does not depend on x.
3 Mathematical formulation
5 NMPC properties
8 Discussion
subject to:
˙ ) = f (x̂(τ ), u(τ )) ,
x̂(τ x̂(t) = x(t)
(2)
x̂(τ ) ∈ Xc , ∀τ ∈ [t, t + Tp ]
u(τ ) ∈ Uc , ∀τ ∈ [t, t + Tc ]
u(τ ) = u(t + Tc ), ∀τ ∈ [t + Tc , t + Tp ]
c = (c1 , . . . , cm ) ∈ Rnu ×m .
At each time t = tk , the following optimization problem is solved:
3 Mathematical formulation
5 NMPC properties
8 Discussion
NMPC algorithm
subject to:
˙ ) = f (x̂(τ ), u(τ )) ,
x̂(τ x̂(t) = x(t)
x̂(τ ) ∈ Xc , ∀τ ∈ [t, t + Tp ]
u(τ ) ∈ Uc , ∀τ ∈ [t, t + Tc ]
u(τ ) = u(t + Tc ), ∀τ ∈ [t + Tc , t + Tp ].
Pm
◮ Optimal open-loop input: u∗ (τ ) = ∗
i=1 ci φ(τ ).
◮ Closed-loop control law: u(τ ) = u∗ (tk ), ∀τ ∈ [tk , tk+1 ].
plant: ẋ = f (x, u)
nmpc law: algorithm shown in the previous slide.
◮ The NMPC algorithm contains a model of the plant, that is used for
prediction.
◮ The model is of the form ẋ = fˆ(x, u). In the nominal case, fˆ = f .
◮ It is important to not confuse the prediction model with the plant.
NMPC design
Parameters choice
Trial and error (in simulation): Change the values of Qii , Rii and
Pii , until the requirements are satisfied.
1 Introduction
3 Mathematical formulation
5 NMPC properties
8 Discussion
NMPC properties
Stability
x̂(t + Tp ) ∈ Ω
Theorem
Consider a constant r̄ ∈ Ω such that f (r̄, ū) = 0 for some ū. Assume that a
function u(x) exists such that u(r̄) = ū, u(x) ∈ Uc ∀x ∈ Ω and
2 2 2
∇x kr̄ − xkP f (x, u(x)) + kr̄ − xkQ + kūkR ≤ 0, ∀x ∈ Ω.
NMPC properties
Robustness
3 Mathematical formulation
5 NMPC properties
8 Discussion
This system has relative degree γ = 2 and, with R > 0, an as. st.
internal dynamics.
Closed-loop performance
1 Introduction
3 Mathematical formulation
5 NMPC properties
8 Discussion
Example: space rendezvous
A space rendezvous is an orbital maneuver in which two spacecrafts
(one is often a space station) approach to a very close distance.
Suppose that a space station is traveling on some circular orbit and a
spacecraft has to move a point located near a specific side of the
station, to allow a subsequent docking maneuver.
◮ State constraints must be imposed to avoid collisions.
◮ Input constraints are present, due to thruster saturation.
rendezvous docking
ẍ1 = 3ω 2 x1 + 2ω ẋ2 + u1
ẍ2 = −2ω ẋ1 + u2
ẍ3 = −ω 2 x3 + u3
NMPC design:
◮ Ts = 3 s, Tp = Tc = 70 s;
◮ polynomial input parametrization, with m = 1;
◮ weight matrices: Q = 0, R = 105 I, P = I;
◮ constraints:
safety sphere around
⋆ Xc = {x : k(x1 , x2 , x3 )k > 50} ←
the space station;
⋆ Uc = {u : kuk∞ ≤ 1} ← thruster saturation.
◮ reference: r = (400, 0, 0, 0, 0, 0) ← docking starting point.
3 Mathematical formulation
5 NMPC properties
8 Discussion
Discussion
Advantages and drawbacks of NMPC
Advantages:
◮ general and flexible;
◮ constraints and input saturation accounted for;
◮ efficient management of the performance/input activity trade-off;
◮ optimal trajectories (over a finite time interval).
Drawbacks:
◮ problems in the case unstable zero-dynamics;
◮ possible local minima in the optimization problem;
◮ high on-line computational cost.
Nonlinear control and aerospace applications
Carlo Novara
Politecnico di Torino
Tel. +39 011 5647019
Email: [email protected]
Outline
1 Introduction
2 Overview
Introduction
The fields in which satellites are used are numerous:
◮ telecommunications
◮ scientific research
◮ meteorology
◮ environment monitoring
◮ etc.
Satellite weight: from several kilos to tens of tons.
Satellite life:
◮ reaching transfer orbit
◮ reaching mission orbit
◮ checking of instrumentation
◮ mission.
Introduction
Orbits:
◮ low Earth orbit (180 to 2 000 km above the Earth surface)
◮ mid Earth orbit (2 000 to 35 000 km)
◮ high Earth orbit (≥ 35 000 km).
Introduction
Introduction
Overview
Rotations
Carlo Novara
Politecnico di Torino
Outline
1 Introduction
2 Reference frames
4 Euler angles
5 Rotation matrices
7 Quaternions
8 Changes of representation
1 Introduction
2 Reference frames
4 Euler angles
5 Rotation matrices
7 Quaternions
8 Changes of representation
Introduction
1 Introduction
2 Reference frames
4 Euler angles
5 Rotation matrices
7 Quaternions
8 Changes of representation
Reference frames
Definition
An orthogonal frame of reference R = {O, i, j, k} (or Cartesian coordinate
system) is formed by an origin O and a set of three unitary vectors {i, j, k}
with origin in O, that are mutually orthogonal.
Reference frames
r = xi + yj + zk ← physical vector
Reference frames
Vector representations
r = ~v = xi + yj + zk ← physical vector
x
r = y ← column vector.
x
The physical vector is often denoted with ~v . For simplicity, we use the
same symbol r for both the physical and the column vector.
Reference frames
Vector representations: example
Consider two RFs:
◮ F1={O, I, J, K}, with axes X, Y, Z.
◮ F2={O, i, j, k}, with axes x, y, z.
The physical vector
r = −0.45I + 0.04J + 0.19K = −0.4i − 0.24j + 0.16k
has two different representations (column vectors):
[−0.45 0.04 0.19]T and [−0.4 − 0.24 0.16]T .
1 Introduction
2 Reference frames
4 Euler angles
5 Rotation matrices
7 Quaternions
8 Changes of representation
Direction cosine matrices
X = R · I = (Ro + r) · I = Xo + xI · i + yI · j + zI · k
Y = R · J = (Ro + r) · J = Yo + xJ · i + yJ · j + zJ · k
Z = R · K = (Ro + r) · K = Zo + xK · i + yK · j + zK · k.
In matrix form:
X − Xo x I·i I·j I·k
.
Y − Yo = T y , T = J · i J · j J · k .
Z − Zo z K·i K·j K·k
I · i = cos θ = J · j
I · j = cos( π2 + θ) = − sin θ = −J · i
It follows that
X cos θ − sin θ x
= .
Y sin θ cos θ y
2 Reference frames
4 Euler angles
5 Rotation matrices
7 Quaternions
8 Changes of representation
Euler angles
In three dimensions, we define the elementary rotation matrices:
1 0 0
. rotation about X (or x)
T1 (φ) = 0 cφ −sφ
through an angle φ.
0 sφ cφ
cθ 0 sθ
. rotation about Y (or y)
T2 (θ) = 0 1 0
through an angle θ
−sθ 0 cθ
cψ −sψ 0
. rotation about Z (or z)
T3 (ψ) = sψ cψ 0
through an angle ψ
0 0 1
Euler angles
Example: 3D elementary rotation of an hyper-rectangle
Euler angles
Tait–Bryan 123:
X x
Y = T123 y
Z z
.
where T123 (φ, θ, ψ) = T1 (φ)T2 (θ)T3 (ψ) is the rotation matrix (or
attitude matrix) given by
cθ cψ −cθ sψ sθ
T123 = cφ sψ + sφ sθ cψ cφ cψ − sφ sθ sψ −sφ cθ .
sφ sψ − cφ sθ cψ sφ cψ + cφ sθ sψ cφ cθ
Euler angles
Tait–Bryan 321:
X x
Y = T321 y
Z z
.
where T321 (ψ, θ, φ) = T3 (ψ)T2 (θ)T1 (φ) is the rotation matrix
cθ cψ −cφ sψ + sφ sθ cψ sφ sψ + cφ sθ cψ
T321 = cθ sψ cφ cψ + sφ sθ sψ −sφ cψ + cφ sθ sψ .
−sθ sφ cθ cφ cθ
Euler angles
Euler angles
Extrinsic and intrinsic rotations
2 Reference frames
4 Euler angles
5 Rotation matrices
7 Quaternions
8 Changes of representation
Rotation matrices
Properties
T⋄ are orthogonal matrices, that is, square matrices with real entries
whose columns are orthonormal vectors.
Main property:
T
T−1
⋄ = T⋄ , TT⋄ T⋄ = T⋄ TT⋄ = I.
Rotation matrices
Singularities
Three-gimbal system:
used on boats and
inertial platforms.
Rotation matrices
Singularities
Critical situations:
◮ Tait–Bryan rotations: cos θ = 0;
◮ proper Euler rotations: sin θ = 0.
2 Reference frames
4 Euler angles
5 Rotation matrices
7 Quaternions
8 Changes of representation
Te1 = e1 .
This means that e1 has the same components in the original and rotated
reference frames. The claim follows. 2
From this theorem, it follows that any rotation can be described by 2
quantities, involving 4 variables:
- a rotation angle (1 variable)
← angle-axis representation.
- a rotation axis (3 variables)
Euler’s rotation theorem
Example
, , = 3 2 3 2 3 1
T123 − .
6 3 4 8√ 8
√ √4
− 82 5 2
8 4
3
1 Introduction
2 Reference frames
4 Euler angles
5 Rotation matrices
7 Quaternions
8 Changes of representation
Quaternions
The Euler parameters form a quaternion.
Quaternions are mathematical objects introduced by the Irish
mathematician Hamilton that are
◮ a generalization of complex numbers to a 3D-space;
◮ efficient rotation operators.
Advantages wrt Euler angles/rotation matrices:
◮ more efficient from a computational point of view;
◮ less sensitive to rounding errors;
◮ gimbal lock avoided.
Definition
Quaternions are elements of a 4D linear space with basis {1, i, j, k}, where
the basis vectors satisfy the following multiplication rules:
i2 = j2 = k2 = i ⊗ j ⊗ k = −1
i ⊗ j = −j ⊗ i = k
j ⊗ k = −k ⊗ j = i
k ⊗ i = −i ⊗ k = j.
Quaternions
The following notations are equivalent to indicate a quaternion q:
q = q0 + q1 i + q2 j + q3 k
= q0 + q
= cos β2 + u sin β2
β
= eu 2
β β β β
= cos 2 , u1 sin 2 , u2 sin 2 , u3 sin 2
= (q0 , q1 , q2 , q3 )
cos β2
q0
= (q0 , q) = =
q u sin β2
◮ q0 is the real part,
◮ q is the imaginary (or vector) part.
◮ A quaternion with null real part is said pure.
Quaternions
Algebra
. β β β
q∗ = q0 − q = (q0 , −q) = cos − u sin = e−u 2 .
2 2
The norm of a quaternion is
v
u 3
p uX
|q| = kqk = kqk2 = |q∗ | = q · q∗ = t qi2 .
i=0
q−1 = q∗ / |q|
q−1 = q∗ for a unit quaternion.
Quaternions
Algebra
Sum: q + p = q0 + p0 + q + p.
Dot product: q · p = 3i=0 qi pi .
P
q ⊗ p = (q0 + q) ⊗ (p0 + p) = . . .
= (q0 p0 − q · p) + (q0 p + p0 q + q × p)
P3
q·p= i=1 qi pi dot product
q 2 p 3 − q 3 p2
q × p = q 3 p 1 − q 1 p3 cross product.
q 1 p 2 − q 2 p1
.
◮ The identity element is I = (1, 0): q ⊗ I = q, I ⊗ q = q.
◮ The quaternion product is associative, non-commutative.
◮ The cross product is non-associative, anti-commutative.
Quaternions
Algebra
q ⊗ p = (q0 p0 − q · p) + (q0 p + p0 q + q × p)
−qT
q0 p0
=
q q0 I + q× p
−pT
p0 q0
= .
p p0 I − p× q
Quaternions
Rotations
r′ = T(β, u)r.
β β β β
Let q = cos 2 , u1 sin 2 , u2 sin 2 , u3 sin 2 be the unit quaternion
corresponding to this rotation.
Theorem
The rotated vector r′ can be computed as follows:
(0, r′ ) = q ⊗ rq ⊗ q∗ .
Quaternions
Rotations
T =T1 T2 . . . Tn ,
q = q 1 ⊗ q 2 ⊗ · · · ⊗ qn
q−1 = q∗ .
Quaternions
Rotations
Elementary rotations:
φ φ
T1 (φ) ↔ q1 (φ) = cos 2 , sin 2 , 0, 0
Quaternions
Example: 3D generic rotation of an hyper-rectangle
2 Reference frames
4 Euler angles
5 Rotation matrices
7 Quaternions
8 Changes of representation
Changes of representation
Changes of representation
Note
In Matlab, atan2(0, 0) = 0.
Changes of representation
DCM↔ angle-axis
Angle-axis → DCM:
u21 (1 − cβ) + cβ u1 u2 (1 − cβ) − u3 sβ u1 u3 (1 − cβ) + u2 sβ
T = u1 u2 (1 − cβ) + u3 sβ u22 (1 − cβ) + cβ u2 u3 (1 − cβ) − u1 sβ .
u1 u3 (1 − cβ) − u2 sβ u2 u3 (1 − cβ) + u1 sβ u23 (1 − cβ) + cβ
Changes of representation
DCM↔ quaternions
Quaternions → DCM:
q02 + q12 − q22 − q32 2(q1 q2 − q0 q3 ) 2(q1 q3 + q0 q2 )
T = 2(q1 q2 + q0 q3 ) q0 − q12 + q22 − q32
2
2(q2 q3 − q0 q1 ) .
2(q1 q3 − q0 q2 ) 2(q2 q3 + q0 q1 ) q02 − q12 − q22 + q32
Quaternions ↔ angle-axis
β = 2 arccos q0
ui = qi / sin β2 .
Changes of representation
Examples
Changes of representation
Examples
Attitude kinematics
Carlo Novara
Politecnico di Torino
Outline
1 Introduction
2 Vector derivative
5 Quaternion kinematics
6 Discussion
1 Introduction
2 Vector derivative
5 Quaternion kinematics
6 Discussion
Introduction
Introduction
Introduction
2 Vector derivative
5 Quaternion kinematics
6 Discussion
Vector derivative
We recall that
0 −ω3 ω2
. cross product
ω× = ω3 0 −ω1 ←
matrix.
−ω2 ω1 0
1 Introduction
2 Vector derivative
5 Quaternion kinematics
6 Discussion
Thus,
b1
ṪT + TT ω× b2 = 0.
b3
ṪT + TT ω× = 0.
Ṫ = ω × T.
1 Introduction
2 Vector derivative
5 Quaternion kinematics
6 Discussion
Euler angle kinematics
The goal is to describe the time evolution of the rotation Euler angles
in function of ω1 , ω2 , ω3 .
For example, for a Tait-Bryan 321 intrinsic rotation, the axes of F1 are
X ′ , Y ′ , Z, while the axes of F2 are X ′′ , Y ′ , Z ′ , with X ′′ = x.
1 Rotation IF → F1:
◮ F1 is rotated wrt IF of an angle ψ about the Z axis.
◮ In IF, the angular velocity due to the ψ rotation is ω ψI = [0 0 ψ̇]T .
◮ Coordinate transformations:
⋆ T3 (ψ): F1 → IF,
⋆ T3 (ψ)T = T3 (−ψ): IF → F1.
◮ In F1, the angular velocity is ω ψ1 = T3 (−ψ) ω ψI = ω ψI .
Euler angle kinematics
Tait-Bryan 321
ω θ1 = [0 θ̇ 0]T .
ω θ2 = T2 (−θ) ω θ1 = ω θ1 .
ω ψ2 = T2 (−θ) ω ψ1 = T2 (−θ) ω ψI .
ω φ2 = [φ̇ 0 0]T .
ω φB = T1 (−φ) ω φ2 = ω φ2 .
ω θB = T1 (−φ) ω θ2 = T1 (−φ) ω θ1 .
ω = ω φB + ω θB + ω ψB
For the Tait-Bryan 321 rotation with angles (ψ, θ, φ), simple
calculations yield
ω1 1 0 −sθ φ̇
ω2 = 0 cφ sφ cθ θ̇ .
ω3 0 −sφ cφ cθ ψ̇
Similarly, for the Tait-Bryan 123 rotation with angles (φ, θ, ψ),
ω1 cθ cψ sψ 0 φ̇
ω2 = −cθ sψ cψ 0 θ̇
ω3 sθ 0 1 ψ̇
φ̇ cψ −sψ 0 ω1
θ̇ = 1 cθ sψ cθ cψ 0 ω2 .
cθ
ψ̇ −sθ cψ sθ sψ cθ ω3
Similarly, for the proper Euler 313 rotation with angles (φ, θ, ψ),
ω1 sθ sψ cψ 0 φ̇
ω2 = sθ cψ −sψ 0 θ̇
ω3 cθ 0 1 ψ̇
φ̇ sψ cψ 0 ω1
θ̇ = 1 sθ cψ −sθ sψ 0 ω2 .
sθ
ψ̇ −cθ sψ −cθ cψ sθ ω3
2 Vector derivative
5 Quaternion kinematics
6 Discussion
Quaternion kinematics
Note that both the quaternion and the angular speed change in time:
q ≡ q(t)
ω = (ω1 , ω2 , ω3 ) ≡ ω(t).
At time t + ∆t, we have the rotation q(t) at time t composed with the
rotation ∆q(t) occurred from time t to time t + ∆t.
q⊗(∆q−(1,0)) q⊗((1,ω∆t/2)−(1,0))
= lim∆t→0 ∆t = lim∆t→0 ∆t .
Quaternion kinematics
. Defining ω q = (0, ω),
Consider that 1, ω∆t
2 − (1, 0) = 0, ω∆t
2
q⊗(0, ω∆t
2 )
q̇ = lim∆t→0 ∆t = 21 q ⊗ (0, ω) ⇒ q̇ = 1
2 q ⊗ ωq .
2 Vector derivative
5 Quaternion kinematics
6 Discussion
Discussion
ẋ = f (x, ω)
where x = T, x = (φ, θ, ψ) or x = q.
Example
Attitude dynamics
Carlo Novara
Politecnico di Torino
Outline
1 Introduction
2 Angular momentum
3 Inertia matrix
6 Dynamic-kinematic equations
1 Introduction
2 Angular momentum
3 Inertia matrix
6 Dynamic-kinematic equations
Introduction
Introduction
2 Angular momentum
3 Inertia matrix
6 Dynamic-kinematic equations
Angular momentum
Ri = Ro + ri
Ṙi = Ṙo + [ṙi ]B + ω × ri
where
Ri = Xi1 + Y i2 + Zi3
R o = Xo i1 + Y o i2 + Z o i3
= −Ṙo × mi ri + ri × mi (ω × ri ) .
Angular momentum
2 Angular momentum
3 Inertia matrix
6 Dynamic-kinematic equations
Inertia matrix
Performing the products and using a matrix notation, from the above
expression we obtain
J11 J12 J13 ω1
H = J21 J22 J23 ω2 = Jω
J31 J32 J33 ω3
J11 = RB y 2 + z 2 dm
R
R
J12 = J21 = − RB xy dm
J13 = J31 = − RB xz dm products of inertia.
J23 = J32 = − B yz dm
J = TT J′ T
J1 0 0
◮ J= 0 J2 0 : diagonal inertia matrix;
0 0 J3
′
◮ J′ = Jij : non-diagonal inertia matrix;
◮ T = [e1 e2 e3 ]
⋆ ei : eigenvectors of J′ ;
⋆ T is a rotation matrix, since J′ is real and symmetric.
2 Angular momentum
3 Inertia matrix
6 Dynamic-kinematic equations
Ḣ = M.
h i
Since Ḣ = Ḣ + ω × H, we obtain the Euler moment equation:
B
h i
Ḣ + ω × H = M.
B
h i
Considering that H = Jω and Ḣ = Jω̇, the Euler moment
B
equation can be written as
Jω̇ + ω × Jω = M.
Jω̇ = M − ω × Jω.
J1 ω̇1 + (J3 − J2 ) ω2 ω3 = M1
J2 ω̇2 + (J1 − J3 ) ω1 ω3 = M2
J3 ω̇3 + (J2 − J1 ) ω1 ω2 = M3 .
J2 − J3 J3 − J1 J1 − J2
σ1 = , σ2 = , σ3 = .
J1 J2 J3
These equations are nonlinear: in general, no analytical solution is
available.
1 Introduction
2 Angular momentum
3 Inertia matrix
6 Dynamic-kinematic equations
J1 ω̇1 + ω2 ω3 (J3 − J1 ) = 0
J1 ω̇2 + ω1 ω3 (J1 − J3 ) = 0
J3 ω̇3 = 0.
It follows that:
1 The body rotates with constant velocity about the symmetry axis z.
2 The equations become linear, allowing a complete theoretical analysis
and the calculation of the analytical solution.
Free motion for a symmetric body
1
Notation: |·| = k·k = k·k2 .
ω̈1 + λ2 ω1 = 0
It follows that:
1 ω1 always remains bounded (without converging to the origin).
2 In particular, ω1 is an harmonic signal.
ω̇1 (0)
ω1 (t) = ω1 (0) cos(λt) + sin(λt).
λ
ω̇1 (0)
ω2 (t) = ω1 (0) sin(λt) − cos(λt).
λ
Other properties:
◮ M =0 ⇒ H = const.
◮ It can be shown that
⋆ H, ω and b3 always lie on a plane;
⋆ the angle θh between b3 and H (nutation angle) is given by
p
J1 ω12 + ω22
tan θh = = const;
J3 ω 3
⋆ the angle γω between b3 and ω is given by
p
ω12 + ω22
tan γω = = const.
ω3
J 3 > J1 = J 2 J 3 < J1 = J 2
ω3 is constant;
ω1 and ω2 are harmonic signals;
trajectory of ω close to the z axis;
trajectory of (ω1 , ω2 ) = combination
of harmonic curves → ellipse;
ω draws the body cone.
Free motion for an asymmetric body
Suppose that
◮ M = 0 (free motion = free response = homogeneous equation);
◮ J1 6= J2 6= J3 6= J1 (asymmetry).
Differentiating
r the first, using the second and defining
J3 J3
γ = ωo 1 − J1 1 − J2 , we obtain
ω̈1 + γ 2 ω1 = 0.
It follows that:
1 The motion about the minor and major principal axis is stable.
2 The motion about the intermediate principal axis is unstable.
Free motion for an asymmetric body
1 Introduction
2 Angular momentum
3 Inertia matrix
6 Dynamic-kinematic equations
Dynamic-kinematic equations
Dynamic-kinematic equations
φ 0 0 0 1 sφ tθ cφ tθ
θ
0 0 0 0 cφ −sφ
ψ 0 0 0 0 sφ/cθ cφ/cθ
x= , A (x) =
ω1
0 0 0 0 σ1 ω3 0
ω2 0 0 0 σ2 ω3 0 0
ω3 0 0 0 σ3 ω2 0 0
0 0 0
0 0 0
M1
0 0 0
u = M2 , B =
.
1/J1 0 0
M3
0 1/J2 0
0 0 1/J3
Dynamic-kinematic equations
Tait-Bryan 123
φ 0 0 0 cψ/cθ −sψ/cθ 0
θ
0 0 0 sψ cψ 0
ψ 0 0 0 −tθ cψ tθ sψ 1
x= , A (x) =
ω1
0 0 0 0 σ1 ω3 0
ω2 0 0 0 σ2 ω 3 0 0
ω3 0 0 0 σ3 ω 2 0 0
0 0 0
0 0 0
M1
0 0 0
u = M2 , B = .
1/J1 0 0
M3
0 1/J2 0
0 0 1/J3
Dynamic-kinematic equations
Proper Euler 313
φ 0 0 0 sψ/sθ cψ/sθ 0
θ
0 0 0 cψ −sψ 0
ψ 0 0 0 −ctθ sψ −ctθ cψ 1
x= , A (x) =
ω1
0 0 0 0 σ1 ω3 0
ω2 0 0 0 σ2 ω3 0 0
ω3 0 0 0 σ3 ω2 0 0
0 0 0
0 0 0
M1
0 0 0
u = M2 , B =
.
1/J1 0 0
M3
0 1/J2 0
0 0 1/J3
Dynamic-kinematic equations
Quaternions
Red: initial position. Blue: position after 11.72, 18.76, 30.48, 37.52 s.
The rotation is always about an axis close to the x axis.
Dynamic-kinematic equations
Example: free rotational motion of an hyper-rectangular body
Red: initial position. Blue: position after 11.72, 18.76, 30.48, 37.52 s.
After a certain time, the rotation axis tends to diverge from the y axis.
Dynamic-kinematic equations
Example: free rotational motion of an hyper-rectangular body
Red: initial position. Blue: position after 11.72, 18.76, 30.48, 37.52 s.
The rotation is always about an axis close to the z axis.
Dynamic-kinematic equations
Example: free rotational motion of an hyper-rectangular body
Red: initial position. Blue: position after 11.72, 18.76, 30.48, 37.52 s.
After a certain time, the rotation axis get close to the x axis.
Nonlinear control and aerospace applications
Attitude control
Carlo Novara
Politecnico di Torino
Outline
1 Introduction
2 Sensors
3 Actuators
4 Control methods
6 Regulation
Application: satellite attitude regulation
7 Tracking
Application: WMAP attitude control
1 Introduction
2 Sensors
3 Actuators
4 Control methods
6 Regulation
Application: satellite attitude regulation
7 Tracking
Application: WMAP attitude control
Introduction
2 Sensors
3 Actuators
4 Control methods
6 Regulation
Application: satellite attitude regulation
7 Tracking
Application: WMAP attitude control
Sensors
2 Sensors
3 Actuators
4 Control methods
6 Regulation
Application: satellite attitude regulation
7 Tracking
Application: WMAP attitude control
Actuators
Actuators
2 Sensors
3 Actuators
4 Control methods
6 Regulation
Application: satellite attitude regulation
7 Tracking
Application: WMAP attitude control
Control methods
unstable.
◮ Environment perturbations (for instance the gravity gradient torques,
aerodynamic torques) can lead to stable attitude and rate equilibriums.
◮ In the case of large perturbations and/or perturbations with nonzero
mean, passive control needs the assistance of active control.
Control methods
Active control applies suitable and explicit torques to guide and keep
the attitude and angular rate close to suitable reference values.
◮ Typically based on thrusters.
◮ It can both stabilize and manoeuvre the spacecraft attitude.
Control methods
1 Introduction
2 Sensors
3 Actuators
4 Control methods
6 Regulation
Application: satellite attitude regulation
7 Tracking
Application: WMAP attitude control
Attitude control: a general setting
Consider a rigid body with inertia matrix J, subject to a rotational
motion. For this body, define (body frame coordinates):
◮ ω = (ω1 , ω2 , ω3 ): angular velocity;
◮ q = (q0 , q)= (q0 , q1 , q2 , q3 ): quaternion representing the attitude;
◮ x = (q, ω): state;
◮ u = (u1 , u2 , u3 ): external moment.
The general goal of control is to make the state vector (q, ω) track
some time-varying reference vector (qr , ω r ).
It is thus important to measure the distance between the reference and
the actual state. To this aim, we define:
◮ the angular speed tracking error
.
ω̃ = ω r − ω;
q̇ = 21 q ⊗ ω q = −q · ω + q0 ω + q × ω
(q̇)−1 = −q · ω − q0 ω − q × ω
= − (−ω · (−q) + q0 ω + ω × (−q)) = − 21 ω q ⊗ q−1 .
d
Since quat. inversion is a linear operation, (q̇)−1 = dt q−1 = q̇−1 .
It follows that
1
q̇−1 = − ω q ⊗ q−1 .
2
The time derivative of q̃ is thus given by
q̃˙ = d −1
dt q ⊗ qr + q−1 ⊗ q̇r = − 21 ω q ⊗ q−1 ⊗ qr
+ 12 q−1 ⊗ qr ⊗ ω qr = − 21 ω q ⊗ q̃ + 21 q̃ ⊗ ω qr .
2 Sensors
3 Actuators
4 Control methods
6 Regulation
Application: satellite attitude regulation
7 Tracking
Application: WMAP attitude control
Regulation
The goal of regulation is
q → qr = const and ω → 0
.
q̃ → I = (1, 0) and ω → 0.
u = kp q̃ − kd ω (R1)
With this law, the state equations of the closed-loop system are
autonomous and can be written as
q̃˙ = − 21 ω q ⊗ q̃
ω̇ = J−1 (−ω × Jω + kp q̃ − kd ω) .
Regulation
This system has two equilibrium points: (q̃0 , q̃, ω) = (±1, 0, 0). Both
signs of q̃0 correspond to the same attitude.
Theorem
The equilibria (±1, 0, 0) of the closed-loop system are loc. asymptotically
stable. Moreover, for any initial condition (q̃0 (0), q̃(0), ω(0)),
Regulation
Other effective control laws are the following:
u = kp sign(q̃0 ) q̃ − kd ω (R2)
u = kp q̃ − kd (1 ± q̃T q̃) ω (R3)
u = kp sign(q̃0 ) q̃ − kd (1 ± q̃T q̃) ω. (R4)
2 Sensors
3 Actuators
4 Control methods
6 Regulation
Application: satellite attitude regulation
7 Tracking
Application: WMAP attitude control
Tracking
s(q, ω, t) = ω̃ + k2 q̃.
Tracking
The derivative is
ṡ = ω̇ r − ω̇ + k2 q̃˙
k2
= ω̇ r + J−1 ω × Jω − J−1 u + 2 (q̃0 ω̃ + q̃ × (ω r + ω)) .
u = us + k1 J tanh(η s).
Tracking
Another sliding mode control law, guaranteeing the shortest
reorientation, is the following:
s(q, ω) = ω̃ + k2 sign(q̃0 ) q̃
us = J ω̇ r + k22 (|q̃0 | ω̃ + sign(q̃0 ) q̃ × (ω r + ω)) + ω × Jω.
(T2)
u = us + k1 J tanh(η s).
The reference angular velocities and angles in SRF are the following:
Orbital dynamics
Carlo Novara
Politecnico di Torino
Outline
1 Introduction
4 Orbit geometry
5 State equations
6 Reference frames
7 Orbital elements
8 Orbit perturbations
1 Introduction
4 Orbit geometry
5 State equations
6 Reference frames
7 Orbital elements
8 Orbit perturbations
Introduction
Introduction
Kepler’s laws:
1 The orbit of a planet is an ellipse with the sun located at one focus.
2 The radius vector drawn from the sun to a planet sweeps out equal
areas in equal time intervals.
⋆ In other words, the areal velocity is constant.
3/2
3 Planetary periods of revolution are proportional to rm , where rm is
the mean distance from the sun.
The Kepler’s laws can be derived from the more general Newton’s laws
(3 laws of motion + 1 law of gravitation).
Introduction
Introduction
Scalars: a, b, A, B ∈ R.
Column vectors:
r1
r = (r1 , . . . , rn ) = [r1 . . . rn ]T = ... ∈ Rn×1 .
rn
Row vectors: rT = [r1 . . . rn ] ∈ R1×n .
Matrices: M ∈ Rn×m .
Products: Pn
r · p = rT p = i=1 ri pi dot product
r 2 p 3 − r3 p 2
r × p = r 3 p 1 − r1 p 3 cross product.
r 1 p 2 − r2 p 1
ℓ2 (Euclidean) norm:
√ √ pPn
|r| = krk = krk2 = r·r= rT r = 2
i=1 ri = r.
1 Introduction
4 Orbit geometry
5 State equations
6 Reference frames
7 Orbital elements
8 Orbit perturbations
The two-body problem
General setting
The Newton’s II law and gravity law yield the following equations:
Gm1 1
v̇0 = r + F0
r3 m0
Gm0 1
v̇1 = − 3 r+ F1
r m1
where r = r1 − r0 is the relative position, r = |r| and constant masses
have been assumed.
r = r1 − r0 (relative position)
v = v1 − v0 (relative velocity)
m0 m1
rc = m0 +m1 r0 + m0 +m1 r1 (CoM position)
m0 m1
vc = m0 +m1 v0 + m0 +m1 v1 (CoM velocity).
The two-body problem
Restricted two-body equation
4 Orbit geometry
5 State equations
6 Reference frames
7 Orbital elements
8 Orbit perturbations
Ė = 0, E = const
v2
◮ E= 2 − µr : total (mechanical) energy per unit mass
v2
2 : kinetic energy per unit mass
◮
µ d
r × v̇ + r × r = r × v̇ = v × v + r × v̇ = (r × v) = 0.
r3 dt
This proves the principle of angular momentum conservation:
ḣ = 0, h = const
h2 − µ r = µ r e cos θ
4 Orbit geometry
5 State equations
6 Reference frames
7 Orbital elements
8 Orbit perturbations
Orbit geometry
Conic sections
The ORE
p
r=
1 + e cos θ
is the equation of a conic section, written in terms of the polar
coordinates r and θ: for θ ∈ [0, 2π], r describes a conic.
A conic section (or simply a conic) is a curve obtained as the
intersection of a cone with a plane.
Orbit geometry
Conic sections
Properties:
◮ the origin is located at one focus
◮ θ is measured from the point on the conic nearest to the focus
◮ p determines the size
◮ e determines the shape.
Orbit geometry
Ellipse
An ellipse is the locus of points the sum of whose distances from two fixed
points (foci) is constant (and = 2a, with a = semi-major axis).
Orbit geometry
Ellipse
Ellipse parameters:
◮ basic: eccentricity: e; semilatus rectum: p
◮ semi-major axis: a = p/(1 − e2 )
√
◮ semi-minor axis: b = a 1 − e2
◮ distance center-focus: c = ae.
Other relevant quantities:
◮ total energy: E = −µ/(2a) < 0
p
◮ velocity: v = 2µ/r − µ/a ← vis-viva equation.
Orbit geometry
Ellipse: parameters of the solar system planets
Orbit geometry
Ellipse: parameters of the Earth
Orbit geometry
Kepler’s laws
∆A r (r ∆θ) r2 θ̇ h
Ȧ = lim = lim = = = const
∆t→0 ∆t ∆t→0 2∆t 2 2
which is the second law.
Let Ap be the total orbital area. Then, the period P of an elliptical
orbit is given by
2
√ s
Ap Ap 2πab 2πa 1 − e 2 a3
P = = = =p = 2π
Ap /P Ȧ h µa(1 − e2 ) µ
Orbit geometry
Parabola
Orbit geometry
Orbit geometry
Discussion
Our study about orbits is based on the equation
r
v̇ + µ 3 = 0. (FR2B)
r
The position trajectory generated by (FR2B) is described by the
equation p
r= . (ORE)
1 + e cos θ
Integrating (FR2B) with z(0) = 0, ż(0) = 0, we obtain the position
r(t) = (x(t), y(t), z(t) = 0), where x(t) and y(t) satisfy (ORE), when
transformed as
p
r(t) = x2 (t) +py 2 (t),
cos θ(t) = x(t)/ x2 (t) + y 2 (t).
Inverse transformation:
x(t) = r cos θ(t)
y(t) = r sin θ(t)
z(t) = 0.
1 Introduction
4 Orbit geometry
5 State equations
6 Reference frames
7 Orbital elements
8 Orbit perturbations
State equations
State equations:
ṙ = v
r
v̇ = −µ .
r3
Alternative:
ẋ1 0 0 0 1 0 0 x1
ẋ2 0 0 0 0 1 0 x2
ẋ3 0 0 0 0 0 1 x3
= .
ẋ4
− rµ3 0 0 0 0 0
x4
ẋ5 0 − rµ3 0 0 0 0 x5
ẋ6 0 0 − rµ3 0 0 0 x6
State equations
Example: Earth orbit about the Sun
State equations
Example: escape velocity
Consider a spacecraft taking off from the surface of the Earth with the
escape velocity (take off angle 45o ).
Parameters (values expressed in the International System of Units):
µ = 0.4e15, ve = 11.2e3.
√ √
Initial state: x0 = [6e6; 0; 0; ve / 2; ve / 2; 0] (perigee).
Numerical integration: [t, x] =ode23tb(@fF RT B , [0, 43200], x0 ).
4 Orbit geometry
5 State equations
6 Reference frames
7 Orbital elements
8 Orbit perturbations
Reference frames
Several reference frames may be associated to an elliptic orbit:
Rl = {P1 , l1 , l2 , l3 };
Ro = {P1 , o1 , o2 , o3 };
Rp = {P0 , p1 , p2 , p3 }.
Reference frames
The LORF frame: origin in P1 ; the following unit vectors:
◮ o1 : instantaneous normalized velocity, on the orbit plane, tangent to
the orbit;
◮ o2 = l2 (orbit pole): perpendicular to the orbit plane;
◮ o3 = o1 × o2 : on the orbit plane.
Reference frames
Reference frames
GE frame:
◮ Î and Ĵ are on the equatorial plane;
◮ Î = Xǫ : vernal equinox: Earth-Sun direction, 1st day of spring;
◮ K̂: polar rotation axis;
◮ ĵ = K̂ × Î: on the equatorial plane.
◮ not rotating with the Earth;
◮ independent on the orbit.
1 Introduction
4 Orbit geometry
5 State equations
6 Reference frames
7 Orbital elements
8 Orbit perturbations
Orbital elements
Orbital elements
The 6 classical orbital elements are 5 independent constant quantities
(a, e, Ω, i, ω), which completely describe the orbit, and one quantity (ν),
which gives the spacecraft position on the orbit.
The true anomaly is usually denoted with ν or θ. The time of perigee passage tp is
sometimes used instead of the true anomaly.
Orbital elements
Example: a communication satellite orbit
Orbital elements
Position, velocity → orbital elements
h = r × v, e = µ1 v × h − rr , Î′ = K̂ × (h/h).
Suppose the 6 orbital elements are known. The semilatus rectum and
the radial position can be computed as
p
p = a(1 − e2 ), r= 1+e cos θ .
Types of orbit
Classification I
1 Introduction
4 Orbit geometry
5 State equations
6 Reference frames
7 Orbital elements
8 Orbit perturbations
Orbit perturbations
Atmospheric drag
Orbital control
Carlo Novara
Politecnico di Torino
Outline
1 Introduction
2 Orbital maneuvers
6 Space applications
Spacecraft launch
Orbit shape change
Orbit inclination change
Orbit rotation
Set-point control
1 Introduction
2 Orbital maneuvers
6 Space applications
Spacecraft launch
Orbit shape change
Orbit inclination change
Orbit rotation
Set-point control
Introduction
1 Introduction
2 Orbital maneuvers
6 Space applications
Spacecraft launch
Orbit shape change
Orbit inclination change
Orbit rotation
Set-point control
Orbital maneuvers
Launch
A payload (a satellite, a probe, a space station, ...) is usually launched
by means of a rocket, which can be single-stage or multistage. Large
propellant amounts are required.
The main launch phases are
1 vertical ascent
2 pitchover maneuver (or turnover maneuver)
3 gravity turn.
Orbital maneuvers
Orbit shape change
The shape of the orbit is changed, maintaining the orbital plane.
Typical is the Hohmann transfer, with two steps:
1 starting orbit → transfer orbit
2 transfer orbit → target orbit.
Orbital maneuvers
Rendezvous
A vehicle is required to approach another vehicle (typically, a space
station).
The relative motion when the two vehicles are close can be described
by the linear Hill-Clohessy-Wiltshire equations.
Docking
Usually docking follows rendezvous. The goal is to bring a vehicle into
physical contact with another vehicle and create a link between them.
Interplanetary flight
Three phases:
1 Earth escape
2 heliocentric orbital transfer
3 planet encounter.
1 Introduction
2 Orbital maneuvers
6 Space applications
Spacecraft launch
Orbit shape change
Orbit inclination change
Orbit rotation
Set-point control
ṙ = v
1
v̇ = −µ rr3 + m (Fd + d + u)
(
0, u=0
ṁ = (1)
−u/ve , u 6= 0
Fd = − 21 ρ CD S v v, ρ = ρ0 exp − r−r
0
H
u = 0 if m ≤ mb
◮ variables: (r,v): spacecraft position and velocity, u: rocket thrust, Fd :
atmosphere drag, ρ: atmosphere density, d: other disturbances, m:
spacecraft mass (body + propellant);
◮ parameters: µ: gravitational parameter, CD : drag coefficient, H: scale
coefficient, S: spacecraft projected area, ρ0 and r0 : reference density and
height, ve : effective exhaust velocity, mb : body mass.
Orbital dynamics model
Orbital dynamics model:
ṙ = v
1
v̇ = −µ rr3 + m (Fd + d + u)
(
0, u=0
ṁ = (1)
−u/ve , u 6= 0
Fd = − 21 ρ CD S v v, ρ = ρ0 exp − r−r
0
H
u = 0 if m ≤ mb
◮ x = (r, v, m) ∈ R7 : state
◮ u ∈ R3 : command input
◮ Fd , d ∈ R3 : disturbances
◮ y: output to control, i.e.,
⋆ physical trajectory (tracking maneuvers)
⋆ constants of motion/orbital elements (proper orbital maneuvers).
The model (1) describes the main aspects of the spacecraft behavior
in all the phases although it makes several approximations:
◮ no solar radiation
◮ simple spacecraft geometry
◮ no thrust delta-pressure
◮ no gravity perturbations
◮ no lift force (launch)
◮ angle of attack = 0 (launch) ...
1 Introduction
2 Orbital maneuvers
6 Space applications
Spacecraft launch
Orbit shape change
Orbit inclination change
Orbit rotation
Set-point control
NMPC additional topics
NMPC with y 6= x
ẋ = f (x, u)
(2)
y = h(x, u)
The predicted output is a function of the “initial” state x(t) and the
input signal:
ŷ (τ ) ≡ ŷ (τ, x(t), u(t : τ )) .
subject to:
˙ ) = f (x̂(τ ), u(τ )) ,
x̂(τ x̂(t) = x(t)
u(τ ) ∈ Uc , ∀τ ∈ [t, t + Tc ]
u(τ ) = u(t + Tc ), ∀τ ∈ [t + Tc , t + Tp ].
Pm
◮ Optimal open-loop input: u∗ (τ ) = ∗
j=1 cj φ(τ ).
◮ Closed-loop control law: u(τ ) = u∗ (tk ), ∀τ ∈ [tk , tk+1 ].
2 Orbital maneuvers
6 Space applications
Spacecraft launch
Orbit shape change
Orbit inclination change
Orbit rotation
Set-point control
y = (a, e, ci) ∈ R5
where
h = r × v, e = µ1 v × h − rr ,
a = h2 /(µ(1 − e2 )), ci = cos i = K̂ · h/h.
The output is related to the orbital elements. Main advantage: it is
not required to specify a reference trajectory or an arrival point.
◮ An optimal trajectory is implicitly found by the NMPC algorithm.
NMPC for orbital control
2 Orbital maneuvers
6 Space applications
Spacecraft launch
Orbit shape change
Orbit inclination change
Orbit rotation
Set-point control
Space applications
Control scheme
spacecraft dynamics: model (1).
nmpc law: algorithm shown in the previous slide.
◮ The NMPC algorithm contains a model of the plant, that is used for
prediction. The prediction model can be different from (1).
◮ Measurement errors: w.
◮ State: x = (r, v, m).
◮ Output: y = (r, v) or y = (a, e, ci).
Space applications
Perturbations/disturbances/errors
Drag model:
Fd = − 12 ρ CD S v v
ρ = ρ0 exp − r−r 0
H
Spacecraft launch
A spacecraft (payload) has to be placed on a low Earth orbit (LEO).
Spacecraft:
◮ spacecraft mass: 4000 kg;
◮ total initial mass (body + fuel): 30000 kg;
◮ engine exhaust velocity is ve = 10 km/s;
◮ no input saturation.
Launch point on the Earth: r(0) = (rE , 0, 0), v(0) = (0, vE , 0), where
rE = 6371 km is the mean Earth radius and vE = 0.465 km/s is the
mean Earth rotation speed at the Equator.
◮ The point is on the Equator. Launch sites are often located close to
the Equator to exploit the Earth rotation speed to save fuel.
Target orbit:
◮ circular orbit: er = (0, 0, 0) (eccentricity vector);
◮ altitude: hr = 500 km, corresponding to a semi-major axis
ar = rE + hr = 6871 km, where rE = 6371 km is the mean Earth
radius;
◮ equatorial plane: cir = 1 (inclination).
Spacecraft launch
Spacecraft launch
NMPC design:
◮ a simplified prediction model is used, not accounting for disturbances
and mass variation during the prediction interval;
◮ output: y = (r, e, ci); using r instead of a allows a faster convergence
to the target orbit;
◮ Ts = 10 s, Tp = Tc = 150 s;
◮ polynomial input parametrization, with m = 1;
◮ weight matrices: Q = 0, R = 0.1 I, P = diag(10, 103 , 103 , 103 , 103 );
◮ tracking error tolerance: tol = (1, 0.01, 0.01, 0.01, 0.01);
◮ no state and input constraints.
Spacecraft launch
Simulation results (closed-loop)
Initial orbit:
◮ semi-major axis: a0 = 6871 km;
◮ eccentricity vector: e0 = (0, 0, 0);
◮ inclination: ci0 = 1.
Target orbit:
◮ semi-major axis: ar = 8932 km;
◮ eccentricity vector: er = (0.25, 0, 0);
◮ inclination: cir = 1.
Orbit shape change
The spacecraft dynamics is described by (1).
The references is
NMPC design:
◮ a simplified prediction model is used, not accounting for disturbances
and mass variation during the prediction interval;
◮ output: y = (a, e, ci); using r instead of a allows a faster convergence
to the target orbit;
◮ Ts = 10 s, Tp = Tc = 50 s;
◮ polynomial input parametrization, with m = 1;
◮ weight matrices: Q = 0, R = 3 I, P = diag(1, 103 , 103 , 103 , 103 );
◮ tracking error tolerance: tol = (2, 0.01, 0.01, 0.01, 0.01);
◮ input saturation: ui ∈ [−132, 132] kg · km/s2 , i = 1, 2, 3;
◮ no state constraints.
Initial orbit:
◮ semi-major axis: a0 = 8.932 km;
◮ eccentricity vector: e0 ≃ (0.25, 0, 0);
◮ inclination: ci0 = 1.
Target orbit:
◮ semi-major axis: ar = 8932 km;
◮ eccentricity vector: er ≃ (0.25, 0, 0);
◮ inclination: cir = 0.9.
NMPC design:
◮ a simplified prediction model is used, not accounting for disturbances
and mass variation during the prediction interval;
◮ output: y = (a, e, ci); using r instead of a allows a faster convergence
to the target orbit;
◮ Ts = 10 s, Tp = Tc = 50 s;
◮ polynomial input parametrization, with m = 1;
◮ weight matrices: Q = 0, R = 3 I, P = diag(1, 103 , 103 , 103 , 104 );
◮ tracking error tolerance: tol = (3, 0.05, 0.05, 0.05, 0.01);
◮ input saturation: ui ∈ [−132, 132] kg · km/s2 , i = 1, 2, 3;
◮ no state constraints.
Orbit inclination change
Simulation results (closed-loop)
Orbit rotation
The goal is to rotate the orbital plane around, while keeping the
inclination fixed.
Spacecraft:
◮ spacecraft mass: 4000 kg;
◮ total initial mass (body + fuel): 12000 kg;
◮ engine exhaust velocity is ve = 4.4 km/s;
◮ input saturation: ui ∈ [−132, 132] kg · km/s2 , i = 1, 2, 3.
Initial orbit:
◮ semi-major axis: a0 = 8.932 km;
◮ eccentricity vector: e0 ≃ (0.25, 0, 0);
◮ inclination: ci0 = 1.
Target orbit:
◮ semi-major axis: ar = 8932 km;
◮ eccentricity vector: er ≃ (0, 0.25, 0);
◮ inclination: cir = 1.
Orbit rotation
The spacecraft dynamics is described by (1).
The references is
NMPC design:
◮ a simplified prediction model is used, not accounting for disturbances
and mass variation during the prediction interval;
◮ output: y = (a, e, ci); using r instead of a allows a faster convergence
to the target orbit;
◮ Ts = 10 s, Tp = Tc = 50 s;
◮ polynomial input parametrization, with m = 1;
◮ weight matrices: Q = 0, R = 0.5 I, P = diag(1, 103 , 103 , 103 , 102 );
◮ tracking error tolerance: tol = (5, 0.015, 0.015, 0.015, 0.015);
◮ input saturation: ui ∈ [−132, 132] kg · km/s2 , i = 1, 2, 3;
◮ no state constraints.
Orbit rotation
Simulation results (closed-loop)
Initial orbit:
◮ initial position: r(0) = (6971, 0, 0) km;
◮ initial velocity: v(0) = (0, 8.4, 0) km/s.
Set-point (reference):
Set-point control
Set-point control
Simulation results (closed-loop)
Exercises
Carlo Novara
Politecnico di Torino
Outline
1 Rotations
2 Attitude kinematics
3 Attitude dynamics
4 Orbital dynamics
5 Orbital control
1 Rotations
2 Attitude kinematics
3 Attitude dynamics
4 Orbital dynamics
5 Orbital control
Exercise 1 (rotations)
TTT = TT T = I.
Exercise 1 (rotations)
Solution
First, note that
b1 b1 · b1 b1 · b2 b1 · b3
b2 · b1 b2 b3 = b1 · b2 b2 · b2 b2 · b3
b3 b1 · b3 b2 · b3 b3 · b3
1 0 0 a1
= 0 1 0 = I; similarly, a2 · a1 a2 a3 = I.
0 0 1 a3
Then,
a1 b 1
I = a2 · a1 a2 a3 = T b 2 · b 1 b2 b3 TT = TTT .
a3 b3
From this identity, TT TTT = TT ⇒ TT T TT = TT , which implies
that TT T = I.
Exercise 2 (rotations)
Solution
Using the Matlab Symbolic Toolbox:
Exercise 3 (rotations)
Exercise 3 (rotations)
Solution
The components of r in F1 can be obtained as follows:
2.0643 3
T
−3.1173 = T212 (φ, θ, ψ) 1 .
−0.1453 2
Exercise 4 (rotations)
Exercise 4 (rotations)
Solution
The required quaternion is q = q∗2 (ψ) ⊗ q∗1 (θ) ⊗ q∗2 (φ), where
2 Attitude kinematics
3 Attitude dynamics
4 Orbital dynamics
5 Orbital control
Solution
A first important observation is that, when ω = const, the kinematic
equations define an LTI system.
The matrix Ω, due to its structure, has pure complex eigenvalues for
any constant ω.
1 Rotations
2 Attitude kinematics
3 Attitude dynamics
4 Orbital dynamics
5 Orbital control
Exercise 6 (attitude dynamics)
Exercise 6: Find:
1 The principal moments of inertia of J′ .
2 The principal axes of inertia of J′ .
3 A reference frame in which J′ is diagonal.
Answers:
1 The principal moments of inertia of J′ are (1500, 2700, 3000).
2 The principal axes of inertia of J′ are e1 , e2 , e3 .
3 A reference frame in which J′ is diagonal is defined by e1 , e2 , e3 .
Exercise 6 (attitude dynamics)
Solution
1 Rotations
2 Attitude kinematics
3 Attitude dynamics
4 Orbital dynamics
5 Orbital control
Exercise 7 (orbital dynamics)
Observing that tan θ + cot θ = 1/(cos θ · sin θ), and summing the two
equations, we obtain the first equation of motion:
r̈ − rθ̇2 + µ/r2 = 0.
Similarly, subtracting the following two equations,
r̈ − rθ̇ − tan θ 2ṙθ̇ + rθ̈ + µ/r2 = 0
2
r̈ − rθ̇2 + cot θ 2ṙθ̇ + rθ̈ + µ/r2 = 0
2ṙθ̇ + rθ̈ = 0.
Consider a system with 2 big bodies (e.g., the Earth and the Moon),
with masses m0 and m2 , and a small body (e.g., a spacecraft), with
mass m1 .
Assume that:
◮ m1 ≪ m0 and m1 ≪ m2 ;
◮ the primary bodies 0 and 2 rotate about their composite CoM in
circular orbits; the CoM is denoted with Oc ;
p
the rotation angular speed is ωp = (µ0 + µ2 )/D3 , where D is the
distance between the two bodies.
Let Fc={Oc , i, j, k} be a reference frame fixed with m0 and m2 :
◮ i, j are on the orbit plane of the primary bodies; i is from m0 to m2 ;
◮ Fc rotates with an angular velocity ωp k.
The position of m1 is expressed as r1 = xi + yj + zk.
Exercise 8 (orbital dynamics)
Let Fc={Oc , i, j, k} be a reference frame fixed with m0 and m2 :
◮ Oc = composite CoM of m0 and m2 ;
◮ i, j are on the orbit plane of the primary bodies; i is from m0 to m2 ;
◮ Fc rotates with an angular velocity ωp k.
The position of m1 is expressed as r1 = xi + yj + zk.
ÿ + ωp2 y
2ωp ẋ − = −µ0 ry3 − µ2 ry3
10 12
z̈ = −µ0 r3 − µ2 rz3 .
z
10 12
Solution
1 Rotations
2 Attitude kinematics
3 Attitude dynamics
4 Orbital dynamics
5 Orbital control
Exercise 9 (orbital control)