-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Control surface preflight check #24391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🔎 FLASH Analysispx4_fmu-v5x [Total VM Diff: 1864 byte (0.09 %)]
px4_fmu-v6x [Total VM Diff: 1864 byte (0.1 %)]
Updated: 2025-07-16T09:17:00 |
a815643
to
d1e18c1
Compare
This is great. A CS preflight command QGC side is the logical next step that allows you to hit a button and have all CS move to min max move rather than a manual check. Awesome. |
e9c709b
to
b0de604
Compare
b0de604
to
9e4b058
Compare
b162d35
to
c75ea70
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have mostly nitpicks here, you did a good job in adding this functionality to an architecture that didn't plan for it.
We need to align on the wording of the mavlink message.
|
||
if (vehicle_command.command == vehicle_command_s::VEHICLE_CMD_DO_PREFLIGHT_CS_CHECK) { | ||
if (!_armed) { | ||
// currently this does not check prearmed status. if not prearmed, it will just do nothing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to notify the user, yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checking for prearmed state now. I added a subscription to actuator_armed
to get it, I presume there's not a neater way, or can you think of one?
...odules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessTiltrotorVTOL.cpp
Outdated
Show resolved
Hide resolved
uORB::Subscription _tiltrotor_extra_controls_sub{ORB_ID(tiltrotor_extra_controls)}; | ||
|
||
bool _bypass_tiltrotor_controls{false}; | ||
float _collective_tilt_normalized_setpoint{0.5f}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need both that and _last_collective_tilt_control
? Can we remove some of these class members? They add memory and through that complexity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd keep them both as they serve different purposes:
_last_collective_tilt_control
is populated inprocessTiltrotorControls
, thus acts as an output wrt. that function. It is used to construct the effectivenes matrix. note that is is not actually the last collective tilt control -- it is modified here to achieve desired transition behaviour with a "wrong" effectiveness matrix..._collective_tilt_normalized_setpoint
is an input toprocessTiltrotorControls
, only in the case of overriding collective tilt introduced here.
I suppose it would be technically possible to unify them, especially if we guarantee that we will never be in a preflight check and a transition at the same time. But mixing input/output functionality would imo be confusing and hinder maintainability, and we'd have to remove / move / work around the hack of sometimes outputting the wrong collective tilt.
instead only leaving tilt. adjust function / variable names accordingly.
Please don't merge before before mavlink/mavlink#2224 |
6ecc76d
to
2d76534
Compare
I still need to get someone from ArduPilot to look at the mavlink PR. I've been trying and will continue to do so. Ping me next week if it has not merged. |
Solved Problem
The current preflight check sends servo commands (essentially) directly over mavlink. This requires the GS to know/guess which actuators are available and should be tested.
Solution
As an alternative solution, this check tests control surfaces in functional groups (roll/pitch/yaw/tilt). It works as follows:
VEHICLE_CMD_DO_PREFLIGHT_CS_CHECK
, containing parameters: axis (roll/pitch/yaw/tilt) and control input.ControlAllocator
applies the given control input to the given axis.param set COM_PREARM_MODE 2
).ActuatorEffectivenessTiltrotorVTOL
with a setter function (declared for the base classActuatorEffectiveness
, but empty implementation unless overridden).Here is a diagram depicting the information flow:

Alternatives / modifications
ControlAllocator
into an own class