mirror of
https://gitlab.com/lander-team/lander-cpp.git
synced 2025-07-25 23:51:35 +00:00
PID fully debugged
This commit is contained in:
13
matlabHelpers/Untitled.asv
Normal file
13
matlabHelpers/Untitled.asv
Normal file
@@ -0,0 +1,13 @@
|
||||
clear all; close all; clc;
|
||||
|
||||
syms I11 I22 I33 I11dot I22dot I33dot
|
||||
|
||||
I = [I11 0 0; 0 I22 0; 0 0 I33];
|
||||
Idot = [I11dot 0 0; 0 I22dot 0; 0 0 I33dot];
|
||||
|
||||
syms yaw pitch roll yawdot pitchdot rolldot yawddot pitchddot rollddot
|
||||
|
||||
w =
|
||||
|
||||
I *
|
||||
|
24
matlabHelpers/Untitled.m
Normal file
24
matlabHelpers/Untitled.m
Normal file
@@ -0,0 +1,24 @@
|
||||
clear all; close all; clc;
|
||||
|
||||
syms I11 I22 I33 I11dot I22dot I33dot
|
||||
|
||||
I = [I11 0 0; 0 I22 0; 0 0 I33];
|
||||
Idot = [I11dot 0 0; 0 I22dot 0; 0 0 I33dot];
|
||||
|
||||
syms yaw pitch roll yawdot pitchdot rolldot yawddot pitchddot rollddot
|
||||
|
||||
w = [yawdot; pitchdot; rolldot];
|
||||
|
||||
Iw = I * w;
|
||||
Idw = Idot * w;
|
||||
|
||||
C = cross(w, Iw);
|
||||
|
||||
syms momentX momentY momentZ
|
||||
|
||||
M = [momentX; momentY; momentZ];
|
||||
A = M - Idw - C;
|
||||
B = [A(1) A(2) A(3)];
|
||||
|
||||
X = B*inv(I);
|
||||
E = [X(1); X(2); X(3)]
|
@@ -27,8 +27,8 @@ rolldot = T(:, 16);
|
||||
Servo1 = T(:, 17);
|
||||
Servo2 = T(:, 18);
|
||||
|
||||
LQRx = T(:, 19);
|
||||
LQRy = T(:, 20);
|
||||
LQRx = T(:, 20);
|
||||
LQRy = T(:, 21);
|
||||
|
||||
% Acceleration
|
||||
subplot(3, 1, 1)
|
||||
|
Reference in New Issue
Block a user