Pixhawk Cube crash analysis help

Hi, our quadcopter uses a Pixhawk Cube with a Here2 GPS, and an Odroid XU4 onboard. We are having quite a few crashes where the copter starts acting weird (see video), and crashes. We’ve done calibration before every flight and Mission Planner shows no warnings. I’ve attached the logs for the latest flight (we first did a brief takeoff and land, and the second takeoff was the one where it crashed). Any help diagnosing would be appreciated.

Logs and video (files too large to upload here): https://drive.google.com/open?id=1JOgeSsT8j5RF0a5CHL4fEzO-YpiQNKM-

I am not very good at log analysis yet, so others will most likely jump in, but here is my take on it.

Size (kb) 23174.1767578125
No of lines 270063
Duration 0:10:22
Vehicletype ArduCopter
Firmware Version V4.0.3
Firmware Hash ffd08628
Hardware Type
Free Mem 0
Skipped Lines 0
Test: Autotune = UNKNOWN - No ATUN log data
Test: Brownout = GOOD -
Test: Compass = FAIL - Large change in mag_field (500.73%)
Max mag field length (1304.49) > recommended (550.00)

Test: Dupe Log Data = GOOD -
Test: Empty = GOOD -
Test: Event/Failsafe = FAIL - ERRs found: CRASH FS_THR GPS_GLITCH
Test: GPS = UNKNOWN - join() takes exactly one argument (2 given)
Test: IMU Mismatch = GOOD - (Mismatch: 0.43, WARN: 0.75, FAIL: 1.50)
Test: Motor Balance = GOOD - Motor channel averages = [1153, 1147, 1145, 1146]
Average motor output = 1147
Difference between min and max motor averages = 8
Test: NaNs = FAIL - Found NaN in POS.RelOriginAlt
Found NaN in CTUN.TAlt
Found NaN in CTUN.DSAlt

Test: OpticalFlow = FAIL - FAIL: no optical flow data

Test: Parameters = FAIL - ‘MAG_ENABLE’ not found
Test: PM = FAIL - 5 slow loop lines found, max 12.38% on line 233934
Test: Pitch/Roll = UNKNOWN - ‘BarAlt’
Test: Thrust = GOOD -
Test: VCC = UNKNOWN - No CURR log data

The tune means Pitch and Roll are almost out of control the whole time, maybe because of the wind evident in that video. Since this craft is fairly unstable I’m guessing this is near to the first flight. Best to wait for a windless day - once it’s fully tuned and got up some good solid flight time, it should be able to handle high winds then, otherwise avoid wind.
There shouldn’t be any need to do calibrations before each flight - which are you doing?

If your battery voltage monitoring is correct, the battery voltage drops to almost nothing (10.5 for a 3cell LiPo) almost as soon as you fly. Are you using LiPos or something else?
If you are using a 3cell LiPo, set these and fix the voltage monitoring - or replace that battery.
BATT_ARM_VOLT,11
BATT_CRT_VOLT,10.5
BATT_LOW_VOLT,10.8
MOT_BAT_VOLT_MAX,12.6
MOT_BAT_VOLT_MIN,9.9

You can set these right away too, although not critical:
PSC_ACCZ_I,1.08
PSC_ACCZ_P,0.54

If you’re certain the voltage and current monitoring are correct you can do the Compass/Motor calibration - carefully! Also you might wont to try setting this since you’ve got a CAN GPS and Compass:
BRD_BOOT_DELAY,5000
Some have found it improves the reliability, allows the CAN devices to boot up and be ready before the flight controller.

For your initial testing and tuning probably check and set these too, just to be safe:
FENCE_ACTION,3
FENCE_ALT_MAX,50
FENCE_ENABLE,1
FENCE_RADIUS,100
FENCE_TYPE,3
You wont be able to arm until there’s a good 3D fix, even if just using Stabilise or AltHold.

Set this to soften your RC control a bit:
ATC_INPUT_TC,0.22

Set these to get the basic tune under control so you have a chance of moving on to Autotune:
ATC_ACCEL_P_MAX,80000
ATC_ACCEL_R_MAX,80000
ATC_ACCEL_Y_MAX,10000
ATC_RAT_PIT_I,0.120
ATC_RAT_PIT_P,0.120
ATC_RAT_PIT_D,0.00324
ATC_RAT_RLL_I,0.120
ATC_RAT_RLL_P,0.120
ATC_RAT_RLL_D,0.00324
If it’s still unstable reduce all those a further 10%

Autotune one axis at a time, unless there’s a bit more stability and you can be more certain of that battery. You’ll need a much bigger area and well away from any other people.
This is the guide you need:
https://ardupilot.org/copter/docs/tuning-process-instructions.html

1 Like

Thanks for all the pointers.

We’re using a 3 cell LiPo, but we’ve got a gimbal, on board computer, and two cameras connected to it, so that might be causing the low voltage. We’ll try out those parameters and see the difference.

Regarding the wind, we’ve been flying it since January, and lately (past month, flying only on weekends) we’ve had this type of crashes (regardless of wind), and most of the time, re calibrating seemed to solve them. But given that we can’t be crashing down every weekend, we are looking deeper into the logs (and looking for help).

We’ve tuned the aircraft before every flight because we’re only flying on weekends and every time we boot it up after a week we get warnings regarding mag field or compass calibration.

For calibration we’re always doing the OnBoard calibration for compass, and accelerometer (level, and putting it on each side). We have a front-facing gimbal on the bottom of the craft, could this be a cause for instability, and if so, could proper calibration mitigate it?

I wouldn’t call that your take on it I would call that an Obsolete Auto Analysis. Some of the parameters shown in Auto Analysis haven’t existed for quite a while. This tool is of little use.

1 Like

Ok Professor Dave :slight_smile:

I got busy, but go ahead and help him out.

Your copter is overweight/underpowered combined with only 3S power it is all too little to stay stable and flying.


You can see here that the tune is not too bad but the motors are working at near maximum just to fly.
Once the craft is disturbed (wind) it does not have enough power to self stabilise as you can see in your motor outputs.
An ideal setup would have the output PWM at 1500.

When combined with a battery that is fast losing its voltage what you see is expected.

You could try moving to a 4S if the components can take it, or lighten the load.

1 Like

We are using a 3S 10000mAh Battery and Emax GT3510 motors. We did a test on them and we got almost 900 g of thrust from each, and a maximum current consumption of ~26 A, all on said battery. Our quad weighs in at 2.9 kg, so we thought we’d have plenty of thrust to weight ratio to fly and not be at full consumption. We’ll try lightening the load after tuning to see if it improves. Thanks for taking the time to view the logs!

With 900g of max thrust per motor you would want an All-up-weight of ~1.8kg. It needs an extensive weight loss program and/or higher power as has been suggested.

You shouldnt have to do any calibrations repeatedly.
Take off cameras and gimbal for Autotune, make sure the craft is the lightest possible weight.

Make sure the onboard compasses are disabled, calibrate the external compass and then do the Compass/Motor calibration - carefully!
https://ardupilot.org/copter/docs/common-compass-setup-advanced.html#compassmot-compensation-for-interference-from-the-power-wires-escs-and-motors

Then put in the other settings I sugested and work towards doing Autotune.
Dont change the voltage failsafe values - fix whatever is causing the low voltages.

1 Like

And probably set these a bit higher, for example .007 or .008
ATC_RAT_RLL_D,0.007
ATC_RAT_PIT_D,0.007

Let us know how you get on, and post another .bin log if you like

1 Like

After a lot of testing we realized that the Pixhawk Cube power module isn’t measuring current nor voltage properly. We’ve tested with a separate battery meter and we were able to draw 40 amps and drop ~1.5 volts from the battery. We’re now working on setting up the proper parameters for the power module but the documentation is iffy at best.

Did you set the power module type then reboot? The default one should be OK for a Cube, otherwise set “Other” and do your voltage and current calibrations as accurately as possible.
Do the voltage calibration at the lowest voltage you expect to see.

1 Like

Regardless of the battery figures its the PWM output that tells the main story.
Less weight or more thrust is required.
When you measure the thrust from motors it needs to be done at 50% not max.

1 Like

We’ve reviewed our numbers, our thrust-to-weight ratio is at 1.71, we thought it wouldn’t be an issue since we’ve had another copter (from another project group) that had a TWR of 1.2 (!!!) and managed to fly.

The strange this is, while stripping down the copter to its bare minimum in order to do the autotune we’ve gotten a lot of “potential thrust loss” messages.

A flight with a 1.2:1 T:W would be interesting to see a log from. Potential thrust loss errors may be due to an unfit tune or motor balancing. Please hover for around 30 seconds and post a log at the lower AUW.

We did the calibration setting the parameters and we get a correct voltage reading with the motors off. As soon as we throttle up the motors and the voltage drops we get a difference of 0.6 V between the Pixhawk sensors and a battery sensor (measuring directly from the xt60 plug). The voltage drops to 11.6 at max throttle but the pixhawk measures 11 V. Could this be a faulty sensor in the Pixhawk?