Project 1 - Phase 2: Trajectory Planning and Generation

Published:

  • Keywords: Trajectory Planning, Optimization-based Trajectory Generation, Minimum Snap Trajectory, (un)constrained Quadratic Programming
  • Coding language: MATLAB
  • Detailed code implementation can be found in the Github code repo

Trajectory Generation Method

Design the trajectory for quadrotor given the path (waypoints), and calculate desired states given time. Try to make the trajectory smooth and feasible.

  • The trajectory is generated using an optimization-based method (minimum snap trajectory generation). In the actual coding implementation, the built-in function quadprog from MATLAB is used to solve the constrained Quadratic Programming problem.
  • The time allocation is proportional to the length of each segment of the trajectory (weighted average).
  • At the end of the trajectory, the Quadrotor will hover with the final state if the experiment is still ongoing.

Simulation Figures

Path1

p1p2-path1.jpg

Path2

p1p2-path2.jpg

Path3 (self-designed)

p1p2-path3.jpg

Path4 (self-designed)

p1p2-path4.jpg

Controller Statistics

The Controller’s parameters have been optimized based on Project1-Phase1. Currently, the parameters’ values are:

 X_posY_posZ_posRoll_attPitch_attYaw_att
Kp101010300030003000
Kd888100100100
Ki111111

The performances on different paths based on RMSE values:

RMSEPath1Path2Path3Path4
RMSE Position (m)0.0774450.0705510.0846090.12952
RMSE Velocity (m/s)0.130650.102430.128580.16033
RMSE Yaw (deg)1.33411.32321.33021.3326

Result Analysis

After the optimization of the Controller, the path following becomes smoother and more stable. The trajectory generation is also acceptable.

Reference

Some implementations are adapted from this code repository. - GitHub @ Garyandtang - ELEC5660-2021