Copter uncontrolled climb and fly away in position hold mode

I was testing my 6 inch copter in position hold mode. But the copter quickly climbed up.

I checked the log, it seems the altitude estimated by GPS is way higher than that from the barometer. This may be the reason for shooting up after takeoff.

I was wondering how to correct the GPS error, could it be the interference coming from my VTX that is close by? Or is it possible to use the barometer only to estimate the altitude?

edit:
I just checked the EK2_ALT_SOURCE, it was set to 0, using the barometer. Now I don’t have any idea why it behaved this way.

I read the vibration could cause the copter to rapidly climbing up. Here is my vibration graph. It seems to be below 30m/s/s as this page (https://ardupilot.org/copter/docs/common-measuring-vibration.html#common-measuring-vibration) describes during the climbing period.

https://drive.google.com/file/d/14vmhozx3hYGHrmRtN6vr4eO1DB0Tlqkg/view?usp=sharing

how close are your GPS and VTX and its power lines

VTX antenna is right next to GPS, about 6 cm from the battery power line.

It took a while to acquire 3d fix but it did pass the preflight check for GPS speed( <1) and HDOP(<2).

Despite the difference between the altitude reading from GPS and barometer, they seem to follow the same shape just shifted vertically.

But I used EK2_ALT_SOURCE = 0, using barometer as the primary reading for altitude. If the GPS is bad, the barometer reading should be ok, yet it did fly away, I am at loss now.

In the end FC GPS and VTX must be far from eachother so I mean that your barometer is being also effected by the field which is being created by power lines GPS and VTX

The problem is the PWM signal that the FC send to the ESC and the motors.Here you can see the oscilations, and with that, the drone cannot achieve a correct stabilization:

I don’t think that the problem are vibrations because they are low, but it might be a problem with PIDs, incorrect configuration of acc and gyro filters, an overpowered drone with a problem with the minimum PWM… And I can see that you have not follow the basic tunning instructions with a correct configuration of the filters with the size of your props. First read this https://ardupilot.org/copter/docs/tuning-process-instructions.html and later in Mission Planner you can make the same configuration by pressing ALT+A with the FC connected.

Thank you, I will see what I can do with the small frame.

Thank you so much. I did not follow the page at all.

I will do that the coming weekend and see how it goes.