An attitude controller gain is zero or negative
What ArduPilot says:
- …_…_D must be >= 0
- …_…_P must be >= 0
- …_…_I must be >= 0
- …_…_P must be > 0
- …_…_I must be > 0
ArduPilot checks the attitude controller's gains before arming. The angle gains ATC_ANG_RLL_P, ATC_ANG_PIT_P and ATC_ANG_YAW_P must be above zero. In the roll, pitch and yaw rate controllers (ATC_RAT_RLL_P, ATC_RAT_RLL_I, ATC_RAT_RLL_D and the same with PIT and YAW) P and I must be above zero, unless that axis has a feed-forward above zero (ATC_RAT_RLL_FF), when they may be zero but not negative; D may be zero but never negative. The message names the first gain that breaks this, as “PreArm: Bad parameter: …”.
What to do, most likely first
A gain was set to 0 while tuning by hand: I taken out “to tune P first”, or a value typed wrongly.
CheckRead the gain the message names.
FixGive it a positive value again. A fresh Copter has
ATC_ANG_RLL_P4.5,ATC_RAT_RLL_PandATC_RAT_RLL_I0.135,ATC_RAT_RLL_D0.0036 (pitch the same),ATC_RAT_YAW_P0.18 andATC_RAT_YAW_I0.018.The transmitter's tuning knob is at the bottom of its range and
TUNE_MINis 0.CheckTUNE is not 0, and the named gain changes as the knob turns.
FixTurn the knob up, or set
TUNE_MINabove zero; when the tuning is finished set TUNE to 0 so that the knob no longer changes anything.The gains came with a parameter file from another aircraft or were only partly written.
CheckParameter Compare & Migrate shows what differs from your earlier file.
FixLoad your own backup, or the values above, and tune from there.
Parameters to look at
| Parameter | What it is |
|---|---|
ATC_ANG_RLL_P | Roll axis angle controller P gain |
ATC_ANG_PIT_P | Pitch axis angle controller P gain |
ATC_ANG_YAW_P | Yaw axis angle controller P gain |
ATC_RAT_RLL_P | Roll axis rate controller P gain |
ATC_RAT_RLL_I | Roll axis rate controller I gain |
ATC_RAT_RLL_D | Roll axis rate controller D gain |
ATC_RAT_PIT_P | Pitch axis rate controller P gain |
ATC_RAT_YAW_P | Yaw axis rate controller P gain |
Where to do it:Setup & Tuning GuideParameter Compare & Migrate
The code that sends it
…_…_D must be >= 0
libraries/AC_AttitudeControl/AC_AttitudeControl.cpp AC_AttitudeControl::pre_arm_checks() · Open in ArduPilot Copter-4.7.1
…_…_P must be >= 0
libraries/AC_AttitudeControl/AC_AttitudeControl.cpp AC_AttitudeControl::pre_arm_checks() · Open in ArduPilot Copter-4.7.1
…_…_I must be >= 0
libraries/AC_AttitudeControl/AC_AttitudeControl.cpp AC_AttitudeControl::pre_arm_checks() · Open in ArduPilot Copter-4.7.1
…_…_P must be > 0
libraries/AC_AttitudeControl/AC_AttitudeControl.cpp AC_AttitudeControl::pre_arm_checks() · Open in ArduPilot Copter-4.7.1
And 1 more messages, sent from the same places.