Paparazzi UAS  v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
guidance_v.h File Reference

Vertical guidance for rotorcrafts. More...

+ Include dependency graph for guidance_v.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GUIDANCE_V_MODE_KILL   0
 
#define GUIDANCE_V_MODE_RC_DIRECT   1
 
#define GUIDANCE_V_MODE_RC_CLIMB   2
 
#define GUIDANCE_V_MODE_CLIMB   3
 
#define GUIDANCE_V_MODE_HOVER   4
 
#define GUIDANCE_V_MODE_NAV   5
 
#define GUIDANCE_V_MODE_MODULE   6
 
#define GUIDANCE_V_MODE_FLIP   7
 
#define GUIDANCE_V_MODE_GUIDED   8
 
#define GuidanceVSetRef   guidance_v_set_ref
 
#define guidance_v_SetKi(_val)
 

Functions

void guidance_v_init (void)
 
void guidance_v_read_rc (void)
 
void guidance_v_mode_changed (uint8_t new_mode)
 
void guidance_v_thrust_adapt (bool in_flight)
 
void guidance_v_notify_in_flight (bool in_flight)
 
void guidance_v_run (bool in_flight)
 
void guidance_v_z_enter (void)
 
void guidance_v_set_ref (int32_t pos, int32_t speed, int32_t accel)
 Set guidance ref parameters. More...
 
void run_hover_loop (bool in_flight)
 
void guidance_v_from_nav (bool in_flight)
 Set guidance setpoint from NAV and run hover loop. More...
 
void guidance_v_guided_enter (void)
 Enter GUIDED mode control. More...
 
void guidance_v_guided_run (bool in_flight)
 Run GUIDED mode control. More...
 
bool guidance_v_set_guided_z (float z)
 Set z setpoint in GUIDED mode. More...
 
bool guidance_v_set_guided_vz (float vz)
 Set z velocity setpoint in GUIDED mode. More...
 
bool guidance_v_set_guided_th (float th)
 

Variables

uint8_t guidance_v_mode
 
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_z_sum_err
 accumulator for I-gain More...
 
int32_t guidance_v_ff_cmd
 feed-forward command More...
 
int32_t guidance_v_fb_cmd
 feed-back command More...
 
int32_t guidance_v_rc_delta_t
 Direct throttle from radio control. More...
 
int32_t guidance_v_delta_t
 thrust command. More...
 
float guidance_v_nominal_throttle
 nominal throttle for hover. More...
 
bool guidance_v_adapt_throttle_enabled
 Use adaptive throttle command estimation. More...
 
int32_t guidance_v_thrust_coeff
 
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...
 

Detailed Description

Vertical guidance for rotorcrafts.

Definition in file guidance_v.h.

Macro Definition Documentation

#define GUIDANCE_V_MODE_CLIMB   3
#define GUIDANCE_V_MODE_FLIP   7

Definition at line 42 of file guidance_v.h.

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

#define GUIDANCE_V_MODE_HOVER   4
#define GUIDANCE_V_MODE_KILL   0

Definition at line 35 of file guidance_v.h.

Referenced by autopilot_static_set_mode(), and guidance_v_init().

#define GUIDANCE_V_MODE_MODULE   6

Definition at line 41 of file guidance_v.h.

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

#define GUIDANCE_V_MODE_NAV   5

Definition at line 40 of file guidance_v.h.

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

#define GUIDANCE_V_MODE_RC_CLIMB   2

Definition at line 37 of file guidance_v.h.

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

#define GUIDANCE_V_MODE_RC_DIRECT   1

Definition at line 36 of file guidance_v.h.

Referenced by autopilot_static_set_mode(), and guidance_v_run().

#define guidance_v_SetKi (   _val)
Value:
{ \
}
int32_t guidance_v_z_sum_err
accumulator for I-gain
Definition: guidance_v.c:136
int32_t guidance_v_ki
vertical control I-gain
Definition: guidance_v.c:134

Definition at line 150 of file guidance_v.h.

Function Documentation

void guidance_v_from_nav ( bool  in_flight)
void guidance_v_guided_enter ( void  )

Enter GUIDED mode control.

Definition at line 501 of file guidance_v.c.

References GUIDANCE_V_GUIDED_MODE_ZHOLD, GuidanceVSetRef, stateGetPositionNed_i(), stateGetSpeedNed_i(), and NedCoor_i::z.

Referenced by guidance_v_mode_changed().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void guidance_v_guided_run ( bool  in_flight)
void guidance_v_mode_changed ( uint8_t  new_mode)
void guidance_v_notify_in_flight ( bool  in_flight)

Definition at line 267 of file guidance_v.c.

References gv_adapt_init().

+ Here is the call graph for this function:

void guidance_v_read_rc ( void  )
bool guidance_v_set_guided_th ( float  th)

Definition at line 583 of file guidance_v.c.

References GUIDANCE_V_GUIDED_MODE_THROTTLE, GUIDANCE_V_MODE_GUIDED, GuidanceVSetRef, MAX_PPRZ, stateGetPositionNed_i(), and stateGetSpeedNed_i().

+ Here is the call graph for this function:

bool guidance_v_set_guided_vz ( float  vz)

Set z velocity setpoint in GUIDED mode.

Parameters
vzSetpoint (down is positive) in meters/second.
Returns
TRUE if setpoint was set (currently in GUIDANCE_V_MODE_GUIDED)

Definition at line 567 of file guidance_v.c.

References GUIDANCE_V_GUIDED_MODE_CLIMB, GUIDANCE_V_MODE_GUIDED, GuidanceVSetRef, SPEED_BFP_OF_REAL, stateGetPositionNed_i(), and stateGetSpeedNed_i().

Referenced by autopilot_guided_move_ned(), and autopilot_guided_update().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool guidance_v_set_guided_z ( float  z)

Set z setpoint in GUIDED mode.

Parameters
zSetpoint (down is positive) in meters.
Returns
TRUE if setpoint was set (currently in GUIDANCE_V_MODE_GUIDED)

Definition at line 547 of file guidance_v.c.

References GUIDANCE_V_GUIDED_MODE_ZHOLD, GUIDANCE_V_MODE_GUIDED, GuidanceVSetRef, POS_BFP_OF_REAL, stateGetPositionNed_i(), and stateGetSpeedNed_i().

Referenced by autopilot_guided_goto_ned(), and autopilot_guided_update().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void guidance_v_set_ref ( int32_t  pos,
int32_t  speed,
int32_t  accel 
)

Set guidance ref parameters.

Definition at line 368 of file guidance_v.c.

References gv_set_ref().

+ Here is the call graph for this function:

void guidance_v_thrust_adapt ( bool  in_flight)

Definition at line 274 of file guidance_v.c.

References get_vertical_thrust_coeff(), guidance_v_thrust_coeff, gv_adapt_init(), gv_adapt_run(), INT32_TRIG_FRAC, stabilization_cmd, and stateGetAccelNed_i().

Referenced by guidance_v_run().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void guidance_v_z_enter ( void  )

Definition at line 355 of file guidance_v.c.

References GuidanceVSetRef, stateGetPositionNed_i(), and NedCoor_i::z.

+ Here is the call graph for this function:

Variable Documentation

bool guidance_v_adapt_throttle_enabled

Use adaptive throttle command estimation.

Definition at line 105 of file guidance_v.c.

int32_t guidance_v_delta_t

thrust command.

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

Definition at line 102 of file guidance_v.c.

Referenced by guidance_hybrid_vertical(), guidance_v_from_nav(), guidance_v_guided_run(), and guidance_v_run().

int32_t guidance_v_fb_cmd

feed-back command

Definition at line 101 of file guidance_v.c.

Referenced by run_hover_loop().

int32_t guidance_v_ff_cmd

feed-forward command

Definition at line 100 of file guidance_v.c.

int32_t guidance_v_kd

vertical control D-gain

Definition at line 133 of file guidance_v.c.

Referenced by guidance_hybrid_vertical().

int32_t guidance_v_ki

vertical control I-gain

Definition at line 134 of file guidance_v.c.

Referenced by guidance_hybrid_vertical().

int32_t guidance_v_kp

vertical control P-gain

Definition at line 132 of file guidance_v.c.

Referenced by guidance_hybrid_vertical().

uint8_t guidance_v_mode

Definition at line 99 of file guidance_v.c.

Referenced by booz_fms_impl_periodic(), and send_status().

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 104 of file guidance_v.c.

Referenced by guidance_hybrid_vertical(), and vertical_ctrl_module_init().

int32_t guidance_v_rc_delta_t

Direct throttle from radio control.

range 0:MAX_PPRZ

Definition at line 117 of file guidance_v.c.

Referenced by guidance_v_run().

int32_t guidance_v_thrust_coeff

Definition at line 138 of file guidance_v.c.

Referenced by guidance_h_traj_run(), and guidance_v_thrust_adapt().

int32_t guidance_v_z_ref

altitude reference in meters.

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

Definition at line 128 of file guidance_v.c.

Referenced by gps_sim_hitl_event(), and guidance_indi_run().

int32_t guidance_v_z_sp

altitude setpoint in meters (input).

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

Definition at line 125 of file guidance_v.c.

Referenced by send_fp().

int32_t guidance_v_z_sum_err

accumulator for I-gain

Definition at line 136 of file guidance_v.c.

Referenced by run_hover_loop().

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 129 of file guidance_v.c.

Referenced by gps_sim_hitl_event().

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 126 of file guidance_v.c.

Referenced by autopilot_static_set_mode().

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 130 of file guidance_v.c.

Referenced by gps_sim_hitl_event().