MAV'RIC
velocity_controller_copter_default_config.h
1 /*******************************************************************************
2  * Copyright (c) 2009-2014, MAV'RIC Development Team
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its contributors
16  * may be used to endorse or promote products derived from this software without
17  * specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  ******************************************************************************/
31 
32 /*******************************************************************************
33  * \file velocity_controller_copter_default_config.h
34  *
35  * \author MAV'RIC Team
36  * \author Julien Lecoeur
37  *
38  * \brief Default configuration for the module velocity_controller_copter
39  *
40  ******************************************************************************/
41 
42 
43 #ifndef VELOCITY_CONTROLLER_COPTER_DEFAULT_CONFIG_H_
44 #define VELOCITY_CONTROLLER_COPTER_DEFAULT_CONFIG_H_
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 #include "velocity_controller_copter.h"
51 
52 static velocity_controller_copter_conf_t velocity_controller_copter_default_config =
53 {
54  .thrust_hover_point = -0.3,
55  .pid_config =
56  {
57  // -----------------------------------------------------------------
58  // ------ X PID -------------------------------------------------
59  // -----------------------------------------------------------------
60  {
61  .p_gain = 0.2f,
62  .clip_min = -0.5f,
63  .clip_max = 0.5f,
64  .integrator={
65  .pregain = 1.0f,
66  .postgain = 0.5f,
67  .accumulator = 0.0f,
68  .clip = 0.5f,
69  },
70  .differentiator={
71  .gain = 0.0f,
72  .previous = 0.0f,
73  .clip = 0.5f
74  },
75  .soft_zone_width = 0.2f
76  },
77  // -----------------------------------------------------------------
78  // ------ Y PID ------------------------------------------------
79  // -----------------------------------------------------------------
80  {
81  .p_gain = 0.2f,
82  .clip_min = -0.5f,
83  .clip_max = 0.5f,
84  .integrator={
85  .pregain = 1.0f,
86  .postgain = 0.5f,
87  .accumulator = 0.0f,
88  .clip = 0.5f,
89  },
90  .differentiator={
91  .gain = 0.0f,
92  .previous = 0.0f,
93  .clip = 0.5f
94  },
95  .soft_zone_width = 0.2f
96  },
97  // ---------------------------------------------------------------------
98  // ------ Z PID ---------------------------------------------------
99  // ---------------------------------------------------------------------
100  {
101  .p_gain = 0.20f,
102  .clip_min = -0.9f,
103  .clip_max = 0.65f,
104  .integrator={
105  .pregain = 0.01f,
106  .postgain = 1.0f,
107  .accumulator = 0.0f,
108  .clip = 1.0f,
109  },
110  .differentiator={
111  .gain = 0.2f,
112  .previous = 0.0f,
113  .clip = 0.2f
114  },
115  .soft_zone_width = 0.2f
116  },
117  },
118 };
119 
120 #ifdef __cplusplus
121 }
122 #endif
123 
124 #endif // VELOCITY_CONTROLLER_COPTER_DEFAULT_CONFIG_H_
float thrust_hover_point
Amount of thrust required to hover (between -1 and 1)
Definition: velocity_controller_copter.h:82
Velocity controller configuration.
Definition: velocity_controller_copter.h:79