Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
guidance_common.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2006-2014 The Paparazzi Team
3 *
4 * This file is part of paparazzi.
5 *
6 * paparazzi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * paparazzi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with paparazzi; see the file COPYING. If not, write to
18 * the Free Software Foundation, 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
20 */
21
28#ifndef FW_V_CTL_COMMON_H
29#define FW_V_CTL_COMMON_H
30
31
32#include <inttypes.h>
33#include "paparazzi.h"
34
35/* Vertical mode */
36#define V_CTL_MODE_MANUAL 0
37#define V_CTL_MODE_AUTO_THROTTLE 1
38#define V_CTL_MODE_AUTO_CLIMB 2
39#define V_CTL_MODE_AUTO_ALT 3
40#define V_CTL_MODE_LANDING 4
41#define V_CTL_MODE_NB 5
42extern uint8_t v_ctl_mode;
43
44/* Inner loop */
45extern float v_ctl_climb_setpoint;
47#define V_CTL_CLIMB_MODE_AUTO_THROTTLE 0
48#define V_CTL_CLIMB_MODE_AUTO_PITCH 1
49
51#define V_CTL_AUTO_THROTTLE_STANDARD 0
52#define V_CTL_AUTO_THROTTLE_AGRESSIVE 1
53#define V_CTL_AUTO_THROTTLE_BLENDED 2
54
55// Needed for telemetry
57
58// Needed for course loop gain
59extern float v_ctl_altitude_error;
60
61// Old airspeed code wants:
64
68extern float v_ctl_pitch_setpoint;
69
70extern void v_ctl_init(void);
71extern void v_ctl_altitude_loop(void);
72extern void v_ctl_climb_loop(void);
73extern void v_ctl_landing_loop(void);
74
78extern void v_ctl_guidance_loop(void);
79
81extern void v_ctl_throttle_slew(void);
82
83#define guidance_v_SetCruiseThrottle(_v) { \
84 v_ctl_auto_throttle_cruise_throttle = (_v ? _v : v_ctl_auto_throttle_nominal_cruise_throttle); \
85 Bound(v_ctl_auto_throttle_cruise_throttle, v_ctl_auto_throttle_min_cruise_throttle, v_ctl_auto_throttle_max_cruise_throttle); \
86 }
87
88#define guidance_v_SetAutoThrottleIgain(_v) { \
89 v_ctl_auto_throttle_igain = _v; \
90 v_ctl_auto_throttle_sum_err = 0; \
91 }
92
93
94
95#endif
96
void v_ctl_landing_loop(void)
Definition guidance_v.c:357
pprz_t v_ctl_throttle_setpoint
void v_ctl_climb_loop(void)
Auto-throttle inner loop.
float v_ctl_auto_airspeed_controlled
uint8_t v_ctl_climb_mode
Definition energy_ctrl.c:75
uint8_t v_ctl_auto_throttle_submode
Definition energy_ctrl.c:76
float v_ctl_pitch_setpoint
void v_ctl_guidance_loop(void)
General guidance logic This will call the proper control loops according to the sub-modes.
Definition guidance_v.c:265
void v_ctl_throttle_slew(void)
Computes throttle_slewed from throttle_setpoint.
float v_ctl_auto_throttle_sum_err
Definition energy_ctrl.c:77
pprz_t v_ctl_throttle_slewed
void v_ctl_altitude_loop(void)
outer loop
float v_ctl_auto_throttle_cruise_throttle
void v_ctl_init(void)
float v_ctl_altitude_error
in meters, (setpoint - alt) -> positive = too low
Definition energy_ctrl.c:92
float v_ctl_auto_groundspeed_setpoint
in meters per second
float v_ctl_climb_setpoint
Definition energy_ctrl.c:98
uint8_t v_ctl_mode
Definition energy_ctrl.c:74
int16_t pprz_t
Definition paparazzi.h:6
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.