How to control thrusters independently

This has come up again elsewhere and it turns out those messages don’t do what I thought they did at the time.

  • MAV_CMD_DO_SET_SERVO does allow setting servo values directly, but only for servo output ports that aren’t assigned as motors
  • SERVO_OUTPUT_RAW is used to communicate the current output values (e.g. from the flight controller to the ground control station), not set/command them

There has apparently been an open GitHub issue for multiple years for making this functionality possible in a convenient way, but it unfortunately hasn’t yet been enabled/made possible, and will likely require changes to the mavlink protocol.

As a summary of the ‘hacky’ options I can think of:

  • Persistent: Vehicles with <= 6 thrusters can make an ArduSub build with a custom frame that sets a single unique factor of 1.0 for each thruster, at which point it can then be controlled using RC_CHANNELS_OVERRIDE messages, where the RC Input channels 1-6 would correspond to individual thruster activations (this should only be used with MANUAL flight mode - stabilisation modes will have a really bad time)
  • Temporary or Persistent: backup the servo outputs, then change them to correspond to RCIN_ instead of Motor_ → because they’re not recognised as motors, they can then be controlled directly using RC_CHANNELS_OVERRIDE or DO_SET_SERVO depending on setup. NOTE: not registering as motors also means arming isn’t required, and failsafes don’t work, so be very careful if doing this! I’ve implemented this approach as part of a larger example program here.
    Temporary if backed up values restored once done (as in my example), but persistent if vehicle is shut down before restoring occurs (in which case parameters need to be restored manually, or do a full reset to defaults).
  • Temporary: Use MAV_CMD_DO_MOTOR_TEST (least effect on other flight modes - not sure if can control multiple thrusters at once)
1 Like