diff --git a/conf/airframes/microjet7.xml b/conf/airframes/microjet7.xml index 2f7039e51f..b5e278d6e9 100644 --- a/conf/airframes/microjet7.xml +++ b/conf/airframes/microjet7.xml @@ -110,6 +110,8 @@
+ + @@ -153,7 +155,8 @@ - + + diff --git a/conf/airframes/slayer1.xml b/conf/airframes/slayer1.xml index ae2ea44557..e8a01d2a91 100644 --- a/conf/airframes/slayer1.xml +++ b/conf/airframes/slayer1.xml @@ -104,6 +104,7 @@ +
@@ -150,7 +151,8 @@ - + + diff --git a/conf/airframes/slayer2.xml b/conf/airframes/slayer2.xml index e30b06d1cf..5f27bf6a09 100644 --- a/conf/airframes/slayer2.xml +++ b/conf/airframes/slayer2.xml @@ -69,6 +69,7 @@ + @@ -99,6 +100,7 @@ +
@@ -109,12 +111,12 @@ - + - + - + @@ -129,7 +131,7 @@
- + @@ -139,13 +141,14 @@ - + - + + @@ -165,7 +168,7 @@ - +
diff --git a/conf/airframes/slayer3.xml b/conf/airframes/slayer3.xml index 8ce89517ef..ea37d9f694 100755 --- a/conf/airframes/slayer3.xml +++ b/conf/airframes/slayer3.xml @@ -149,7 +149,8 @@ - + + diff --git a/conf/radios/flash5.xml b/conf/radios/flash5.xml new file mode 100644 index 0000000000..9bf6e886e4 --- /dev/null +++ b/conf/radios/flash5.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/conf/settings/tuning.xml b/conf/settings/tuning.xml index 36fa7ac235..189a035f05 100644 --- a/conf/settings/tuning.xml +++ b/conf/settings/tuning.xml @@ -49,7 +49,8 @@ - + + @@ -62,12 +63,12 @@ - + - + diff --git a/sw/airborne/fw_h_ctl.c b/sw/airborne/fw_h_ctl.c index 3553addce7..8fe7267a0c 100644 --- a/sw/airborne/fw_h_ctl.c +++ b/sw/airborne/fw_h_ctl.c @@ -28,6 +28,7 @@ * */ +#include "std.h" #include "led.h" #include "fw_h_ctl.h" #include "estimator.h" @@ -70,7 +71,8 @@ float h_ctl_elevator_of_roll; float h_ctl_roll_rate_setpoint; float h_ctl_roll_rate_mode; float h_ctl_roll_rate_setpoint_pgain; -float h_ctl_roll_rate_pgain; +float h_ctl_hi_throttle_roll_rate_pgain; +float h_ctl_lo_throttle_roll_rate_pgain; float h_ctl_roll_rate_igain; float h_ctl_roll_rate_dgain; #endif @@ -109,7 +111,8 @@ void h_ctl_init( void ) { #ifdef H_CTL_RATE_LOOP h_ctl_roll_rate_mode = H_CTL_ROLL_RATE_MODE_DEFAULT; h_ctl_roll_rate_setpoint_pgain = H_CTL_ROLL_RATE_SETPOINT_PGAIN; - h_ctl_roll_rate_pgain = H_CTL_ROLL_RATE_PGAIN; + h_ctl_hi_throttle_roll_rate_pgain = H_CTL_HI_THROTTLE_ROLL_RATE_PGAIN; + h_ctl_lo_throttle_roll_rate_pgain = H_CTL_LO_THROTTLE_ROLL_RATE_PGAIN; h_ctl_roll_rate_igain = H_CTL_ROLL_RATE_IGAIN; h_ctl_roll_rate_dgain = H_CTL_ROLL_RATE_DGAIN; #endif @@ -184,8 +187,10 @@ static inline void h_ctl_roll_rate_loop() { static float last_err = 0; float d_err = err - last_err; last_err = err; - - float cmd = h_ctl_roll_rate_pgain * ( err + h_ctl_roll_rate_igain * roll_rate_sum_err / H_CTL_ROLL_RATE_SUM_NB_SAMPLES + h_ctl_roll_rate_dgain * d_err); + + float throttle_dep_pgain = + Blend(h_ctl_hi_throttle_roll_rate_pgain, h_ctl_lo_throttle_roll_rate_pgain, v_ctl_throttle_setpoint/((float)MAX_PPRZ)); + float cmd = throttle_dep_pgain * ( err + h_ctl_roll_rate_igain * roll_rate_sum_err / H_CTL_ROLL_RATE_SUM_NB_SAMPLES + h_ctl_roll_rate_dgain * d_err); h_ctl_aileron_setpoint = TRIM_PPRZ(cmd); } diff --git a/sw/airborne/fw_h_ctl.h b/sw/airborne/fw_h_ctl.h index fa0b4b7b29..472015c053 100644 --- a/sw/airborne/fw_h_ctl.h +++ b/sw/airborne/fw_h_ctl.h @@ -68,6 +68,8 @@ extern float h_ctl_elevator_of_roll; extern float h_ctl_roll_rate_mode; extern float h_ctl_roll_rate_setpoint_pgain; extern float h_ctl_roll_rate_pgain; +extern float h_ctl_hi_throttle_roll_rate_pgain; +extern float h_ctl_lo_throttle_roll_rate_pgain; extern float h_ctl_roll_rate_igain; extern float h_ctl_roll_rate_dgain; #endif diff --git a/sw/airborne/main_ap.c b/sw/airborne/main_ap.c index c404c0af86..1acfc73f04 100644 --- a/sw/airborne/main_ap.c +++ b/sw/airborne/main_ap.c @@ -223,6 +223,10 @@ static inline void reporting_task( void ) { } } +#ifndef RC_LOST_MODE +#define RC_LOST_MODE PPRZ_MODE_HOME +#endif + /** \brief Function to be called when a command is available (usually comming from the radio command) */ inline void telecommand_task( void ) { @@ -230,9 +234,15 @@ inline void telecommand_task( void ) { copy_from_to_fbw(); uint8_t really_lost = bit_is_set(fbw_state->status, RADIO_REALLY_LOST) && (pprz_mode == PPRZ_MODE_AUTO1 || pprz_mode == PPRZ_MODE_MANUAL); - if (pprz_mode != PPRZ_MODE_HOME && pprz_mode != PPRZ_MODE_GPS_OUT_OF_ORDER && launch && (really_lost || too_far_from_home)) { - pprz_mode = PPRZ_MODE_HOME; - mode_changed = TRUE; + if (pprz_mode != PPRZ_MODE_HOME && pprz_mode != PPRZ_MODE_GPS_OUT_OF_ORDER && launch) { + if (too_far_from_home) { + pprz_mode = PPRZ_MODE_HOME; + mode_changed = TRUE; + } + if (really_lost) { + pprz_mode = RC_LOST_MODE; + mode_changed = TRUE; + } } if (bit_is_set(fbw_state->status, AVERAGED_CHANNELS_SENT)) { bool_t pprz_mode_changed = pprz_mode_update(); @@ -341,6 +351,11 @@ static void navigation_task( void ) { if (vertical_mode == VERTICAL_MODE_AUTO_GAZ) v_ctl_throttle_setpoint = nav_desired_gaz; +#ifdef V_CTL_POWER_CTL_BAT_NOMINAL + v_ctl_throttle_setpoint *= 10. * V_CTL_POWER_CTL_BAT_NOMINAL / (float)vsupply; + v_ctl_throttle_setpoint = TRIM_UPPRZ(v_ctl_throttle_setpoint); +#endif + h_ctl_pitch_setpoint = nav_pitch; Bound(h_ctl_pitch_setpoint, H_CTL_PITCH_MIN_SETPOINT, H_CTL_PITCH_MAX_SETPOINT); if (kill_throttle || (!estimator_flight_time && !launch)) diff --git a/sw/ground_segment/cockpit/pages.ml b/sw/ground_segment/cockpit/pages.ml index 5d08601f27..d44c5b6200 100644 --- a/sw/ground_segment/cockpit/pages.ml +++ b/sw/ground_segment/cockpit/pages.ml @@ -235,7 +235,7 @@ let one_setting = fun i do_change packing s (tooltips:GData.tooltips) (strip:Str else (* slider *) let value = (lower +. upper) /. 2. in let adj = GData.adjustment ~value ~lower ~upper:(upper+.10.) ~step_incr () in - let _scale = GRange.scale `HORIZONTAL ~digits:2 ~adjustment:adj ~packing:hbox#add () in + let _scale = GRange.scale `HORIZONTAL ~digits:3 ~adjustment:adj ~packing:hbox#add () in (fun _ -> do_change i adj#value) in