Discrete mechanics, optimal control and formation flying spacecraft Oliver Junge Center for Mathematics Munich University of Technology joint work with Jerrold E. Marsden and Sina Ober-Blöbaum partially supported by the CRC 376 Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.1
Outline mechanical optimal control problem direct discretization of the variational principle ( DMOC ) applications: low-thrust orbital transfer, hovercraft, spacecraft formation flying Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.2
Introduction Optimal control problem mechanical system, configuration space Q, to be moved from (q 0, q 0 ) to (q 1, q 1 ), force f, s.t. J(q, f ) = 1 0 C(q(t), q(t), f (t)) dt min Dynamics: Lagrange-d Alembert principle δ 1 L(q(t), q(t)) dt + 1 0 0 f (t) δq(t) dt = 0 for all δq with δq(0) = δq(1) = 0, Lagrangian L : TQ R. Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.3
Introduction Equality constrained optimization problem Minimize subject to (q, f ) J(q, f ) L(q, f ) = 0. Standard approach: derive differential equations, discretize (multiple shooting, collocation), solve the resulting (nonlinear) optimization problem. Here: discretize the Lagrange-d Alembert principle directly. Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.4
Discretization techniques: comparison cost function + EL cost function + Ld Ap variation discretization discrete cost function + discretized ode Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.5
Discretization techniques: comparison cost function + Ld Ap cost function + EL variation discretization discrete cost function + discretized ode discretization discrete cost function + discrete Ld Ap variation discrete cost function + DEL Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.6
Discretization techniques: comparison cost function + Ld Ap cost function + EL variation discretization discrete cost function + discretized ode finite differences, multiple shooting, collocation,... discretization discrete cost function + discrete Ld Ap variation discrete cost function + DEL Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.7
Discretization techniques: comparison cost function + Ld Ap cost function + EL variation discretization discrete cost function + discretized ode finite differences, multiple shooting, collocation,... discretization discrete cost function + discrete Ld Ap variation discrete cost function + DEL DMOC Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.8
Discrete paths Figure: J.E. Marsden, Lectures on Mechanics Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.9
Discrete paths Figure: J.E. Marsden, Lectures on Mechanics Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.10
Discretization of the variational principle Replace the state space TQ by Q Q, a path q : [0, 1] Q by a discrete path q d : {0, h,..., Nh = 1} Q, the force f : [0, 1] T Q by a discrete force f d : {0, h, 2h,..., Nh = 1} T Q. Discrete Lagrangian L d : Q Q R, virtual work L d (q k, q k+1 ) (k+1)h kh f k δq k + f + k δq k+1 L(q(t), q(t)) dt, (k+1)h f k, f + k T Q: left and right discrete forces. kh f (t) δq(t) dt, Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.11
Discretizing the variational principle Discrete Lagrange-d Alembert principle Find discrete path {q 0, q 1,..., q N } s.t. for all variations {δq 0,..., δq N } with δq 0 = δq N = 0 N 1 L d (q k, q k+1 ) + N 1 δ k=0 k=0 f k δq k + f + k δq k+1 = 0. Forced discrete Euler-Lagrange equations Discrete principle quivalent to D 2 L d (q k 1, q k ) + D 1 L d (q k, q k+1 ) + f + k 1 + f k = 0. k = 1,..., N 1. Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.12
Boundary Conditions We need to incorporate the boundary conditions q(0) = q 0, q(0) = q 0 q(1) = q 1, q(1) = q 1 into the discrete description. Legendre transform FL : TQ T Q FL : (q, q) (q, p) = (q, D 2 L(q, q)), Discrete Legendre transform for forced systems F f + L d : (q k 1, q k ) (q k, p k ), p k = D 2 L d (q k 1, q k ) + f + k 1. Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.13
The Discrete Constrained Optimization Problem Minimize N 1 J d (q d, f d ) = C d (q k, q k+1, f k, f k+1 ), k=0 subject to q 0 = q 0, q N = q 1 and D 2 L(q 0, q 0 ) + D 1 L d (q 0, q 1 ) + f 0 = 0, D 2 L d (q k 1, q k ) + D 1 L d (q k, q k+1 ) + f + k 1 + f k = 0, D 2 L(q N, q N ) + D 2 L d (q N 1, q N ) + f + N 1 = 0, k = 1,..., N 1. Solution by, e.g., sequential quadratic programming. Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.14
Implementation: quadrature q(t) q k+1 q(t) q( t k+t k+1 ) = q k+q k+1 2 2 q k Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.15
Implementation: quadrature Discrete Lagrangian tk+1 tk+1 t k t k tk+1 ( ( tk + t k+1 L q t k 2 ( qk + q k+1 = hl 2 L(q, q) dt L( q(t), q(t)) dt =: L d (q k, q k+1 ) ), q, q k+1 q k 2 ( )) tk + t k+1 ) 2 dt Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.16
Implementation: quadrature Discrete forces (k+1)h kh f δq dt h f k+1 + f k 2 δq k+1 + δq k 2 = h 4 (f k+1 + f k ) δq k + h } {{ } 4 (f k+1 + f k ) } {{ } =:f =:f + k k δq k+1 Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.17
Example: Low thrust orbital transfer Satellite with mass m, to be transferred from one circular orbit to one in the same plane with a larger radius. Number of revolutions around the Earth is fixed. In 2d-polar coordinates q = (r, ϕ) L(q, q) = 1 2 m(ṙ 2 + r 2 ϕ 2 ) + γ Mm, r M: mass of the earth. Force u in the direction of motion of the satellite. Goal minimize the control effort J(q, u) = T 0 u(t) 2 dt. Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.18
Comparison to traditional scheme 0.24 0.22 1 rotation Euler Variational 0.2 0.18 objective function value 0.16 0.14 0.12 0.1 0.08 0.06 0.04 10 15 20 25 30 35 40 45 50 number of nodes Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.19
Comparison to traditional scheme 0.18 0.16 1 rotation Midpointrule Variational 0.14 objective function value 0.12 0.1 0.08 0.06 0.04 5 10 15 20 25 30 35 40 45 50 number of nodes Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.20
Comparison to the true solution 8 7 Euler Variational 6 deviation of final state 5 4 3 2 1 0 5 10 15 20 25 30 35 40 45 50 number of nodes Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.21
Comparison to the true solution 0.4 0.35 Midpointrule Variational 0.3 deviation of final state 0.25 0.2 0.15 0.1 0.05 0 5 10 15 20 25 30 35 40 45 50 number of nodes Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.22
Example: Reconfiguration of a group of hovercraft Hovercraft y θ f 2 f 1 r Configuration manifold: Q = R 2 S 1 Underactuated system, but configuration controllable. Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.23 x
Reconfiguration of a group of Hovercraft Lagrangian L(q, q) = 1 2 (mẋ 2 + mẏ 2 + J θ 2 ), q = (x, y, θ), m the mass of the hovercraft, J moment of inertia. Forced discrete Euler-Lagrange equations ( ) 1 M ( q h k 1 + 2q k q k+1 ) + h fk 1 +f k + f k+f k+1 = 0, (1) 2 2 2 k = 1,..., N. Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.24
Goal Minimize the control effort while attaining a desired final formation: (a) a fixed final orientation ϕ i of each hovercraft, (b) equal distances r between the final positions, (c) the center M = (M x, M y ) of the formation is prescribed, (d) fixed final velocities. Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.25
Results Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.26
Application: Spacecraft Formation Flying ESA: Darwin NASA: Terrestrial Planet Finder SFB 376 Massive Parallelism, Project C10: Efficient Control of Formation Flying Spacecraft Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.27
The Model A group of n identical spacecraft, single spacecraft: rigid body with six degrees of freedom (position and orientation), control via force-torque pair (F, τ) acting on its center of mass. dynamics (as required for Darwin/TPF): circular restricted three body problem Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.28
The Lagrangian Potential energy: 1 µ V (x) = x (1 µ, 0, 0) µ x ( µ, 0, 0), µ = m 1 /(m 1 + m 2 ) normalized mass. kinetic energy: K trans (x, ẋ) = 1 2 (( x 1 ωx 2 ) 2 + ( x 2 + ωx 1 ) 2 + ẋ3 2 ) + K rot (Ω) = 1 2 ΩT JΩ, Ω: angular velocity, J: inertia tensor. Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.29
The Control Problem Goal: compute control laws (F (i) (t), τ (i) (t)), i = 1,..., n, such that within a prescribed time interval, the group moves from a given initial state into a prescribed target manifold, minimizing a given cost functional (related to the fuel consumption). Target manifold: 1. all spacecraft are located in a plane with prescribed normal, 2. the spacecraft are located at the vertices of a regular polygon with a prescribed center on a Halo orbit, 3. each spacecraft is rotated according to a prescribed rotation, 4. all spacecraft have the same prescribed linear velocity and zero angular velocity. Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.30
Collision avoidance Artificial potential 4 3.5 3 2.5 2 1.5 1 0 1 2 3 4 5 L = K trans + K rot V n V a ( q (i) q (j) ). i,j=1 i j Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.31
Halo orbits x 10 3 4 2 0 L 2 z 2 4 E 6 8 10 12 0.01 y 0 0.01 0.999 1.0016 1.0042 x 1.0068 1.0094 1.012 Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.32
Result Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.33
Hierarchical decomposition same model for every vehicle n identical subsystems, coupling through constraint on final state Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.34
Hierarchical optimal control problem min ϕ 1,...,ϕ n n J i (ϕ i ) s.t. g(ϕ) = 0, i=1 (g describes final state) with J(ϕ i ) = optimal solution of 2-point bvp with ϕ i parametrizing the final state Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.35
Parallelization solve inner problems in parallel synchronization (communication) for iteration step in solving the outer problem implementation: PUB ( Paderborn University BSP-Library ) library to support development of parallel algorithms based on the Bulk-Synchronous-Parallel-Model. Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.36
Result Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.37
Conclusion new approach to the discretization of mechanical optimal control problems direct discretization of the underlying variational principle faithful energy behaviour by construction Outlook convergence backward error analysis hierarchical decomposition in time: discontinuous ( weak ) solutions, Pontryagin-d Alembert principle generalization to spatially distributed systems (PDEs) Oliver Junge Discrete mechanics, optimal control and formation flying spacecraft p.38