Tuning 18 kg quadcopter

Hi I am in the process of tuning an 18kg quadcopter. The specs are:
Airframe T-drones M1200 with U8XL 100KV with 32" propellers
Battery: 12S 30000mAh batteries

I have followed the Tuning Process instructions. I have set the notch at 35Hz with attenuation of 50dB upto 3rd harmonic.
Then I have done autotune of pitch and roll axis. The P and I in pitch axis were high as can be seen via oscillations in initial stage of the flight logs. I reduced the gains to 0.14. The impulse response is quite stable now both in pitch and roll axis. What steps can I for further improvement in flight performance. My main aim is to fly it at speeds of 25m/s.

Flight Logs

You input in this regard will be highly valued.

1 Like

Essentials plus a few things to adjust

ARMING_CHECK,1
BATT_FS_CRT_ACT,1
BATT_FS_LOW_ACT,2 or 3
ATC_INPUT_TC,0.2
ATC_THR_MIX_MAX,0.5
BATT_ARM_VOLT,44.30
BATT_CRT_VOLT,42.00
BATT_LOW_VOLT,43.20
FENCE_ENABLE,1
INS_HNTCH_FM_RAT,0.7
INS_HNTCH_HMNCS,3
INS_HNTCH_REF,0.25
MOT_PWM_MAX,1940
MOT_PWM_MIN,1100
MOT_THST_EXPO,0.4
MOT_THST_HOVER,0.20

After these changes retest your MOT_SPIN_ARM and also MOT_THST_HOVER will need some time to relearn in the next flight. Then adjust
INS_HNTCH_REF = 1xMOT_THST_HOVER
PSC_ACCZ_I = 2xMOT_THST_HOVER
PSC_ACCZ_P = 1xMOT_THST_HOVER

You could reduce the logging to leave out fast attitude unless you need it
LOG_BITMASK,145406

Your pitch and roll PIDs were quite different, yet the M1200 is quite square. Try these to settle down the attitude control and standardise
ATC_ACCEL_P_MAX,20000
ATC_ACCEL_R_MAX,20000
ATC_ACCEL_Y_MAX,8000
ATC_RAT_RLL_P,0.12
ATC_RAT_RLL_I,0.12
ATC_RAT_RLL_D,0.0035
ATC_RAT_PIT_P,0.12
ATC_RAT_PIT_I,0.12
ATC_RAT_PIT_D,0.0035

Start the next flight in Stabilise and you will have to manipulate the throttle continuously to hover. If there’s reasonable stability then use AltHold for a while then Loiter.
Let’s see that .bin log

As for 25m/sec I dont like your chances.
Plugging a few things in to ecalc gives you a long hover time and 3:1 thrust to weight ratio, but motor temperature and electrical power are off the scale for anything but hover.
Assuming you could even get these motors and props up to a high RPM without something catching fire the best you could expect is probably 67km/hr or 18 m/sec tilted to nearly 70 degrees.

EDIT
Also set PILOT_THR_BHV,7 since you appear to have a spring-centered throttle.

Actually, if it is 18kg, you’ll be lucky to get 60km/hr at 60 degrees tilt.
Thrust is 2:1 and motors are at twice their rated power. :fire:

Hi Shawn, Such a detailed and comprehensive reply is greatly appreciated. I will incorporate the changes suggested by you and upload the log as soon as possible.

I dont understand your point in this case. Are you suggesting that the speed will be limited by motor Temps or the electrical power requirment of the motor.

I did a flight with max angle of 20 degrees at max speed of 18m/sec. The bird was able to achieve the desired speed. The average current consumption was 30A @ 44V. The issue which I faced was during breaking. I set the Loit_brk_accel 50, Loit_BRK_Delay 0.3 & Loit_BRK_Jerk to 200 but it still is not resolved. What is your take on this?

Nevertheless I will incorporate the parametric changes suggested by you and upload the log as soon as possible. Your help in this regard is highly appreciated Shawn. Thank you.

That’s good if you can achieve near the speed you want. I was basing my figures on what ecalc says.
It doesnt have a U8XL motor listed, nor could I find one via the T-Motor store, so I had selected the nearest U8 I could find.

Is there some issue with getting Loiter to behave like you want?

1 Like

Just pinging here that e-calc drastically overestimates drag. I don’t know how it calculates “drag” values - but my aircraft are always capable of higher top speeds (and much longer flight ranges) than ecalc estimates.

Yes the UAV doesn’t brake in a smooth manner. I tested it at speeds of 12, 15 and 18m/s. And whenever I release the stick for braking the copter brakes in a very wobbly manner. It oscillates on braking which increase with amplitude as I raise the speeds. To get a smoother response the loiter brake parameter were set as follows but it had no significant effect. Can you provide your input in this regard via which I can improve the braking for a more smooth and stable flight.

These are the specification for U8XL KV110 with 32 inch propellers.

Can you tell us from the data what is the max speed we that can be achieved with U8XL?

Also how do you calculate the max speed of a UAV from the motor data?

And what is the relation between motor speed and max tilt angle ?

All that and more would have to be entered into the ecalc database for any such calculations to be made.

With Loiter braking being wobbly, I would apply the params I recommend plus improve the tuning before changing any more Loiter parameters.
It can take several attempts to get the tuning close to being correct.

Hi Shawn,
I did a flight with the parameters you suggested. Flight Logs are attached here. Initial Flight with minor RC input was stable. I did not move the copter at high speed only impulse inputs and it was able to follow the input commands both in roll and pitch. The vibes are below 14 as well. Should I go ahead with the Autotune? What is your opinion in this regard?

ARMING_CHECK,1
BATT_ARM_VOLT,44.30
BATT_LOW_VOLT,43.20
BATT_FS_CRT_ACT,1
BATT_FS_LOW_ACT,2 or 3
FENCE_ENABLE,1

Harmonic notch filter is ineffective, set these:
INS_HNTCH_ATT,40
INS_HNTCH_HMNCS,3
INS_HNTCH_REF,0.25
INS_LOG_BAT_OPT,4

Reduce the logging a bit
LOG_BITMASK,145406

Try these for Loiter
LOIT_ACC_MAX,600
LOIT_ANG_MAX,30
LOIT_BRK_ACCEL,300
LOIT_BRK_DELAY,0.3
LOIT_BRK_JERK,300
test with low speeds first

What ESCs do you have?

Attitude control is very good, with just a bit of overshoot in Pitch but there’s no oscillations.
I would fix the Harmonic Notch Filter and set those other parameters that I would consider mandatory on any large aircraft, then do another test flight to confirm the HNOTCH is effective.
Then try Autotune.

1 Like

Hi Shawn, thanks for going through the logs

I am deliberately leaving these parameters out. I set them at the end when the bird is thoroughly tested just before performing BVLOS (Beyond Visual Line of Sight) flights.

What do u mean by ineffective Harmonic notch? Because the noise in the Gyro is below -40dbs whereas in pre filter it was quite high. Can you elaborate it a little more please?

I ll perform a flight with these parameters ASAP and get back to you with the flight logs.

The airframe came with U8XL KV100 motor and Flame ESCs.

With Flame ESCs it’s important to set these
MOT_PWM_MIN,1100
MOT_PWM_MAX,1940
and you will NEED to retest and set MOT_SPIN_ARM and MOT_SPIN_MIN using MissionPlanner motor test.
You will also need to hover for a while to allow MOT_THST_HOVER to relearn.

I strongly believe it’s a mistake to ignore or leave unset the safety related params that I highlighted in BOLD - especially with copters that have a high take off weight and swing large props.
You need them the most during testing, before you are fully familiar with the capabilities and reliability of the copter. There is no detriment to setting them from the start, and if they give you any issue or hold-ups then something else is wrong → dont shoot the messenger.

INS_HNTCH_HMNCS,7 is probably excess to requirements
INS_HNTCH_ATT,50 might be excess to requirements too, usually 40 is more than enough
INS_HNTCH_REF,0.34 means since MOT_THST_HOVER=0.326956 you are basically not getting any HNOTCH filtering till well over hover thrust
The settings I gave should be OK at least for testing and INS_LOG_BAT_OPT,4 will tell the full tale.

1 Like

Hi Shawn, Thank you for the reply,

I set the PWM limits as you suggested. tested the spin arm and spin min, both remained the same. Hover thrust however is 0.31 now.

I incorporated these suggested paramters and did a test flights at low speed upto 8 m/s. From a pilot’s perspective, the braking seemed a bit tight. Should I relax the loit_brk_accel and loit_brk jerk a little bit to get a more smooth feeling?

Flight Log.

Kindly review the logs. Your input in tuning this copter has been very helpful. I appreciate it very much.

I understand your concerns. The only reason I set them in the last is because sometimes testing takes a little longer and triggering RTL due to low battery in the middle of the flight when it is flying in front of you at 30m or so disrupts the testing. Usually during tuning, I monitor the voltage level myself and land it immediately if it goes below 42V. Nevertheless, I have incorporated the safeties as you suggested and will be conducted my flights in this manner from now - Safety comes first.

The voltage levels are up to you I suppose, particularly if you are confident in manually monitoring the battery voltage yourself - it is easy to get busy and miss a falling voltage. We’ve had plenty of people ask why they crashed or why they have short flight times or why their batteries just dont last - and they are often leaving these battery failsafe voltages unset and over-discharging their battery.
I would set BATT_FS_CRT_ACT,1 since once voltage is critical it’s hard to do an RTL, considering RTL will already have been attempted by the LOW voltage level.
ARMING_CHECK is not something you can “monitor” yourself.
FENCE makes sure you have a good GPS 3D Fix and Home can be set before you arm. Just be sure to check the other Fence parameters suit your situation and local laws.

That is still looking very good for a big copter.
Certainly experiment with the Loiter parameters to see what works best for your copter.
Since your copter seems very stable and responsive I would try running Autotune one axis at a time.
You might be able to reduce the D terms a little, from 0.0035 down to 0.003 or even 0.0025.

Adjust the harmonic notch settings as follows:
INS_HNTCH_FREQ,33
INS_HNTCH_BW,20
The reason for the relatively wide bandwidth is : there is almost a double peak between 25 Hz and 40 Hz due to these big props spinning so slow and each prop is (almost) making its own distinct vibrations. Rather there’s two props with a consistently (slightly) lower RPM than the other two, making two peaks at almost the same frequencies. I think that’s just a normal weight imbalance that’s not worth worrying about - but it’s interesting how it is apparent in the FFT and vibrations.

Pre-filter
image

Post-filter
image

Hi Shawn,
The weather finally permitted me to do some flights today

To be honest, I wanted to increase the BW while notch tuning but I was being a bit reluctant since it was greater than the BW/2 suggested in the instruction. But, now thanks to you readjusting the notch has been very effective.

I also ran the Autotune one axis at a time with AUTOTUNE_AGGR 0.075. These are gains that came back after tuning.
ATC_ACCEL_P_MAX 61375.6
ATC_ACCEL_R_MAX 49744.97

ATC_ANG_PIT_P 7.313405
ATC_ANG_RLL_P 5.730244

ATC_RAT_PIT_P0.1265418
ATC_RAT_PIT_I 0.1265418
ATC_RAT_PIT_D 0.003376161

ATC_RAT_RLL_P 0.06820717
ATC_RAT_RLL_I 0.06820717
ATC_RAT_RLL_D 0.001

Since it is a bigger copter so to avoid making it too twitchy I reduced the Accel max value for roll and pitch to 25000 and 30000 respectively.
Afterwards I performed a Test Flight and as it can be seen from the logs that roll controller gains are quite low and the copter is quite loose in tracking the desired roll

The Pitch Controller on the other hand was performing quite well. The PID values were also close to the manually tuned gains.

I am now thinking of tweaking roll gains starting from P & I 0.11 and D 0.0035 obtained from manual tuning since the roll controller performance with those gains was very good.

I have also varied Loit_BRK parameters as per my liking to get a more smoother feel while braking and will be changing it further as I test it at higher speeds.

What way forward do you suggest? Your help in this case has been very valuable. Thank you for your valuable input. :slight_smile:

I would not go below 0.08 - you could probably try Autotune again with the default 0.1

To avoid running Autotune unnecessarily, and since Pitch is performing so well in that log, just copy all the Pitch values into Roll.
ATC_ACCEL_R_MAX,30000
ATC_ANG_RLL_P,7.313405
ATC_RAT_RLL_D,0.003376161
ATC_RAT_RLL_I,0.1265418
ATC_RAT_RLL_P,0.1265418
That should be close enough to correct - do another test flight and see for yourself. If you do wish to run Autotune it’s better to have a good starting point, it can be quicker.

You can always increase this slightly too, for a softer or smoother input
ATC_INPUT_TC,0.22 or up to 0.25

If you feel it’s still a bit twitchy or moving unnecessarily while holding position (Loiter mode) with no stick input then try these for the position controller. They are just half of default values, so easy to put back to original. This will allow the copter to track the GPS position a little bit more loosely.
PSC_POSXY_P,0.5
PSC_VELXY_D,0.25
PSC_VELXY_I,0.5
PSC_VELXY_P,1.0

Set this to ensure the CAN GPS unit always boots up before the flight controller.
BRD_BOOT_DELAY,3000

HNOTCH is now working as planned
Pre-filter:
image
Post-filter:
image

Hi Shawn,
Did some test flights on Friday but due to personal commitments I was a bit tied up.

I did the AutoTune with default 0.1 and initial parameters of roll set the same as pitch

The weather was very calm however the gains after Aftertune came out very different again.
These are the gains that came after tuning
ATC_ACCEL_P_MAX,47949
ATC_ANG_PIT_P,9.26
ATC_RAT_PIT_D,0.00692736
ATC_RAT_PIT_I,0.1389866
ATC_RAT_PIT_P,0.1389866

ATC_ACCEL_R_MAX,61504
ATC_ANG_RLL_P,7.256726
ATC_RAT_RLL_D,0.001962741
ATC_RAT_RLL_I,0.07955347
ATC_RAT_RLL_P,0.07955347

Did a test flight with these gains with accel max values set at 30000. The roll Control was not very good and the copter was a little wobbly in roll axis when moving at 12m/s in pitch direction. I checked the tracking performance in pitch for both 0.075 and 0.1. There was not much difference in tracking so I didn’t plus the D-term was a bit higher…

For the next test flight, I opted for these gains for both the pitch and roll axis
ATC_RAT_PIT_P 0.1265418
ATC_RAT_PIT_I 0.1265418
ATC_RAT_PIT_D 0.003376161
ATC_ANG_PIT_P 7.313405
ATC_ACCEL_P_MAX 30000

ATC_RAT_RLL_P 0.11
ATC_RAT_RLL_I 0.11
ATC_RAT_RLL_D 0.0035
ATC_ANG_RLL_P 7.313405
ATC_ACCEL_R_MAX 30000

Performed a test flight, the control and tracking was much better I set the ATC_INPUT_TC to 0.25 for smoothness. I also tested the bird at high speeds gradually upto 15m/s. The control and braking performance of the copter was very decent. The logs for the Test Flight are attached. Kindly check the logs.

What do u furhter suggest regarding the tuning aspect of the copter since the performance is much better now. Also regarding max speed I have been looking at RCouts and THST_hov. The RCOUT is around 1600us when copter is moving at 15m/s and during braking it reaches 1752 on higher end and 1259 on lower end. what do you thing can be the max speed achieved at 25 or 30 degree max angle. In the next flight, I am planning to test it at 18m/s if weather permits with a little loose braking to avoid RCOUT saturation.

Thank you for your highly valued suggestion and advice. Much appreciated

Try lowering the Roll D just a bit to see if some of it’s “noise” goes away
ATC_RAT_RLL_D 0.0029

For such big props, it’s getting quite close and it is going to take tiny steps to get it just right. You could set up transmitter-based tuning and carefully give that a shot - from now onwards that will be quicker to an outcome than flying/interpreting logs/adjusting/flying again.

https://ardupilot.org/copter/docs/common-transmitter-tuning.html#transmitter-based-tuning

Hi Shawn,

Lowered the Roll D to 0.0030, it has improved the noise performance quite a lot.
I m also thinking of reducing Pitch D too as I have observed a little jitter during hover. Overall the bird is performing very well. I did a couple of high speed test flights gradually increasing the speed till 22m/s. The logs are attached below:
Test Flight 1 (Upto 20m/s)
Test Flight 2 (Upto 22m/s)

The copter is very stable and is performing quite well at high speeds. How ever during braking it oscillates a little bit. This frequency of its occurrence is quite less (once or twice in a flight). What do you suggest to stop this from happening. Since it is oscillations I am thinking of finely reducing the pitch gains and see the effect. What do you suggest in this regard?
EDIT: Attaching pictures