# MC Follow

{% hint style="info" %}
This document applies only to MC-Follow version 2.4.0 and newer.
{% endhint %}

## 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. 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](https://docs.px4.io/main/en/config_mc/filter_tuning#filter-tuning) and to[Software setup](/vehicle-operation/dragon-setup/dragon-sr/software-setup.md#imu-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](https://docs.px4.io/main/en/config_mc/pid_tuning_guide_multicopter_basic). Make sure to disable [MC\_AIRMODE](https://docs.px4.io/main/en/advanced_config/parameter_reference#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.&#x20;

#### 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.

## Restricted mode

There are two working modes of MC Follow app: restricted and unrestricted.

* **Restricted** - where the pitch stick input on RC or Joystick control the velocity toward the tracked object.
* **Unrestricted** - that requires a license and allows to specify pitch forward threshold (via `MCFLW_PF_THRSHLD` parameter) above which the vehicle will continue the approach regardless of the pitch stick input. If `MCFLW_PF_THRSHLD`is set to 0.0, the vehicle will start following the object right after the mode is engaged.

{% hint style="info" %}
To abort the approach anytime, switch to any other flight mode (e.g. Stabilized mapped on a RC switch)
{% endhint %}

## Active pitch limiter

The MC-Follow app allows to actively limit the vehicle pitch angle to keep the tracked object within camera vertical field of view. To use pitch limiter, camera parameters are required to be set: &#x20;

* `MCFLW_CAM_VFOV` - Camera sensor vertical FOV used to prevent the tracked object getting out of the view. Set to 0 to disable camera based pitch limiting.
* `MCFLW_CAM_PITCH` - Camera sensor pitch up angle used to actively limit pitch.

<figure><img src="/files/lEk6igRtYqf32qdDv5on" alt=""><figcaption></figcaption></figure>

Active pitch angle limitation will restrict the pitch angle up to the value specified by `MCFLW_PITCH_LIM`.

## Troubleshooting

**The drone oscillates slowly in MC-Follow mode**

If using video tracking pipeline, check if the camera orientation 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.auterion.com/vehicle-operation/dragon-setup/dragon-sr/mc-follow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
