Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
guidance_h_ref.c File Reference

Reference generation for horizontal guidance. More...

#include "firmwares/rotorcraft/guidance/guidance_h_ref.h"
#include "generated/airframe.h"
+ Include dependency graph for guidance_h_ref.c:

Go to the source code of this file.

Macros

#define GUIDANCE_H_REF_MAX_ACCEL   5.66
 Accel saturation. More...
 
#define GH_MAX_ACCEL   BFP_OF_REAL(GUIDANCE_H_REF_MAX_ACCEL, GH_ACCEL_REF_FRAC)
 
#define GUIDANCE_H_REF_MAX_SPEED   5.
 Speed saturation. More...
 
#define GH_MAX_SPEED_REF_FRAC   7
 
#define GH_MAX_SPEED   BFP_OF_REAL(GUIDANCE_H_REF_MAX_SPEED, GH_MAX_SPEED_REF_FRAC)
 
#define GUIDANCE_H_REF_OMEGA   RadOfDeg(67.)
 second order model natural frequency More...
 
#define GUIDANCE_H_REF_ZETA   0.85
 second order model damping More...
 
#define GH_ZETA_OMEGA_FRAC   10
 
#define GH_ZETA_OMEGA   BFP_OF_REAL((GUIDANCE_H_REF_ZETA*GUIDANCE_H_REF_OMEGA), GH_ZETA_OMEGA_FRAC)
 
#define GH_OMEGA_2_FRAC   7
 
#define GH_OMEGA_2   BFP_OF_REAL((GUIDANCE_H_REF_OMEGA*GUIDANCE_H_REF_OMEGA), GH_OMEGA_2_FRAC)
 
#define GH_REF_THAU_F   0.5
 first order time constant More...
 
#define GH_REF_INV_THAU_FRAC   16
 
#define GH_REF_INV_THAU   BFP_OF_REAL((1./GH_REF_THAU_F), GH_REF_INV_THAU_FRAC)
 

Functions

void gh_set_ref (struct Int32Vect2 pos, struct Int32Vect2 speed, struct Int32Vect2 accel)
 
void gh_update_ref_from_pos_sp (struct Int32Vect2 pos_sp)
 
void gh_update_ref_from_speed_sp (struct Int32Vect2 speed_sp)
 

Variables

struct Int32Vect2 gh_accel_ref
 Reference model acceleration. More...
 
struct Int32Vect2 gh_speed_ref
 Reference model speed. More...
 
struct Int64Vect2 gh_pos_ref
 
static struct Int32Vect2 gh_max_speed_ref
 
static struct Int32Vect2 gh_max_accel_ref
 
static int32_t route_ref
 
static int32_t s_route_ref
 
static int32_t c_route_ref
 

Detailed Description

Reference generation for horizontal guidance.

Definition in file guidance_h_ref.c.

Macro Definition Documentation

Definition at line 56 of file guidance_h_ref.c.

Referenced by gh_update_ref_from_pos_sp(), and gh_update_ref_from_speed_sp().

#define GH_MAX_SPEED_REF_FRAC   7
Todo:
GH_MAX_SPEED must be limited to 2^14 to avoid overflow

Definition at line 63 of file guidance_h_ref.c.

Referenced by gh_update_ref_from_pos_sp(), and gh_update_ref_from_speed_sp().

Definition at line 77 of file guidance_h_ref.c.

Referenced by gh_update_ref_from_pos_sp().

#define GH_OMEGA_2_FRAC   7

Definition at line 76 of file guidance_h_ref.c.

Referenced by gh_update_ref_from_pos_sp().

#define GH_REF_INV_THAU   BFP_OF_REAL((1./GH_REF_THAU_F), GH_REF_INV_THAU_FRAC)

Definition at line 82 of file guidance_h_ref.c.

Referenced by gh_update_ref_from_speed_sp().

#define GH_REF_INV_THAU_FRAC   16

Definition at line 81 of file guidance_h_ref.c.

Referenced by gh_update_ref_from_speed_sp().

#define GH_REF_THAU_F   0.5

first order time constant

Definition at line 80 of file guidance_h_ref.c.

Definition at line 75 of file guidance_h_ref.c.

Referenced by gh_update_ref_from_pos_sp().

#define GH_ZETA_OMEGA_FRAC   10

Definition at line 74 of file guidance_h_ref.c.

Referenced by gh_update_ref_from_pos_sp().

#define GUIDANCE_H_REF_MAX_ACCEL   5.66

Accel saturation.

tanf(RadOfDeg(30.))*9.81 = 5.66

Definition at line 54 of file guidance_h_ref.c.

#define GUIDANCE_H_REF_MAX_SPEED   5.

Speed saturation.

Definition at line 60 of file guidance_h_ref.c.

#define GUIDANCE_H_REF_OMEGA   RadOfDeg(67.)

second order model natural frequency

Definition at line 68 of file guidance_h_ref.c.

#define GUIDANCE_H_REF_ZETA   0.85

second order model damping

Definition at line 72 of file guidance_h_ref.c.

Function Documentation

void gh_set_ref ( struct Int32Vect2  pos,
struct Int32Vect2  speed,
struct Int32Vect2  accel 
)

Variable Documentation

int32_t c_route_ref
static

Definition at line 89 of file guidance_h_ref.c.

Referenced by gh_update_ref_from_pos_sp(), and gh_update_ref_from_speed_sp().

struct Int32Vect2 gh_accel_ref

Reference model acceleration.

in meters/sec2 (output) fixed point representation: Q23.8 accuracy 0.0039, range 8388km/s2

Definition at line 35 of file guidance_h_ref.c.

Referenced by gh_set_ref(), gh_update_ref_from_pos_sp(), gh_update_ref_from_speed_sp(), and guidance_h_update_reference().

struct Int32Vect2 gh_max_accel_ref
static

Definition at line 85 of file guidance_h_ref.c.

Referenced by gh_update_ref_from_pos_sp(), and gh_update_ref_from_speed_sp().

struct Int32Vect2 gh_max_speed_ref
static

Definition at line 84 of file guidance_h_ref.c.

Referenced by gh_update_ref_from_pos_sp(), and gh_update_ref_from_speed_sp().

struct Int32Vect2 gh_speed_ref

Reference model speed.

in meters/sec with fixedpoint representation: Q14.17 accuracy 0.0000076 , range 16384m/s

Definition at line 42 of file guidance_h_ref.c.

Referenced by gh_set_ref(), gh_update_ref_from_pos_sp(), gh_update_ref_from_speed_sp(), and guidance_h_update_reference().

int32_t route_ref
static

Definition at line 87 of file guidance_h_ref.c.

Referenced by gh_update_ref_from_pos_sp(), and gh_update_ref_from_speed_sp().

int32_t s_route_ref
static

Definition at line 88 of file guidance_h_ref.c.

Referenced by gh_update_ref_from_pos_sp(), and gh_update_ref_from_speed_sp().