PX4 Firmware
PX4 Autopilot Software http://px4.io
pwm_params_main.c
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * Copyright (c) 2012-2016 PX4 Development Team. 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
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in
13  * the documentation and/or other materials provided with the
14  * distribution.
15  * 3. Neither the name PX4 nor the names of its contributors may be
16  * used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
26  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  *
32  ****************************************************************************/
33 
34 /**
35  * @file pwm_params_main.c
36  *
37  * Parameters defined for PWM output.
38  *
39  */
40 
41 /******************************************************************************
42 * PWM_RATE *
43 ******************************************************************************/
44 
45 /**
46  * Set the PWM output frequency for the main outputs
47  *
48  * Set to 400 for industry default or 1000 for high frequency ESCs.
49  *
50  * Set to 0 for Oneshot125.
51  *
52  * @reboot_required true
53  *
54  * @min -1
55  * @max 2000
56  * @unit Hz
57  * @group PWM Outputs
58  */
59 PARAM_DEFINE_INT32(PWM_RATE, 400);
60 
61 /**
62  * Set the minimum PWM for the main outputs
63  *
64  * Set to 1000 for industry default or 900 to increase servo travel.
65  *
66  * @reboot_required true
67  *
68  * @min 800
69  * @max 1400
70  * @unit us
71  * @group PWM Outputs
72  */
73 PARAM_DEFINE_INT32(PWM_MIN, 1000);
74 
75 /**
76  * Set the maximum PWM for the main outputs
77  *
78  * Set to 2000 for industry default or 2100 to increase servo travel.
79  *
80  * @reboot_required true
81  *
82  * @min 1600
83  * @max 2200
84  * @unit us
85  * @group PWM Outputs
86  */
87 PARAM_DEFINE_INT32(PWM_MAX, 2000);
88 
89 /**
90  * Set the disarmed PWM for the main outputs
91  *
92  * This is the PWM pulse the autopilot is outputting if not armed.
93  * The main use of this parameter is to silence ESCs when they are disarmed.
94  *
95  * @reboot_required true
96  *
97  * @min 0
98  * @max 2200
99  * @unit us
100  * @group PWM Outputs
101  */
102 PARAM_DEFINE_INT32(PWM_DISARMED, 900);
103 
104 /******************************************************************************
105 * PWM_MAIN_MIN *
106 ******************************************************************************/
107 /**
108  * Set the min PWM value for the main 1 output
109  *
110  * This is the minimum PWM pulse the autopilot is allowed to output.
111  * When set to -1 the value for PWM_MIN will be used
112  *
113  * @reboot_required true
114  *
115  * @min -1
116  * @max 2200
117  * @unit us
118  * @group PWM Outputs
119  */
120 PARAM_DEFINE_INT32(PWM_MAIN_MIN1, -1);
121 
122 /**
123  * Set the min PWM value for the main 2 output
124  *
125  * This is the minimum PWM pulse the autopilot is allowed to output.
126  * When set to -1 the value for PWM_MIN will be used
127  *
128  * @reboot_required true
129  *
130  * @min -1
131  * @max 2200
132  * @unit us
133  * @group PWM Outputs
134  */
135 PARAM_DEFINE_INT32(PWM_MAIN_MIN2, -1);
136 
137 /**
138  * Set the min PWM value for the main 3 output
139  *
140  * This is the minimum PWM pulse the autopilot is allowed to output.
141  * When set to -1 the value for PWM_MIN will be used
142  *
143  * @reboot_required true
144  *
145  * @min -1
146  * @max 2200
147  * @unit us
148  * @group PWM Outputs
149  */
150 PARAM_DEFINE_INT32(PWM_MAIN_MIN3, -1);
151 
152 /**
153  * Set the min PWM value for the main 4 output
154  *
155  * This is the minimum PWM pulse the autopilot is allowed to output.
156  * When set to -1 the value for PWM_MIN will be used
157  *
158  * @reboot_required true
159  *
160  * @min -1
161  * @max 2200
162  * @unit us
163  * @group PWM Outputs
164  */
165 PARAM_DEFINE_INT32(PWM_MAIN_MIN4, -1);
166 
167 /**
168  * Set the min PWM value for the main 5 output
169  *
170  * This is the minimum PWM pulse the autopilot is allowed to output.
171  * When set to -1 the value for PWM_MIN will be used
172  *
173  * @reboot_required true
174  *
175  * @min -1
176  * @max 2200
177  * @unit us
178  * @group PWM Outputs
179  */
180 PARAM_DEFINE_INT32(PWM_MAIN_MIN5, -1);
181 
182 /**
183  * Set the min PWM value for the main 6 output
184  *
185  * This is the minimum PWM pulse the autopilot is allowed to output.
186  * When set to -1 the value for PWM_MIN will be used
187  *
188  * @reboot_required true
189  *
190  * @min -1
191  * @max 2200
192  * @unit us
193  * @group PWM Outputs
194  */
195 PARAM_DEFINE_INT32(PWM_MAIN_MIN6, -1);
196 
197 /**
198  * Set the min PWM value for the main 7 output
199  *
200  * This is the minimum PWM pulse the autopilot is allowed to output.
201  * When set to -1 the value for PWM_MIN will be used
202  *
203  * @reboot_required true
204  *
205  * @min -1
206  * @max 2200
207  * @unit us
208  * @group PWM Outputs
209  */
210 PARAM_DEFINE_INT32(PWM_MAIN_MIN7, -1);
211 
212 /**
213  * Set the min PWM value for the main 8 output
214  *
215  * This is the minimum PWM pulse the autopilot is allowed to output.
216  * When set to -1 the value for PWM_MIN will be used
217  *
218  * @reboot_required true
219  *
220  * @min -1
221  * @max 2200
222  * @unit us
223  * @group PWM Outputs
224  */
225 PARAM_DEFINE_INT32(PWM_MAIN_MIN8, -1);
226 
227 /******************************************************************************
228 * PWM_MAIN_MAX *
229 ******************************************************************************/
230 /**
231  * Set the max PWM value for the main 1 output
232  *
233  * This is the maximum PWM pulse the autopilot is allowed to output.
234  * When set to -1 the value for PWM_MAX will be used
235  *
236  * @reboot_required true
237  *
238  * @min -1
239  * @max 2200
240  * @unit us
241  * @group PWM Outputs
242  */
243 PARAM_DEFINE_INT32(PWM_MAIN_MAX1, -1);
244 
245 /**
246  * Set the max PWM value for the main 2 output
247  *
248  * This is the maximum PWM pulse the autopilot is allowed to output.
249  * When set to -1 the value for PWM_MAX will be used
250  *
251  * @reboot_required true
252  *
253  * @min -1
254  * @max 2200
255  * @unit us
256  * @group PWM Outputs
257  */
258 PARAM_DEFINE_INT32(PWM_MAIN_MAX2, -1);
259 
260 /**
261  * Set the max PWM value for the main 3 output
262  *
263  * This is the maximum PWM pulse the autopilot is allowed to output.
264  * When set to -1 the value for PWM_MAX will be used
265  *
266  * @reboot_required true
267  *
268  * @min -1
269  * @max 2200
270  * @unit us
271  * @group PWM Outputs
272  */
273 PARAM_DEFINE_INT32(PWM_MAIN_MAX3, -1);
274 
275 /**
276  * Set the max PWM value for the main 4 output
277  *
278  * This is the maximum PWM pulse the autopilot is allowed to output.
279  * When set to -1 the value for PWM_MAX will be used
280  *
281  * @reboot_required true
282  *
283  * @min -1
284  * @max 2200
285  * @unit us
286  * @group PWM Outputs
287  */
288 PARAM_DEFINE_INT32(PWM_MAIN_MAX4, -1);
289 
290 /**
291  * Set the max PWM value for the main 5 output
292  *
293  * This is the maximum PWM pulse the autopilot is allowed to output.
294  * When set to -1 the value for PWM_MAX will be used
295  *
296  * @reboot_required true
297  *
298  * @min -1
299  * @max 2200
300  * @unit us
301  * @group PWM Outputs
302  */
303 PARAM_DEFINE_INT32(PWM_MAIN_MAX5, -1);
304 
305 /**
306  * Set the max PWM value for the main 6 output
307  *
308  * This is the maximum PWM pulse the autopilot is allowed to output.
309  * When set to -1 the value for PWM_MAX will be used
310  *
311  * @reboot_required true
312  *
313  * @min -1
314  * @max 2200
315  * @unit us
316  * @group PWM Outputs
317  */
318 PARAM_DEFINE_INT32(PWM_MAIN_MAX6, -1);
319 
320 /**
321  * Set the max PWM value for the main 7 output
322  *
323  * This is the maximum PWM pulse the autopilot is allowed to output.
324  * When set to -1 the value for PWM_MAX will be used
325  *
326  * @reboot_required true
327  *
328  * @min -1
329  * @max 2200
330  * @unit us
331  * @group PWM Outputs
332  */
333 PARAM_DEFINE_INT32(PWM_MAIN_MAX7, -1);
334 
335 /**
336  * Set the max PWM value for the main 8 output
337  *
338  * This is the maximum PWM pulse the autopilot is allowed to output.
339  * When set to -1 the value for PWM_MAX will be used
340  *
341  * @reboot_required true
342  *
343  * @min -1
344  * @max 2200
345  * @unit us
346  * @group PWM Outputs
347  */
348 PARAM_DEFINE_INT32(PWM_MAIN_MAX8, -1);
349 
350 /******************************************************************************
351 * PWM_MAIN_FAIL *
352 ******************************************************************************/
353 
354 /**
355  * Set the failsafe PWM for the main 1 output
356  *
357  * This is the PWM pulse the autopilot is outputting if in failsafe mode.
358  * When set to -1 the value is set automatically depending if the actuator
359  * is a motor (900us) or a servo (1500us)
360  *
361  * @reboot_required true
362  *
363  * @min -1
364  * @max 2200
365  * @unit us
366  * @group PWM Outputs
367  */
368 PARAM_DEFINE_INT32(PWM_MAIN_FAIL1, -1);
369 
370 /**
371  * Set the failsafe PWM for the main 2 output
372  *
373  * This is the PWM pulse the autopilot is outputting if in failsafe mode.
374  * When set to -1 the value is set automatically depending if the actuator
375  * is a motor (900us) or a servo (1500us)
376  *
377  * @reboot_required true
378  *
379  * @min -1
380  * @max 2200
381  * @unit us
382  * @group PWM Outputs
383  */
384 PARAM_DEFINE_INT32(PWM_MAIN_FAIL2, -1);
385 
386 /**
387  * Set the failsafe PWM for the main 3 output
388  *
389  * This is the PWM pulse the autopilot is outputting if in failsafe mode.
390  * When set to -1 the value is set automatically depending if the actuator
391  * is a motor (900us) or a servo (1500us)
392  *
393  * @reboot_required true
394  *
395  * @min -1
396  * @max 2200
397  * @unit us
398  * @group PWM Outputs
399  */
400 PARAM_DEFINE_INT32(PWM_MAIN_FAIL3, -1);
401 
402 /**
403  * Set the failsafe PWM for the main 4 output
404  *
405  * This is the PWM pulse the autopilot is outputting if in failsafe mode.
406  * When set to -1 the value is set automatically depending if the actuator
407  * is a motor (900us) or a servo (1500us)
408  *
409  * @reboot_required true
410  *
411  * @min -1
412  * @max 2200
413  * @unit us
414  * @group PWM Outputs
415  */
416 PARAM_DEFINE_INT32(PWM_MAIN_FAIL4, -1);
417 
418 /**
419  * Set the failsafe PWM for the main 5 output
420  *
421  * This is the PWM pulse the autopilot is outputting if in failsafe mode.
422  * When set to -1 the value is set automatically depending if the actuator
423  * is a motor (900us) or a servo (1500us)
424  *
425  * @reboot_required true
426  *
427  * @min -1
428  * @max 2200
429  * @unit us
430  * @group PWM Outputs
431  */
432 PARAM_DEFINE_INT32(PWM_MAIN_FAIL5, -1);
433 
434 /**
435  * Set the failsafe PWM for the main 6 output
436  *
437  * This is the PWM pulse the autopilot is outputting if in failsafe mode.
438  * When set to -1 the value is set automatically depending if the actuator
439  * is a motor (900us) or a servo (1500us)
440  *
441  * @reboot_required true
442  *
443  * @min -1
444  * @max 2200
445  * @unit us
446  * @group PWM Outputs
447  */
448 PARAM_DEFINE_INT32(PWM_MAIN_FAIL6, -1);
449 
450 /**
451  * Set the failsafe PWM for the main 7 output
452  *
453  * This is the PWM pulse the autopilot is outputting if in failsafe mode.
454  * When set to -1 the value is set automatically depending if the actuator
455  * is a motor (900us) or a servo (1500us)
456  *
457  * @reboot_required true
458  *
459  * @min -1
460  * @max 2200
461  * @unit us
462  * @group PWM Outputs
463  */
464 PARAM_DEFINE_INT32(PWM_MAIN_FAIL7, -1);
465 
466 /**
467  * Set the failsafe PWM for the main 8 output
468  *
469  * This is the PWM pulse the autopilot is outputting if in failsafe mode.
470  * When set to -1 the value is set automatically depending if the actuator
471  * is a motor (900us) or a servo (1500us)
472  *
473  * @reboot_required true
474  *
475  * @min -1
476  * @max 2200
477  * @unit us
478  * @group PWM Outputs
479  */
480 PARAM_DEFINE_INT32(PWM_MAIN_FAIL8, -1);
481 
482 /******************************************************************************
483 * PWM_MAIN_DIS *
484 ******************************************************************************/
485 
486 /**
487  * Set the disarmed PWM for the main 1 output
488  *
489  * This is the PWM pulse the autopilot is outputting if not armed.
490  * When set to -1 the value for PWM_DISARMED will be used
491  *
492  * @reboot_required true
493  *
494  * @min -1
495  * @max 2200
496  * @unit us
497  * @group PWM Outputs
498  */
499 PARAM_DEFINE_INT32(PWM_MAIN_DIS1, -1);
500 
501 /**
502  * Set the disarmed PWM for the main 2 output
503  *
504  * This is the PWM pulse the autopilot is outputting if not armed.
505  * When set to -1 the value for PWM_DISARMED will be used
506  *
507  * @reboot_required true
508  *
509  * @min -1
510  * @max 2200
511  * @unit us
512  * @group PWM Outputs
513  */
514 PARAM_DEFINE_INT32(PWM_MAIN_DIS2, -1);
515 
516 /**
517  * Set the disarmed PWM for the main 3 output
518  *
519  * This is the PWM pulse the autopilot is outputting if not armed.
520  * When set to -1 the value for PWM_DISARMED will be used
521  *
522  * @reboot_required true
523  *
524  * @min -1
525  * @max 2200
526  * @unit us
527  * @group PWM Outputs
528  */
529 PARAM_DEFINE_INT32(PWM_MAIN_DIS3, -1);
530 
531 /**
532  * Set the disarmed PWM for the main 4 output
533  *
534  * This is the PWM pulse the autopilot is outputting if not armed.
535  * When set to -1 the value for PWM_DISARMED will be used
536  *
537  * @reboot_required true
538  *
539  * @min -1
540  * @max 2200
541  * @unit us
542  * @group PWM Outputs
543  */
544 PARAM_DEFINE_INT32(PWM_MAIN_DIS4, -1);
545 
546 /**
547  * Set the disarmed PWM for the main 5 output
548  *
549  * This is the PWM pulse the autopilot is outputting if not armed.
550  * When set to -1 the value for PWM_DISARMED will be used
551  *
552  * @reboot_required true
553  *
554  * @min -1
555  * @max 2200
556  * @unit us
557  * @group PWM Outputs
558  */
559 PARAM_DEFINE_INT32(PWM_MAIN_DIS5, -1);
560 
561 /**
562  * Set the disarmed PWM for the main 6 output
563  *
564  * This is the PWM pulse the autopilot is outputting if not armed.
565  * When set to -1 the value for PWM_DISARMED will be used
566  *
567  * @reboot_required true
568  *
569  * @min -1
570  * @max 2200
571  * @unit us
572  * @group PWM Outputs
573  */
574 PARAM_DEFINE_INT32(PWM_MAIN_DIS6, -1);
575 
576 /**
577  * Set the disarmed PWM for the main 7 output
578  *
579  * This is the PWM pulse the autopilot is outputting if not armed.
580  * When set to -1 the value for PWM_DISARMED will be used
581  *
582  * @reboot_required true
583  *
584  * @min -1
585  * @max 2200
586  * @unit us
587  * @group PWM Outputs
588  */
589 PARAM_DEFINE_INT32(PWM_MAIN_DIS7, -1);
590 
591 /**
592  * Set the disarmed PWM for the main 8 output
593  *
594  * This is the PWM pulse the autopilot is outputting if not armed.
595  * When set to -1 the value for PWM_DISARMED will be used
596  *
597  * @reboot_required true
598  *
599  * @min -1
600  * @max 2200
601  * @unit us
602  * @group PWM Outputs
603  */
604 PARAM_DEFINE_INT32(PWM_MAIN_DIS8, -1);
605 
606 /******************************************************************************
607 * PWM_MAIN_REV *
608 ******************************************************************************/
609 
610 /**
611  * Invert direction of main output channel 1
612  *
613  * Enable to invert the channel.
614  * Warning: Use this parameter when connected to a servo only.
615  * For a brushless motor, invert manually two phases to reverse the direction.
616  *
617  * @boolean
618  * @group PWM Outputs
619  */
620 PARAM_DEFINE_INT32(PWM_MAIN_REV1, 0);
621 
622 /**
623  * Invert direction of main output channel 2
624  *
625  * Enable to invert the channel.
626  * Warning: Use this parameter when connected to a servo only.
627  * For a brushless motor, invert manually two phases to reverse the direction.
628  *
629  * @boolean
630  * @group PWM Outputs
631  */
632 PARAM_DEFINE_INT32(PWM_MAIN_REV2, 0);
633 
634 /**
635  * Invert direction of main output channel 3
636  *
637  * Enable to invert the channel.
638  * Warning: Use this parameter when connected to a servo only.
639  * For a brushless motor, invert manually two phases to reverse the direction.
640  *
641  * @boolean
642  * @group PWM Outputs
643  */
644 PARAM_DEFINE_INT32(PWM_MAIN_REV3, 0);
645 
646 /**
647  * Invert direction of main output channel 4
648  *
649  * Enable to invert the channel.
650  * Warning: Use this parameter when connected to a servo only.
651  * For a brushless motor, invert manually two phases to reverse the direction.
652  *
653  * @boolean
654  * @group PWM Outputs
655  */
656 PARAM_DEFINE_INT32(PWM_MAIN_REV4, 0);
657 
658 /**
659  * Invert direction of main output channel 5
660  *
661  * Enable to invert the channel.
662  * Warning: Use this parameter when connected to a servo only.
663  * For a brushless motor, invert manually two phases to reverse the direction.
664  *
665  * @boolean
666  * @group PWM Outputs
667  */
668 PARAM_DEFINE_INT32(PWM_MAIN_REV5, 0);
669 
670 /**
671  * Invert direction of main output channel 6
672  *
673  * Enable to invert the channel.
674  * Warning: Use this parameter when connected to a servo only.
675  * For a brushless motor, invert manually two phases to reverse the direction.
676  *
677  * @boolean
678  * @group PWM Outputs
679  */
680 PARAM_DEFINE_INT32(PWM_MAIN_REV6, 0);
681 
682 /**
683  * Invert direction of main output channel 7
684  *
685  * Enable to invert the channel.
686  * Warning: Use this parameter when connected to a servo only.
687  * For a brushless motor, invert manually two phases to reverse the direction.
688  *
689  * @boolean
690  * @group PWM Outputs
691  */
692 PARAM_DEFINE_INT32(PWM_MAIN_REV7, 0);
693 
694 /**
695  * Invert direction of main output channel 8
696  *
697  * Enable to invert the channel.
698  * Warning: Use this parameter when connected to a servo only.
699  * For a brushless motor, invert manually two phases to reverse the direction.
700  *
701  * @boolean
702  * @group PWM Outputs
703  */
704 PARAM_DEFINE_INT32(PWM_MAIN_REV8, 0);
705 
706 /******************************************************************************
707 * PWM_MAIN_TRIM *
708 ******************************************************************************/
709 
710 /**
711  * Trim value for main output channel 1
712  *
713  * Set to normalized offset
714  *
715  * @min -0.2
716  * @max 0.2
717  * @decimal 2
718  * @group PWM Outputs
719  */
720 PARAM_DEFINE_FLOAT(PWM_MAIN_TRIM1, 0);
721 
722 /**
723  * Trim value for main output channel 2
724  *
725  * Set to normalized offset
726  *
727  * @min -0.2
728  * @max 0.2
729  * @decimal 2
730  * @group PWM Outputs
731  */
732 PARAM_DEFINE_FLOAT(PWM_MAIN_TRIM2, 0);
733 
734 /**
735  * Trim value for main output channel 3
736  *
737  * Set to normalized offset
738  *
739  * @min -0.2
740  * @max 0.2
741  * @decimal 2
742  * @group PWM Outputs
743  */
744 PARAM_DEFINE_FLOAT(PWM_MAIN_TRIM3, 0);
745 
746 /**
747  * Trim value for main output channel 4
748  *
749  * Set to normalized offset
750  *
751  * @min -0.2
752  * @max 0.2
753  * @decimal 2
754  * @group PWM Outputs
755  */
756 PARAM_DEFINE_FLOAT(PWM_MAIN_TRIM4, 0);
757 
758 /**
759  * Trim value for main output channel 5
760  *
761  * Set to normalized offset
762  *
763  * @min -0.2
764  * @max 0.2
765  * @decimal 2
766  * @group PWM Outputs
767  */
768 PARAM_DEFINE_FLOAT(PWM_MAIN_TRIM5, 0);
769 
770 /**
771  * Trim value for main output channel 6
772  *
773  * Set to normalized offset
774  *
775  * @min -0.2
776  * @max 0.2
777  * @decimal 2
778  * @group PWM Outputs
779  */
780 PARAM_DEFINE_FLOAT(PWM_MAIN_TRIM6, 0);
781 
782 /**
783  * Trim value for main output channel 7
784  *
785  * Set to normalized offset
786  *
787  * @min -0.2
788  * @max 0.2
789  * @decimal 2
790  * @group PWM Outputs
791  */
792 PARAM_DEFINE_FLOAT(PWM_MAIN_TRIM7, 0);
793 
794 /**
795  * Trim value for main output channel 8
796  *
797  * Set to normalized offset
798  *
799  * @min -0.2
800  * @max 0.2
801  * @decimal 2
802  * @group PWM Outputs
803  */
804 PARAM_DEFINE_FLOAT(PWM_MAIN_TRIM8, 0);
PARAM_DEFINE_FLOAT(PWM_MAIN_TRIM1, 0)
Trim value for main output channel 1.
PARAM_DEFINE_INT32(PWM_RATE, 400)
Set the PWM output frequency for the main outputs.