Paparazzi UAS  v4.2.2_stable-4-gcc32f65
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
guidance_v.c File Reference

Vertical guidance for rotorcrafts. More...

+ Include dependency graph for guidance_v.c:

Go to the source code of this file.

Macros

#define GUIDANCE_V_C
 
#define GUIDANCE_V_USE_REF   1
 
#define GUIDANCE_V_GAIN_SCALER   48
 
#define GuidanceVSetRef(_pos, _speed, _accel)
 
#define FF_CMD_FRAC   18
 
#define MAX_BANK_COEF   (BFP_OF_REAL(RadOfDeg(30.),INT32_TRIG_FRAC))
 

Functions

 __attribute__ ((always_inline))
 
void guidance_v_read_rc (void)
 
void guidance_v_mode_changed (uint8_t new_mode)
 
void guidance_v_notify_in_flight (bool_t in_flight)
 
void guidance_v_run (bool_t in_flight)
 

Variables

uint8_t guidance_v_mode
 
int32_t guidance_v_ff_cmd
 feed-forward command More...
 
int32_t guidance_v_fb_cmd
 feed-back command More...
 
int32_t guidance_v_delta_t
 thrust command. More...
 
float guidance_v_nominal_throttle
 nominal throttle for hover. More...
 
int32_t guidance_v_rc_delta_t
 Direct throttle from radio control. More...
 
int32_t guidance_v_rc_zd_sp
 Vertical speed setpoint from radio control. More...
 
int32_t guidance_v_z_sp
 altitude setpoint in meters (input). More...
 
int32_t guidance_v_zd_sp
 vertical speed setpoint in meter/s (input). More...
 
int32_t guidance_v_z_ref
 altitude reference in meters. More...
 
int32_t guidance_v_zd_ref
 vertical speed reference in meter/s. More...
 
int32_t guidance_v_zdd_ref
 vertical acceleration reference in meter/s^2. More...
 
int32_t guidance_v_kp
 vertical control P-gain More...
 
int32_t guidance_v_kd
 vertical control D-gain More...
 
int32_t guidance_v_ki
 vertical control I-gain More...
 
int32_t guidance_v_z_sum_err
 accumulator for I-gain More...
 

Detailed Description

Vertical guidance for rotorcrafts.

Definition in file guidance_v.c.

Macro Definition Documentation

#define FF_CMD_FRAC   18

Definition at line 252 of file guidance_v.c.

#define GUIDANCE_V_C

Definition at line 27 of file guidance_v.c.

#define GUIDANCE_V_GAIN_SCALER   48

Definition at line 55 of file guidance_v.c.

#define GUIDANCE_V_USE_REF   1

Definition at line 28 of file guidance_v.c.

#define GuidanceVSetRef (   _pos,
  _speed,
  _accel 
)
Value:
{ \
gv_set_ref(_pos, _speed, _accel); \
}
static void gv_set_ref(int32_t alt, int32_t speed, int32_t accel)
int32_t guidance_v_zdd_ref
vertical acceleration reference in meter/s^2.
Definition: guidance_v.c:80
int32_t guidance_v_z_ref
altitude reference in meters.
Definition: guidance_v.c:78
int32_t guidance_v_zd_ref
vertical speed reference in meter/s.
Definition: guidance_v.c:79

Definition at line 89 of file guidance_v.c.

Referenced by guidance_v_mode_changed().

#define MAX_BANK_COEF   (BFP_OF_REAL(RadOfDeg(30.),INT32_TRIG_FRAC))

Definition at line 254 of file guidance_v.c.

Function Documentation

__attribute__ ( (always_inline)  )

Definition at line 97 of file guidance_v.c.

References guidance_v_kd, guidance_v_ki, guidance_v_kp, guidance_v_mode, GUIDANCE_V_MODE_KILL, guidance_v_nominal_throttle, guidance_v_z_sum_err, and gv_adapt_init().

+ Here is the call graph for this function:

void guidance_v_mode_changed ( uint8_t  new_mode)
void guidance_v_notify_in_flight ( bool_t  in_flight)

Definition at line 158 of file guidance_v.c.

References gv_adapt_init().

+ Here is the call graph for this function:

void guidance_v_read_rc ( void  )

Definition at line 118 of file guidance_v.c.

References guidance_v_rc_delta_t, guidance_v_rc_zd_sp, MAX_PPRZ, radio_control, and RADIO_THROTTLE.

Referenced by autopilot_on_rc_frame().

+ Here is the caller graph for this function:

Variable Documentation

int32_t guidance_v_delta_t

thrust command.

summation of feed-forward and feed-back commands, valid range 0 : MAX_PPRZ

Definition at line 60 of file guidance_v.c.

Referenced by guidance_v_run().

int32_t guidance_v_fb_cmd

feed-back command

Definition at line 59 of file guidance_v.c.

int32_t guidance_v_ff_cmd

feed-forward command

Definition at line 58 of file guidance_v.c.

int32_t guidance_v_kd

vertical control D-gain

Definition at line 83 of file guidance_v.c.

Referenced by __attribute__().

int32_t guidance_v_ki

vertical control I-gain

Definition at line 84 of file guidance_v.c.

Referenced by __attribute__().

int32_t guidance_v_kp

vertical control P-gain

Definition at line 82 of file guidance_v.c.

Referenced by __attribute__().

uint8_t guidance_v_mode
float guidance_v_nominal_throttle

nominal throttle for hover.

This is only used if #"GUIDANCE_V_NOMINAL_HOVER_THROTTLE is defined! Unit: factor of MAX_PPRZ with range 0.1 : 0.9

Definition at line 62 of file guidance_v.c.

Referenced by __attribute__().

int32_t guidance_v_rc_delta_t

Direct throttle from radio control.

range 0:MAX_PPRZ

Definition at line 68 of file guidance_v.c.

Referenced by guidance_v_read_rc(), and guidance_v_run().

int32_t guidance_v_rc_zd_sp

Vertical speed setpoint from radio control.

fixed point representation: Q12.19 accuracy 0.0000019, range +/-4096

Definition at line 74 of file guidance_v.c.

Referenced by guidance_v_read_rc(), and guidance_v_run().

int32_t guidance_v_z_ref

altitude reference in meters.

fixed point representation: Q23.8 accuracy 0.0039, range 8388km

Definition at line 78 of file guidance_v.c.

int32_t guidance_v_z_sp

altitude setpoint in meters (input).

fixed point representation: Q23.8 accuracy 0.0039, range 8388km

Definition at line 76 of file guidance_v.c.

Referenced by guidance_v_mode_changed(), and guidance_v_run().

int32_t guidance_v_z_sum_err

accumulator for I-gain

Definition at line 86 of file guidance_v.c.

Referenced by __attribute__(), and guidance_v_mode_changed().

int32_t guidance_v_zd_ref

vertical speed reference in meter/s.

fixed point representation: Q12.19 accuracy 0.0000038, range 4096

Definition at line 79 of file guidance_v.c.

Referenced by guidance_v_run().

int32_t guidance_v_zd_sp

vertical speed setpoint in meter/s (input).

fixed point representation: Q12.19 accuracy 0.0000019, range +/-4096

Definition at line 77 of file guidance_v.c.

Referenced by autopilot_set_mode(), guidance_v_mode_changed(), and guidance_v_run().

int32_t guidance_v_zdd_ref

vertical acceleration reference in meter/s^2.

fixed point representation: Q21.10 accuracy 0.0009766, range 2097152

Definition at line 80 of file guidance_v.c.