Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

MC Follow

This page covers MC Follow app setup and tuning

This document applies only to MC-Follow version 2.15.0 and newer.

Introduction

The MC Follow application uses external object tracking data to follow an object. The app needs to be paired with a source of Line-Of-Sight (LOS) and LOS rate, such as the Tracking Service app.

Setup

The system comes with pre-configured MC-Follow app and no additional setup is required. Default tuning is optimized for 10" multicopter with high thrust-to-weight ratio. MC-Follow mode can be activated directly in the Modes tab in AMC, configured to an RC controller switch or assigned to a joystick button.

Tuning

1. Noise filter tuning

It is recommended to perform a noise filter tuning first. Refer to PX4 filter tuning guide and toIMU filters configuration for suggestions regarding IMU filters tuning for MC-Follow.

2. Angular rate and attitude controllers

Tune the PID angular rate and P attitude gains as defined in the multirotor tuning documentation. Make sure to disable MC_AIRMODE for the duration of the tuning, but make sure to re-enable it afterwards as it's necessary to fly highly dynamic trajectories.

3. Behavior at maximum speed

Verify that the drone is stable enough at the maximum desired velocity by performing the following tests:

  1. Fast forward flight in altitude mode at constant altitude (reach desired approach flight speed).

  2. Fast forward flight in altitude mode with decreasing altitude.

Test object (virtual object)

Testing can be performed without vision tracking using a so-called “Test Object”. The test object is defined by 3D coordinates relative to the local origin (i.e.: where the autopilot is initialized):

  • MCFLW_TO_ENU_X - Eastward position of the test object in meters.

  • MCFLW_TO_ENU_Y - Northward position of the test object in meters.

  • MCFLW_TO_ENU_Z - Upward position of the test object in meters.

Then MCFLW_TO_ENABLE must be set and the app restarted to enable the test object.

Note that a source of position (e.g.: GNSS) is required to use virtual following.

Auto-activate video tracking

Usually you want the tracking-service to publish LOS of the tracked object, before you activate MC-Follow mode, but if you don't have access, you can use automatic video-tracking activation on MC-Follow start. With MCFWL_TOA enabled, the app will send tracking init message when you enter the mode - tracking will start at relative image coordinates:

  • MCFLW_TOA_X - relative horizontal coordinate of the tracking init message.

  • MCFLW_TOA_Y - relative vertical coordinate of tracking init message.

Following the object

Once the mode is activated, the vehicle holds its position and altitude, keeping the tracked object in view. It does not close in on its own. To move closer, push the pitch stick forward - the further you push, the faster the vehicle moves. Release the stick and it returns to holding position.

To abort the approach anytime, switch to any other flight mode (e.g. Stabilized mapped on a RC switch)

Unrestricted mode

A special mode that requires a valid licence. It removes the need to hold the pitch stick: once following has started, the vehicle continues to actively follow the object even after the stick is released. With MCFLW_PF_THRSHLD set to 0, no stick input is needed at all and the vehicle starts following right after mode activation.

Pitch forward stick threshold

In unrestricted mode, MCFLW_PF_THRSHLD sets how far the pitch stick must be pushed forward before the vehicle starts actively following the object. Below the threshold the vehicle holds position; values under 0.1 have no effect, as 10% of stick travel is always required. The pitch threshold is what triggers the latch: below it the vehicle behaves as in restricted mode, and once the stick passes it the app latches and keeps following the object even after the stick is moved back below the threshold.

Approach angle

Approach angle defines the angle of the flight path with respect to the tracked object, at which the vehicle will descend towards. With approach angle greater than 0, the vehicle will first fly at constant altitude and only descends towards the tracked object once reaching the defined angle. Steeper values approach more from above, shallower ones more from the side.

Parameter:

  • MCFLW_APR_ANG - Flight path angle with respect to tracked object at which the final following phase is started. Set to zero to disable.

Keeping the tracked object in frame

MC-Follow limits how the vehicle tilts and turns so the tracked object stays inside the camera’s view.

Where the camera data comes from:

  • Tracking service - when the tracked camera reports its own data, MC-Follow uses it: the camera’s actual orientation, including a gimbal as it moves, and a limit based on the area the tracker searches rather than the full image. The object is held with some margin inside the frame, and the limit keeps working as the gimbal points around.

  • App parameters are used when the tracking service doesn't publish camera data. They describe a fixed camera looking forward, pitched up by MCFLW_CAM_PITCH, with the object allowed anywhere within the FOV you enter. Set the parameters even when the tracking service supplies the data, so the fallback is sensible - for a gimbal, use values the limit can hold at any gimbal angle.

Parameters:

  • MCFLW_CAM_VFOV - Camera vertical FOV. Limits pitch so the object does not leave the top or bottom of the frame. Set to 0 to disable.

  • MCFLW_CAM_HFOV - Camera horizontal FOV. Limits how far the vehicle turns away from the object, so it does not leave the sides of the frame. Set to 0 to disable.

  • MCFLW_CAM_PITCH - Camera pitch up angle relative to the vehicle. Ignored while the tracking service supplies the camera data.

Troubleshooting

The drone oscillates slowly in MC-Follow mode (e.g. rolls left and right)

If using video tracking pipeline, check if the camera orientation (especially camera pitch) and calibration is set up correctly. Otherwise check the source of LOS.

The drone oscillates fast (>1 Hz) in MC-Follow mode

Reduce acceleration control proportional gain (MCFLW_ACC_P ) by 20% per step.

The drone vibrates while hovering (in any mode)

  • Verify that all the components are firmly attached to the drone.

  • Antennas must be rigid to have their resonance at high frequency.

  • Make sure no component touches the autopilot.

  • In case of a fixed structural resonance at low frequency, a notch filter can be enabled in APX4.

  • Adjust digital filters. Excessive filtering (e.g.: gyro LPF with low cutoff frequency or unnecessary notch filter) degrades the stability of the drone.

  • Adjust the angular rate and attitude gains. Remember that the rate D gain amplifies noise, so it cannot be set to a high value.

Last updated