diff --git a/RLS_V1.0/R2Home_SOFTWARE_V1.01/R2Home_OBC_V1.04/main/config.h b/RLS_V1.0/R2Home_SOFTWARE_V1.01/R2Home_OBC_V1.04/main/config.h index e0cb099..7a59401 100644 --- a/RLS_V1.0/R2Home_SOFTWARE_V1.01/R2Home_OBC_V1.04/main/config.h +++ b/RLS_V1.0/R2Home_SOFTWARE_V1.01/R2Home_OBC_V1.04/main/config.h @@ -2,6 +2,7 @@ #define I_WANT_TO_FLY false // Simulated servo movement to test the servo movement :)) #define TEST_DIR_RC false // Use channels 0 on the radio to test the direction of the autopilot and the servos, I_WANT_TO_FLY should be set true too. +#define TEST_SEP_SERVO false // Will simulate a separation 10 seconds after start up #define BUZZER_TURN false // Buzzer sounds as function of the turn command #define BUZZER_SWEEP false // Buzzer turn on steroïds, should be easier to understand his tricky language ^^ #define NO_INIT false // Skip init, for testing only purposes @@ -35,7 +36,7 @@ #define OPENING_TIMER 3000 #define SPIRAL_RECOVER 5000 #define DEP_ALT 300 // m above ground -#define SEP_ALT 10000 // m above sea level +#define SEP_ALT 10 // m above sea level #define VUP 1 // m/s #define VDOWN -1 // m/s diff --git a/RLS_V1.0/R2Home_SOFTWARE_V1.01/R2Home_OBC_V1.04/main/flight_state.hpp b/RLS_V1.0/R2Home_SOFTWARE_V1.01/R2Home_OBC_V1.04/main/flight_state.hpp index ec0937c..4f359cd 100644 --- a/RLS_V1.0/R2Home_SOFTWARE_V1.01/R2Home_OBC_V1.04/main/flight_state.hpp +++ b/RLS_V1.0/R2Home_SOFTWARE_V1.01/R2Home_OBC_V1.04/main/flight_state.hpp @@ -3,6 +3,7 @@ int flight_mode = 0; int dep_altitude = 0; +int sep_altitude = 0; int prev_flight_mode = 0; bool initialised = false; bool flight_started = false; @@ -50,7 +51,10 @@ void flight_init() { cmpt_string_data(flight_mode, initialised, deployed, wing_opened, spiral); ground_altitude = gps.altitude.meters(); + ground_altitude = constrain(ground_altitude, 0, 2000); + dep_altitude = (DEP_ALT+ground_altitude); + sep_altitude = (SEP_ALT+ground_altitude); setcam(1, 60, 60); newfile(); @@ -107,7 +111,7 @@ void flight_ascent() { if ((gps.altitude.meters()-ground_altitude)>10) { flight_started = true; } - if (gps.altitude.meters()>SEP_ALT and gps_ok) { + if (gps.altitude.meters()>sep_altitude and gps_ok) { separation = true; } } diff --git a/RLS_V1.0/R2Home_SOFTWARE_V1.01/R2Home_OBC_V1.04/main/main.ino b/RLS_V1.0/R2Home_SOFTWARE_V1.01/R2Home_OBC_V1.04/main/main.ino index a0ce0e8..aa3fd5c 100644 --- a/RLS_V1.0/R2Home_SOFTWARE_V1.01/R2Home_OBC_V1.04/main/main.ino +++ b/RLS_V1.0/R2Home_SOFTWARE_V1.01/R2Home_OBC_V1.04/main/main.ino @@ -59,6 +59,10 @@ void loop() { if (DEBUG) { delay(10); } + + if (TEST_SEP_SERVO and millis()>10000) { + deployed = true; + } }