diff --git a/README.md b/README.md index 73a674d191f7c7fec8492af2624b58a6727923cf..649abc155c4656ffc1e716f3769e3746bc2eedd5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # GNC Recruitment Assigment -In this assigment, the goal is to create a function to detect the apogee of the rocket during the flight and comand the opening of the parachute. +In this assigment, the goal is to create algorithm able to detect the apogee of the rocket during the flight and comand the opening of the parachute. The file `main.m` load the logs of a previous flight and then simulates the flight of the rocket. The first part of the script logs the logs of the sensors of a previous flight which will be then used for the simulation. @@ -18,8 +18,16 @@ function [ flag_apogee, data] = apogee_detector( pressure_measurment, IMU_measur which uses the datas measured during the flight as input and outputs the boolean variable `flag_apogee`, which must be: -* 1 if the function detecs the apogee -* 0 otherwise +* 1 during the instants where the rocket is at the apogee +* 0 otherwise + +This algorithm is safe critical, because the detection of the apogeee comands the opening of the parachute. So the algorithm that you will develop should be resilient and work even in off nominal conditions where: + +* the apogeee height may change from the one contained in the logs +* the trajectory of the rocket may change from the one contained in the logs +* unexpected faults may happen + +To take into acount these factors, the function that you will submit will be tested with the logs of a different flight. **data:** it is a support variable that you can use if and however you want. It is declared inside `main.m`; if you want to use it you have to declare it there, otherwise you can just leave it as it is. @@ -29,13 +37,13 @@ which uses the datas measured during the flight as input and outputs the boolean | :------: | | Pa | -**IMU_measurment:** the reference axis are the body-axis of the rocket. +**IMU_measurment:** the reference axis are the body-axis of the rocket. | acceleration_X | acceleration_Y | acceleration_Z | angular_speed_X | angular_speed_Y | angular_speed_Z | | :------------: | :------------: | :------------: | :-------------: | :-------------: | :-------------: | | m/s^2 | m/s^2 | m/s^2 | rad/s | rad/s | rad/s | -**GPS_measurment:** +**GPS_measurment:** | latitude | longitude | altitude (from sea level) | | :-------------: | --------------- | :-----------------------: | diff --git a/main.m b/main.m index b5b307835b8b138f68f4075dfd268cd95d6ff8c5..50f7c8cbb09232b39591dd2ee48e59d6dbba08f8 100644 --- a/main.m +++ b/main.m @@ -31,7 +31,7 @@ for t = 0:20000:300*1e6 % Apogee detection [flag_apogee, data] = apogee_detector(pressure_measurment, IMU_measurment, GPS_measurment, data); - % Save apogee + % Save first apogee detection time if flag_apogee && (apogee_time < 0) apogee_time = t; end @@ -57,17 +57,19 @@ subplot(3,1,1); plot(IMU(:,1)/1e6, IMU(:,2) ); grid minor; xlabel('time'); ylabel('m/s^2'); xline(apogee_time/1e6, '--', "apogee"); -title('Accelerometer') +title('Accelerometer X') subplot(3,1,2); plot(IMU(:,1)/1e6, IMU(:,3) ); grid minor; xlabel('time'); ylabel('m/s^2'); xline(apogee_time/1e6, '--', "apogee"); +title('Accelerometer Y') subplot(3,1,3); plot(IMU(:,1)/1e6, IMU(:,4) ); grid minor; xlabel('time'); ylabel('m/s^2'); xline(apogee_time/1e6, '--', "apogee"); +title('Accelerometer Z') % Plot GPS figure();