Help needed in Tuning Big Octocopter

Hello community,
I am working on Octocopter with AUW of 24 Kg and 2.2 meters of Span from motor tip to tip. Arducopter firmware version 4.4.0 release is installed on Pixhawk Cube orange for this Octacopter. We are using Tmotor Flame 80 Amp ESC and Tmotor P80III 100kv motors and 34 inch propeller. My battery configuration is 12S 35000 mah battery pack. I have previously worked on Quad configuration drone with Arducopter and tuned it for stable flights.

With Octacopter I have limited experience and so need some help from community for better tuning. Here is my progress. I have been able to hover this OctaCopter where we started from mission planner’s “Initial tuning” page and got initial PID gains. But we observed these gains weren’t sufficient for stable hover so we had to increase RATE controller gains and decrease Attitude controller gains drastically for somewhat stable hover.
Here are my observations from current gains:

  1. In loiter mode drone oscillates when I give roll and pitch commands from radio stick and release the stick. This can be clearly seen in logs where desired and actual roll/pitch increases rapidly without any stick inputs. What can be the reason for this oscillation? Once the oscillations start UAV becomes pendulam and takes time to again level itself in loiter mode. This isn’t observed in AltHold or Stabilize mode.
  2. Drone also oscillates while gaining altitude during takeoff so we had set WPNAV_UP ascent speed to low velocity right now.
  3. We also tried Auto tune with this flight but it failed with Auto tune aggression of 0.075 saying “Failed to level. Manual tuning required”. Then we reduced auto tune aggression to 0.05, we got some tuned results on roll axis only, with which we again did test takeoff and hover where we found osillations were increasing. How can we improve autotune functionality for gaining optimal results for such big vehicle?

I have went through the Arducopter wiki for manual tuning but need some better assistance from our current progress in tuning to optimum tuning of this vehicle.

Log file Link : 00000098.BIN - Google Drive

Another log file : 00000094.BIN - Google Drive

Please help me ahead on topic.
@Leonardthall @rmackay9 @xfacta

1 Like

You risk a crash with these Angle Parameters and Gyro filter so low:
ATC_ANG_PIT_P,1.25
ATC_ANG_RLL_P,1.25
INS_GYRO_FILTER,10
I would set them back to default for now. And set these to the Initial Tune Parameter values, they are low also:
ATC_ACCEL_P_MAX,9509
ATC_ACCEL_R_MAX,9509
And set these based on MOT_THST_HOVER
PSC_ACCZ_I,0.4
PSC_ACCZ_P,0.2
Set these to collect data for the Notch Fillter and make a short hover flight in AltHold and then configure it.
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4

@dkemxr Thank you for your input.
We reduced ATC_ANG_PIT_P, ATC_ANG_RLL_P since on default value it was very oscillatory when our ATC_ACCEL_P_MAX, ATC_ACCEL_R_MAX was 17000 which was default.
Should we still increase ATC_ANG_PIT_P and ATC_ANG_RLL_P with ATC_ACCEL_P_MAX,9509?

How about RATE controller PIDs? Should they be kept the same?

Pretty much never is a Angle Pitch/Roll parameter below default going to work well. This is often what Auto Tune will produce with aggression set too low (<.075). I realize this isn’t from Auto Tune.

Increase all of them as suggested and make the other parameter changes. The PSC parameters not properly set will cause Oscillation.

Those look in the ball-park for a large propped craft but no doubt will change once Auto Tune can be run. It will never run with those parameters I mentioned set so low.

I would agree with all that Dave says.
Put these values in place:

ATC_ACCEL_P_MAX,17200
ATC_ACCEL_R_MAX,17200
ATC_ACCEL_Y_MAX,8000
ATC_ANG_PIT_P,4.5
ATC_ANG_RLL_P,4.5
ATC_INPUT_TC,0.2
ATC_RAT_PIT_D,0.0055
ATC_RAT_PIT_I,0.11
ATC_RAT_PIT_P,0.11
ATC_RAT_RLL_D,0.0055
ATC_RAT_RLL_I,0.11
ATC_RAT_RLL_P,0.11
AUTOTUNE_AGGR,0.1
BATT_ARM_VOLT,44.30
BATT_CRT_VOLT,42.00
BATT_LOW_VOLT,43.20
BRD_BOOT_DELAY,3000
BRD_SAFETYOPTION,0
FENCE_ENABLE,1
INS_GYRO_FILTER,20
INS_HNTCH_ENABLE,1  // write this then refresh params to see the rest
INS_HNTCH_MODE,1
INS_HNTCH_REF,0.17
INS_HNTCH_FREQ,30
INS_HNTCH_BW,10
INS_HNTCH_FM_RAT,0.7
INS_LOG_BAT_MASK,1
INS_LOG_BAT_OPT,4
LOG_BITMASK,180222
MOT_BAT_VOLT_MAX,50.40
MOT_BAT_VOLT_MIN,39.60
MOT_PWM_MIN,1100
MOT_PWM_MAX,1940
MOT_THST_EXPO,0.4
PSC_ACCZ_I,0.4
PSC_ACCZ_P,0.2

You can copy all these to a text file and save as a .param file then apply them all at once in MP full paramater list with “Load from file”.
The ENABLE parameter means you will have to apply the file twice to get all the HNOTCH values in place.

Probably return to MissionPlanner motor test and recheck MOT_SPIN_ARM and MOT_SPIN_MIN
I couldnt tell exactly what battery type you have from the values you had in place, so I’ve specified Lipo values, which seem to be the closest to what you had, but more correct.
Check the Fence radius and Altitude.

Now see if you can do a test flight, mostly just hover using Stabilise mode and AltHold mode.
This will gather data for the harmonic notch filter. Once that is nailed down and we make any other alterations, you can move on to the VTOL Quick Tune script:

Then you could probably run Autotune

@dkemxr @xfacta Thank you for your valuable insights.

I took both feedbacks into considerations and went ahead by putting back my Angular and rate gains to default. I also ran test for imu batch sampling and notch filter frequency comes out to be 50 Hz. Please guide ahead if my analysis is correct.

My alt hold flight looks very stable but my loiter mode flight is highly oscillatory with current parameters. I reduced the Rate P,D an I gains by 50% in each iteration but still no good result.

  1. How can I obtain stable loiter mode performance so that I can start quick tune as per @xfacta ?
  2. With current configuration drone flies fine in Alt hold only, then should I go forward for Autotune directly without quick_tune?

Please find logs attached. Waiting for your feedback.

https://drive.google.com/drive/folders/1FPLc-YWFQW6vHBol5oa0JQJ3vAWPU9It?usp=sharing

You dont appear to have set all the parameters I specified

Just do a test flight with everything set and we will work out what to do next before jumping straight into quick tunes or autotunes

Thank you for the prompt response @xfacta . Please find the attached logs and a short video of our flight.

Waiting for your response on further steps.

Logs : Octa Testing phase 1 - Google Drive

You still missed a bunch:

BATT_ARM_VOLT,44.30
BATT_CRT_VOLT,42.00
BATT_LOW_VOLT,43.20
MOT_BAT_VOLT_MAX,50.40
MOT_BAT_VOLT_MIN,39.60
MOT_PWM_MIN,1100
MOT_PWM_MAX,1940
MOT_THST_EXPO,0.4
PSC_ACCZ_I,0.4
PSC_ACCZ_P,0.2

Also set BATT_FS_CRT_ACT,1

There’s not much point changing the harmonic notch filter settings yet, for two reasons:

  1. the next parameter changes will require more adjustments anyway
  2. there is a motor output imbalance causing a spread of frequencies

I’m not sure how to explain that motor output imbalance: It’s not a difference between clockwise and counter-clockwise motors, and it does not seem to be a weight imbalance either…
It will be interesting to see if it’s still there after you load the rest of my parameters.

Try to fly a little higher next time, up out of any ground effect and prop wash.

@xfacta Thank you for the analysis. We are on field and did one more test run with all your parameters this time. We didnt change only MOT_PWM_MIN since that would need ESC calibration again since motors are spinning on ground without arming with MOT_PWM_MIN,1100.

Regarding “motor imbalance” what exactly can this be? Can this be solved by hardware/software means? Requesting further inputs on this topic.

Please help us ahead as we are still on field waiting for your further inputs :slight_smile:

Logs link : Octa testing Phase 2 - Google Drive

Those ESCs dont calibrate, so it is safe to set those PWM values I gave.
But you do have to check and set MOT_SPIN_ARM and MOT_SPIN_MIN as I mentioned in an earlier post. MOT_THST_EXPO has more of an effect anyway.
What did you think of the flight?

I’ll check that log now.

Set these for Harmonic Notch filter

INS_HNTCH_FREQ,27
INS_HNTCH_BW,15
INS_HNTCH_REF,0.18

for this effect:

It wont make much difference to flight at this stage, but it will allow better tuning.

I would probably do the VTOL Quick Tune next - it’s very safe and gives good enough stability to get into autotune.

These may help Loiter be a bit more stable, we can always revert them later if needed.

GPS_GNSS_MODE,5  // or 65
PSC_POSXY_P,0.5
PSC_VELXY_D,0.25
PSC_VELXY_I,0.5
PSC_VELXY_P,1.0

@xfacta Thank you for your feedback. With current gains in Loiter mode vehicle oscillates alot and struggles to attain firm stability. Quick tune would need Loiter mode very stable right for the flight. How to proceed in this case?

See my post with the PSC_ parameters and GPS mode change.
Try to be up a little higher.
Do a flight with AltHold and Loiter in one flight so we can see the difference.

@xfacta Please check attached flight log. In this flight we are observing drone hold’s position in loiter with less oscillations for few seconds but after some time it starts drifting from its position. We are having less confidence if drone might topple in loiter so we are flying close to the ground.

We have all the parameters set as per your suggestion above.

Plese help us ahead.

@xfacta Apart from above drifting motion we have one more observation from our logs, our desired Roll/Pitch/Yaw axis in Attitude controller goes on increasing without any stick inputs from pilot.
Please see below snapshots.


What can be the reason behind this?

There is a definite yaw bias. You will have to find if one or more of the motors are twisted slightly

Also I think you should definitely set MOT_PWM_MIN,1100 and use MissionPlanner motor test to reset your MOT_SPIN_ARM and MOT_SPIN_MIN

Try to increase the Rate P and I values just a bit and let us see what affect that has. I suspect they can go higher yet

ATC_RAT_PIT_D,0.007
ATC_RAT_PIT_I,0.12
ATC_RAT_PIT_P,0.12
ATC_RAT_RLL_D,0.007
ATC_RAT_RLL_I,0.12
ATC_RAT_RLL_P,0.12

but dont do another flight until you’ve sorted out the motor mount twist.

@xfacta Thank you for your feedback. Actually the Frame structure is completely rigid and fixed and the motors are aligned upwards. Motor mounts doesn’t seem to have any visual twist at all. Still we will check this aspect but as of now we don’t see any twist in the motors.

Current Flight looks stable in AltHold mode and when we previously decreased Angular gains drone seemed to be stable in loiter as well but we had to increase Rate gains and decrease Ang P on both roll and pitch axis to 1.25. (Flight log in my first post)

One query which we had is, Why Angular P gain can’t go below 3?

Is it necessary to have Gyro filter frequency to be high for big crafts?

@xfacta We also did test flights with Reduced PSC parameters as per your suggestion and have started to increase RATE gains for roll and pitch axis. With these flights we found loiter was getting stable but still minor oscillations are present. Tune still doesn’t seem to be tight for sure. Please find logs below and provide your analysis.
Logs : Octa Testing phase 3 - Google Drive

  1. Along with above logs we are facing “toilet bowling” like effect in loiter mode of operation where drone circles around a particular point continuously. In above shared logs please check log 00000128.BIN which had this problem and we had to land.
  2. We are also sometimes getting Error in flight about “EKF3 IMU0 MAG0 ground mag anomaly, yaw re-aligned” post which toilet bowling starts.
    Can these two issues also be somehow related to instability seen in the RCout above and yaw bias?