Skip to content

Controlling Servos via Mission Planner

This page walks you through setting up your system so that you can control a servo manually from Mission Planner's Servo/Relay tab.

Minimum hardware requirements

Everything here is in your kit; see the kit list for what each item looks like.

  • Cube Orange+ on its carrier board
  • USB/buzzer cable, and a USB cable to your laptop
  • Power supply (12 V DC) and mains cable
  • Power Brick Mini and POWER2 cable
  • UBEC
  • One servo: a blue 9 g micro servo, or the large black Feetech servo
  • A laptop with Mission Planner installed

Start from a freshly flashed Cube

These instructions assume a newly flashed Cube. If you run into problems following them, re-flash your Cube to Sub (submarine), then back to Plane. As explained on the Mission Planner page, this makes sure all parameters are reset to default: the "Reset to Defaults" button doesn't always do a thorough enough job.

Connecting the servo

Power servos from the UBEC, not from USB

Your laptop's USB port can't supply the current a servo draws, particularly when it stalls. Power the servo rail from the UBEC.

Servos can draw significant current when 'stalled', i.e. the servo is trying to move but has reached the end of a mechanism's movement. The kit's 9 g micro servos stall at around 0.8 A each, and the large Feetech servo up to 4 A (est): its stall current isn't published, so treat that as an estimate and leave yourself margin.

  1. Set the UBEC's output voltage. Start with 5 V.
  2. Connect the UBEC's output to AUX OUT 1, at the end of the row, taking care with polarity. All the positive (+) pins are connected to one another, as are all the negative (-) pins, so this one connection powers the whole rail, including MAIN OUT 5.
  3. Plug the servo into MAIN OUT 5, the right way round:

    • top: negative (-), black (or sometimes brown) wire
    • middle: positive (+), red wire
    • bottom: signal (S), white or orange wire

    Your cable colours may vary, and that's fine: many other colour schemes exist. The polarity is what counts, not the colour.

Setting the parameters

  1. Connect your Cube to your laptop with the USB/buzzer cable.
  2. Connect Mission Planner, choosing AUTO in the connection drop-down menu. Mission Planner will detect which COM port to use.
  3. Open the full parameter list: go to the CONFIG tab, then Full Parameter List.
  4. Search for each parameter in the table below, and set it to the value shown.
  5. Write the parameters with Write Params, and reboot if prompted. You can reboot with reboot pixhawk in the Ctrl+F menu, or with a power cycle.
Parameter Value Description
SERVO5_FUNCTION 0 Disables Servo 5's automatic function, allowing us to take manual control. This should be the default.

No arming needed

You don't need to arm the Cube to move a servo whose SERVOn_FUNCTION is 0, so you don't need to change THR_FAILSAFE either: leave it at its default. What holds the servo still is the safety switch, below.

Moving the servo

Toggle the safety switch. Press Ctrl+F and click Toggle Saftey Switch. This allows a PWM signal to be sent to the servo.

Toggle safety MP

Open the Servo/Relay tab, in the bottom left of the DATA tab.

servo MP

You can now use this tab to change the PWM signal being sent to the servo connected to MAIN OUT 5.

Check the signal in Servo Output

SETUP › Mandatory Hardware › Servo Output shows the PWM signal on each output in its Position bar. If output 5 changes when you use the Servo/Relay tab but the servo doesn't move, the signal is leaving the Cube, so check the servo's wiring and power.

Servo output MP

Troubleshooting

If the servo doesn't move, work through these in order.

  1. Check the servo is plugged into MAIN OUT 5, the right way round: see Connecting the servo.
  2. Check the servo is getting power from the BEC, by using a multimeter to test that the MAIN OUT 5 pins are powered.
  3. Reboot the Cube from Mission Planner.
  4. Toggle the safety switch again. It turns back on every time the Cube reboots or is power cycled.
  5. Check SERVO5_FUNCTION is 0. If it isn't, the Cube is using output 5 for something else, and ignores the Servo/Relay tab.
  6. Power cycle the Cube: unplug the power, plug it back in, reconnect Mission Planner, and toggle the safety switch.
  7. Re-flash the Cube to Sub, then back to Plane, and follow the steps on this page again.

Arming the Cube won't help: a servo on an output with SERVOn_FUNCTION = 0 moves without it.

Once your servo moves from Mission Planner, you're ready to control it from a script. Head to the next step using the links below or to the left.