mirror of
https://gitlab.com/lander-team/lander-sim.git
synced 2025-08-03 20:01:28 +00:00
Replace simPrototypeSTART.m
This commit is contained in:
@@ -5,8 +5,8 @@ close all; clear all; clc;
|
|||||||
% Initial Conditions
|
% Initial Conditions
|
||||||
v0 = 0; % Initial Velocity (z) [m/s]
|
v0 = 0; % Initial Velocity (z) [m/s]
|
||||||
M0 = 1.2; % Initial Mass [kg]
|
M0 = 1.2; % Initial Mass [kg]
|
||||||
yaw0 = 0; % Initial Yaw [deg]
|
yaw0 = 5; % Initial Yaw [deg]
|
||||||
pitch0 = 5; % Initial Pitch [deg]
|
pitch0 = 15; % Initial Pitch [deg]
|
||||||
roll0 = 0; % Initial Roll [deg]
|
roll0 = 0; % Initial Roll [deg]
|
||||||
p0 = 0; % Initial Angular Velocity (x) [deg/s]
|
p0 = 0; % Initial Angular Velocity (x) [deg/s]
|
||||||
q0 = 0; % Initial Angular Velocity (y) [deg/s]
|
q0 = 0; % Initial Angular Velocity (y) [deg/s]
|
||||||
@@ -31,8 +31,9 @@ I33 = 0.5 * 0.05105^2; % 0.
|
|||||||
I = [I11 0 0; 0 I22 0; 0 0 I33]; % I divided by Mass... this is taken care of in Simulink since our mass isn't constant
|
I = [I11 0 0; 0 I22 0; 0 0 I33]; % I divided by Mass... this is taken care of in Simulink since our mass isn't constant
|
||||||
|
|
||||||
%% Pre-Sim Calcs
|
%% Pre-Sim Calcs
|
||||||
K = calcLQR(I*M0); % LQR Gain Calcs
|
K = calcLQR(I*M0) % LQR Gain Calcs
|
||||||
[h0, vb, burnStartTime] = burnStartTimeCalc(Tcurve, tb, M0, mdot, Mb, v0); % Burn Start Time Calc
|
[h0, vb, burnStartTime] = burnStartTimeCalc(Tcurve, tb, M0, mdot, Mb, v0) % Burn Start Time Calc
|
||||||
|
h0 = 21;
|
||||||
simTime = burnStartTime + tb; % Simulation Time [s]
|
simTime = burnStartTime + tb; % Simulation Time [s]
|
||||||
|
|
||||||
yaw0 = yaw0 * pi / 180; % Initial Yaw [rad]
|
yaw0 = yaw0 * pi / 180; % Initial Yaw [rad]
|
||||||
@@ -128,7 +129,7 @@ for i = 1 : length(simOut.h.Data)
|
|||||||
drawnow limitrate
|
drawnow limitrate
|
||||||
|
|
||||||
% Write Animation to gif, set to zero when testing since its slow to render.
|
% Write Animation to gif, set to zero when testing since its slow to render.
|
||||||
outframes = 50; % 50 is a nice default
|
outframes = 0; % 50 is a nice default
|
||||||
if outframes
|
if outframes
|
||||||
% Write to the GIF File
|
% Write to the GIF File
|
||||||
if i == 1
|
if i == 1
|
||||||
|
Reference in New Issue
Block a user