Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
shift_tracking.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Gautier Hattenberger <gautier.hattenberger@enac.fr>
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, see
18  * <http://www.gnu.org/licenses/>.
19  */
20 
29 #ifndef SHIFT_TRACKING_H
30 #define SHIFT_TRACKING_H
31 
32 #include "std.h"
33 
35  float kp;
36  float kd;
37  float ki;
38  float shift;
39 };
40 
41 extern struct shift_tracking_t shift_tracking;
42 
45 extern void shift_tracking_init(void);
46 
53 extern void shift_tracking_run(float *shift);
54 
59 extern void shift_tracking_reset(void);
60 
63 #define shift_tracking_SetKp(_v) { shift_tracking.kp = _v; shift_tracking_update_gains(); }
64 #define shift_tracking_SetKd(_v) { shift_tracking.kd = _v; shift_tracking_update_gains(); }
65 #define shift_tracking_SetKi(_v) { shift_tracking.ki = _v; shift_tracking_update_gains(); }
66 extern void shift_tracking_update_gains(void);
67 
68 #endif
69 
float ki
integral gain
void shift_tracking_update_gains(void)
float kp
proportional gain
void shift_tracking_run(float *shift)
run function
float shift
shift command
void shift_tracking_init(void)
init function
struct shift_tracking_t shift_tracking
float kd
derivative gain
void shift_tracking_reset(void)
reset function