Hi all,
I’m digging into the QuadPlane / tailsitter transition logic in ArduPlane and I’m trying to trace precisely where the throttle used in the following line comes from:
quadplane.attitude_control->set_throttle_out(
MAX(motors->get_throttle_hover(),
quadplane.attitude_control->get_throttle_in()),
true,
0);
This is in Tailsitter.cpp during the forward transition.
My question is specifically about this part:
quadplane.attitude_control->get_throttle_in()
I’m looking for an exact description of the upstream logic:
-
Where is
_throttle_inlast written before this call?
I understandget_throttle_in()is just returning some internal_throttle_invariable fromAC_AttitudeControl, but I want to know which higher-level controller or function is the last one to write this throttle value in the tailsitter / QuadPlane context right before this line is executed. -
Which module actually decides that throttle in the relevant modes?
For a tailsitter during:-
QSTABILIZE
-
QHOVER / QLOITER
-
Assisted flight / Q_ASSIST region during forward transition
…what is the complete control chain that leads to the value stored in
_throttle_in(and later read byget_throttle_in())?For example, is it always coming from the vertical position/velocity controller (
pos_control/ Z controller), or are there paths where TECS or some other module sets this throttle directly before it ends up inAC_AttitudeControl::set_throttle_out()? -
-
Timing / “previous iteration” question:
Isget_throttle_in()here guaranteed to be the throttle command from the immediately previous control loop iteration, or are there cases where it could be older (e.g. if certain branches are skipped)?
What I’m trying to understand conceptually is:
-
During the tailsitter forward transition, this line is doing:
throttle_cmd = max( hover_throttle, last_throttle_in ); quadplane.attitude_control->set_throttle_out(throttle_cmd, ...);I want to be sure I fully understand:
-
Who set
last_throttle_in, -
When it was set (in the update sequence),
-
and in which frame / context (e.g. TECS vs Z controller vs pilot throttle in QSTAB).
-
If you could point me to the exact code path(s) and functions that write _throttle_in for a tailsitter in the transition/assist region (file + function names), that would be extremely helpful. I’m not looking for a general description but for the concrete call chain as it exists in current ArduPlane.