# Trajectory Optimization

MIT 6.8210: Underactuated Robotics

Spring 2023, Lecture 11

(or later at https://slides.com/russtedrake/spring23-lec11)

Image credit: Boston Dynamics

def optimize_double_integrator(N):
# Discrete-time approximation of the double integrator.
dt = 0.01
A = np.eye(2) + dt * np.mat("0 1; 0 0")
B = dt * np.mat("0; 1")

prog = MathematicalProgram()

# Create decision variables
u = prog.NewContinuousVariables(1, N-1, "u")
x = prog.NewContinuousVariables(2, N, "x")

x0 = [-2, 0]
for n in range(N - 1):
prog.AddConstraint(eq(x[:, n + 1], A.dot(x[:, n]) + B.dot(u[:, n])))
xf = [0, 0]
prog.AddBoundingBoxConstraint(xf, xf, x[:, N - 1])

result = Solve(prog)


https://en.wikipedia.org/wiki/Stall_(fluid_dynamics)

## Dimensional Analysis

• Bird or plane...
• with mass $$m$$, wing area $$S$$, operating in a fluid with density $$\rho$$
• which requires a distance $$x$$ to slow from $$V_0$$ to $$V_f$$
• Distance-averaged drag coefficient:

\langle C_D \rangle = \frac{2m}{\rho S x} \ln \left( \frac{V_0}{V_f}\right)
Vehicle Average C_D
Boeing 747 0.16
X-31 0.3
Cornell Perching Plane 0.25
Common pigeon 10
• A few (very rough) reference points:

## Experiment Design

• Glider (no propellor)
• Flat plate wings
• Dihedral (passive roll stability)
• Offboard sensing and control

## System Identification

• Nonlinear rigid-body vehicle model
• Linear actuator model (+ saturations, delay)
• Real flight data (no wind tunnel)

Lift Coefficient

Drag Coefficient

## Dynamic Model

• Planar dynamics

• Aerodynamics fit from data

• State: $${\bf x} = [x, y, \theta, \phi, \dot{x}, \dot{y}, \dot\theta]$$

• Control: $${\bf u} = \dot\phi$$
• Enters motion capture @ 6m/s
• Perch in < 3.5m away
• Entire trajectory < 1s
Vehicle Average C_D
Boeing 747 0.16
X-31 0.3
Cornell Perching Plane 0.25
Common pigeon 10
Our glider 1.1
Cobra maneuver (Mig) 0.9

By russtedrake

# Lecture 11: Trajectory Optimization

MIT Underactuated Robotics Spring 2023 http://underactuated.csail.mit.edu

• 797