Hi Dave,
yes I also calibrated the compass with magfit but nothing seems to have changed. I’ve put logs here and I don’t think the lidar and sonar sensors are the problem (it happens even if I disable them). I’ve never had this happen to me in 7 years of ardupilot builds. While I was looking at the advanced settings of the compass in the wiki, I noticed that it is indicated to do the calibration of the accelerometer first and then that of the compass. When I moved the gps to the 3d printed support, I did NOT do the accelerometer calibration again. Could this be the problem?