Copter Doesn't Hold in AltHold

Hi all,

I’m a newbie guy who tries to do his initial setup with a custom drone in Gazebo. I want to switch it to AltHold/Loiter to do a QuickTune and Autotune, but it doesn’t hold. Instead, it slowly climbs down, and then crashes as I have problems with manual (mode Guided) ascend and descend too. Otherwise drone is more or less fliable.

Parameters and settings:

  • X-frame
  • 9-inch props
  • 0.15 throttle
  • MOT_SPIN_ARM = 0.04
  • MOT_SPIN_MIN = 0.07
  • MOT_THST_EXPO = 0.58
  • ATC_THR_MIX_MAN = 0.100
  • ATC_THR_MIX_MAX = 0.500

Baro.Alt, CTun.Alt and DAlt all are very close (except for the crash), so I don’t really know what to do with that.

I followed the documentation on AltHold, but it is not of much help. The closest thing is Common Problem #2, which advices to have a stick in mid position to prevent the descend. I’m not using sticks in simulation, but increasing/decreasing THR_DZ anywhere in [30; 400] didn’t help. Changing PSC_POSZ_P, PSC_VELZ_P to 50% also didn’t help.

Also, this advice says to tune PSC_ACCZ_P and I, as these params affect AltHold the most. I tested a wide variety of values (P = 0.05-0.27, I - accordingly), but it still doesn’t hold.

Automatic takeoff (Guided), and landing in RTL right after the takeoff work perfect (stable, no oscillations, no crashes). Guided, though, both up and down, is unstable and often results in crash.

Thoughts are highly appreciated.

Log 172 - simple vertical ascend (with crash while landing)
Log 174 - zigzag flight on the same altitude
Log 176 - takeoff with switching to AltHold (crash)
Log 177 - takeoff and immediate RTL

You need to set the throttle channel to 1500 in order for it to not fall down

1 Like

Thank you! It’s brilliant.

For future searchers: by default throttle channel is RC 3. So, in simulation you have to send rc 3 1500 mavlink command, and then AltHold/Loiter works.

QuickTune actually does nothing besides reducing every parameter for 20% every time. Is that supposed to work so? What’s the point then?

Autotune, I receive ‘Failed to level. Please tune manually’. I’ve done manual tuning following recommendations, but after that, it’s the same message (settings didn’t change much).

Also, I’ll be grateful, if you have any tips on vertical stabilization as well. It it climbing up OK, but climbing down sucks - only really small position changes work without crashes.

Here’s most recent settings and a log.