Unknown Crash (Maybe) Related to GPS Flight Modes

Hi.
I have a heavy X quadcopter running Copter 4.0 on Cube Black autopilot hardware.
Everything works fine on non-GPS flight modes.
But within the GPS modes (Loiter, Auto, Land, and so on) quadcopter has some strange behaviors.
First, I experienced this situation in Auto Mode.
My mission was including takeoff, loiter, goto waypoint, loiter, goto takeoff location, loiter, and land.
After taking off (and still not reached to target altitude) the vehicle was drift and I immediately put it in land mode.
The drifting situation was still there and the vehicle crashed to an object.
The vehicle was not landing the position when I switched to land mode.
In the second attempt, I was taking off in stabilize mode and it flies fine again.
I gained some altitude and put it in the loiter mode.
The vehicle was drifting again really fast.
I put the vehicle in land mode and it still drifts.
Luckily there wasn’t any object at the trajectory :smiley: so the quad is OK (at least for now :smiley:)
I think this situation is GPS related and I don’t know whether a faulty GPS module or not.
Can anyone help me to debug this situation?
I am attaching the logs.
https://drive.google.com/drive/folders/13jAnXx23HgxWQ09UtKttCVgCJgswEsEQ?usp=sharing
Thank you for anyone interested in from now.
Regards…

Good old “compass is too close to power wires”.


Normalized compass data should not change during the flight, and should not change with throttle… Rethink you compass location.

2 Likes

Dear Andras.
Thanks for your quick look and suggestions.
Closest power cable to the autopilot is at least 10cm and to the GPS module (on top of the frame and elevated 10cm) is at least 20cm.
Also I have the exact parameters, frame and electronics on the 3 platforms.
Other two platforms were flying perfectly fine on both GPS related and non-related modes.
Do you have any other suggestions?
Thanks for your efforts.
Regards…

Apparently you use only the internal compasses of your cube. So your external compass is faulty or the cabling is not ok.

image

1 Like

I will check them.
Thank you :blush:

Being a Cube, update to 4.0.4 and also do the boot loader update.

Try BRD_BOOT_DELAY,5000 and see if that external compass shows up reliably then.

The GPS Glitch messages are generated when Arducopter thinks the GPS position and “dead reckoning” positioning (Gyros and Accels) have diverged. Most often caused by excessive vibrations or some actual GPS fault. Your GPS accuracy does go down, but there’s also vibrations to worry about.

Y axis has poor vibrations. Usually X and Y axis vibrations are closely linked because of prop balance or motor vibrations. In this case it’s just Y axis which may mean wires or something are loose or even bumping or pulling on the flight controller.
Z axis is not too bad, but keep an eye on Z vibrations because you’re getting close to marginal.

Your attitude control is poor, but there’s not much to look at in that log unfortunately. See if you can get everything working better and do some hovering and gentle maneuvers and post a new log.
You’ll probably want to do the harmonic notch filtering and an Autotune with AUTOTUNE_AGGR,0.1

Not a problem, but you’ve got MOT_PWM_TYPE,1 (oneshot) yet motors are connected to main outputs as per normal. They’ll be running off normal PWM.
Or just stick with normal PWM, MOT_PWM_TYPE,0

If you really want to use non-PWM you have to move the motor/ESC connectors to the AUX outputs if you have enough spare, and you have to change a bunch of parameters to suit.
MOT_PWM_TYPE,4 (dshot 150 would be my preference)
SERVO_BLH_AUTO,1
SERVO9_FUNCTION,33 through to SERVO12_FUNCTION,36
BRD_PWM_COUNT,x check messages after boot to see if your outputs are as expected

and reset
SERVO1_FUNCTION through to SERVO4_FUNCTION to zeros (no motors on these outputs)

Reboot after any of these SERVO motor output changes and check that things got changed as you expect.

1 Like

Hello, again sir.
I changed the GPS module with a new one today.
There was a really strong wind in the area (around 20-25km/s).
The drone was able to hold its position in the loiter mode (with some wobble) with really struggle.
I am attaching today’s flight logs, 3 logs in total.
Could you please look at them and give me more suggestions if you see any problem?
Thanks for your time…
https://drive.google.com/drive/folders/1QOphsLZXjYRYES-JBXP8nawK6ImrbAdm?usp=sharing

INS_ACCEL_FILTER,10 might be getting too low, maybe try 15 or so.
You seem to have oscillations, I’d probably alter the PIDs somewhat:
ATC_RAT_RLL_P,0.12
ATC_RAT_RLL_I,0.12
ATC_RAT_RLL_D,0.005
ATC_RAT_PIT_P,0.12
ATC_RAT_PIT_I,0.12
ATC_RAT_PIT_D,0.005
Check the tuning guide on manually tuning pitch and roll:
https://ardupilot.org/copter/docs/tuning-process-instructions.html

Also vibrations are high in Y axis and definitely too high in Z axis. Only X axis is good.
Y axis vibes might be something rubbing against the flight controller, or some wires pulled too tight.
Z axis can be hard to fix since it’s most often generated by thrust from the props hitting the arms and frame. Unless you can find and secure any loose items, then you may have to increase the physical damping of the flight controller.
The vibrations will definitely need to be fixed before you have a fly-away.

Once you’ve got vibrations and oscillations under control, move onto the Harmonic Notch filtering and then Autotune.

Hello again sir.
Sorry for the late response, we were really busy.
Yesterday we tried to work on harmonic notch filtering using ardupilot docs.
https://ardupilot.org/copter/docs/common-imu-fft.html
https://ardupilot.org/copter/docs/common-imu-notch-filtering.html
We found that we have noise at 53Hz.
We tried to eliminate this noise using notch filtering and set parameters accordingly but it seems that filtering is not working or do we have something forgotten?
I am attaching some logs.
If you have some time to look at I will be very grateful.
Thanks for all of your effort :slight_smile:
https://drive.google.com/drive/folders/1EKBP3Ye_KCzVZhhXJwbN9xXsy4Vt6x5t?usp=sharing

I think you have missed key tuning steps by jumping to the Harmonic Notch Filter settings at this stage, your aircraft is not stable and not flying correctly. You are not getting enough altitude to get away from ground effects.

Change:
INS_ACCEL_FILTER,20
ATC_ANG_RLL_P,6.0
ATC_ANG_PIT_P,6.0
ATC_RAT_RLL_P,0.12
ATC_RAT_RLL_I,0.12
ATC_RAT_RLL_D,0.005
ATC_RAT_PIT_P,0.12
ATC_RAT_PIT_I,0.12
ATC_RAT_PIT_D,0.005
ATC_INPUT_TC,0.2

Definitely set up voltage and current monitoring (and failsafes), then these important parameters will help PIDs:
MOT_BAT_VOLT_MAX
MOT_BAT_VOLT_MIN

Leave the notch filter settings in place, just change:
INS_HNTCH_ATT,40
INS_HNTCH_BW,25

If the aircraft will take off and hover OK, do a gentle flight of at least 2meters altitude, with some gentle stick movements and post that log.

Download a copy of this spreadsheet and put in your prop size and battery cells, use it to check all your parameters.
Use the “Suggested” parameters too.

Hi Shawn.
Thanks for your quick reply.
With your suggested parameter values, we did a quick flight and attached the log file.
According to my observations on this flight, the PID settings are not good. I saw some instabilities and oscillations. It is much more responsive, but have some overshoots and oscillations as well.

We also tried to apply notch filtering as you suggested. Unfiltered and filtered FFT plots are given below.
53 Hz vibrations on GYRO readings are filtered but no filtering on ACC data. Is this the expected behavior or are we doing something wrong?
Thanks
https://drive.google.com/file/d/1rlFztOM_Zy0fpJmpjPxLD3drcnxzD0kj/view?usp=sharing


The notch filter is only active on the gyro’s.

1 Like