Paparazzi UAS  v4.2.2_stable-4-gcc32f65
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
guidance_v.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
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 
27 #ifndef GUIDANCE_V
28 #define GUIDANCE_V
29 
30 #include "std.h"
31 
32 #include "generated/airframe.h"
34 
39 #ifndef SUPERVISION_MIN_MOTOR
40 #define SUPERVISION_MIN_MOTOR 1
41 #endif
42 #ifndef SUPERVISION_MAX_MOTOR
43 #define SUPERVISION_MAX_MOTOR 200
44 #endif
45 
47 
48 #define GUIDANCE_V_MODE_KILL 0
49 #define GUIDANCE_V_MODE_RC_DIRECT 1
50 #define GUIDANCE_V_MODE_RC_CLIMB 2
51 #define GUIDANCE_V_MODE_CLIMB 3
52 #define GUIDANCE_V_MODE_HOVER 4
53 #define GUIDANCE_V_MODE_NAV 5
54 
56 
62 
68 
74 
80 
86 
90 
96 
101 extern float guidance_v_nominal_throttle;
102 
103 extern int32_t guidance_v_kp;
104 extern int32_t guidance_v_kd;
105 extern int32_t guidance_v_ki;
106 
107 extern void guidance_v_init(void);
108 extern void guidance_v_read_rc(void);
109 extern void guidance_v_mode_changed(uint8_t new_mode);
110 extern void guidance_v_notify_in_flight(bool_t in_flight);
111 extern void guidance_v_run(bool_t in_flight);
112 
113 #define guidance_v_SetKi(_val) { \
114  guidance_v_ki = _val; \
115  guidance_v_z_sum_err = 0; \
116  }
117 
118 #endif /* GUIDANCE_V */
int32_t guidance_v_fb_cmd
feed-back command
Definition: guidance_v.c:59
void guidance_v_run(bool_t in_flight)
Definition: guidance_v.c:165
int32_t guidance_v_kd
vertical control D-gain
Definition: guidance_v.c:83
int32_t guidance_v_zdd_ref
vertical acceleration reference in meter/s^2.
Definition: guidance_v.c:80
void guidance_v_read_rc(void)
Definition: guidance_v.c:118
int32_t guidance_v_z_sp
altitude setpoint in meters (input).
Definition: guidance_v.c:76
uint8_t guidance_v_mode
Definition: guidance_v.c:57
void guidance_v_init(void)
int32_t guidance_v_zd_sp
vertical speed setpoint in meter/s (input).
Definition: guidance_v.c:77
void guidance_v_mode_changed(uint8_t new_mode)
Definition: guidance_v.c:129
int32_t guidance_v_z_sum_err
accumulator for I-gain
Definition: guidance_v.c:86
signed long int32_t
Definition: types.h:19
float guidance_v_nominal_throttle
nominal throttle for hover.
Definition: guidance_v.c:62
int32_t guidance_v_zd_ref
vertical speed reference in meter/s.
Definition: guidance_v.c:79
unsigned char uint8_t
Definition: types.h:14
int32_t guidance_v_ff_cmd
feed-forward command
Definition: guidance_v.c:58
int32_t guidance_v_delta_t
thrust command.
Definition: guidance_v.c:60
int32_t guidance_v_kp
vertical control P-gain
Definition: guidance_v.c:82
void guidance_v_notify_in_flight(bool_t in_flight)
Definition: guidance_v.c:158
int32_t guidance_v_ki
vertical control I-gain
Definition: guidance_v.c:84
int32_t guidance_v_z_ref
altitude reference in meters.
Definition: guidance_v.c:78