diff --git a/classes/@Rocket/Rocket.m b/classes/@Rocket/Rocket.m index a06283be4bc00d80338e94a9fc570771dfda416d..7e39e879fb8a463b4548fcc69f138efdb8c08da4 100644 --- a/classes/@Rocket/Rocket.m +++ b/classes/@Rocket/Rocket.m @@ -50,9 +50,11 @@ classdef Rocket < Config properties pitot Pitot % [-] Pitot component parachutes cell % [-] (nParachutes, nStages) Parachutes onboard + + dynamicDerivatives (1, 1) logical % [-] True if dynamic derivatives will be loaded - coefficients struct % [-] Aerodynamic coefficients - coefficientsHighAOA struct % [-] Aerodynamic coefficients at high angle of attack + coefficients Coefficient % [-] Aerodynamic coefficients + coefficientsHighAOA Coefficient % [-] Aerodynamic coefficients at high angle of attack end properties(Access = private) @@ -138,9 +140,20 @@ classdef Rocket < Config obj.parachutes = paraLoader.parachutes; if options.loadCoefficients - obj = obj.loadData(); + if obj.dynamicDerivatives, coeffName = obj.motor.name; + else, coeffName = 'generic'; + end + + obj.coefficients = Coefficient( ... + fullfile(mission.dataPath, 'aeroCoefficients.mat'), ... + coeffName); + + obj.coefficientsHighAOA = Coefficient( ... + fullfile(mission.dataPath, 'aeroCoefficientsHighAOA.mat'), ... + coeffName); + answer = ''; - if isempty(obj.coefficients) || isempty(obj.coefficientsHighAOA) + if isempty(obj.coefficients.static) || isempty(obj.coefficientsHighAOA.static) answer = questdlg(['Coefficient matrices not found. ' ... 'Do you want to create new matrices?']); elseif options.checkGeometry && ~all(obj.checkGeometry()) @@ -153,7 +166,14 @@ classdef Rocket < Config parserPath = fullfile(mission.msaPath, 'autoMatricesProtub'); addpath(genpath(parserPath)); mainAutoMatProtub(obj); - obj = obj.loadData(); + + obj.coefficients = Coefficient( ... + fullfile(mission.dataPath, 'aeroCoefficients.mat'), ... + coeffName); + + obj.coefficientsHighAOA = Coefficient( ... + fullfile(mission.dataPath, 'aeroCoefficientsHighAOA.mat'), ... + coeffName); case 'Cancel' error('Rocket creation aborted') otherwise diff --git a/missions/2021_Lynx_Portugal_October/config/rocketConfig.m b/missions/2021_Lynx_Portugal_October/config/rocketConfig.m index 4df34a1b48f4d03c4a6cdcb791b8c8c5985a17ec..160c5b09b850ef81406e13cf89dfcda9005c2e9c 100644 --- a/missions/2021_Lynx_Portugal_October/config/rocketConfig.m +++ b/missions/2021_Lynx_Portugal_October/config/rocketConfig.m @@ -16,6 +16,11 @@ rocket.inertiaNoMotor = [0.0786; 12.972; 12.972]; % [kg*m^2] OVERRIDE iner rocket.xCgNoMotor = 1.6025; % [m] OVERRIDE xCg without motor rocket.lengthCenterNoMot = 1.7640; % [m] OVERRIDE Center length - no nose, no motor +% If dynamic derivatives are loaded, coefficient will depend on rocket xcg +% When false, coefficients are saved with current motor's name +% When true, coefficients are saved as 'generic' +rocket.dynamicDerivatives = false; % [-] True if dynamic derivatives will be loaded + %% PLD - Includes Parafoil + Nose parafoil = Parafoil(); diff --git a/missions/2021_Lynx_Roccaraso_September/config/rocketConfig.m b/missions/2021_Lynx_Roccaraso_September/config/rocketConfig.m index 83f64760123f82fd1703c408e2543fa3d76f8e12..d0dc3df55356e3aebc59d51214a30794f8668dc1 100644 --- a/missions/2021_Lynx_Roccaraso_September/config/rocketConfig.m +++ b/missions/2021_Lynx_Roccaraso_September/config/rocketConfig.m @@ -16,6 +16,11 @@ rocket.inertiaNoMotor = [0.06; 7.511; 7.512]; % [kg*m^2] OVERRIDE inertia rocket.xCgNoMotor = 1.1986; % [m] OVERRIDE xCg without motor rocket.lengthCenterNoMot = 1.7840; % [m] OVERRIDE Center length - no nose, no motor +% If dynamic derivatives are loaded, coefficient will depend on rocket xcg +% When false, coefficients are saved with current motor's name +% When true, coefficients are saved as 'generic' +rocket.dynamicDerivatives = false; % [-] True if dynamic derivatives will be loaded + %% PLD - Includes Parafoil + Nose parafoil = Parafoil(); diff --git a/missions/2022_Pyxis_Portugal_October/config/rocketConfig.m b/missions/2022_Pyxis_Portugal_October/config/rocketConfig.m index 8cdcf2b5942b6f6ef50f8c2a627b7111452abc46..2f949bfb46c9b09dd02fea6a1c87253e9c6c5b20 100644 --- a/missions/2022_Pyxis_Portugal_October/config/rocketConfig.m +++ b/missions/2022_Pyxis_Portugal_October/config/rocketConfig.m @@ -16,6 +16,11 @@ rocket.inertiaNoMotor = [0.06303; 9.62497; 9.62524]; % [kg*m^2] OVERRIDE i rocket.xCgNoMotor = 1.2239; % [m] OVERRIDE xCg without motor rocket.lengthCenterNoMot = 1.4470; % [m] OVERRIDE Center length - no nose, no motor +% If dynamic derivatives are loaded, coefficient will depend on rocket xcg +% When false, coefficients are saved with current motor's name +% When true, coefficients are saved as 'generic' +rocket.dynamicDerivatives = false; % [-] True if dynamic derivatives will be loaded + %% PLD - Includes Parafoil + Nose parafoil = Parafoil(); diff --git a/missions/2022_Pyxis_Roccaraso_September/config/rocketConfig.m b/missions/2022_Pyxis_Roccaraso_September/config/rocketConfig.m index bec3d20b753eb2ec6b956c9924e12353c7cd6e2b..ee3a3c71bd73ab263db92f3e929db488a6a5735c 100644 --- a/missions/2022_Pyxis_Roccaraso_September/config/rocketConfig.m +++ b/missions/2022_Pyxis_Roccaraso_September/config/rocketConfig.m @@ -18,6 +18,11 @@ rocket.xCgNoMotor = 1.2957; % [m] % settings.Lcenter - motors(iMotor).L/1000 rocket.lengthCenterNoMot = 1.61; % [m] OVERRIDE Center length - no nose, no motor +% If dynamic derivatives are loaded, coefficient will depend on rocket xcg +% When false, coefficients are saved with current motor's name +% When true, coefficients are saved as 'generic' +rocket.dynamicDerivatives = false; % [-] True if dynamic derivatives will be loaded + %% PLD - Includes Parafoil + Nose parafoil = Parafoil(); diff --git a/missions/2023_Gemini_Portugal_October/config/rocketConfig.m b/missions/2023_Gemini_Portugal_October/config/rocketConfig.m index 610966af09dd387c856d5e559e8b6bd6020f4e8e..401c415be5e782af00b4318e62db4d13ea6ef5ca 100644 --- a/missions/2023_Gemini_Portugal_October/config/rocketConfig.m +++ b/missions/2023_Gemini_Portugal_October/config/rocketConfig.m @@ -15,6 +15,12 @@ rocket.inertiaNoMotor = [0.06535397; 17.21019828; 17.21056483]; % [kg*m^2] rocket.xCgNoMotor = 1.254; % [m] OVERRIDE xCg without motor rocket.lengthCenterNoMot = 1.517; % [m] OVERRIDE Center length - no nose, no motor +% If dynamic derivatives are loaded, coefficient will depend on rocket xcg +% When false, coefficients are saved with current motor's name +% When true, coefficients are saved as 'generic' +rocket.dynamicDerivatives = false; % [-] True if dynamic derivatives will be loaded + + %% PLD - Includes Parafoil + Nose parafoil = Parafoil(); diff --git a/missions/2023_Gemini_Roccaraso_September/config/rocketConfig.m b/missions/2023_Gemini_Roccaraso_September/config/rocketConfig.m index 600065acce5a8ab60dc9e917019745567596d1d1..fc2715bc0dd7d61dd740e20b3138c8552440dcf1 100644 --- a/missions/2023_Gemini_Roccaraso_September/config/rocketConfig.m +++ b/missions/2023_Gemini_Roccaraso_September/config/rocketConfig.m @@ -15,6 +15,11 @@ rocket.inertiaNoMotor = [0.06535397; 12.07664659; 12.07701314]; % [kg*m^2] rocket.xCgNoMotor = 1.149; % [m] OVERRIDE xCg without motor rocket.lengthCenterNoMot = 1.517; % [m] OVERRIDE Center length - no nose, no motor +% If dynamic derivatives are loaded, coefficient will depend on rocket xcg +% When false, coefficients are saved with current motor's name +% When true, coefficients are saved as 'generic' +rocket.dynamicDerivatives = false; % [-] True if dynamic derivatives will be loaded + %% PLD - Includes Parafoil + Nose parafoil = Parafoil(); diff --git a/missions/2024_Lyra_Portugal_October/config/rocketConfig.m b/missions/2024_Lyra_Portugal_October/config/rocketConfig.m index 2369c08ce6c490b4ff849c682698f0d112a784d3..f87640c176ca52f0ab3274f1b32602462a1489ff 100644 --- a/missions/2024_Lyra_Portugal_October/config/rocketConfig.m +++ b/missions/2024_Lyra_Portugal_October/config/rocketConfig.m @@ -9,6 +9,11 @@ rocket.inertiaNoMotor = []; % [kg*m^ rocket.xCgNoMotor = []; % [m] OVERRIDE xCg without motor rocket.lengthCenterNoMot = []; % [m] OVERRIDE Center length - no nose, no motor +% If dynamic derivatives are loaded, coefficient will depend on rocket xcg +% When false, coefficients are saved with current motor's name +% When true, coefficients are saved as 'generic' +rocket.dynamicDerivatives = false; % [-] True if dynamic derivatives will be loaded + %% PLD - Includes Parafoil + Nose parafoil = Parafoil(); diff --git a/missions/2024_Lyra_Roccaraso_September/config/rocketConfig.m b/missions/2024_Lyra_Roccaraso_September/config/rocketConfig.m index b2ca5cb545dec731f15e540e33c3f05711f8e027..2939db0ce6550575817cdd355d8b2f6ca2e68943 100644 --- a/missions/2024_Lyra_Roccaraso_September/config/rocketConfig.m +++ b/missions/2024_Lyra_Roccaraso_September/config/rocketConfig.m @@ -15,6 +15,11 @@ rocket.lengthCenterNoMot = []; % [m] % rocket.xCgNoMotor = 1.28; % [m] OVERRIDE xCg without motor % rocket.lengthCenterNoMot = 1.778; % [m] OVERRIDE Center length - no nose, no motor +% If dynamic derivatives are loaded, coefficient will depend on rocket xcg +% When false, coefficients are saved with current motor's name +% When true, coefficients are saved as 'generic' +rocket.dynamicDerivatives = false; % [-] True if dynamic derivatives will be loaded + %% PLD - Includes Parafoil + Nose parafoil = Parafoil(); diff --git a/missions/2025_Orion_Portugal_October/config/rocketConfig.m b/missions/2025_Orion_Portugal_October/config/rocketConfig.m index c8791602b6261e955857793796d59d896bd004bc..6a13ec2512f1ba80b938af94064c3038be076bfd 100644 --- a/missions/2025_Orion_Portugal_October/config/rocketConfig.m +++ b/missions/2025_Orion_Portugal_October/config/rocketConfig.m @@ -3,12 +3,17 @@ %% ROCKET - OVERRIDES BAYS CONFIG rocket = Rocket(); -rocket.diameter = 0.15; % [m] Rocket diameter +rocket.diameter = 0.15; % [m] Rocket diameter % rocket.massNoMotor = []; % [kg] OVERRIDE mass without motor % rocket.inertiaNoMotor = []; % [kg*m^2] OVERRIDE inertia without motor - body axes reference % rocket.xcgNoMotor = []; % [m] OVERRIDE xCg without motor % rocket.lengthCenterNoMot = []; % [m] OVERRIDE Center length - no nose, no motor +% If dynamic derivatives are loaded, coefficient will depend on rocket xcg +% When false, coefficients are saved with current motor's name +% When true, coefficients are saved as 'generic' +rocket.dynamicDerivatives = false; % [-] True if dynamic derivatives will be loaded + %% PRF - Includes Parafoil + Nose parafoil = Parafoil(); @@ -69,7 +74,7 @@ airbrakes.servoTau = 0.0374588; %% MOTOR motor = Motor(); -motor.name = 'HRE_ARM_OPT_3_Update'; +motor.name = 'HRE_ARM_EuRoC_2024'; motor.cutoffTime = []; % [s] OVERRIDE Cutoff time motor.ignitionTransient = 0.3; % [s] Ignition transient diff --git a/missions/2025_Orion_Roccaraso_September/config/rocketConfig.m b/missions/2025_Orion_Roccaraso_September/config/rocketConfig.m index dfc372f3e3e1f47af69fd4b9e1dc3d80f730052a..c4e1ffcee38a736e09fe06543010f7699fe3a553 100644 --- a/missions/2025_Orion_Roccaraso_September/config/rocketConfig.m +++ b/missions/2025_Orion_Roccaraso_September/config/rocketConfig.m @@ -15,6 +15,11 @@ rocket.lengthCenterNoMot = []; % [m] % rocket.xCgNoMotor = 1.28; % [m] OVERRIDE xCg without motor % rocket.lengthCenterNoMot = 1.778; % [m] OVERRIDE Center length - no nose, no motor +% If dynamic derivatives are loaded, coefficient will depend on rocket xcg +% When false, coefficients are saved with current motor's name +% When true, coefficients are saved as 'generic' +rocket.dynamicDerivatives = false; % [-] True if dynamic derivatives will be loaded + %% PLD - Includes Parafoil + Nose parafoil = Parafoil();