Altitude Control Failure, Unable to Maintain Stable Height

Describe the bug

We are using a custom flight controller based on the PX4_V4 hardware, equipped with GPS and a laser rangefinder. The height reference (HGT_REF) is set to GPS, and we are not using the rangefinder data for altitude control. After takeoff, the vehicle can maintain its position in the XY plane relatively well. However, the altitude fluctuates significantly around the setpoint (Z_SETPOINT). Adjusting the MPC_Z_P parameter has little effect on stabilizing the altitude. The issue persists even with the latest 1.16.0 firmware.

To Reproduce

Take off.
Manually control the vehicle to a certain altitude.
Center the remote control sticks.
The altitude continues to fluctuate.

Expected behavior

The relative altitude should be accurate, and the vehicle should maintain a stable hover without significant altitude fluctuations.

Screenshot / Media

None.

Flight Log

https://logs.px4.io/plot_app?log=6fdf707b-1d74-4710-964b-6594fed8969c

Software Version

Release 1.13.0 stable
One test with 1.16.0 alpha

Flight controller

Type: PX4_V4

Vehicle type

Multicopter

How are the different components wired up (including port information)

Not provided.

Additional context

When the vehicle reaches its lowest point and begins to ascend, there is a slight vibration.
When using ekf2_rng_ctrl enabled and Terrain Hold mode, the vehicle can maintain a stable altitude within the rangefinder’s 8-meter range.

1 Like

Looking at the log, the value of the actual distance sensor seems to fluctuate.

What are the chances that the transmitted laser light is being distorted and/or diffused by the terrain below the aircraft? Another possibility is the frame could be vibrating and causing the detector to malfunction…