|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
34 #define THROTTLE_CURVE_SWITCH_VAL (MAX_PPRZ*2/THROTTLE_CURVES_NB)
37 #ifndef THROTTLE_CURVE_RPM_FB_P
38 #define THROTTLE_CURVE_RPM_FB_P 0.0
41 #ifndef THROTTLE_CURVE_RPM_FB_I
42 #define THROTTLE_CURVE_RPM_FB_I 0.0
45 #ifndef THROTTLE_CURVE_RPM_INC_LIMIT
46 #define THROTTLE_CURVE_RPM_INC_LIMIT 512
50 #ifndef THROTTLE_CURVE_RPM_ID
51 #define THROTTLE_CURVE_RPM_ID ABI_BROADCAST
53 #ifndef THROTTLE_CURVE_RPM_ACT
54 #define THROTTLE_CURVE_RPM_ACT 0
62 .curves = THROTTLE_CURVES
65 #if PERIODIC_TELEMETRY
94 #if PERIODIC_TELEMETRY
120 Bound(
mode, 0, THROTTLE_CURVES_NB - 1);
140 int8_t curve_p = ((float)
cmds[COMMAND_THRUST] / curve_range);
144 uint16_t x =
cmds[COMMAND_THRUST] - curve_p * curve_range;
146 + ((curve.
throttle[curve_p + 1] - curve.
throttle[curve_p]) * x / curve_range);
149 if (curve.
rpm[0] != 0xFFFF) {
154 + ((curve.
rpm[curve_p + 1] - curve.
rpm[curve_p]) * x / curve_range);
165 Bound(trimmed_throttle, 0,
MAX_PPRZ);
190 }
else if (curve.
rpm[0] == 0xFFFF) {
200 cmds[COMMAND_THRUST] = 0;
211 Bound(new_mode, 0, THROTTLE_CURVES_NB - 1);
bool autopilot_get_motors_on(void)
get motors status
uint16_t throttle[THROTTLE_POINTS_NB]
Throttle points in the curve.
#define THROTTLE_CURVE_RPM_ID
int32_t throttle_trim
RPM feedback i gain.
float rpm_fb_p
RPM feedback p gain.
#define THROTTLE_CURVE_RPM_INC_LIMIT
float rpm_err_sum
Summed RPM error.
int16_t collective
Output collective of the throttle curve.
Event structure to store callbacks in a linked list.
#define THROTTLE_CURVE_RPM_ACT
#define THROTTLE_CURVE_SWITCH_VAL
static void throttle_curve_send_telem(struct transport_tx *trans, struct link_device *dev)
uint8_t nb_curves
The number of throttle/pitch curves.
struct throttle_curve_t throttle_curve
uint16_t rpm
Output RPM of the throttle curve.
int32_t coll_trim
Collective trim.
static const struct usb_device_descriptor dev
struct curve_t curves[THROTTLE_CURVES_NB]
Throttle/pitch curves.
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
uint8_t nb_points
The number of points in the curve.
uint8_t nav_mode
Nav Flight mode.
uint16_t rpm[THROTTLE_POINTS_NB]
RPM points in the curve.
void throttle_curve_init(void)
Initialize the default throttle curve values.
void throttle_curve_run(pprz_t cmds[], uint8_t ap_mode)
Run the throttle curve and generate the output throttle and pitch This depends on the FMODE(flight mo...
uint16_t throttle
Output thrust(throttle) of the throttle curve.
bool rpm_measured
Whenever the RPM is measured.
int16_t collective[THROTTLE_POINTS_NB]
The collective points in the curve.
static void rpm_cb(uint8_t sender_id, uint16_t *rpm, uint8_t num_act)
RPM callback for RPM based control throttle curves.
static uint8_t mode
mode holds the current sonar mode mode = 0 used at high altitude, uses 16 wave patterns mode = 1 used...
Hardware independent code for commands handling.
uint16_t rpm_meas
RPM measured.
void nav_throttle_curve_set(uint8_t mode)
Set a specific throttle curve based on the mode given with this function.
#define THROTTLE_CURVE_RPM_FB_I
#define THROTTLE_CURVE_RPM_FB_P
#define DefaultPeriodic
Set default periodic telemetry.
struct RadioControl radio_control
pprz_t values[RADIO_CONTROL_NB_CHANNEL]