Plane Extreme Position / Velocity Glitches (HDOP ~ 99)

Hi,

While flying my plane (Matek F405-WTE) in an airfield at around 50m altitude, Mission Planner started showing the plane “moving on it’s own” extremely far from the actual position. Here is a picture of the displayed flight path (our actual plane was only in the black circle). The HDOP was also spiking to 99 and at the same time the number of satellites oscillated between 4 and 0.

I suspected this may be because the GPS did not have a good lock before flight but a previous log reveals that after the GPS was in the air and had 15 satellite connections, it later spiked down to 0 and HDOP spiked to 99.

I was wondering what may be causing this issue? Our GPS is mounted near the tail and on top of the plane so I don’t suspect electronic interference. The GPS is a HGLRC M100-5883, and I realized during the flight the baud rate was set to 9600 while the working one was 115200, but I’m not sure if that caused the error. Another possibility is a wiring issue since we soldered off the jst connectors on the GPS to put our Dupont connectors, but the wires were secure before and after the flight. Any help would be greatly appreciated and thank you for your time!

Here are the logs from the flight with a large position offset: https://www.dropbox.com/scl/fi/ekd036n255qms0saajkxw/00000051PositionTweak.BIN?rlkey=pmqldvxyl1623esx8bvpfznj0&st=06kal09l&dl=0
and the previous flight with only one small spike and little position offset: https://www.dropbox.com/scl/fi/ar0pvwm0kk8q0kepwsfqu/00000043TweakFlight.BIN?rlkey=za6s30b1ru4657fa985ltvlbr&st=05ct310m&dl=0

Just wanted to update on the issue. I figured out the setting AHRS_OPTIONS to 1 (which disables fallback to DCM in case of EKF error) will stop the autopilot from giving really inaccurate velocities and position when it loses satellite signal. However, I am still not sure why the GPS would spike randomly down to 0 satellites from 17. I also realized that my GPA.Delta would consistently spike to 220-240ms which exceeds the max refresh rate of ArduPlane so this may be a cause but I have no idea how to fix it.

Similar problem https://discuss.ardupilot.org/t/the-conversion-of-dcm-to-ekf3-caused-the-crash/105342/2