MAV'RIC
conf_stabilisation_copter.h
1 /*
2  * conf_stabilisation_copter.h
3  *
4  * Default values for stabilisation
5  *
6  * Created: 13/11/2013 17:46:00
7  * Author: Julien
8  */
9 
10 #ifndef CONF_STABILISATION_COPTER_H_
11 #define CONF_STABILISATION_COPTER_H_
12 
13 #include "stabilisation_copter.h"
14 
15 static stabiliser_stack_copter_t stabiliser_defaults_copter =
16 {
17 // #############################################################################
18 // ###### RATE CONTROL #######################################################
19 // #############################################################################
22  // -----------------------------------------------------------------
23  // ------ ROLL PID -------------------------------------------------
24  // -----------------------------------------------------------------
25  {
26  .p_gain = 0.08,
27  .clip_min = -0.9,
28  .clip_max = 0.9,
29  .integrator={
30  .pregain = 0.5,
31  .postgain = 1.0,
32  .accumulator = 0.0,
33  .clip = 0.65,
34  .leakiness = 0.0
35  },
36  .differentiator={
37  .gain = 0.2,
38  .previous = 0.0,
39  .LPF = 0.4,
40  .clip = 0.65
41  },
42  .output = 0.0,
43  .error = 0.0,
44  .last_update = 0.0,
45  .dt = 1,
46  .soft_zone_width = 0.0
47  },
48  // -----------------------------------------------------------------
49  // ------ PITCH PID ------------------------------------------------
50  // -----------------------------------------------------------------
51  {
52  .p_gain = 0.08,
53  .clip_min = -0.9,
54  .clip_max = 0.9,
55  .integrator={
56  .pregain = 0.5,
57  .postgain = 1.0,
58  .accumulator = 0.0,
59  .clip = 0.65,
60  .leakiness = 0.0
61  },
62  .differentiator={
63  .gain = 0.2,
64  .previous = 0.0,
65  .LPF = 0.4,
66  .clip = 0.65
67  },
68  .output = 0.0,
69  .error = 0.0,
70  .last_update = 0.0,
71  .dt = 1,
72  .soft_zone_width = 0.0
73  },
74  // -----------------------------------------------------------------
75  // ------ YAW PID --------------------------------------------------
76  // -----------------------------------------------------------------
77  {
78  .p_gain = 0.5,
79  .clip_min = -0.9,
80  .clip_max = 0.9,
81  .integrator={
82  .pregain = 0.5,
83  .postgain = 0.5,
84  .accumulator = 0.0,
85  .clip = 0.15,
86  .leakiness = 0.0
87  },
88  .differentiator={
89  .gain = 0.0,
90  .previous = 0.0,
91  .LPF = 0.4,
92  .clip = 0.5
93  },
94  .output = 0.0,
95  .error = 0.0,
96  .last_update = 0.0,
97  .dt = 1,
98  .soft_zone_width = 0.0
99  }
100  },
101  // ---------------------------------------------------------------------
102  // ------ THRUST PID ---------------------------------------------------
103  // ---------------------------------------------------------------------
104  .thrust_controller={
105  .p_gain = 1.0,
106  .clip_min = -1000,
107  .clip_max = 1000,
108  .integrator={
109  .pregain = 0.0,
110  .postgain = 0.0,
111  .accumulator = 0.0,
112  .clip = 0.0,
113  .leakiness = 0.0
114  },
115  .differentiator={
116  .gain = 0.0,
117  .previous = 0.0,
118  .LPF = 0.0,
119  .clip = 0.0
120  },
121  .output = 0.0,
122  .error = 0.0,
123  .last_update = 0.0,
124  .dt = 1,
125  .soft_zone_width = 0.0
126  },
127  // ---------------------------------------------------------------------
128  // ------ OUTPUT -------------------------------------------------------
129  // ---------------------------------------------------------------------
130  .output = {
131  .rpy = {0.0, 0.0, 0.0},
132  .thrust = 0.0,
133  .tvel = {0.0, 0.0, 0.0},
134  .theading = 0.0,
135  .control_mode = RATE_COMMAND_MODE,
136  .yaw_mode = YAW_RELATIVE,
137  .run_mode = MOTORS_OFF
138  },
139  },
140 // #############################################################################
141 // ###### ATTITUDE CONTROL ###################################################
142 // #############################################################################
143  .attitude_stabiliser={
144  .rpy_controller={
145  // -----------------------------------------------------------------
146  // ------ ROLL PID -------------------------------------------------
147  // -----------------------------------------------------------------
148  {
149  .p_gain = 1.5,
150  .clip_min = -1.2,
151  .clip_max = 1.2,
152  .integrator={
153  .pregain = 0.0,
154  .postgain = 0.0,
155  .accumulator = 0.0,
156  .clip = 0.0,
157  .leakiness = 0.0
158  },
159  .differentiator={
160  .gain = 0.0,
161  .previous = 0.0,
162  .LPF = 0.5,
163  .clip = 0.1
164  },
165  .output = 0.0,
166  .error = 0.0,
167  .last_update = 0.0,
168  .dt = 1,
169  .soft_zone_width = 0.0
170  },
171  // -----------------------------------------------------------------
172  // ------ PITCH PID ------------------------------------------------
173  // -----------------------------------------------------------------
174  {
175  .p_gain = 1.5,
176  .clip_min = -1.2,
177  .clip_max = 1.2,
178  .integrator={
179  .pregain = 0.0,
180  .postgain = 0.0,
181  .accumulator = 0.0,
182  .clip = 0.0,
183  .leakiness = 0.0
184  },
185  .differentiator={
186  .gain = 0.0,
187  .previous = 0.0,
188  .LPF = 0.5,
189  .clip = 0.1
190  },
191  .output = 0.0,
192  .error = 0.0,
193  .last_update = 0.0,
194  .dt = 1,
195  .soft_zone_width = 0.0
196  },
197  // -----------------------------------------------------------------
198  // ------ YAW PID --------------------------------------------------
199  // -----------------------------------------------------------------
200  {
201  .p_gain = 1.5,
202  .clip_min = -1.5,
203  .clip_max = 1.5,
204  .integrator={
205  .pregain = 0.0,
206  .postgain = 0.0,
207  .accumulator = 0.0,
208  .clip = 0.0,
209  .leakiness = 0.0
210  },
211  .differentiator={
212  .gain = 0.0,
213  .previous = 0.0,
214  .LPF = 0.5,
215  .clip = 0.5
216  },
217  .output = 0.0,
218  .error = 0.0,
219  .last_update = 0.0,
220  .dt = 1,
221  .soft_zone_width = 0.0
222  }
223  },
224  // ---------------------------------------------------------------------
225  // ------ THRUST PID ---------------------------------------------------
226  // ---------------------------------------------------------------------
227  .thrust_controller={
228  .p_gain = 1.0,
229  .clip_min = -1,
230  .clip_max = 1,
231  .integrator={
232  .pregain = 0.0,
233  .postgain = 0.0,
234  .accumulator = 0.0,
235  .clip = 0.0,
236  .leakiness = 0.0
237  },
238  .differentiator={
239  .gain = 0.0,
240  .previous = 0.0,
241  .LPF = 0.0,
242  .clip = 0.0
243  },
244  .output = 0.0,
245  .error = 0.0,
246  .last_update = 0.0,
247  .dt = 1,
248  .soft_zone_width = 0.0
249  },
250  // ---------------------------------------------------------------------
251  // ------ OUTPUT -------------------------------------------------------
252  // ---------------------------------------------------------------------
253  .output = {
254  .rpy = {0.0, 0.0, 0.0},
255  .thrust = 0.0,
256  .tvel = {0.0, 0.0, 0.0},
257  .theading = 0.0,
258  .control_mode = RATE_COMMAND_MODE,
259  .yaw_mode = YAW_RELATIVE,
260  .run_mode = MOTORS_OFF
261  },
262  },
263 // #############################################################################
264 // ###### VELOCITY CONTROL ###################################################
265 // #############################################################################
266  .velocity_stabiliser={
267  .rpy_controller={
268  // -----------------------------------------------------------------
269  // ------ ROLL PID -------------------------------------------------
270  // -----------------------------------------------------------------
271  {
272  .p_gain = 0.2,
273  .clip_min = -0.5,
274  .clip_max = 0.5,
275  .integrator={
276  .pregain = 0.0,
277  .postgain = 0.0,
278  .accumulator = 0.0,
279  .clip = 0.3,
280  .leakiness = 0.0
281  },
282  .differentiator={
283  .gain = 0.0,
284  .previous = 0.0,
285  .LPF = 0.5,
286  .clip = 0.5
287  },
288  .output = 0.0,
289  .error = 0.0,
290  .last_update = 0.0,
291  .dt = 1,
292  .soft_zone_width = 0.3
293  },
294  // -----------------------------------------------------------------
295  // ------ PITCH PID ------------------------------------------------
296  // -----------------------------------------------------------------
297  {
298  .p_gain = 0.2,
299  .clip_min = -0.5,
300  .clip_max = 0.5,
301  .integrator={
302  .pregain = 0.0,
303  .postgain = 0.0,
304  .accumulator = 0.0,
305  .clip = 0.3,
306  .leakiness = 0.0
307  },
308  .differentiator={
309  .gain = 0.0,
310  .previous = 0.0,
311  .LPF = 0.5,
312  .clip = 0.5
313  },
314  .output = 0.0,
315  .error = 0.0,
316  .last_update = 0.0,
317  .dt = 1,
318  .soft_zone_width = 0.3
319  },
320  // -----------------------------------------------------------------
321  // ------ YAW PID --------------------------------------------------
322  // -----------------------------------------------------------------
323  {
324  .p_gain = 1.0,
325  .clip_min = -1,
326  .clip_max = 1,
327  .integrator={
328  .pregain = 0.0,
329  .postgain = 0.0,
330  .accumulator = 0.0,
331  .clip = 0.0,
332  .leakiness = 0.0
333  },
334  .differentiator={
335  .gain = 0.0,
336  .previous = 0.0,
337  .LPF = 0.0,
338  .clip = 0.0
339  },
340  .output = 0.0,
341  .error = 0.0,
342  .last_update = 0.0,
343  .dt = 1,
344  .soft_zone_width = 0.0
345  }
346  },
347  // ---------------------------------------------------------------------
348  // ------ THRUST PID ---------------------------------------------------
349  // ---------------------------------------------------------------------
350  .thrust_controller={
351  .p_gain = 0.4,
352  .clip_min = -0.9,
353  .clip_max = 0.65,
354  .integrator={
355  .pregain = 1.5,
356  .postgain = 1.0,
357  .accumulator = 0.0,
358  .clip = 1.0,
359  .leakiness = 0.0
360  },
361  .differentiator={
362  .gain = 0.5,
363  .previous = 0.0,
364  .LPF = 0.95,
365  .clip = 1.0
366  },
367  .output = 0.0,
368  .error = 0.0,
369  .last_update = 0.0,
370  .dt = 1,
371  .soft_zone_width = 0.2
372  },
373  // ---------------------------------------------------------------------
374  // ------ OUTPUT -------------------------------------------------------
375  // ---------------------------------------------------------------------
376  .output = {
377  .rpy = {0.0, 0.0, 0.0},
378  .thrust = 0.0,
379  .tvel = {0.0, 0.0, 0.0},
380  .theading = 0.0,
381  .control_mode = RATE_COMMAND_MODE,
382  .yaw_mode = YAW_RELATIVE,
383  .run_mode = MOTORS_OFF
384  },
385  },
386 // #############################################################################
387 // ###### MISC ###############################################################
388 // #############################################################################
389  .yaw_coordination_velocity=1.5
390 };
391 
392 
393 #endif /* CONF_STABILISATION_COPTER_H_ */
float p_gain
Proportional gain.
Definition: pid_controller.h:97
Structure containing the stacked controller.
Definition: stabilisation_copter.h:70
stabiliser_t rate_stabiliser
The rate controller structure.
Definition: stabilisation_copter.h:72
pid_controller_t rpy_controller[3]
roll pitch yaw controllers
Definition: stabilisation.h:91