Arducopter altitude hold details

Hey guys, I'm trying to understand what exactly is happening when you change the throttle in altitude hold and I'm hoping someone can explain the details to me.

Baometric altitude hold works great for me when I try to hover at a set height, but changing the setpoint seems really unintuitive. When I push the throttle up the quad climbs, but when I put the throttle back to neutral instead of holding its altitude the quad comes way back down.

Playing with the sim reveals that when you push the throttle up the setpoint actually doesn't change much, but the quad itself climbs like crazy, so when you put the throttle to neutral it's actually coming down to the real set point.

I've attached two plots of altitude error to illustrate the point. The first shows the response to a change in the set point: the error quickly settles to around zero. The second shows a response to the throttle: the error overshoots wildly, then slowly settles back down.

So I guess the real question is, what is the throttle doing in addition to changing the setpoint? Is it also affecting the motor speed directly? Because further playing with the sim shows that the step response of the altitude controller to a change in the setpoint doesn't result in the crazy overshoots that I see both in real life and the sim.

It'd be great if someone could explain what's happening when you change the throttle in altitude hold, and it'd be even better if you could point out where that gets set in the code. I'm interested in making my own altitude hold mode that's a little more intuitive for me.

sim_step.png

sim_step_throttle.png

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Developer

    You're exactly right about the lag in the baro. There is a small filter and this add some more lag.

    There is also a bad random walk in the baro which is what you're seeing as the bad behavior. APM2 is much much better, but the noise being played back in the SIM was sampled from an APM1. 

    The best way to get the alt change to work is to ease off the throttle and not got pull it back to the middle. We changed to this method to allow users to change altitude very rapidly while in AP modes. Once you get used to it, and understand what's happening it's more powerful and has faster feedback than just nudging the target altitude.

    Jason

  • I have noticed the same behavior from my quad.. I was assuming it was my home built frame (slightly heavy). I have raised throttle_p and Alt_hold_p (I think) with the same results.. Usually it will settle LOWER than the previous hold I raised it from..

    I do have sonar and all flights have been below 10 meters..

This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…