Problem with altitude hold-tuning

I need some help with my tuning.

I’v tried to tune using the guide here
copter.ardupilot.com/wiki/altholdmode/
But it doesn’t really seem to be up to date at all. No info of the thr_accel-parameters, and the default values for 3.0.1 is, if i’m not mistaken, WA/ of from that guide.

I don’t even know if the problem lies within my alt-hold tuning, but I’m hoping that you can point me in the right direction.

My problem started when I changed my cheap Turnigy 10x4.5-props to The slightly less cheap Turnigy 10x3.8. This props should have less pitch, but is a little bit heavier and a lot less flexible.

It flies quite well with them, except for when i’m in alt hold mode and lets got of my roll/pitch stick.
As soon as I let go of the stick it starts to “brake” by leaning back against the travel direction. The faster I go, the more it leans. I even had it lean to 90 degrees and fall from the sky. If i have enough altitude, it recovers, but it usually looses a couple of meters.

It doesn’t do this in stabilize and I think I have the pitch/roll-rate tuned quite well.
It does a little bit better if I lower my thr_accel_p to 0.5-0.6-ish, but it still wants to break if it has gained some speed.

What can cause this kind of behavior? I tried to experiment with thr_rate_p in case it’s applying to much/little throttle when its trying to return to normal pitch, but I can’t really tell if it changes anything.

Any ideas? It might have had the same tendency with the old 10x4.5 props, but not as severe as with the 10x3.8.

Hi There!

I had the same problem. Tried different things.
You have to do the Compass dance, the compassmot and that helped in my case and it sounds like it is your problem, you have to get rid of vibrations.
Look at the wiki
copter.ardupilot.com/wiki/vibration-damping/
After reducing the vibs below 1G it now flies in the auto modes (loiter) very well.

Greetings from northern Germany
Gunnar

Hi, do you have any logs of this issue?

Based on the info you have presented, but feeling is that you don’t have an Alt Hold problem, but in fact have a Rate Pitch and Roll PID tuning problem. In Alt Hold mode, the copter should not be doing any braking at all. And surely it should never pass 45°, yet you say it approaches 90° in some cases. This tells me your Rate Roll and Pitch PID’s are not tuned up nearly enough, and it is being “blown back” by the wind when you return to level while at speed.

What values do you have for these PIDs? Also Imax.

I guess I could redo the compass dance and compassmot, but it’s seems to work pretty well in loiter.

You are probably correct in that the wind affects the stabilization Robert. The overshoot while leveling was often more severe when going into the wind. This effekt was only visible in alt-hold though. In stabilize it was very stable, but often gained a lot of altitude instead (as expected).

I did increased rate_d from 0.006 to 0.008 when I changed the props. I also tried to increase rate_imax, but that didn’t have much of an affect (so I left it on 500).

But with that said, I went out this evening and realized that I actually could raise the rate_d quite a bit more with these props. I ended up with a rate_d of 0.015 and rate_p of 0.28 (was 0.008 and 0.16). That’s probably a bit to high because the stabilize looked a bit digital (it did the leveling in small (but fast) steps).

Unfortunately its about -12C with neither wind nor light outside right now, so I have to continue another day. I’ll get back with the result when I have dialed in the pid a bit more, and been able to test alt-hold on a windy day.

I’ve been out some more trying to dial in the rate and stb-pids.
I can’t really get the hang of it. You might be right that this isn’t a alt-hold-problem.

It actually seems like I have a problem with stabilize if i’m descending. If I’m going ever so slightly up and jerk the roll/pitch stick in random directions, it seems to stabilize quite good. But if I’m descending (even quite slowly) It seems to overdo the stabilization. I tried both high and a low throttle_p, but I don’t even know if this affect this.

I currently don’t have any good/short logfiles of this (just 6min logfile of me trying different parameters and trying to figure out how it affects the flight). But perhaps it’s quite obvious what parameters effect the stabilize when descending?

chsw001 and Rob-

Long time lurker here, first time poster. I am currently having the same exact problem with Alt-Hold on a scratch built Octo-X. Everything seems to be tuned okay and flies well in stabilize but pitches backwards about 15 degrees when alt-hold is engaged. I auto trimmed it yesterday and it is very stable in the air but I get the backward pitch at alt-hold even if I start in a flat stable hover. Since this is a new build I’m going through the steps trying to eliminate issues. I just re balanced the frame and I am working on better dampening but what vibration I know have doesn’t seem to affect stabilize to much. If it stops raining today I’ll see if I can grab an IMU log to take a look at.

One other wrinkle is my x configuration is more of a dead cat with shorter more angled arms in the front. Maybe that is affecting the geometry of the calculation adversely?

What is very surprising is that it in initial tests it holds altitude very well in loiter. I can’t figure out why that is. Doesn’t loiter depend on alt-hold?

Here’s a log-file with the problem. Winds of about 10m/s.

I took it up to altitude and gave it short (but full) roll inputs which seem to be very effective to get it to overshoot the leveling.

When I do the same thing in stabilize it levels with no overshoot.