Dramatic braking in PosHold and loiter modes and behavior in windy conditions

Hello all,

My research group has built a large quadcopter that, after being auto tuned, performs well except for two circumstances:

  • Our most pressing concern is that in moderate to high wind gusts (15-20mph) the aircraft pitches forward dramatically and instantaneously.
  • The second and perhaps less serious issue is that after ceasing input during lateral movements in both position hold and loiter flight modes, the braking is dramatic and seems to exceed the 8 deg/s roll rate and 30 deg max angle set in the parameters. However, it quickly recovers without oscillation.

Hardware:

  • Motors: MAD M6C12 170kV
  • ESCs: T Motor Flame 60A HV
  • Propellers: 24.4" T-MOTOR MF2412
  • Frame: Custom carbon fiber frame
  • Flight controller: Hex Pixhawk 2.1 with Cube Blue H7
  • PDB: Custom PDB
  • Battery: 12s 21800 mAh
  • Battery connectors: Matek AS150
  • Comms: HereLink Blue
  • GPS: 1x Here3

Notable software configurations:

  • FFT notch filtering
  • Experimentally determined mot_thst_expo
  • Here3 GPS as primary compass with cube compass as back up
  • Altitude control uses only the cube barometer

Flight configuration:

  • 23.1 lb takeoff weight

Known issues:

  • Altitude loss during long straight movements

  • Infrequent but very consequential “EKF3 ground mag anomaly” errors. Presumed to be resolved by relocating GPS further from PDB and making it the primary compass. Motor compass test now shows less than 11% interference up to 70% throttle. The error has not reoccurred with the new configuration but continues to perform midflight yaw realignments that cause mild to moderate instability that is quickly resolved.

  • Aggressive landing behavior following the presenting issues resulting in spinning about one of the land gear legs when attempting to land and disarm. Presumed to be due to mot_spin_min being set too high, but it has not yet been changed.

High wind flight - wind behavior in PosHold mode
Bin file:

Video:

Wind issue: 0:41

Description:
Previously the drone was manually tuned per the documentation and had been flying with these manual values. The day prior to this flight, the pitch and roll axes were auto tuned in a 24 minute flight at dawn with very little to no wind. The yaw axis was then auto tuned in another 11 minute flight. During both flights periodically the “auto tune failing to level” warning appeared but the flight characteristics when these warnings occurred didn’t reflect any issues and the tuning continued and was eventually successful. However, during the yaw tuning flight, the twice the aircraft performed an inflight yaw alignment that resulted in an instability that was immediately corrected. These auto tuned PID values flew perfectly and following flights that morning had no issues or remarkable incidents despite lifting and dragging an 18.4 lb payload.

The following day (the day of the video) winds were 15 mph gusting to around 25 mph. The drone was first tested by hovering and exhibited a pseudo flyaway in that full throttle down in PosHold mode did not cause the aircraft to descend but instead it continued ascending at a slow rate. After switching to AltHold, we were able to land but the drone pitched forward dramatically on descent. When flown again the altitude and position were stable, but the aircraft exhibited the same pitching motion and had to be violently landed. This same behavior occurred in loiter mode, after the ESCs had been recalibrated, and in milder (around 6mph gusting to 15mph) conditions two weeks later.

Moderate wind flight - braking and wind behavior in loiter mode
Bin file:

Video:

Braking: 1:03
Wind issue: 2:25

Description:
When hovering or flying in low wind conditions, the aircraft flies very well. However, after gaining speed in lateral motion, ceasing input causes the drone to tilt faster and beyond the maximum values set by the parameters. I believed this issue was due to a poor tune, so I auto tuned the roll axis in albeit slightly windy conditions (~3-6 mph) and did get P and I terms approximately 30% lower, D term 20% lower, and angle P terms about 50% lower. These PID values exhibited the same behavior in addition to overall worse flight characteristics compared to the previous auto tune values.

My main hypothesis is a bad tune but other tunes we have tested have all performed worse save for this issue. Could it be a hardware issue? If so, would it be a bad motor or ESC or something else entirely? Motor 4 does seem to be commanded less than the others but it is also the motor facing into the wind in these videos. We are open to all possible resolutions, hardware or software. If any more information is required, please let me know and I can provide it as soon as possible. Thank you and I look forward to hearing what you all have to say!

Hi, welcome to the community :wave:t2:

I have good news and bad news:
The good news is that what you are experiencing is expected behavior, given your state of configuration and tuning.
The bad news is that you have quite a bid of work ahead of you until your drone flies perfect.

The first thing I noticed when I looked at your logs is that your vibrations are concerningly high. Below 10 is good, below 15 is tolerable, above 15 is bad. When you match the timeline of the plot to the videos it becomes obvious that the vibrations were exeptionally high whenever the copter had a bad twitch. The spikes where the vibes go out of bounds is where the copter got grounded and can be ignored.
vibe_first_flight
vibe_second_flight
Reducing vibrations is your highest priority right now. Everything else depends on it.

The second thing I noticed is that you didn’t set ATC_THR_MIX_MAN and your PSC_ACCZ_P and PSC_ACCZ_I don’t correspond to your MOT_THST_HOVER. Those values should have been attended to after the first test flight and mission planner tells you that explicitly after setting the initial tuning parameters.

The third problem is that you are missing vital calibrations, namely the IMU temperature calibration and the inflight MagFit calibration.
missing calibrations

So in conclusion I’d say your problem is that you started with a badly tuned drone and autotune understandably wasn’t able to fix it.

I recommend to read and follow the How to methodically tune (almost) any multicopter using ArduCopter 4.4.x guide. Download the .zip folder with the param files from the guide, edit each file to suit your copter and upload them one by one as you read along. The guide tells you what to do and which file is needed at any given time. Do not skip any steps! All steps are essential for all of the following steps. Anything that might seem like a shortcut will result in a worse tuned drone in the end.

2 Likes

Thank you so much for helping us out! Thankfully, I have already begun reinitializing our set up per the guide and will update this thread with our results. We will replace our current vibration damping setup for the Pixhawk with the recommendations in the documentation. I believe we will go with either the Kyosho Zeal gel or HolyBro foam unless you believe there is a better option for us. Thanks again.

Perfect, I’d love to hear about your results, especially when they’re good :wink:

In my experience it is best to start the fight against vibrations at the source:

  • balance your props (obvious)
  • balance your motors (only if you can, it is quite complex)
  • stiffen up your frame; the stiffer the frame is, the higher is it’s eigenfrequency (resonance frequency)
  • make sure that everything is mounted tight and nothing rattles → more mass that resists vibrations
  • the GPS mast in particular has to be stiff and shouldn’t shake easily

Apart from that the mentioned gel and foam are good options.
When the FC is mounted on gel/foam, make sure you don’t have taut or stiff wires (flexible silicone wires are best).

Thank you again for your advice! Sorry for the delay in response but I wanted to post this incase someone else is having the same problem. We did reduce vibrations by stiffening our GPS masts and mounting our FC differently for marginal improvements. It turns out the real issue was our notch filter was configured incorrectly. INS_HNTCH_FREQ was set to 80 Hz which prevented our FFT based filter from going low enough to capture the first harmonic from our props at around 40-60 Hz. Fixing this resolved all of our stability issues. The flyaway type behavior was caused by MOT_SPIN_MIN being set too high so that the motors leaning into the wind couldn’t go low enough to allow it to pitch into the wind without it gaining altitude. Lowering it appears to have fixed it entirely.

Dont worry about Position Hold mode, just use Stabilise, AltHold and Loiter.

Vibrations look good.

Mandatory for these bigger copters:

BATT_FS_CRT_ACT,1
BATT_FS_LOW_ACT,2
FENCE_ENABLE,1

For T-Motor Flame set these:

MOT_THST_EXPO,0.4
MOT_PWM_MIN,1100
MOT_PWM_MAX,1940
ATC_RAT_PIT_SMAX,50
ATC_RAT_RLL_SMAX,50
ATC_RAT_YAW_SMAX,50

Then use MissionPlanner motor test to recheck and set your MOT_SPIN_ARM and MOT_SPIN_MIN since they might be a bit different now.
Set ARM to as low a percentage as you can get it and still be reliable, then add 0.03 and set that value as MIN.

Change these to get the FFT and HNOTCH working correctly (you have already discovered some of this) , along with desirable logging:

INS_ACCEL_FILTER,10
INS_GYRO_FILTER,20
INS_LOG_BAT_OPT,4
LOG_BITMASK,180222
FFT_MINHZ,20
FFT_MAXHZ,200
FFT_NUM_FRAMES,2
FFT_HMNC_PEAK,2
FFT_WINDOW_SIZE,128
INS_HNTCH_MODE,4
INS_HNTCH_FREQ,30
INS_HNTCH_BW,15
INS_HNTCH_FM_RAT,1
INS_HNTCH_HMNCS,1
INS_HNTCH_REF,1
INS_HNTCH_OPTS,2

When it’s flying OK probably run the VTOL Quicktune script before going any further.
Please provide this .bin log so we can check a few things.
Then do some circles, ascents and descents and we can sort out the compass calibration.

If you use the new Configurator process it steps you through all of these things.

@JackParker I advise you to change those values as @xfacta said and after that use the MethodicConfigurator/USECASES.md at master · ArduPilot/MethodicConfigurator · GitHub to create a configuration based on your almost fully configurated vehicle.

@xfacta in the future you can point new users directly at that guide.