Quadrotor
Example
Quadrotor/
Where you can find this quadrotor
M. Hehn and R. D’Andrea, “A flying inverted pendulum,” ICRA, Shanghai, China, 2011, pp. 763–770.
Problem Description
-
The state vector of the quadrotor is x = [X,\dot{X} , Y ,\dot{Y} ,Z ,\dot{Z} ,\gamma ,\beta ,\alpha ]^{T}\in\mathbb{R}^{9}, where (X,Y,Z) and (\gamma,\beta,\alpha) are the position and angles of the quadrotor, respectively. The state is bounded by [-0.2,-0.2,-0.2]^T \leq [\gamma,\beta,\alpha]^T \leq [0.2,0.2,0.2]^T.
-
The input vector is u=[a,\omega_{X},\omega_{Y},\omega_{Z}]^T, where a represents the thrust and (\omega_{X},\omega_{Y},\omega_{Z}) the rotational rates. The control input is bounded by [0,-1,-1,-1]^T \leq u \leq [11,1,1,1]^T.
-
The dynamics of the quadrotor are given by the following equations:
The task is to control the quadrotor to track a given position reference.
OCP in ParNMPC
- The state constraints are softened by introducing a slack variable s\geq 0 with a quadratic penalty on s.
Closed-loop Simulation using ParNMPC
Step 1. NMPC problem formulation
See Workflow of ParNMPC > NMPC Problem Formulation.
Example
Quadrotor/NMPC_Problem_Formulation.m
Step 2. Code generation and deployment in Simulink
See Workflow of ParNMPC > Code Generation and Deployment > Simulink.
-
Code generation
Example
Quadrotor/Simu_Simulink_Setup.m
-
Deployment
Example
Quadrotor/Simu_Simulink.slx