How to fix altitude oscillation on PosHold


My drone with PosHold mode oscillates its altitude.
Could you tell me how to fix this issue?

I paste log screenshot.
Log file is here.

I didn’t controll throttle stick while line number from 700 to 1000

My drone specs is below.

  • Pixhawk 2.4.8
  • ArduCopter 3.6.4
  • Quad X
  • PosHold mode without GPS (indoor use)
  • LIDAR-Lite v3 and PX4FLOW sensing support
  • 1045 big propellers
  • 2212 950KV motors
  • S500 big frame
  • Max 40A output BLHeli ESC
  • 3000mAh 30-60C LiPo battery
  • Pixhawk, LIDAR-Lite v3 and PX4FLOW are on shock mount
  • 1.7kg weight

Thank you.

1 Like


I forget if we talked about this before or not but it looks like the EK2_ALT_SOURCE = 1 (range finder). It’s mentioned in numerous places but in short, it should be set to “0” in 99% of cases.

1 Like

Thank you.

“EK2_ALT_SOURCE = 0” is “Use Baro”.
It means ArduPilot does not use LIDAR value to keep altitude on AltHold and PosHold?

No, it uses lidar in AltHold and PosHold but the EKF doesn’t need to use the range finder to estimate it’s altitude. “Terrain Following” is explained here and here.

I will set EK2_ALT_SOURCE = 0 and do test flight.

1 Like