# ArduPilot

[ArduPilot](https://ardupilot.org/) is an open-source autopilot. Theseus is proud to be an [ArduPilot partner](https://ardupilot.org/ardupilot/docs/common-partners.html).

Theseus Micro VPS does not require you to install any custom version of ArduPilot, Mission Planner, or QGroundControl. Our system works out of the box with existing software.

Theseus **Micro VPS v1.5.3 is tested on ArduPilot v4.6**. We recommend using ArduPilot v4.6+ to guarantee compatibility.

{% hint style="info" %}
Theseus Micro VPS is expected to be compatible with ArduPilot v4.x. Please let us know if you integrate with an older version of ArduPilot.

If using a flight controller with a MCU other than the H7, e.g. F405,  you may need to build custom firmware ([custom.ardupilot.org](https://custom.ardupilot.org)) for your board and **enable MAVlink GPS** under the GPS Drivers drop-down. This is not enabled in the default ArduPilot firmware build on certain boards using MCUs such as the F405.
{% endhint %}

## Parameters

Prior to configuring the ArduPilot parameters to enable communication with the Micro VPS, enable MAVLink on the port you selected when integrating with your flight controller in [Flight Controller](/micro-vps/vehicle-integration/flight-controller.md).

### UART Port

Set the port protocol to **MAVLink 2** and baud rate to **921600**.

Here is the map between physical and UART ports for the Cube Orange +:

| UART   | Serial   | Physical Port |
| ------ | -------- | ------------- |
| UART 2 | SERIAL 1 | TELEM 1       |
| UART 3 | SERIAL 2 | TELEM 2       |
| UART 8 | SERIAL 4 | GPS 2         |

### ArduPilot System Params

These parameters govern system time synchronization as well as GPS configuration. We disable GPS blending and auto switching.

We choose to set the GPS 2 source to the VPS via MAVLink. This is interchangeable with GPS 1.

| ArduPilot Parameter | Param Value | Description                |
| ------------------- | ----------- | -------------------------- |
| BRD\_RTC\_TYPES     | 2           | Set time from MAVLink      |
| GPS2\_TYPE          | 14          | Set GPS 2 to MAVLink       |
| GPS\_BLEND\_MASK    | 0           | Disable GPS blending       |
| GPS\_AUTO\_SWITCH   | 0           | Disable GPS auto switching |

{% hint style="info" %}
To enable navigation by VPS, **change GPS\_PRIMARY param to "1"** (second GPS) or whichever GPS is designated for the VPS system.
{% endhint %}

### ArduPilot EKF Params

These parameters govern how the ArduPilot EKF integrates sensor measurements to estimate its position. This is one of the key components in ArduPilot's navigation and control mechanisms.

ArduPilot's EKF has three sensor source sets (EK3\_SRC1, EK3\_SRC2, EK3\_SRC3). You can configure each source sets with different sensor inputs. The configuration below sets EK3\_SRC1 to pull its information from the GPS, barometer and compass.

The VPS relies on the barometer to estimate altitude. The altitude it forwards via its GPS signal is copied from the [VFR\_HUD](https://mavlink.io/en/messages/common.html#VFR_HUD) altitude messages it receives. Do not use this GPS POSZ measurement as it can cause undesired feedback loops in the EKF.

The Micro VPS estimates velocity on the XY axis. However, we found through evaluation that setting VEL\_XY to pull from the VPS causes instabilities in the EKF. We recommend to not use the GPS as a velocity source to the EKF.

We recommend enabling continuous calibration of the compass during flight. It is recommend to set EK3\_MAG\_CAL to 3 (in the air) or 4 (always).

{% hint style="warning" %}
Do not pull velocity (VELXY, VELZ), altitude (POSZ), or yaw (YAW) inputs from the GPS when VPS is on.
{% endhint %}

| ArduPilot Parameter | Param Value | Description                                   |
| ------------------- | ----------- | --------------------------------------------- |
| EK3\_SRC\_OPTIONS   | 0           | Disable fusing velocity sources               |
| EK3\_GPS\_CHECK     | 23          | Disable horizontal accuracy checks for arming |
| EK3\_SRC1\_POSXY    | 3           | Pull GPS for xy position input                |
| EK3\_SRC1\_VELXY    | 0           | Disable xy velocity inputs                    |
| EK3\_SRC1\_POSZ     | 1           | Pull altitude from barometer                  |
| EK3\_SRC1\_VELZ     | 0           | Disable z velocity inputs                     |
| EK3\_SRC1\_YAW      | 1           | Pull yaw from compass                         |
| EK3\_MAG\_CAL       | 3           | Enabling mag cal in the air                   |

Go to [Mission Planner](/micro-vps/autopilot-integration/mission-planner.md) or [QGroundControl](/micro-vps/autopilot-integration/qgroundcontrol.md) to see how to configure your drone to operate with Micro VPS.


---

# 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.theseus.us/micro-vps/autopilot-integration/ardupilot.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.
