Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
guidance_plane.c File Reference

Guidance controller for planes with PID compatible with the rotorcraft firmware no airspeed control. More...

#include "firmwares/rotorcraft/guidance/guidance_plane.h"
#include "firmwares/rotorcraft/navigation.h"
#include "firmwares/rotorcraft/guidance.h"
#include "firmwares/rotorcraft/stabilization.h"
#include "generated/airframe.h"
#include "generated/flight_plan.h"
#include "modules/nav/waypoints.h"
#include "state.h"
#include "modules/datalink/telemetry.h"
Include dependency graph for guidance_plane.c:

Go to the source code of this file.

Macros

#define GUIDANCE_PLANE_MAX_BANK   RadOfDeg(45.f)
#define GUIDANCE_PLANE_MAX_PITCH   RadOfDeg(30.f)
#define GUIDANCE_PLANE_MIN_PITCH   RadOfDeg(-20.f)
#define GUIDANCE_PLANCE_COURSE_PRE_BANK   1.f
#define GUIDANCE_PLANE_MAX_CLIMB   2.f
#define GUIDANCE_PLANE_PITCH_OF_VZ   RadOfDeg(5.f)
#define GUIDANCE_PLANE_PITCH_TRIM   RadOfDeg(0.f)
#define GUIDANCE_PLANE_CLIMB_THROTTLE_INCREMENT   0.1f
#define GUIDANCE_PLANE_PITCH_MAX_SUM_ERR   (RadOfDeg(10.))
#define GUIDANCE_PLANE_THROTTLE_MAX_SUM_ERR   0.4

Functions

void guidance_plane_init (void)
struct StabilizationSetpoint guidance_plane_attitude_from_nav (bool in_flight UNUSED)
 run horizontal control loop for position and speed control
static void guidance_plane_set_pitch (bool in_flight)
static void guidance_plane_set_throttle (bool in_flight)
struct ThrustSetpoint guidance_plane_thrust_from_nav (bool in_flight)
 run vertical control loop for position and speed control
void guidance_plane_enter (void)

Variables

struct GuidancePlane guidance_plane
 Guidance PID structyre.
static float pitch_sum_err
static float throttle_sum_err

Detailed Description

Guidance controller for planes with PID compatible with the rotorcraft firmware no airspeed control.

Definition in file guidance_plane.c.

Macro Definition Documentation

◆ GUIDANCE_PLANCE_COURSE_PRE_BANK

#define GUIDANCE_PLANCE_COURSE_PRE_BANK   1.f

Definition at line 50 of file guidance_plane.c.

Referenced by guidance_plane_init().

◆ GUIDANCE_PLANE_CLIMB_THROTTLE_INCREMENT

#define GUIDANCE_PLANE_CLIMB_THROTTLE_INCREMENT   0.1f

Definition at line 66 of file guidance_plane.c.

Referenced by guidance_plane_init().

◆ GUIDANCE_PLANE_MAX_BANK

#define GUIDANCE_PLANE_MAX_BANK   RadOfDeg(45.f)

Definition at line 38 of file guidance_plane.c.

Referenced by guidance_plane_init().

◆ GUIDANCE_PLANE_MAX_CLIMB

#define GUIDANCE_PLANE_MAX_CLIMB   2.f

Definition at line 54 of file guidance_plane.c.

Referenced by guidance_plane_init().

◆ GUIDANCE_PLANE_MAX_PITCH

#define GUIDANCE_PLANE_MAX_PITCH   RadOfDeg(30.f)

Definition at line 42 of file guidance_plane.c.

Referenced by guidance_plane_init().

◆ GUIDANCE_PLANE_MIN_PITCH

#define GUIDANCE_PLANE_MIN_PITCH   RadOfDeg(-20.f)

Definition at line 46 of file guidance_plane.c.

Referenced by guidance_plane_init().

◆ GUIDANCE_PLANE_PITCH_MAX_SUM_ERR

#define GUIDANCE_PLANE_PITCH_MAX_SUM_ERR   (RadOfDeg(10.))

Definition at line 80 of file guidance_plane.c.

Referenced by guidance_plane_set_pitch().

◆ GUIDANCE_PLANE_PITCH_OF_VZ

#define GUIDANCE_PLANE_PITCH_OF_VZ   RadOfDeg(5.f)

Definition at line 58 of file guidance_plane.c.

Referenced by guidance_plane_init().

◆ GUIDANCE_PLANE_PITCH_TRIM

#define GUIDANCE_PLANE_PITCH_TRIM   RadOfDeg(0.f)

Definition at line 62 of file guidance_plane.c.

Referenced by guidance_plane_init().

◆ GUIDANCE_PLANE_THROTTLE_MAX_SUM_ERR

#define GUIDANCE_PLANE_THROTTLE_MAX_SUM_ERR   0.4

Definition at line 83 of file guidance_plane.c.

Referenced by guidance_plane_set_throttle().

Function Documentation

◆ guidance_plane_attitude_from_nav()

struct StabilizationSetpoint guidance_plane_attitude_from_nav ( bool in_flight UNUSED)

run horizontal control loop for position and speed control

Definition at line 128 of file guidance_plane.c.

References guidance_plane_attitude_from_nav(), if(), nav, NAV_HORIZONTAL_MODE_ATTITUDE, NAV_HORIZONTAL_MODE_GUIDED, NAV_HORIZONTAL_MODE_NONE, and UNUSED.

Referenced by control_mixing_heewing_nav_run(), and guidance_plane_attitude_from_nav().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ guidance_plane_enter()

void guidance_plane_enter ( void )

Definition at line 276 of file guidance_plane.c.

References pitch_sum_err, and throttle_sum_err.

◆ guidance_plane_init()

◆ guidance_plane_set_pitch()

void guidance_plane_set_pitch ( bool in_flight)
static

Definition at line 193 of file guidance_plane.c.

References guidance_plane, GUIDANCE_PLANE_PITCH_MAX_SUM_ERR, nav, pitch_sum_err, stateGetSpeedEnu_f(), and EnuCoor_f::z.

Referenced by guidance_plane_thrust_from_nav().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ guidance_plane_set_throttle()

void guidance_plane_set_throttle ( bool in_flight)
static

Definition at line 221 of file guidance_plane.c.

References guidance_plane, GUIDANCE_PLANE_THROTTLE_MAX_SUM_ERR, MAX_PPRZ, stateGetSpeedEnu_f(), throttle_sum_err, TRIM_UPPRZ, and EnuCoor_f::z.

Referenced by guidance_plane_thrust_from_nav().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ guidance_plane_thrust_from_nav()

struct ThrustSetpoint guidance_plane_thrust_from_nav ( bool in_flight)

run vertical control loop for position and speed control

Definition at line 253 of file guidance_plane.c.

References guidance_plane, guidance_plane_set_pitch(), guidance_plane_set_throttle(), guidance_plane_thrust_from_nav(), if(), nav, NAV_VERTICAL_MODE_CLIMB, and NAV_VERTICAL_MODE_MANUAL.

Referenced by control_mixing_heewing_nav_run(), and guidance_plane_thrust_from_nav().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ guidance_plane

◆ pitch_sum_err

float pitch_sum_err
static

◆ throttle_sum_err

float throttle_sum_err
static