|
Paparazzi UAS
v4.9_devel-840-g45e46d9-dirty
Paparazzi is a free software Unmanned Aircraft System.
|
Total Energy (speed + height) control for fixed wing vehicles. More...
#include "firmwares/fixedwing/guidance/energy_ctrl.h"#include "state.h"#include "subsystems/nav.h"#include "generated/airframe.h"#include "firmwares/fixedwing/autopilot.h"#include "subsystems/ahrs.h"#include "subsystems/imu.h"
Include dependency graph for energy_ctrl.c:Go to the source code of this file.
Macros | |
| #define | V_CTL_AUTO_GROUNDSPEED_MAX_SUM_ERR 100 |
| #define | V_CTL_ALTITUDE_MAX_CLIMB 2; |
| #define | STALL_AIRSPEED NOMINAL_AIRSPEED |
| #define | AIRSPEED_SETPOINT_SLEW 1 |
| #define | V_CTL_THROTTLE_SLEW 1. |
Functions | |
| static void | ac_char_average (float *last, float new, int count) |
| static void | ac_char_update (float throttle, float pitch, float climb, float accelerate) |
| void | v_ctl_init (void) |
| void | v_ctl_altitude_loop (void) |
| outer loop | |
| static float | low_pass_vdot (float v) |
| void | v_ctl_climb_loop (void) |
| auto throttle inner loop | |
| void | v_ctl_throttle_slew (void) |
| Computes slewed throttle from throttle setpoint called at 20Hz. | |
Total Energy (speed + height) control for fixed wing vehicles.
Energy:
Equilibrium:
with:


Strategy:
Pseudo-Control Unit = dimensionless acceleration [g]
- pitch <-> pseudocontrol: sin(Theta) steers Vdot in [g] - throttle <-> pseudocontrol: motor characteristic as function of V x throttle steeds VDot
Definition in file energy_ctrl.c.
| #define AIRSPEED_SETPOINT_SLEW 1 |
Definition at line 149 of file energy_ctrl.c.
Referenced by v_ctl_climb_loop().
| #define STALL_AIRSPEED NOMINAL_AIRSPEED |
Definition at line 146 of file energy_ctrl.c.
Referenced by v_ctl_altitude_loop().
| #define V_CTL_ALTITUDE_MAX_CLIMB 2; |
Definition at line 141 of file energy_ctrl.c.
Referenced by potential_task(), v_ctl_altitude_loop(), and v_ctl_init().
| #define V_CTL_AUTO_GROUNDSPEED_MAX_SUM_ERR 100 |
Definition at line 132 of file energy_ctrl.c.
Referenced by v_ctl_climb_loop().
| #define V_CTL_THROTTLE_SLEW 1. |
Definition at line 409 of file energy_ctrl.c.
Referenced by ArduIMU_init(), and v_ctl_throttle_slew().
|
static |
Definition at line 165 of file energy_ctrl.c.
Referenced by ac_char_update().
Here is the caller graph for this function:
|
static |
Definition at line 170 of file energy_ctrl.c.
References ac_char_average(), ac_char_climb_count, ac_char_climb_max, ac_char_climb_pitch, ac_char_cruise_count, ac_char_cruise_pitch, ac_char_cruise_throttle, ac_char_descend_count, ac_char_descend_max, ac_char_descend_pitch, stateGetSpeedEnu_f(), and EnuCoor_i::z.
Referenced by v_ctl_climb_loop().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Definition at line 287 of file energy_ctrl.c.
References lp_vdot.
Referenced by v_ctl_climb_loop().
Here is the caller graph for this function:| void v_ctl_altitude_loop | ( | void | ) |
outer loop
Computes v_ctl_climb_setpoint and sets v_ctl_auto_throttle_submode
Definition at line 267 of file energy_ctrl.c.
Referenced by navigation_task().
Here is the caller graph for this function:| void v_ctl_climb_loop | ( | void | ) |
auto throttle inner loop
Definition at line 302 of file energy_ctrl.c.
Referenced by attitude_loop().
Here is the caller graph for this function:| void v_ctl_init | ( | void | ) |
Definition at line 196 of file energy_ctrl.c.
Referenced by init_ap().
Here is the caller graph for this function:| void v_ctl_throttle_slew | ( | void | ) |
Computes slewed throttle from throttle setpoint called at 20Hz.
Computes throttle_slewed from throttle_setpoint.
Definition at line 415 of file energy_ctrl.c.
Referenced by attitude_loop().
Here is the caller graph for this function:| int ac_char_climb_count = 0 |
Definition at line 157 of file energy_ctrl.c.
Referenced by ac_char_update().
| float ac_char_climb_max = 0.0f |
Definition at line 156 of file energy_ctrl.c.
Referenced by ac_char_update().
| float ac_char_climb_pitch = 0.0f |
Definition at line 155 of file energy_ctrl.c.
Referenced by ac_char_update().
| int ac_char_cruise_count = 0 |
Definition at line 163 of file energy_ctrl.c.
Referenced by ac_char_update().
| float ac_char_cruise_pitch = 0.0f |
Definition at line 162 of file energy_ctrl.c.
Referenced by ac_char_update().
| float ac_char_cruise_throttle = 0.0f |
Definition at line 161 of file energy_ctrl.c.
Referenced by ac_char_update().
| int ac_char_descend_count = 0 |
Definition at line 160 of file energy_ctrl.c.
Referenced by ac_char_update().
| float ac_char_descend_max = 0.0f |
Definition at line 159 of file energy_ctrl.c.
Referenced by ac_char_update().
| float ac_char_descend_pitch = 0.0f |
Definition at line 158 of file energy_ctrl.c.
Referenced by ac_char_update().
| const float dt = 1.0 / ((float)CONTROL_FREQUENCY) |
Definition at line 260 of file energy_ctrl.c.
Referenced by ahrs_propagate(), baro_event(), baro_ms5611_event(), ms2100_reset_cb(), propagate_ref(), propagate_state(), tcas_periodic_task_1Hz(), v_ctl_altitude_loop(), and v_ctl_climb_loop().
| float lp_vdot[5] |
Definition at line 284 of file energy_ctrl.c.
Referenced by low_pass_vdot().
| float v_ctl_airspeed_pgain |
Definition at line 94 of file energy_ctrl.c.
Referenced by v_ctl_climb_loop(), and v_ctl_init().
| float v_ctl_altitude_error |
in meters, (setpoint - alt) -> positive = too low
Definition at line 95 of file energy_ctrl.c.
Referenced by h_ctl_course_loop(), v_ctl_altitude_loop(), v_ctl_climb_auto_throttle_loop(), and v_ctl_init().
| float v_ctl_altitude_pgain |
Definition at line 93 of file energy_ctrl.c.
Referenced by gls(), v_ctl_altitude_loop(), and v_ctl_init().
| float v_ctl_altitude_pre_climb |
Path Angle.
Definition at line 92 of file energy_ctrl.c.
Referenced by v_ctl_altitude_loop(), and v_ctl_init().
| float v_ctl_altitude_setpoint |
in meters above MSL
Definition at line 91 of file energy_ctrl.c.
Referenced by flight_benchmark_periodic(), nav_set_altitude(), v_ctl_altitude_loop(), and v_ctl_init().
| float v_ctl_auto_airspeed_controlled |
Definition at line 126 of file energy_ctrl.c.
Referenced by v_ctl_climb_loop(), and v_ctl_init().
| float v_ctl_auto_airspeed_setpoint |
in meters per second
Definition at line 124 of file energy_ctrl.c.
Referenced by flight_benchmark_periodic(), gls(), v_ctl_altitude_loop(), v_ctl_climb_loop(), and v_ctl_init().
| float v_ctl_auto_airspeed_setpoint_slew |
Definition at line 125 of file energy_ctrl.c.
Referenced by v_ctl_climb_loop(), and v_ctl_init().
| float v_ctl_auto_groundspeed_igain |
Definition at line 130 of file energy_ctrl.c.
Referenced by v_ctl_climb_loop(), and v_ctl_init().
| float v_ctl_auto_groundspeed_pgain |
Definition at line 129 of file energy_ctrl.c.
Referenced by v_ctl_climb_loop(), and v_ctl_init().
| float v_ctl_auto_groundspeed_setpoint |
in meters per second
Definition at line 128 of file energy_ctrl.c.
Referenced by v_ctl_climb_loop(), and v_ctl_init().
| float v_ctl_auto_groundspeed_sum_err |
Definition at line 131 of file energy_ctrl.c.
Referenced by v_ctl_climb_loop(), and v_ctl_init().
| float v_ctl_auto_pitch_of_airspeed_dgain |
Definition at line 116 of file energy_ctrl.c.
Referenced by v_ctl_climb_loop(), and v_ctl_init().
| float v_ctl_auto_pitch_of_airspeed_igain |
Definition at line 115 of file energy_ctrl.c.
Referenced by v_ctl_climb_loop(), and v_ctl_init().
| float v_ctl_auto_pitch_of_airspeed_pgain |
Definition at line 114 of file energy_ctrl.c.
Referenced by v_ctl_climb_loop(), and v_ctl_init().
| float v_ctl_auto_throttle_climb_throttle_increment |
Definition at line 109 of file energy_ctrl.c.
Referenced by v_ctl_climb_auto_throttle_loop(), v_ctl_climb_loop(), v_ctl_init(), and v_ctl_set_throttle().
| float v_ctl_auto_throttle_cruise_throttle |
Definition at line 106 of file energy_ctrl.c.
Referenced by formation_flight(), potential_task(), start_formation(), stop_formation(), v_ctl_climb_auto_throttle_loop(), v_ctl_climb_loop(), v_ctl_init(), and v_ctl_set_throttle().
| float v_ctl_auto_throttle_nominal_cruise_pitch |
Definition at line 108 of file energy_ctrl.c.
Referenced by v_ctl_climb_loop(), and v_ctl_init().
| float v_ctl_auto_throttle_nominal_cruise_throttle |
Definition at line 107 of file energy_ctrl.c.
Referenced by v_ctl_climb_loop(), and v_ctl_init().
| float v_ctl_auto_throttle_of_airspeed_igain |
Definition at line 113 of file energy_ctrl.c.
Referenced by v_ctl_climb_loop(), and v_ctl_init().
| float v_ctl_auto_throttle_of_airspeed_pgain |
Definition at line 112 of file energy_ctrl.c.
Referenced by v_ctl_climb_loop(), and v_ctl_init().
| float v_ctl_auto_throttle_pitch_of_vz_pgain |
Definition at line 110 of file energy_ctrl.c.
Referenced by v_ctl_climb_auto_throttle_loop(), v_ctl_climb_loop(), v_ctl_init(), and v_ctl_set_pitch().
| uint8_t v_ctl_auto_throttle_submode = V_CTL_CLIMB_MODE_AUTO_THROTTLE |
Definition at line 79 of file energy_ctrl.c.
Referenced by h_ctl_course_loop(), nav_periodic_task(), v_ctl_altitude_loop(), v_ctl_climb_auto_throttle_loop(), and v_ctl_init().
| float v_ctl_auto_throttle_sum_err = 0 |
Definition at line 80 of file energy_ctrl.c.
Referenced by v_ctl_climb_auto_throttle_loop(), v_ctl_init(), and v_ctl_set_throttle().
| uint8_t v_ctl_climb_mode = V_CTL_CLIMB_MODE_AUTO_THROTTLE |
Definition at line 78 of file energy_ctrl.c.
Referenced by v_ctl_altitude_loop(), v_ctl_climb_loop(), and v_ctl_init().
| float v_ctl_climb_setpoint |
Definition at line 101 of file energy_ctrl.c.
Referenced by v_ctl_altitude_loop(), v_ctl_climb_auto_throttle_loop(), v_ctl_climb_loop(), v_ctl_init(), v_ctl_set_pitch(), and v_ctl_set_throttle().
| float v_ctl_desired_acceleration |
Definition at line 104 of file energy_ctrl.c.
Referenced by v_ctl_climb_loop().
| float v_ctl_energy_diff_igain |
Definition at line 122 of file energy_ctrl.c.
Referenced by v_ctl_climb_loop(), and v_ctl_init().
| float v_ctl_energy_diff_pgain |
Definition at line 121 of file energy_ctrl.c.
Referenced by v_ctl_climb_loop(), and v_ctl_init().
| float v_ctl_energy_total_igain |
Definition at line 119 of file energy_ctrl.c.
Referenced by v_ctl_climb_loop(), and v_ctl_init().
| float v_ctl_energy_total_pgain |
Definition at line 118 of file energy_ctrl.c.
Referenced by v_ctl_climb_loop(), and v_ctl_init().
| float v_ctl_max_acceleration = 0.5 |
Definition at line 98 of file energy_ctrl.c.
Referenced by v_ctl_climb_loop().
| float v_ctl_max_climb |
Definition at line 97 of file energy_ctrl.c.
Referenced by v_ctl_altitude_loop(), and v_ctl_init().
| uint8_t v_ctl_mode = V_CTL_MODE_MANUAL |
Definition at line 77 of file energy_ctrl.c.
Referenced by attitude_loop(), nav_home(), nav_periodic_task(), nav_without_gps(), navigation_task(), v_ctl_climb_loop(), and v_ctl_init().
| float v_ctl_pitch_setpoint |
Definition at line 136 of file energy_ctrl.c.
Referenced by attitude_loop(), v_ctl_climb_auto_throttle_loop(), v_ctl_climb_loop(), and v_ctl_set_pitch().
| pprz_t v_ctl_throttle_setpoint |
Definition at line 134 of file energy_ctrl.c.
Referenced by attitude_loop(), h_ctl_roll_loop(), telecommand_task(), v_ctl_climb_auto_throttle_loop(), v_ctl_climb_loop(), v_ctl_init(), and v_ctl_throttle_slew().
| pprz_t v_ctl_throttle_slewed |
Definition at line 135 of file energy_ctrl.c.
Referenced by attitude_loop(), and v_ctl_throttle_slew().