1
0
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:
bpmcgeeney
2021-10-14 17:39:17 -07:00
parent 591ddc77e4
commit af4a5d16d5
7 changed files with 159 additions and 117 deletions

View 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
View 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)]

View File

@@ -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)