Skip to content

Model Predictive Control of a quadrotor for trajectory tracking.

License

Notifications You must be signed in to change notification settings

elena-ecn/quadrotor_mpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

96c6ca9 · May 8, 2023

History

20 Commits
Apr 14, 2023
Apr 13, 2023
Apr 13, 2023
Apr 13, 2023
Apr 13, 2023
May 8, 2023
Apr 13, 2023
Apr 13, 2023
Apr 13, 2023
Apr 13, 2023
Apr 13, 2023
Apr 13, 2023

Repository files navigation

quadrotor_mpc

Trajectory tracking with a quadrotor.

The non-linear dynamics are linearized about a linearization trajectory x ¯ , u ¯ while the quadrotor aims to track a different reference trajectory x r e f , u r e f .


Quadrotor and reference trajectory

The MPC controller solves the following optimization problem :

min x 1 : N , u 1 : N 1 i = 1 N 1 [ ( x i x i , r e f ) T Q ( x i x i , r e f ) + ( u i u i , r e f ) T R ( u i u i , r e f ) ] + 1 2 ( x N x N , r e f ) T Q f ( x N x N , r e f )   s.t. x 1 = x IC   x k + 1 = f ( x ¯ k , u ¯ k ) + [ f x | x ¯ k , u ¯ k ] ( x k x ¯ k ) + [ f u | x ¯ k , u ¯ k ] ( u k u ¯ k ) for  i = 1 , 2 , , N 1   u m i n u i u m a x                                                                                                                                                           for  i = 1 , 2 , , N 1  


Trajectory tracking with MPC controller

Technologies

The project was created with:

  • Python 3.9.0
  • numpy 1.24.2
  • cvxpy 1.3.1
  • matplotlib 3.6.2
  • seaborn 0.12.2
  • pandas 1.5.3
  • jax 0.3.25

Installation

To use this project, install it locally via:

git clone https://github.com/elena-ecn/quadrotor_mpc.git

The dependencies can be installed by running:

pip install -r requirements.txt

To execute the code, run:

python3 main.py

License

The contents of this repository are covered under the MIT License.

About

Model Predictive Control of a quadrotor for trajectory tracking.

Topics

Resources

License

Stars

Watchers

Forks