2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
35 #define IS_PID_CONTROLLER_FP_BASED(pidController) (pidController == 2)
37 typedef struct pidProfile_s
{
38 uint8_t pidController
; // 0 = multiwii original, 1 = rewrite from http://www.multiwii.com/forum/viewtopic.php?f=8&t=3671, 1, 2 = Luggi09s new baseflight pid
40 uint8_t P8
[PID_ITEM_COUNT
];
41 uint8_t I8
[PID_ITEM_COUNT
];
42 uint8_t D8
[PID_ITEM_COUNT
];
44 float P_f
[3]; // float p i and d factors for lux float pid controller
49 uint8_t H_sensitivity
;
52 #define DEGREES_TO_DECIDEGREES(angle) (angle * 10)
53 #define DECIDEGREES_TO_DEGREES(angle) (angle / 10.0f)
55 extern int16_t axisPID
[XYZ_AXIS_COUNT
];
56 extern int32_t axisPID_P
[3], axisPID_I
[3], axisPID_D
[3];
58 void setPIDController(int type
);
59 void resetErrorAngle(void);
60 void resetErrorGyro(void);