mirror of
https://github.com/ME-561-W20-Quadcopter-Project/Quadcopter-Control.git
synced 2025-08-31 21:03:13 +00:00
Plant state space model
Put plant state space model in Simulink
This commit is contained in:
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
*.slxc
|
||||
*.slx.autosave
|
||||
*.asv
|
||||
slprj
|
52
PlantModel.m
Normal file
52
PlantModel.m
Normal file
@@ -0,0 +1,52 @@
|
||||
%Parameters source: https://sal.aalto.fi/publications/pdf-files/eluu11_public.pdf
|
||||
g=9.81;
|
||||
m = .468;
|
||||
Ix = 4.856*10^-3;
|
||||
Iy = 4.856*10^-3;
|
||||
Iz = 8.801*10^-3;
|
||||
|
||||
%State Space Source: https://arxiv.org/ftp/arxiv/papers/1908/1908.07401.pdf
|
||||
%X' = Ax+Bu
|
||||
%y = Cx+Du
|
||||
|
||||
%Inputs:
|
||||
%U1: Total Upward Force on the quad rotor along z-axis
|
||||
%U2: Pitch Torque (about x-axis)
|
||||
%U3: Roll Torque (about y-axis)
|
||||
%U4: Yaw Torque (about z-axis)
|
||||
A = [0 0 0 1 0 0 0 0 0 0 0 0;...
|
||||
0 0 0 0 1 0 0 0 0 0 0 0;...
|
||||
0 0 0 0 0 1 0 0 0 0 0 0;...
|
||||
0 0 0 0 0 0 0 -g 0 0 0 0;...
|
||||
0 0 0 0 0 0 g 0 0 0 0 0;...
|
||||
0 0 0 0 0 0 0 0 0 0 0 0;...
|
||||
0 0 0 0 0 0 0 0 0 1 0 0;...
|
||||
0 0 0 0 0 0 0 0 0 0 1 0;...
|
||||
0 0 0 0 0 0 0 0 0 0 0 1;...
|
||||
0 0 0 0 0 0 0 0 0 0 0 0;...
|
||||
0 0 0 0 0 0 0 0 0 0 0 0;...
|
||||
0 0 0 0 0 0 0 0 0 0 0 0];
|
||||
|
||||
%Note: In paper, 1/m is in wrong spot
|
||||
B = [0 0 0 0;...
|
||||
0 0 0 0;...
|
||||
0 0 0 0;...
|
||||
0 0 0 0;...
|
||||
0 0 0 0;...
|
||||
1/m 0 0 0;...
|
||||
0 0 0 0;...
|
||||
0 0 0 0;...
|
||||
0 0 0 0;...
|
||||
0 1/Ix 0 0;...
|
||||
0 0 1/Iy 0;...
|
||||
0 0 0 1/Iz];
|
||||
C = [1 0 0 0 0 0 0 0 0 0 0 0;...
|
||||
0 1 0 0 0 0 0 0 0 0 0 0;...
|
||||
0 0 1 0 0 0 0 0 0 0 0 0;...
|
||||
0 0 0 0 0 0 1 0 0 0 0 0;...
|
||||
0 0 0 0 0 0 0 1 0 0 0 0;...
|
||||
0 0 0 0 0 0 0 0 1 0 0 0]
|
||||
D = zeros(6,4)
|
||||
|
||||
|
||||
|
BIN
PlantModelSim.slx
Normal file
BIN
PlantModelSim.slx
Normal file
Binary file not shown.
Reference in New Issue
Block a user