MAV'RIC
attitude_controller_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 attitude_controller_default_config.h
34  *
35  * \author MAV'RIC Team
36  * \author Julien Lecoeur
37  *
38  * \brief Default configuration for the module attitude_controller
39  *
40  ******************************************************************************/
41 
42 
43 #ifndef ATTITUDE_CONTROLLER_DEFAULT_CONFIG_H_
44 #define ATTITUDE_CONTROLLER_DEFAULT_CONFIG_H_
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 #include "attitude_controller.h"
51 
52 static attitude_controller_conf_t attitude_controller_default_config =
53 {
54  // #########################################################################
55  // ###### RATE CONTROL ###################################################
56  // #########################################################################
58  {
59  // -----------------------------------------------------------------
60  // ------ ROLL RATE PID --------------------------------------------
61  // -----------------------------------------------------------------
62  {
63  .p_gain = 0.03f,
64  .clip_min = -0.9f,
65  .clip_max = 0.9f,
66  .integrator =
67  {
68  .pregain = 0.5f,
69  .postgain = 1.0f,
70  .accumulator = 0.0f,
71  .clip = 0.65f,
72  },
73  .differentiator =
74  {
75  .gain = 0.15f,
76  .previous = 0.0f,
77  .clip = 0.65f
78  },
79  .soft_zone_width = 0.0f,
80  },
81  // -----------------------------------------------------------------
82  // ------ PITCH RATE PID -------------------------------------------
83  // -----------------------------------------------------------------
84  {
85  .p_gain = 0.03f,
86  .clip_min = -0.9f,
87  .clip_max = 0.9f,
88  .integrator =
89  {
90  .pregain = 0.5f,
91  .postgain = 1.0f,
92  .accumulator = 0.0f,
93  .clip = 0.65f,
94  },
95  .differentiator =
96  {
97  .gain = 0.15f,
98  .previous = 0.0f,
99  .clip = 0.65f
100  },
101  .soft_zone_width = 0.0f,
102  },
103  // -----------------------------------------------------------------
104  // ------ YAW RATE PID ---------------------------------------------
105  // -----------------------------------------------------------------
106  {
107  .p_gain = 0.3f,
108  .clip_min = -0.3f,
109  .clip_max = 0.3f,
110  .integrator={
111  .pregain = 0.5f,
112  .postgain = 0.5f,
113  .accumulator = 0.0f,
114  .clip = 0.3f,
115  },
116  .differentiator={
117  .gain = 0.0f,
118  .previous = 0.0f,
119  .clip = 0.5f
120  },
121  .soft_zone_width = 0.0f
122  }
123  },
124  // #########################################################################
125  // ###### ANGLE CONTROL ##################################################
126  // #########################################################################
127  .angle_pid_config =
128  {
129  // -----------------------------------------------------------------
130  // ------ ROLL ANGLE PID -------------------------------------------
131  // -----------------------------------------------------------------
132  {
133  .p_gain = 4.0f,
134  .clip_min = -1.2f,
135  .clip_max = 1.2f,
136  .integrator={
137  .pregain = 0.0f,
138  .postgain = 0.0f,
139  .accumulator = 0.0f,
140  .clip = 0.0f,
141  },
142  .differentiator={
143  .gain = 0.0f,
144  .previous = 0.0f,
145  .clip = 0.1f
146  },
147  .soft_zone_width = 0.0f
148  },
149  // -----------------------------------------------------------------
150  // ------ PITCH ANGLE PID ------------------------------------------
151  // -----------------------------------------------------------------
152  {
153  .p_gain = 4.0f,
154  .clip_min = -1.2f,
155  .clip_max = 1.2f,
156  .integrator={
157  .pregain = 0.0f,
158  .postgain = 0.0f,
159  .accumulator = 0.0f,
160  .clip = 0.0f,
161  },
162  .differentiator={
163  .gain = 0.0f,
164  .previous = 0.0f,
165  .clip = 0.1f
166  },
167  .soft_zone_width = 0.0f
168  },
169  // -----------------------------------------------------------------
170  // ------ YAW ANGLE PID --------------------------------------------
171  // -----------------------------------------------------------------
172  {
173  .p_gain = 3.0f,
174  .clip_min = -1.5f,
175  .clip_max = 1.5f,
176  .integrator={
177  .pregain = 0.0f,
178  .postgain = 0.0f,
179  .accumulator = 0.0f,
180  .clip = 0.0f,
181  },
182  .differentiator={
183  .gain = 0.0f,
184  .previous = 0.0f,
185  .clip = 0.5f
186  },
187  .soft_zone_width = 0.0f
188  },
189  },
190 };
191 
192 #ifdef __cplusplus
193 }
194 #endif
195 
196 #endif // ATTITUDE_CONTROLLER_DEFAULT_CONFIG_H_
Attitude controller configuration.
Definition: attitude_controller.h:92
pid_controller_conf_t rate_pid_config[3]
Angular rate PID controller for roll, pitch and yaw.
Definition: attitude_controller.h:94