Uncommanded climb in altitude hold mode

I am flying a hexicopter with a Pixhawk 4 and here2 gps. The climb occurs when aggressive attitude inputs are given by the pilot in attitude control mode. It will climb a little in position hold mode but not bad. I am unsure if it is a vibration/ barometer problem or some sort of safety compensation if control saturation is reached. Here are some flight logs
https://drive.google.com/file/d/1COK7Gg72qKgXPyAbVQhjuUXn1uvk4_go/view?usp=sharing

That link has access request.

sorry about that
https://drive.google.com/file/d/1COK7Gg72qKgXPyAbVQhjuUXn1uvk4_go/view?usp=sharing

Vibration levels are causing a lot of clipping events. How is the FC mounted?

3M mounting tape on a carbon plate. I have recently added a lot of weight to this airframe and it is a rats nest of wires. I was wanting to know if anything else was going on before I spend a lot of time fixing that.

I am not familiar with what the vibe clipping is plotting. Is it a response to the imu hitting it’s full scale value in the down direction?

Yeah, clipping means that the IMU is saturating at the maximum measurable value. It usually happens in both directions on some axis because the IMU is shaking back and forth. The drone flying away is a classic symptom of the IMU clipping in the Z axis. Banging between the min and max value in the Z axis causes the drone to ascend because the average value being measured between min and max is 0 instead of -9.81 (gravity), so the drone thinks it is falling.

Wires rattling against the FC is a pretty common cause of this, so see if cleaning up your build helps. If not, consider different mounting options.

That makes sense, it only happens when the vehicle is accelerating aggressively as well. I see the z position wonders off while the baro alt and gps alt stay together. I will tidy the vehicle up and post the results.

This may be insufficient isolation. I don’t know what the recommendation is for the Pixhawk 4 but if it’s the same cool-aid being served for the Cube (hard mount it) that doesn’t work on every frame.

Inside of the pixhawk 4 the imu is mounted on foam with a ribbon cable. Isolating mounts have been problematic for me in the past but this vehicle is uniquely small and heavy. As a first step I know it needs to be stiffer.

https://drive.google.com/file/d/1tqjyUYPacIWYYspGOE0pwVkCImiAKa0v/view?usp=sharing

I got all of the wires away from the flight controller and did not observe unexpected climbs. Its vibration metrics are still way higher than my other airframes but it has debris guards for the propellers and a heavy sensor payload. I still need to auto tune it so hopefully that smooths it out a little as well.

Better. Before running Autotune run through the Tuning Process Instructions setting the parameters as suggested. Maybe you did and just didn’t set MOT_BAT_VOLT_MAX/MIN. Also before Autotune you should take advantage of the Dynamic Notch Filter.
https://ardupilot.org/copter/docs/tuning-process-instructions.html
https://ardupilot.org/copter/docs/common-imu-notch-filtering.html