|
1 | 1 | <!--- DO NOT EDIT - GENERATED BY extras/scripts/doc_generator.py --> |
2 | 2 |
|
3 | 3 | # madflight Config Parameters |
| 4 | + |
| 5 | +The parameters are saved to EEPROM. You can modify them with: |
| 6 | + - The `madflight_board` and `madfight_config` strings in your code |
| 7 | + - CLI commands: `dump` and `set <parameter> <value>` and `save` |
| 8 | + - Mission Planner or QGround Control via MavLink |
| 9 | + |
| 10 | +## AHR - Attitude and heading reference system (AHRS) |
| 11 | + |
| 12 | + |
4 | 13 | |Parameter|Description|Default|Options| |
5 | 14 | |-|-|-|-| |
6 | 15 | |`ahr_gizmo`|AHRS Algorithm<br>_since v2.0.0_|MAHONY|MAHONY<br>MAHONY_BF<br>MADGWICK<br>VQF| |
| 16 | + |
| 17 | +## BAR - Barometer sensors |
| 18 | + |
| 19 | + |
| 20 | +|Parameter|Description|Default|Options| |
| 21 | +|-|-|-|-| |
7 | 22 | |`bar_gizmo`|Barometer Sensor Type<br>_since v2.0.0_|NONE|NONE<br>BMP280<br>BMP388<br>BMP390<br>MS5611<br>HP203B<br>BMP580<br>DPS310| |
8 | 23 | |`bar_i2c_adr`|Barometer I2C Address (decimal number only, set to 0 for automatic)<br>_since v2.0.0_|0|| |
9 | 24 | |`bar_i2c_bus`|Barometer I2C Bus<br>_since v2.0.0_|-1|| |
10 | 25 | |`bar_rate`|Barometer sample rate in [Hz]<br>_since v2.0.0_|100|| |
| 26 | + |
| 27 | +## BAT - Battery sensors (current, voltage, power, capacity) |
| 28 | + |
| 29 | + |
| 30 | +|Parameter|Description|Default|Options| |
| 31 | +|-|-|-|-| |
11 | 32 | |`bat_cal_i`|Battery ADC current scale calibration, value is actual_current_in_a / adc_reading (For INA226 and INA228 this is the Rshunt value in ohm)<br>_since v1.3.4_|1|| |
12 | 33 | |`bat_cal_v`|Battery ADC voltage scale calibration, value is actual_voltage_in_v / adc_reading<br>_since v1.3.4_|1|| |
13 | 34 | |`bat_gizmo`|Power Sensor Type<br>_since v2.0.0_|NONE|NONE<br>ADC<br>INA226<br>INA228| |
14 | 35 | |`bat_i2c_adr`|Power Sensor I2C Address (decimal number only, set to 0 for automatic)<br>_since v2.0.0_|0|| |
15 | 36 | |`bat_i2c_bus`|Power Sensor I2C Bus<br>_since v2.0.0_|-1|| |
| 37 | + |
| 38 | +## BBX - Blackbox logging to SDCARD |
| 39 | + |
| 40 | + |
| 41 | +|Parameter|Description|Default|Options| |
| 42 | +|-|-|-|-| |
16 | 43 | |`bbx_baud`|Black Box Logger Baud Rate (0=auto)<br>_since v2.3.2_|0|| |
17 | 44 | |`bbx_gizmo`|Black Box Logger Type<br>_since v2.0.0_|NONE|NONE<br>SDSPI<br>SDMMC<br>OPENLOG| |
18 | 45 | |`bbx_log_ahr`|Max log interval in [Hz] for AHR<br>_since v2.3.0_|100|| |
|
21 | 48 | |`bbx_log_rcl`|Max log interval in [Hz] for RCL<br>_since v2.3.0_|100|| |
22 | 49 | |`bbx_ser_bus`|Black Box Logger Serial Bus<br>_since v2.3.2_|-1|| |
23 | 50 | |`bbx_spi_bus`|Black Box SPI Bus<br>_since v2.0.0_|-1|| |
| 51 | + |
| 52 | +## GPS - Global positioning system |
| 53 | + |
| 54 | + |
| 55 | +|Parameter|Description|Default|Options| |
| 56 | +|-|-|-|-| |
24 | 57 | |`gps_baud`|Baud Rate (0=auto baud)<br>_since v2.0.0_|0|| |
25 | 58 | |`gps_gizmo`|GPS Sensor Type<br>_since v2.0.0_|NONE|NONE<br>UBLOX| |
26 | 59 | |`gps_ser_bus`|GPS Serial Bus<br>_since v2.0.0_|-1|| |
| 60 | + |
| 61 | +## IMU - Inertial measurement unit sensors |
| 62 | + |
| 63 | + |
| 64 | +|Parameter|Description|Default|Options| |
| 65 | +|-|-|-|-| |
27 | 66 | |`imu_acc_lp`|Accelerometer Low Pass Filter cutoff frequency in [Hz]<br>_since v2.0.0_|70|| |
28 | 67 | |`imu_align`|Gyro/Acc Sensor Alignment<br>_since v2.0.0_|CW0|CW0<br>CW90<br>CW180<br>CW270<br>CW0FLIP<br>CW90FLIP<br>CW180FLIP<br>CW270FLIP| |
29 | 68 | |`imu_bus_type`|Gyro/Acc Bus Type<br>_since v2.0.1_|SPI|SPI<br>I2C| |
|
39 | 78 | |`imu_i2c_bus`|Gyro/Acc Sensor I2C Bus<br>_since v2.0.0_|-1|| |
40 | 79 | |`imu_rate`|Gyro/Acc sample rate in [Hz]. NOTE: not all IMU drivers support all rates<br>_since v2.0.0_|1000|| |
41 | 80 | |`imu_spi_bus`|Gyro/Acc Sensor SPI Bus<br>_since v2.0.0_|-1|| |
| 81 | + |
| 82 | +## LED - Light emmitting diode |
| 83 | + |
| 84 | + |
| 85 | +|Parameter|Description|Default|Options| |
| 86 | +|-|-|-|-| |
42 | 87 | |`led_gizmo`|LED Type<br>_since v2.0.0_|NONE|NONE<br>HIGH_IS_ON<br>LOW_IS_ON<br>RGB| |
| 88 | + |
| 89 | +## MAG - Magnetometer sensors |
| 90 | + |
| 91 | + |
| 92 | +|Parameter|Description|Default|Options| |
| 93 | +|-|-|-|-| |
43 | 94 | |`mag_align`|Magnetometer Alignment<br>_since v2.1.1_|CW0|CW0<br>CW90<br>CW180<br>CW270<br>CW0FLIP<br>CW90FLIP<br>CW180FLIP<br>CW270FLIP| |
44 | 95 | |`mag_cal_sx`|Magnetometer x scale calibration<br>_since v1.3.4_|1|| |
45 | 96 | |`mag_cal_sy`|Magnetometer y scale calibration<br>_since v1.3.4_|1|| |
|
51 | 102 | |`mag_i2c_adr`|Magnetometer I2C Address (decimal number only, set to 0 for automatic)<br>_since v2.0.0_|0|| |
52 | 103 | |`mag_i2c_bus`|Magnetometer I2C Bus<br>_since v2.0.0_|-1|| |
53 | 104 | |`mag_lp`|Magnetometer Gyro Low Pass Filter cutoff frequency in [Hz]. Set to 1e10Hz for no filtering<br>_since v2.0.0_|1e10|| |
| 105 | + |
| 106 | +## OFL - Optical flow sensors |
| 107 | + |
| 108 | + |
| 109 | +|Parameter|Description|Default|Options| |
| 110 | +|-|-|-|-| |
54 | 111 | |`ofl_align`|Optical Flow XY-Axis Orientation. Example: ES means positive x-axis points East (right) and positive y-axis points South (back)<br>_since v2.1.3_|NE|NE<br>NW<br>ES<br>EN<br>SW<br>SE<br>WN<br>WS| |
55 | 112 | |`ofl_baud`|Optical Flow Baud Rate. 0=auto<br>_since v2.1.3_|0|| |
56 | 113 | |`ofl_cal_rad`|Optical Flow Manual Calibration Factor in [Radians/Pixels], leave at 0 to use gizmo defined calibration<br>_since v2.1.4_|0|| |
57 | 114 | |`ofl_gizmo`|Optical Flow Sensor Type<br>_since v2.1.3_|NONE|NONE<br>PMW3901<br>PMW3901U| |
58 | 115 | |`ofl_ser_bus`|Optical Flow Serial Bus<br>_since v2.1.3_|-1|| |
59 | 116 | |`ofl_spi_bus`|Optical Flow SPI Bus<br>_since v2.1.3_|-1|| |
| 117 | + |
| 118 | +## PID - Proportional–integral–derivative controller |
| 119 | +This is the brain of the flight controller. |
| 120 | + |
| 121 | +**!!! Parameter changes can lead unpleasant surprises, you have been warned !!!** |
| 122 | + |
| 123 | +### Selecting a different controller |
| 124 | + |
| 125 | +Use following procedure to change the selected `pid_gizmo` controller, to ensure the defaults of the new controller are applied. |
| 126 | + |
| 127 | +``` |
| 128 | +defaults pid # this resets the pid values |
| 129 | +set pid_gizmo NEW_GIZMO # select the new PID controller |
| 130 | +save # save parameters to EEPROM and reboot |
| 131 | +
|
| 132 | +... # wait for reboot |
| 133 | +
|
| 134 | +dump pid # check that you now have default values for NEW_GIZMO PID controller |
| 135 | +set pid_xxx value # change parameters as desired |
| 136 | +``` |
| 137 | + |
| 138 | +Note: If a `pid_xxx` parameter is -1 then the default value for the selected `pid_gizmo` is used. |
| 139 | + |
| 140 | +### pid_gizmo MF2 |
| 141 | + |
| 142 | +This controller is a very basic PID rate controller. When in Angle Mode the angle error is converted to a desired rate which the controller tries to keep. |
| 143 | + |
| 144 | +Betaflight friends will notice that the default MF2 PID parameters are identical. Yes, this is the case, so your BF setup should work with MF2. But this controller lacks all the fancy stuff BF offers. |
| 145 | + |
| 146 | +Supported FlightModes: RATE, ANGLE |
| 147 | + |
| 148 | +### pid_gizmo MF1 - NOT TESTED - DO NOT USE |
| 149 | + |
| 150 | +An attempt to improve the MF0 controller with better yaw hold. Not tested, do not use. |
| 151 | + |
| 152 | +### pid_gizmo MF0 - NOT TESTED - DO NOT USE |
| 153 | + |
| 154 | +The MF0 controller is a port of the classic madflight v2.3 controller, but the port is not flight tested so do not use!!! |
| 155 | + |
| 156 | +This controller is a modified version of the [dRehmFlight](https://github.com/nickrehm/dRehmFlight) controller. |
| 157 | + |
| 158 | +Supported FlightModes: RATE, ANGLE |
| 159 | + |
| 160 | +``` |
| 161 | +//Controller parameters |
| 162 | +maxRoll = ifneg(cfg.pid_rol_angl_lim, 30); // Max roll angle in deg for angle mode - DO NOT INCREASE OVER 70 OR YOU WILL CRASH DUE TO GIMBAL-LOCKS |
| 163 | +maxPitch = ifneg(cfg.pid_pit_angl_lim, 30); // Max pitch angle in deg for angle mode - DO NOT INCREASE OVER 70 OR YOU WILL CRASH DUE TO GIMBAL-LOCKS |
| 164 | +maxRollRate = ifneg(cfg.pid_rol_rate_lim, 50); // Max roll rate in deg/sec for rate mode |
| 165 | +maxPitchRate = ifneg(cfg.pid_pit_rate_lim, 60); // Max pitch rate in deg/sec for rate mode |
| 166 | +maxYawRate = ifneg(cfg.pid_yaw_rate_lim, 160); // Max yaw rate in deg/sec for angle and rate mode |
| 167 | +i_limit = ifneg(cfg.pid_i_limit, 25); // Integrator saturation level, mostly for safety |
| 168 | +
|
| 169 | +//PID Rate Mode - Scaled by .01 to bring PID output within -1 to 1 range |
| 170 | +Kp_ro_pi_rate = 0.01 * ifneg(cfg.pid_kp0, 0.15); // Roll/Pitch rate P-gain |
| 171 | +Ki_ro_pi_rate = 0.01 * ifneg(cfg.pid_ki0, 0.2); // Roll/Pitch rate I-gain |
| 172 | +Kd_ro_pi_rate = 0.01 * ifneg(cfg.pid_kd0, 0.002); // Roll/Pitch rate D-gain (be careful when increasing too high, motors will begin to overheat!) |
| 173 | +Kp_yaw_rate = 0.01 * ifneg(cfg.pid_kp1, 0.3); // Yaw rate P-gain |
| 174 | +Ki_yaw_rate = 0.01 * ifneg(cfg.pid_ki1, 0.05); // Yaw rate I-gain |
| 175 | +Kd_yaw_rate = 0.01 * ifneg(cfg.pid_kd1, 0.00015); // Yaw rate D-gain (be careful when increasing too high, motors will begin to overheat!) |
| 176 | +
|
| 177 | +//PID Angle Mode |
| 178 | +Kp_ro_pi_angle = 0.01 * ifneg(cfg.pid_kp2, 0.4); // Roll/Pitch P-gain |
| 179 | +Ki_ro_pi_angle = 0.01 * ifneg(cfg.pid_ki2, 0.1); // Roll/Pitch I-gain |
| 180 | +Kd_ro_pi_angle = 0.01 * ifneg(cfg.pid_kd2, 0.05); // Roll/Pitch D-gain |
| 181 | +Kp_yaw_angle = 0.01 * ifneg(cfg.pid_kp3, 0.6); // Yaw P-gain |
| 182 | +//cfg.pid_ki3 unused |
| 183 | +Kd_yaw_angle = 0.01 * ifneg(cfg.pid_kd3, 0.1); // Yaw D-gain |
| 184 | +``` |
| 185 | + |
| 186 | + |
| 187 | +|Parameter|Description|Default|Options| |
| 188 | +|-|-|-|-| |
| 189 | +|`pid_angl_mult`|Angle to rate multiplier<br>_since v2.4.0_|-1|| |
| 190 | +|`pid_filt0_freq`|Filter Frequency (or filter parameter 1 for non-frequency filters)<br>_since v2.4.0_|-1|| |
| 191 | +|`pid_filt0_q`|Filter Q (or filter parameter 2 for non-Q filters)<br>_since v2.4.0_|-1|| |
| 192 | +|`pid_filt0_type`|Filter Type<br>_since v2.4.0_|NONE|| |
| 193 | +|`pid_filt1_freq`|<br>_since v2.4.0_|-1|| |
| 194 | +|`pid_filt1_q`|<br>_since v2.4.0_|-1|| |
| 195 | +|`pid_filt1_type`|<br>_since v2.4.0_|NONE|| |
| 196 | +|`pid_filt2_freq`|<br>_since v2.4.0_|-1|| |
| 197 | +|`pid_filt2_q`|<br>_since v2.4.0_|-1|| |
| 198 | +|`pid_filt2_type`|<br>_since v2.4.0_|NONE|| |
| 199 | +|`pid_filt3_freq`|<br>_since v2.4.0_|-1|| |
| 200 | +|`pid_filt3_q`|<br>_since v2.4.0_|-1|| |
| 201 | +|`pid_filt3_type`|<br>_since v2.4.0_|NONE|| |
| 202 | +|`pid_gizmo`|PID controller. IMPORTANT: Read module instructions before when changing this parameter!!!<br>_since v2.4.0_|MF2|MF0<br>MF1<br>MF2| |
| 203 | +|`pid_i_limit`|I-Term limit. Usually in percent of output, check pid_gizmo documentation<br>_since v2.4.0_|-1|| |
| 204 | +|`pid_ka0`|Additional-A PID Term<br>_since v2.4.0_|-1|| |
| 205 | +|`pid_ka1`|<br>_since v2.4.0_|-1|| |
| 206 | +|`pid_ka2`|<br>_since v2.4.0_|-1|| |
| 207 | +|`pid_ka3`|<br>_since v2.4.0_|-1|| |
| 208 | +|`pid_kb0`|Additional-B PID Term<br>_since v2.4.0_|-1|| |
| 209 | +|`pid_kb1`|<br>_since v2.4.0_|-1|| |
| 210 | +|`pid_kb2`|<br>_since v2.4.0_|-1|| |
| 211 | +|`pid_kb3`|<br>_since v2.4.0_|-1|| |
| 212 | +|`pid_kd0`|Derivative/Damping PID Term<br>_since v2.4.0_|-1|| |
| 213 | +|`pid_kd1`|<br>_since v2.4.0_|-1|| |
| 214 | +|`pid_kd2`|<br>_since v2.4.0_|-1|| |
| 215 | +|`pid_kd3`|<br>_since v2.4.0_|-1|| |
| 216 | +|`pid_ki0`|Integral PID Term<br>_since v2.4.0_|-1|| |
| 217 | +|`pid_ki1`|<br>_since v2.4.0_|-1|| |
| 218 | +|`pid_ki2`|<br>_since v2.4.0_|-1|| |
| 219 | +|`pid_ki3`|<br>_since v2.4.0_|-1|| |
| 220 | +|`pid_kp0`|Proportional PID Term<br>_since v2.4.0_|-1|| |
| 221 | +|`pid_kp1`|<br>_since v2.4.0_|-1|| |
| 222 | +|`pid_kp2`|<br>_since v2.4.0_|-1|| |
| 223 | +|`pid_kp3`|<br>_since v2.4.0_|-1|| |
| 224 | +|`pid_pit_angl_lim`|Pitch angle limit in angle flightmode [deg]<br>_since v2.4.0_|-1|| |
| 225 | +|`pid_pit_rate_lim`|Pitch rate limit [deg/s]<br>_since v2.4.0_|-1|| |
| 226 | +|`pid_rol_angl_lim`|Roll angle limit in angle flightmode [deg]<br>_since v2.4.0_|-1|| |
| 227 | +|`pid_rol_rate_lim`|Roll rate limit [deg/s]<br>_since v2.4.0_|-1|| |
| 228 | +|`pid_yaw_rate_lim`|Yaw rate limit [deg/s]<br>_since v2.4.0_|-1|| |
| 229 | + |
| 230 | +## PIN - Pin mapping |
| 231 | + |
| 232 | + |
| 233 | +|Parameter|Description|Default|Options| |
| 234 | +|-|-|-|-| |
60 | 235 | |`pin_bat_i`|Battery ADC Current Sense Pin<br>_since v2.0.0_|-1|| |
61 | 236 | |`pin_bat_v`|Battery ADC Voltage Sense Pin<br>_since v2.0.0_|-1|| |
62 | 237 | |`pin_bbx_cs`|SDCard SPI CS Pin<br>_since v2.0.0_|-1|| |
|
131 | 306 | |`pin_spi3_miso`|SPI3 MISO Pin<br>_since v2.0.0_|-1|| |
132 | 307 | |`pin_spi3_mosi`|SPI3 MOSI Pin<br>_since v2.0.0_|-1|| |
133 | 308 | |`pin_spi3_sclk`|SPI3 SCLK Pin<br>_since v2.0.0_|-1|| |
| 309 | + |
| 310 | +## RCL - Remote control radio link |
| 311 | + |
| 312 | + |
| 313 | +|Parameter|Description|Default|Options| |
| 314 | +|-|-|-|-| |
134 | 315 | |`rcl_arm_ch`|Arm Channel (1-based) - default is AETR,arm,flightmode<br>_since v1.3.4_|5|| |
135 | 316 | |`rcl_arm_max`|Maximum PWM for ARMED<br>_since v1.3.4_|2500|| |
136 | 317 | |`rcl_arm_min`|Minimum PWM for ARMED<br>_since v1.3.4_|1600|| |
137 | 318 | |`rcl_baud`|Radio Receiver Baud Rate. Set to 0 for automatic.<br>_since v2.0.0_|0|| |
138 | 319 | |`rcl_deadband`|Radio Receiver Stick Deadband<br>_since v2.0.0_|0|| |
139 | | -|`rcl_flt0`|Flight Mode 0<br>_since v2.3.4_|RATE|| |
140 | | -|`rcl_flt1`|Flight Mode 1<br>_since v2.3.4_|RATE|| |
141 | | -|`rcl_flt2`|Flight Mode 2<br>_since v2.3.4_|RATE|| |
142 | | -|`rcl_flt3`|Flight Mode 3<br>_since v2.3.4_|RATE|| |
143 | | -|`rcl_flt4`|Flight Mode 4<br>_since v2.3.4_|RATE|| |
144 | | -|`rcl_flt5`|Flight Mode 5<br>_since v2.3.4_|ANGLE|| |
| 320 | +|`rcl_flt0`|Flight Mode 0<br>_since v2.4.0_|RATE|| |
| 321 | +|`rcl_flt1`|Flight Mode 1<br>_since v2.4.0_|RATE|| |
| 322 | +|`rcl_flt2`|Flight Mode 2<br>_since v2.4.0_|RATE|| |
| 323 | +|`rcl_flt3`|Flight Mode 3<br>_since v2.4.0_|RATE|| |
| 324 | +|`rcl_flt4`|Flight Mode 4<br>_since v2.4.0_|RATE|| |
| 325 | +|`rcl_flt5`|Flight Mode 5<br>_since v2.4.0_|ANGLE|| |
145 | 326 | |`rcl_flt_ch`|Flight Mode Channel (1-based) - default is AETR,arm,flightmode<br>_since v1.3.4_|6|| |
146 | 327 | |`rcl_flt_max`|Flight Mode 6-pos Switch Highest PWM (flight mode 5)<br>_since v1.3.4_|1815|| |
147 | 328 | |`rcl_flt_min`|Flight Mode 6-pos Switch Lowest PWM (flight mode 0)<br>_since v1.3.4_|1165|| |
|
172 | 353 | |`rcl_yaw_mid`|Yaw Stick Center PWM in [us] 500-2500<br>_since v1.3.4_|1500|| |
173 | 354 | |`rcl_yaw_right`|Yaw Stick Right PWM in [us] 500-2500<br>_since v1.3.4_|1900|| |
174 | 355 | |`rcl_yaw_sens`|Yaw Stick Center Sensitivity: 0.0 (very curvy) to 1.0 (straight line)<br>_since v2.3.3_|0.1|| |
| 356 | + |
| 357 | +## RDR - Radar, lidar, and ultrasonic distance sensors |
| 358 | + |
| 359 | + |
| 360 | +|Parameter|Description|Default|Options| |
| 361 | +|-|-|-|-| |
175 | 362 | |`rdr_baud`|Radar/Sonar Baud Rate. Set to 0 for automatic.<br>_since v2.0.0_|0|| |
176 | 363 | |`rdr_gizmo`|Radar/Sonar Sensor Type<br>_since v2.0.0_|NONE|NONE<br>LD2411S<br>LD2413<br>USD1<br>SR04<br>DTS6012M<br>VL53L3CX| |
177 | 364 | |`rdr_i2c_adr`|Optical Flow I2C Address (decimal number only, set to 0 for automatic)<br>_since v2.1.3_|0|| |
|
0 commit comments