Unstable drone using Pixhawk cube orange immediately after takeoff

We have been using Pixhawk cube orange flight controller for building a quadcopter that weights 7 kg without payload. We tried for months but are unable to stabilize the drone. We tried to change the PID gain values in mission planner but as we takeoff initially it’s stable but as we try to maintain it’s height it starts drifting around on its roll and pitch axis. We have gone through all the initial tuning steps . Can anybody suggest a way we can stabilize it? Attaching link of log file for your reference

https://drive.google.com/file/d/1XSeh6-U75xKA1AmfnqhfHqXuMcOwAnj4/view?usp=sharing

@xfacta can you help???

What are the other components like motors, props, ESCs?
Frame construction - carbon fibre plates and round arm tubes ?

@xfacta Sorry for the delay in reply , here is the picture of the assembled drone .
The frame is made of aluminum which is 3mm thick . The arm tubes are made of carbon fibre 30mm OD and Landing gear is 3D printed ABS material and 50 % fill.
Also the clamps made for holding carbon tubes are 3D printed
Motors : 580KV 5050 prop drive
ESC : Redbrick 100A
Propellers : 13x5
Below I have attached a drive link in which you can see the image of the assembled drone and there are two video of the flight test that we have done on stabilize mode.
Recently we have done few flight test , here are the problems I have faced

  1. The issue in stabilize mode is when we try to land the drone , the speed increases and its uncontrollable , we then switched to land mode for landing which was stable. Also the takeoff is not proper as you can see in the video after performing a slight rotation the drone goes forward and takes off .
  2. Second problem is when we give forward and sideways ( roll and pitch ) signal the drone doesn’t react to it instead it’s drifting in only one direction without any signal given , I am not sure about why it doesn’t react to it my only guess can be the PID value are quite small , especially P and I.

Drone Flight Videos & log files

Pity about that crash in the video, it was doing so well until then. We have all been there :cry:

Those ESCs are old tech and you can save yourself about 1/2 kilogram takeoff weight by replacing them them with a 4in1 ESC :laughing:
You would mount the ESC centrally and run the motor wires through the arms, making sure there’s no joins to short to the carbon fibre.
The battery would have to be mounted under the central plate, or maybe you can fit the ESC in just under the flight controller.

You could probably reduce the size of the landing gear to save a bit of weight too, but it’s working so far.

Definitely remove the USB lead form the side of the Cube. Also secure any other wiring.
There is a connector on the carrier board for USB but you’ll need to get the correct connectors and mount a USB socket somewhere accessible on the copter frame.
Vibrations are critical!

Set up a Motor Emergency Stop switch on an unused RC channel.

Looking at the Log 14-55-23
Z axis vibrations are definitely an issue, not very bad, but worth fixing. Read about it in the docs and see what you can do. Usually it’s loose items, prop wash over the flight controller, no antivibration damping.
Dont fly again until you are sure this is improved, or you’ll have the same issues no matter what parameters are changed. It’s a physical problem.
Below 20 is OK, below 15 is very good.

Also take any stickers or tape off the motors - that throws them out of balance. Adding tiny amount of tape, or even nail polish, in the correct places is how we can balance the motors if needed.

Set up battery voltage monitoring, and current if possible too - the standard Cube power brick will work fine with default settings if you just enable it. This gives you some essential safety features and better tuning.

Those ESCs and motors are going to nearly maximum output.

Attitude control is always going to be poor when motors are operating near maximum just to get airborne.

What’s the total weight of the copter, and what battery do you have?
I’ll see if we can work out what props you can use without changing those motors.
Also take a photo looking straight down from above, and estimate how much clearance you have between prop tips and the centre plate, and also clearance between props. I suspect you could go 1 inch bigger props.

Enable the battery monitor and put these in place, but dont try to fly yet until all the other work is done.

ATC_ANG_RLL_P,6.0
ATC_ANG_PIT_P,6.0
ATC_RAT_PIT_P,0.1
ATC_RAT_PIT_I,0.1
ATC_RAT_PIT_D,0.005
ATC_RAT_RLL_P,0.1
ATC_RAT_RLL_I,0.1
ATC_RAT_RLL_D,0.005
BATT_ARM_VOLT,14.70
BATT_CRT_VOLT,14.00
BATT_LOW_VOLT,14.40
BATT_FS_CRT_ACT,1
BATT_FS_LOW_ACT,2
INS_ACCEL_FILTER,10
INS_HNTCH_ENABLE,1  // set this then refresh params to see the rest
INS_HNTCH_MODE,1
INS_HNTCH_REF,0.21
INS_HNTCH_FREQ,70
INS_HNTCH_BW,35
INS_HNTCH_FM_RAT,0.7
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4

Can you get one of these ESCs ? I know they are expensive but I think you’ll need the current capability with those motors and props, and especially if you add a payload. Think of all the neat and tidy wiring and the ESC telemetry we can set up :slight_smile:
You’ve got a good Cube Orange flight controller and it would be a shame to see it go to waste.

@xfacta Thank you for your suggestions, we will definitely make the suggested changes before the next flight
We were concerned about the continuous drift of drone while takeoff in stabilize mode. As you can see in the video the drone doesn’t go straight upward while take off instead it starts drifting, could it be because of uneven frame weight or due to wind?
Also our drone speed increases as we try to land in stabilize resulting in a crash, so is it normal or we need to change some parameters?
The total weight of the drone is 6.3 kg and we use an Orange Li-po 4S 22Ah battery
Anyways we will surely update you if we do some flight tests after rectifying the mistakes.

I would say 4S is definitely on a low side, for this weight class I would go with 6S.

I think this can be done with those motors and that battery with 16x6 props, 2 blade.
But you will need a good quality ESC than can do about 55A peak (each motor) like the ESC I linked to earlier.

The way it is now, in ecalc the thrust to weight ratio comes out close to 1:1, which means you can barely get off the ground and have nothing for attitude control.

EDIT:
You can get the MasterAirscrew 3 blade 16x10, but the electrical load is getting too high.
Found it!
Master Airscrew 3 blade 15x7

and you need to order these with any Master Airscrew props.

The MA props wont need balancing, they are high quality and should work better than expected (in my experience). The only have the central mounting hole so you’ll need a suitable prop mount on you motor, and nyloc nuts so they dont come undone.

ESC current is right up around 60A at full throttle, but otherwise the 3 blade 15x7 will be good.
The ESC I already specified will be suitable

  • Battery : 3-6s
  • Constant Current : 55A
  • Burst Current : 70A (10s)

@xfacta Thanks for the insight , so you are saying that increasing our thrust to weight ratio might solve the drifting problem of drone as well as decrease the speed of the drone while landing?

It might help, but you will need a higher thrust to weight ratio anyway.
See if you can get MasterAirscrew props, order online direct from their store if you have to - they are worth the wait.

@xfacta Thanks btw the link you shared for props shows no product details
is this the same product
https://www.masterairscrew.com/products/3-blade-15x7-propeller

Correct - that is them.

I couldnt find anything suitable in 16inch 2 blade without going to expensive T-Motor carbon fibre props.
They are nice, but probably overkill for this applications.

@xfacta Thank you so much for your help, we had a successful flight both in stabilize and loiter mode although the quad is facing some issues while flying in loiter mode. The quad gets out of control suddenly and lowering the throttle input does not affects its position which results in a crash. We are unable to find the reason behind it. Initially it flew very well and was hardly moving but after some time in flight eventually it starts either drifting and does not land. This happened while two of our test flights. We have attached the video of crash and the log files below.

https://drive.google.com/drive/folders/1r935gKWjcOG5swjWSTxIMALsHWD99aOW?usp=sharing

Sorry about those crashes - it is never good.

I think in this case you are close to buildings and using Loiter mode, and so the copter is following a wandering/poor GPS position.
You need to start test flights in Stabilise or AltHold mode, and you need lots of area to allow for mistakes and mishaps.
Do not use Loiter until tuning is better, and do not be near any buildings.

Set up the battery monitor, I thought you already had this working??
The failsafe voltage levels need to be correct!

Then set these:
ARMING_CHECK,1
ATC_RAT_PIT_P,0.1
ATC_RAT_PIT_I,0.1
ATC_RAT_RLL_P,0.1
ATC_RAT_RLL_I,0.1
BRD_BOOT_DELAY,3000
DISARM_DELAY,5
FENCE_ENABLE,1
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4
LOG_BITMASK,180222

And use AltHold but you really should practice in Stabilise mode too.

Even worse, the copter will just drop when attitude output is high and T/W < 2. However I have a drone that hovers at around 1700, yet it flies just fine for my purposes (motors never saturate for more than a second), if a similar code change to this is made: AP_MotorsMatrix: prevent altitude loss when thrust-to-weight is less than 2 by 117-MasterChief · Pull Request #23512 · ArduPilot/ardupilot · GitHub

Before discovering and fixing this, I experienced 3 crashes due to rapid and sudden vertical descent. After many more flights with a change similar to the linked PR, I have experienced no crashes at all (even though it is heavier than the ones that crashed!).

Note that of course my application is not fast forward flight or crazy acrobatic maneuvers.

Thanks for your insight , did you have a look at crash 1 video in which we were in open space and flying the drone but suddenly our drone became uncontrollable and upon landing it flipped and crashed badly , also we tried to analyse the data log file and found out that we were getting an error " Potential thrust loss (3) " while we were flying . Can that be the only reason for this failure ( crash land ) because motor could not produce the thrust for desired roll & pitch values or there might be some other reason for it ?

We haven’t enabled battery monitor yet since we are looking for an appropriate module which can be interfaced with pixhawk easily.

yes same thing happened with us, the value of Motor 3 had exceeded 1900 for a long period of time and then it crashed we assume that we should increase our thrust to weight ratio rather than making certain changes in firmware

if motors are saturating (or nearly) frequently and for long periods of time, then that means your copter does not fit your mission and you should increase thrust-to-weight. my fix is for when you do not want the copter to drop whenever attitude outputs are high, which should ideally be only in (rare) short bursts. basically eliminates one particular cause of crashes.

UPDATE : We made a new drone with a frame with following specifications.
Frame : EFT E416P wheelbase: 1362 mm
Flight controller: Pixhawk cube Orange
Motor : Hobbywing X9
prop size : 34.7*11
battery : 12s lipo 22000mah
Dual gps here 3
Drone all up weight: 30 kg (although we are planning to add more payload)

We are not sure about the initial PID tuning parameters that we should use for our first flight. Will it be fine if we use the same used parameters for small size drone ?
@xfacta can you suggest some parameters for above specifications to start with??

Following is our currently used param file attached:
https://drive.google.com/drive/folders/1_A54hLJqq_i1OxM_IUgU9TbB7Ah4ZWNU?usp=drive_link

Rarely can you use parameters from another copter, and never from a very different copter.

Do these steps and set these parameters in the order I specify

  • Connect to MissionPlanner Initial Parameters, put in your prop size (34) and battery cell count (12)
  • Select “Suggested” too.
  • Accept everything it offers

Then change these:

ARMING_CHECK,1
ATC_INPUT_TC,0.20
ATC_RAT_PIT_D,0.005
ATC_RAT_PIT_I,0.11
ATC_RAT_PIT_P,0.11
ATC_RAT_RLL_D,0.005
ATC_RAT_RLL_I,0.11
ATC_RAT_RLL_P,0.11
INS_HNTCH_BW,10
INS_HNTCH_FREQ,30
INS_HNTCH_REF,0.17
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4
MOT_PWM_MAX,1950
MOT_PWM_MIN,1050
MOT_THST_EXPO,0.79

Now you will need to use MissionPlanner motor test to check and set MOT_SPIN_ARM then MOT_SPIN_MIN

Do a test flight with AltHold - let’s see that .bin log. Only use Loiter if stability is very good.

Then next steps will be:

  • check the log to see if anything needs adjustment, there will be a few things
  • setup and run the VTOL quicktune script - this works great for large copters

Thank you so much @xfacta for your help. We had our first flight yesterday and it went well but we observed some vibrations in loiter mode. We added some payload to it but the vibrations were still visible can you suggest any changes to reduce those vibrations.
Following are our log files :
https://drive.google.com/drive/folders/17NsiljB2_czjw_YV5R1FjH_Bsz5s6Tg5?usp=sharing