F550, PX4 1.11.3, huge altitude oscillations

I’m trying to force my Holybro Pixhawk 4 in F550 hexacopter to fly properly.
On 1.11.3 (default settings and PIDs) and pixhawk mounted on vibration damping pad, during maiden flight the drone was shaky, looking like overtuned PIDs.

So I’ve tried a few combinations of firmware versions, with and without damping pad:
1.11.3 with damping - altitude and position holding was quite good, but it was extremely shaky
1.10.2 default settings (flies well on the same frame with pixhawk 2 cube) with damping - same behavior as above
1.10.2 default settings, without damping (no change in firmware setup) - PIDs good, but throttle was zero-one. In Altitude mode with throttle in the middle, the drone drops from the sky, and when throttle was increased to almost 3/4 it shoots up at full speed. When it landed on the ground it couldn’t take off in Altitude mode despite full throttle.
Coming back to 1.11.3 without damping - it flies perfectly indoors in Stabilized and Altitude mode. Alt hold was perfect. But outdoors: PIDs good, position hold good, but altitude hold oscillates around +/- 2m. So with 50% throttle the drone shoots up almost 2 m above hover point, then drops down 2 m below that point and so on until I switched back to Stabilized mode.

Pixhawk is mounted directly to the upper centerplate with thin foam double sided tape.
If it matters, the plastic case was opened before maiden flight, but barometer sponge was inserted back in place when closing.
Here are some flight logs (1.11.3 without damping, altitude oscillations):

Can you tell me what can be a reason of that behaviour? I want to have stable and reliable test platform for autonomous flights. I expected that Pixhawk 4 will fly well out of the box, like Pixhawk 2 Cube in our university drones.

Best regards :slight_smile:

Looking at the logs, I see a lot of noise on z-acceleration, x- and y- gyroscopes, thrust, pitchrate, and rollrate tracking. To me these seem like symptoms of overdamped attitude rate controllers. I would first try turning down MC_ROLLRATE_D and MC_PITCHRATE_D, and going through the rest of the tuning procedure while you’re at it. The D terms do help with oscillations up to a point, but if they’re too high they amplify noise, and it’s more noticeable when flying outside with more disturbances from the wind. Since the attitude is noisy, I think as the controller tries to compensate for bank angle by modulating thrust, we see noise in the thrust as well. (A compounding factor is that the noise then effects the angular speed and vertical acceleration estimates in a bit of a feedback loop.)

It looks like they added an advanced tuning page in QGroundControl and updated the documentation since I last checked:

(Note also: like the Pixhawk 2, the Pixhawk 4’s IMU is physically mounted on foam internally, so hard mounting the case should be okay. If you’ve taken it apart it might not hurt to double check that the IMU is securely attached and the ribbon cable is undamaged.)