diff --git a/data/2024_Lyra_Roccaraso_September/config2024_Lyra_Roccaraso_September.m b/data/2024_Lyra_Roccaraso_September/config2024_Lyra_Roccaraso_September.m index c2e74be136765162c0b321d16ed23c9d68ad48ee..c25bb3a35c0452edb6f26be3459f17dd57f8768b 100644 --- a/data/2024_Lyra_Roccaraso_September/config2024_Lyra_Roccaraso_September.m +++ b/data/2024_Lyra_Roccaraso_September/config2024_Lyra_Roccaraso_September.m @@ -145,27 +145,24 @@ settings.ada.P0 = [ 0.1 0 0; % In [settings.ada.temp_ref, ~,... settings.ada.p_ref, ~] = computeAtmosphericData(environment.z0); % Reference temperature in kelvin and pressure in Pa -settings.ada.v0 = -10; % Vertical velocity initial condition -settings.ada.a0 = -100; % Acceleration velocity initial condition +settings.ada.v0 = 0; % Vertical velocity initial condition +settings.ada.a0 = 0; % Acceleration velocity initial condition settings.ada.x0 = [settings.ada.p_ref, settings.ada.v0, settings.ada.a0]; - % Ada initial condition + % Ada initial condition -settings.ada.v_thr = 0; % Velocity threshold for the detected apogee -settings.ada.count_thr = 5; % If the apogee is detected count_thr time, the algorithm will return the apogee event +settings.ada.v_thr = 0; % Velocity threshold for the detected apogee +settings.ada.count_thr = 5; % If the apogee is detected count_thr time, the algorithm will return the apogee event settings.ada.counter = 0; settings.ada.altitude_confidence_thr = 5; % If the ada recognizes altitude_confidence_thr samples under parachute cutting altitude, it sends the command - -settings.ada.t_ada = -1; % Apogee detection timestamp -settings.ada.flag_apo = false; % True when the apogee is detected - settings.ada.shadowmode = 10; if ~settings.parafoil - settings.ada.para.z_cut = rocket.parachutes(1,1).finalAltitude; + settings.ada.z_cut = rocket.parachutes(1,1).finalAltitude; else - settings.ada.para.z_cut = rocket.parachutes(1,2).finalAltitude; + settings.ada.z_cut = rocket.parachutes(1,2).finalAltitude; end + %% MEA TUNING PARAMETERS / MOTOR SHUT DOWN TUNING PARAMETERS settings.mea.engine_model_A1 = [1.62583090191848 -0.680722129751093 0; 1 0 0; -0.00102053146869855 0.000494919888520664 1]; settings.mea.engine_model_B1 = [2;0;0]; diff --git a/data/2025_Orion_Roccaraso_September/config2025_Orion_Roccaraso_September.m b/data/2025_Orion_Roccaraso_September/config2025_Orion_Roccaraso_September.m index b25b6f5e13e29d10ed1798e53081b7f6b7236646..2ca52bb37fecd18f0fe9fd30de91a2541da36f39 100644 --- a/data/2025_Orion_Roccaraso_September/config2025_Orion_Roccaraso_September.m +++ b/data/2025_Orion_Roccaraso_September/config2025_Orion_Roccaraso_September.m @@ -16,7 +16,8 @@ SPDX-License-Identifier: GPL-3.0-or-later %} -settings.launchDate = [2023 9 18]; +settings.launchDate = [2024 9 14]; +warning("Launch date set to 2024 as wrldmagm does not support 2025 launch date") settings.HREmot = true; %% TRAJECTORY GENERATION PARAMETERS @@ -39,7 +40,7 @@ settings.frequencies.accelerometerFrequency = 100; % [hz settings.frequencies.gyroFrequency = 100; % [hz] sensor frequency settings.frequencies.magnetometerFrequency = 100; % [hz] sensor frequency settings.frequencies.gpsFrequency = 10; % [hz] sensor frequency -settings.frequencies.barometerFrequency = 50; % [hz] sensor frequency +settings.frequencies.barometerFrequency = 100; % [hz] sensor frequency settings.frequencies.chamberPressureFrequency = 50; % [hz] sensor frequency settings.frequencies.pitotFrequency = 20; % [hz] sensor frequency settings.frequencies.NASFrequency = 50; % [hz] sensor frequency @@ -59,7 +60,7 @@ settings.arb.extPol(1) = -0.009083; % co settings.arb.extPol(2) = 0.02473; % coefficient for extension - alpha^3 settings.arb.extPol(3) = -0.01677; % coefficient for extension - alpha^2 settings.arb.extPol(4) = 0.03129; % coefficient for extension - alpha -settings.arb.maxExt = rocket.airbrakes.height(end); +settings.arb.maxExt = rocket.airbrakes.height(end); % maximum extension of air brake aerodynamic surface % servo angle to exposed surface of the airbrakes (GEMINI) settings.arb.surfPol = 0.00932857142857; % coefficient for surface - alpha @@ -72,7 +73,7 @@ settings.arb.guidePol(2) = 0.5337; % co settings.arb.ma = 150e-3; % airbrake mass settings.arb.mb = 20e-3; % tristar beam mass settings.arb.mu = 0.05; % friction coefficient between air brake and guide -settings.arb.R = 66e-3; % tristar beam length (rod) +settings.arb.R = 66e-3; % tristar beam length (rod) % Get maximum extension angle x = @(alpha) settings.arb.extPol(1)*alpha.^4 + ... @@ -97,8 +98,8 @@ settings.nas.P = 0.01*eye(12); settings.nas.Mach_max = 0.4; % max mach number expected for the mission (for nas with pitot update purposes) - not currently used settings.nas.GPS.a = 111132.95225; settings.nas.GPS.b = 111412.87733; -settings.nas.v_thr = 2.5; % Velocity threshold for the detected apogee -settings.nas.count_thr = 5; % If the apogee is detected count_thr time, the algorithm will return the apogee event +settings.nas.v_thr = 2.5; % Velocity threshold for the detected apogee +settings.nas.count_thr = 5; % If the apogee is detected count_thr time, the algorithm will return the apogee event settings.nas.counter = 0; settings.nas.baro.a = 0.0065; @@ -145,25 +146,21 @@ settings.ada.P0 = [ 0.1 0 0; % In [settings.ada.temp_ref, ~,... settings.ada.p_ref, ~] = computeAtmosphericData(environment.z0); % Reference temperature in kelvin and pressure in Pa -settings.ada.v0 = -10; % Vertical velocity initial condition -settings.ada.a0 = -100; % Acceleration velocity initial condition +settings.ada.v0 = 0; % Vertical velocity initial condition +settings.ada.a0 = 0; % Acceleration velocity initial condition settings.ada.x0 = [settings.ada.p_ref, settings.ada.v0, settings.ada.a0]; - % Ada initial condition + % Ada initial condition -settings.ada.v_thr = 0; % Velocity threshold for the detected apogee -settings.ada.count_thr = 5; % If the apogee is detected count_thr time, the algorithm will return the apogee event +settings.ada.v_thr = 0; % Velocity threshold for the detected apogee +settings.ada.count_thr = 5; % If the apogee is detected count_thr time, the algorithm will return the apogee event settings.ada.counter = 0; settings.ada.altitude_confidence_thr = 5; % If the ada recognizes altitude_confidence_thr samples under parachute cutting altitude, it sends the command - -settings.ada.t_ada = -1; % Apogee detection timestamp -settings.ada.flag_apo = false; % True when the apogee is detected - settings.ada.shadowmode = 10; if ~settings.parafoil - settings.ada.para.z_cut = rocket.parachutes(1,1).finalAltitude; + settings.ada.z_cut = rocket.parachutes(1,1).finalAltitude; else - settings.ada.para.z_cut = rocket.parachutes(1,2).finalAltitude; + settings.ada.z_cut = rocket.parachutes(1,2).finalAltitude; end %% MEA TUNING PARAMETERS / MOTOR SHUT DOWN TUNING PARAMETERS @@ -182,7 +179,7 @@ settings.mea.z_shutdown = 800; % [m] settings.mea.t_lower_shadowmode = 2; % minimunm burning time settings.mea.t_higher_shadowmode = 10; % maximum burning time settings.shutdownValveDelay = 0.2; % time from the shut down command to the actual valve closure -settings.mea.cd_correction_factor = 2.69; +settings.mea.cd_correction_factor = 1; % accelerometer correction parameters [~,~,settings.mea.P0] = computeAtmosphericData(103); %[Pa] reference pressure at the SFT location diff --git a/data/2025_Orion_Roccaraso_September/initSensors2025_Orion_Roccaraso_September.m b/data/2025_Orion_Roccaraso_September/initSensors2025_Orion_Roccaraso_September.m index e3b79ac9a7678ec3a53a6443462942f0c01d8392..be8164406350c1c93424fd8c04c8c65f74e69da1 100644 --- a/data/2025_Orion_Roccaraso_September/initSensors2025_Orion_Roccaraso_September.m +++ b/data/2025_Orion_Roccaraso_September/initSensors2025_Orion_Roccaraso_September.m @@ -13,8 +13,8 @@ sensorSettings.barometer1 = SensorFault(); sensorSettings.barometer1.maxMeasurementRange = 1000; % 1100, 1300 in mbar sensorSettings.barometer1.minMeasurementRange = 0; % 300, 10 in mbar sensorSettings.barometer1.bit = 24; % adc on rocket is 24 bits -sensorSettings.barometer1.fault_time = 9; % if negative it will be generated at random between a max and a min value -sensorSettings.barometer1.max_fault_time = 96; % max seconds to wait before possible fault +sensorSettings.barometer1.fault_time = -1; % if negative it will be generated at random between a max and a min value +sensorSettings.barometer1.max_fault_time = 60; % max seconds to wait before possible fault sensorSettings.barometer1.min_fault_time = 6; % min seconds to wait before possible fault % fault generation @@ -42,7 +42,7 @@ sensorSettings.barometer2.maxMeasurementRange = 1000; % 11 sensorSettings.barometer2.minMeasurementRange = 0; % 300, 10 in mbar sensorSettings.barometer2.bit = 24; % adc on rocket is 24 bits sensorSettings.barometer2.fault_time = -1; % if negative it will be generated at random between a max and a min value -sensorSettings.barometer2.max_fault_time = 96; % max seconds to wait before possible fault +sensorSettings.barometer2.max_fault_time = 60; % max seconds to wait before possible fault sensorSettings.barometer2.min_fault_time = 6; % min seconds to wait before possible fault % fault generation @@ -70,7 +70,7 @@ sensorSettings.barometer3.maxMeasurementRange = 4060; % 11 sensorSettings.barometer3.minMeasurementRange = 260; % 300, 10 in mbar sensorSettings.barometer3.bit = 24; sensorSettings.barometer3.fault_time = -1; % if negative it will be generated at random between a max and a min value -sensorSettings.barometer3.max_fault_time = 96; % max seconds to wait before possible fault +sensorSettings.barometer3.max_fault_time = 60; % max seconds to wait before possible fault sensorSettings.barometer3.min_fault_time = 6; % min seconds to wait before possible fault % fault generation diff --git a/simulator/configs/configFlags.m b/simulator/configs/configFlags.m index f3a3dfb1f2f73634f6b577b6fa614895ea714d53..c3c8c615ad6cc16e0e38cbad672e8cd8393f26cd 100644 --- a/simulator/configs/configFlags.m +++ b/simulator/configs/configFlags.m @@ -27,8 +27,8 @@ scenarios explanation: % scenario configuration -conf.scenario = "controlled ascent"; -conf.board = "payload"; % Either "main" or "payload" +conf.scenario = "full flight"; +conf.board = "main"; % Either "main" or "payload" conf.HIL = false; % WIP flags diff --git a/simulator/configs/configReferences.m b/simulator/configs/configReferences.m index 9dd6d2261b77a2947eaa487399224b53a0f442e7..8f0f50920f6c8c96a9270a4f713e0f3a22f21009 100644 --- a/simulator/configs/configReferences.m +++ b/simulator/configs/configReferences.m @@ -109,7 +109,7 @@ switch mission.name end case '2024_Lyra_Roccaraso_September' - load("TrajectoriesCFD.mat") + load("Trajectories.mat") for i = 1:size(trajectories_saving,1) for j = 1:size(trajectories_saving,2) reference.vz_ref{i,j} = trajectories_saving{i,j}.VZ_ref; diff --git a/simulator/mainMontecarlo.m b/simulator/mainMontecarlo.m index 9aeb135d64efebfbe1b434da36e684294abdb26f..d66be5168345176f0211068092ce492f54358733 100644 --- a/simulator/mainMontecarlo.m +++ b/simulator/mainMontecarlo.m @@ -115,7 +115,6 @@ for alg_index = 4 motor_K = settings.motor.K; parfor i = 1:N_sim - % for i = 1:N_sim rocket_vec{i} = copy(rocket); settings_mont = settings_mont_init; settings_mont.motor.expThrust = stoch.thrust(i,:); % initialize the thrust vector of the current simulation (parfor purposes) diff --git a/simulator/src/std_plots.m b/simulator/src/std_plots.m index b061b3a966bc2885374fb3529a749c82bbc1b3b9..676e52d3e697fa14b200489d6088891c0edab063 100644 --- a/simulator/src/std_plots.m +++ b/simulator/src/std_plots.m @@ -125,9 +125,6 @@ if contSettings.run_old_ada sgtitle("Absolute error between run\_ADA and majority voting ADA instances"); end -return - - %% reference figures.NASABKRef = figure('Name', 'NAS vs ABK reference'); yyaxis left