Hover throttle logic in Arducopter- Clarity abt its magical performance

Hi guys,

I wanna understand how Arducopter learns the hover throttle value in realtime during flight, i.e the throttle needed to auto hover the Quad copter.

I m new into developing control codes for UAV , generally how I do it is by measuring the weight of the copter , and forming a relationship with motor PWM vs the thrust on test bench, thus I can find the PWM required for each motor for getting me to hover thrust.

But as I see in Pixhawk with Ardupilot firmware, there is no input of weight(Kg) of the copter in Pixhawk params by the user, but somehow it still magically determines hover throttle and holds the altitude in real time.

Now I know a bit abt controllers, like in altitude controller for maintaining the altitude, the I term in PID control can build up to a hover throttle point and thus this hover I term can get us to hover point, but i m not sure, these thing works in simulation, but I don’t know abt real world.

Kindly help me in understanding abt how Arducopter determines hover throttle so efficiently and magically holds the aircraft at same height.

The control loop keeps the altitude constant, and when the altitude is constant, the throttle output IS the hover throttle. It is that simple. No need to imput weigth information, propeler performance, or any other information. Just the altitude information is needed.

@amilcarlucas thank you for your generous reply.
Controller will keep altitude constant is fine, I want to know it in detail abt the development of hover_throttle from initial default value to final learned value in hover, but as I see in ardupilot code, this hover throttle is used everywhere even in takeoff,guided mode as a reference for all motors, so suppose we never hover or althold in our whole mission , what happens to hover_throttle value in these cases, this value will never be rightly fixed at real hover throttle, but this value will be used in control code still for all modes, so does this not so perfect hover value affect takeoff/guided performance of controllers??

Those are very deep questions, you need to dig in the code yourself to get that info out :wink: