← All tools

Message & Error Explainer

What an ArduPilot message means and what to do about it

Українська

An attitude controller gain is zero or negative

Stops itAutoTune and control

What ArduPilot says:

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

  1. 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_P 4.5, ATC_RAT_RLL_P and ATC_RAT_RLL_I 0.135, ATC_RAT_RLL_D 0.0036 (pitch the same), ATC_RAT_YAW_P 0.18 and ATC_RAT_YAW_I 0.018.

  2. The transmitter's tuning knob is at the bottom of its range and TUNE_MIN is 0.

    CheckTUNE is not 0, and the named gain changes as the knob turns.

    FixTurn the knob up, or set TUNE_MIN above zero; when the tuning is finished set TUNE to 0 so that the knob no longer changes anything.

  3. 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

ParameterWhat it is
ATC_ANG_RLL_PRoll axis angle controller P gain
ATC_ANG_PIT_PPitch axis angle controller P gain
ATC_ANG_YAW_PYaw axis angle controller P gain
ATC_RAT_RLL_PRoll axis rate controller P gain
ATC_RAT_RLL_IRoll axis rate controller I gain
ATC_RAT_RLL_DRoll axis rate controller D gain
ATC_RAT_PIT_PPitch axis rate controller P gain
ATC_RAT_YAW_PYaw axis rate controller P gain
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.

Written here for Copter 4.6. In the tool you choose your vehicle and version, see your own parameter values beside the ones named here, and drop a flight log to have every message in it explained.

Open it in the Message & Error Explainer