Paparazzi UAS
v5.17_devel24g2ae834f
Paparazzi is a free software Unmanned Aircraft System.

This module implements optical flow landings in which the divergence is kept constant. More...
#include "std.h"
Go to the source code of this file.
Data Structures  
struct  OpticalFlowLanding 
Macros  
#define  GUIDANCE_H_MODE_MODULE_SETTING GUIDANCE_H_MODE_NAV 
#define  GUIDANCE_V_MODE_MODULE_SETTING GUIDANCE_V_MODE_MODULE 
Functions  
void  guidance_v_module_init (void) 
void  guidance_v_module_enter (void) 
Entering the vertical module (user switched to module) More...  
void  guidance_v_module_run (bool in_flight) 
Variables  
struct OpticalFlowLanding  of_landing_ctrl 
This module implements optical flow landings in which the divergence is kept constant.
When using a fixed gain for control, the covariance between thrust and divergence is tracked, so that the drone knows when it has arrived close to the landing surface. Then, a final landing procedure is triggered. It can also be set to adaptive gain control, where the goal is to continuously gauge the distance to the landing surface. In this mode, the drone will oscillate all the way down to the surface.
de Croon, G.C.H.E. (2016). Monocular distance estimation with optical flow maneuvers and efference copies: a stabilitybased strategy. Bioinspiration & biomimetics, 11(1), 016004. http://iopscience.iop.org/article/10.1088/17483190/11/1/016004
Based on the above theory, we have also developed a new strategy for landing that consists of two phases: (1) while hovering, the drone determines the optimal gain by increasing the gain until oscillation (2) the drone starts landing while exponentially decreasing the gain over time
This strategy leads to smooth, highperformance constant divergence landings, as explained in the article: H.W. Ho, G.C.H.E. de Croon, E. van Kampen, Q.P. Chu, and M. Mulder (submitted) Adaptive Control Strategy for Constant Optical Flow Divergence Landing, https://arxiv.org/abs/1609.06767
Definition in file optical_flow_landing.h.
struct OpticalFlowLanding 
Definition at line 49 of file optical_flow_landing.h.
Data Fields  

float  agl  agl = height from sonar (only used when using "fake" divergence) 
float  agl_lp  lowpass version of agl 
uint32_t  CONTROL_METHOD  type of divergence control: 0 = fixed gain, 1 = adaptive gain 
float  cov_limit  for fixed gain control, what is the cov limit triggering the landing 
uint32_t  COV_METHOD  method to calculate the covariance: between thrust and div (0) or div and div past (1) 
float  cov_set_point  for adaptive gain control, setpoint of the covariance (oscillations) 
float  d_err  difference of error for the Dgain 
uint32_t  delay_steps  number of delay steps for div past 
float  dgain  Dgain for constant divergence control. 
float  dgain_adaptive  Dgain for adaptive gain control. 
float  divergence  Divergence estimate. 
float  divergence_setpoint  setpoint for constant divergence approach 
bool  elc_oscillate  Whether or not to oscillate at beginning of elc to find optimum gain. 
float  igain  Igain for constant divergence control. 
float  igain_adaptive  Igain for adaptive gain control. 
float  lp_const  lowpass filter constant 
float  lp_cov_div_factor  lowpass factor for the covariance of divergence in order to trigger the second landing phase in the exponential strategy. 
float  nominal_thrust  nominal thrust around which the PIDcontrol operates 
float  p_land_threshold  if during the exponential landing the gain reaches this value, the final landing procedure is triggered 
float  pgain  Pgain for constant divergence control (from divergence error to thrust) 
float  pgain_adaptive  Pgain for adaptive gain control. 
float  previous_err  Previous divergence tracking error. 
float  reduction_factor_elc  reduction factor  after oscillation, how much to reduce the gain... 
float  sum_err  integration of the error for Igain 
float  t_transition  how many seconds the drone has to be oscillating in order to transition to the hover phase with reduced gain 
float  vel  vertical velocity as determined with sonar (only used when using "fake" divergence) 
uint32_t  VISION_METHOD  whether to use vision (1) or Optitrack / sonar (0) 
uint32_t  window_size  number of time steps in "window" used for getting the covariance 
#define GUIDANCE_H_MODE_MODULE_SETTING GUIDANCE_H_MODE_NAV 
Definition at line 84 of file optical_flow_landing.h.
#define GUIDANCE_V_MODE_MODULE_SETTING GUIDANCE_V_MODE_MODULE 
Definition at line 87 of file optical_flow_landing.h.
void guidance_v_module_enter  (  void  ) 
Entering the vertical module (user switched to module)
Entering the vertical module (user switched to module)
Definition at line 111 of file ctrl_module_innerloop_demo.c.
void guidance_v_module_init  (  void  ) 
Definition at line 105 of file ctrl_module_innerloop_demo.c.
void guidance_v_module_run  (  bool  in_flight  ) 
Definition at line 656 of file optical_flow_hover.c.
struct OpticalFlowLanding of_landing_ctrl 
Definition at line 157 of file optical_flow_landing.c.
Referenced by final_landing_procedure(), guidance_v_module_enter(), PID_divergence_control(), reset_all_vars(), send_divergence(), set_cov_div(), update_errors(), vertical_ctrl_agl_cb(), vertical_ctrl_module_init(), and vertical_ctrl_module_run().