1 of 13

Autonomous Drone Racing Using Minimum Snap Trajectory Generation and Differential-Flatness Based MPC

Tom Scherlis and Alvin Shek

2 of 13

Problem Background

Quadcopters:

  1. Underactuated
  2. Nonlinear (roll, pitch, yaw)
  3. 6 degrees of freedom
  4. Fast dynamics

3 of 13

Problem Background

Drone Racing:

  • Small, agile quadcopters
  • Trajectory constrained by series of gates
  • Repetitive courses
  • Good test of aggressive quadcopter controls

4 of 13

Solution Overview

Low Level Controller

  • Cascaded PD Controllers for body orientation
  • Reference Trajectory
  • Gate-constrained Minimum Snap Trajectory Generation
  • High Level Controller
  • MPC For the Flat System

t0

t1

t2

t3

5 of 13

Minimum Snap Trajectories:

  • Formulated as 5th order parametric splines

  • Handy feature: integrals are analytically solvable at any order:

  • Thus: can formulate spline optimization as a quadratic programming problem:

  • X: vector of coefficients (A,B,C,D,E,F)�P: precomputed time vectors (t, t2/2, t3/3, etc)

For quadcopters:

  • Minimize snap: 4th derivative of position
    • Reduces pitch/roll rate
  • Optimize for trajectory time separately:

6 of 13

Gate Constraints for spline generation:

Type 1: Position Constraints

Type 2: Direction Constraints

Hard constraint on 0th order waypoints:

At * x = b

At: precomputed vector of ts�X: vector of coefficients:

b: desired position at time t

Constraint on 1st order waypoints:

  1. Compute null space for direction vector.
  2. Constraint for each null space basis vector n:

  • dot(n, Bt*x) = 0

(Bt*x: first derivative at t)

  1. Finally: n*Bt * x = 0

t0

t1

t2

t3

Type 3: Continuity Constraints

Continuity constraints up to 2nd order: (acceleration)

For A,B corresponding to each order in {0,1,2}:

At=end x1 = Bt=0x2

t

t=0

t=end

7 of 13

Minimum snap trajectories: Results

8 of 13

Feedback Linearization and Flat System

Linear and very simple

“Flat outputs”

9 of 13

MPC Controller

Control of flat system is simple, 2nd order dynamics are linear.

  • Implemented as QP problem on discretized, lifted dynamics
  • Implemented 20 Hz, 10-step horizon.

Green: Reference Trajectory

Red: Reference Trajectory (Horizon=N)

Blue: MPC Predicted trajectory

10 of 13

Analysis: LQR with feedforward v.s MPC:

LQR with feedforward: MPC: (position error less than half of LQR)

11 of 13

Cascaded PD attitude Controller

Desired Orientation -> angular velocities -> motor powers

Tuning for max response, minimal overshoot and noise

FlightGoggles Simulator provides ~1kHz inner control loop

20Hz: Orientation Controller

20Hz:

MPC Controller

1kHz:

Angular rate controller

Single-Shot: Trajectory Planner

Gates

Motor torque

12 of 13

Results:

  • Results:
    • Trajectory length: 442 meters
    • Trajectory time: 40 seconds
    • Average speed: 11 m/s (25 mph)
  • Video of a low speed test: https://www.youtube.com/watch?v=uN9TzCkSSKk

13 of 13

What we learned:

  1. Running control in real time is much harder than running offline
    1. Even at 20Hz
  2. Good reference trajectory generation was more complex than expected
  3. Breaking the control problem into multiple layers helps significantly:
    • High level MPC controller
    • Low level attitude controller
  4. MPC outperforms LQR significantly for tracking

Future Work:

  1. ILC for improving tracking performance in repeated trajectories
  2. DAGGER to learn the control law for computationally-limited systems (Like an actual quadcopter)
  3. Adaptive attitude controllers are somewhat common on quadrotors, rather than PD.