A position controller gain is zero or negative
What ArduPilot says:
- …_POSZ_P must be > 0
- …_VELZ_P must be > 0
- …_ACCZ_I must be > 0
- …_POSXY_P must be > 0
- …_D_VEL_P must be > 0
- …_D_ACC_P must be > 0
Also explained here: 4 more
- …_ACCZ_P must be > 0
- …_NE_POS_P must be > 0
- …_D_POS_P must be > 0
- …_D_ACC_I must be > 0
ArduPilot checks five gains of the position controller before arming: PSC_POSXY_P, PSC_POSZ_P, PSC_VELZ_P, PSC_ACCZ_P and PSC_ACCZ_I. Each must be above zero; with a zero the copter cannot hold its place or its height in the modes that do that for you (AltHold, Loiter, Auto). The message names the first that is not, as “PreArm: Bad parameter: …”.
What to do, most likely first
A gain was set to 0 by hand or by a tuning knob.
CheckRead the gain the message names.
FixGive it a positive value again. A fresh Copter has
PSC_POSXY_P1.0,PSC_POSZ_P1.0,PSC_VELZ_P5.0,PSC_ACCZ_P0.5 andPSC_ACCZ_I1.0.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 |
|---|---|
PSC_POSXY_P | Position (horizontal) controller P gain |
PSC_POSZ_P | Position (vertical) controller P gain |
PSC_VELZ_P | Velocity (vertical) controller P gain |
PSC_ACCZ_P | Acceleration (vertical) controller P gain |
PSC_ACCZ_I | Acceleration (vertical) controller I gain |
Where to do it:Setup & Tuning GuideParameter Compare & Migrate
The code that sends it
…_POSZ_P must be > 0
libraries/AC_AttitudeControl/AC_PosControl.cpp AC_PosControl::pre_arm_checks() · Open in ArduPilot Copter-4.6.3
…_VELZ_P must be > 0
libraries/AC_AttitudeControl/AC_PosControl.cpp AC_PosControl::pre_arm_checks() · Open in ArduPilot Copter-4.6.3
…_ACCZ_I must be > 0
libraries/AC_AttitudeControl/AC_PosControl.cpp AC_PosControl::pre_arm_checks() · Open in ArduPilot Copter-4.6.3
…_POSXY_P must be > 0
libraries/AC_AttitudeControl/AC_PosControl.cpp AC_PosControl::pre_arm_checks() · Open in ArduPilot Copter-4.6.3
And 6 more messages, sent from the same places.