Most of the autonomous systems in the Senior Design labs use the CubePilot CubeOrange system, which is ArduPilot compliant.

Note that this guide is written intentionally ambiguously. This is because ArduPilot can be customized for different platforms but is primarily known for Copters; This document is only for the overlapping elements of setup and orientation to the system.

Copters: https://ardupilot.org/copter/
Rovers: https://ardupilot.org/rover/
Planes: https://ardupilot.org/plane/

ArduPilot’s overview for the Cube Orange can be found at: https://ardupilot.org/copter/docs/common-thecubeorange-overview.html

Note that ArduPilot’s visual diagram below is more comprehensive than we typically build out, and we tend to use different accessories than are shown below.

ArduPilot Ecosystem

Setup

ArduPilot’s First Run guides can be found at: https://ardupilot.org/copter/docs/configuring-hardware.html and https://ardupilot.org/copter/docs/flying-arducopter.html

Wiring the CubePilot (Bare Minimum)

ArduPilot’s long and detailed port listing can be found at: https://docs.cubepilot.org/user-guides/autopilot/the-cube-module-overview#serial-ports-parameter

Connect the USB/Buzzer wiring harness to the port labeled “USB”.

Connect the Button wiring harness to the port labeled “GPS 1”. (Named because this is a UART port which was used for GPS, before GPS moved to the CAN Bus)

Most projects will set up for a GPS, so those instructions are included. Indoor projects likely will not find a GPS useful, so it is not required for configuration or use.

If the pedestal is not already attached to the GPS module:

  • First, thread the GPS cable through the opening in the pedestal.
  • Second, remove the small screw next to the GPS cable on the module itself.
  • Third, hook the pedestal into the 2 indentations on the GPS module, swinging the pedestal toward that screw’s embedded nut.
  • Finally, attach the pedestal to the GPS module using that screw.

Connect the Here3 GPS module to the port labeled “CAN 1”.

Here 3 GPS pedestal Assembly
USB, Buzzer, and GPS Connections

Installing Mission Planner

ArduPilot’s Mission Planner notes can be found at: https://ardupilot.org/planner/

They have a very detailed install guide at: https://ardupilot.org/planner/docs/mission-planner-installation.html

The installation is very straight forward. Note that your browser and/or Windows may flag the MSI installer as untrusted; You’ll need to click on a few dialog boxes along the lines of “Authorize Download” and “Keep this file”.

Loading the ArduPilot Firmware to the CubePilot

ArduPilot’s notes on configuring the device can be found at: https://ardupilot.org/rover/docs/common-loading-firmware-onto-pixhawk.html
Please Note: Their documentation is for a PixHawk. Our team has had very poor luck with the PixHawk system, hence why we use the CubePilot system. The instructions are generally the same.

Once Mission Planner is installed, connect the USB cable to the CubeOrange’s Buzzer/USB wiring harness.

At the top right corner of Mission Planner, select the COM Port which says “SLCAN” for System Level CAN Bus.

Then, click on the Firmware that you want to load.

Mission Planner Firmware Selection Screen

Click “Yes” to confirm the selection.

Confirming Selected Firmware

A new dialog box appears asking which board to apply the firmware to. Select “Cube Orange”, and the firmware URL will automatically fill in.

Selecting the board to load Firmware to
Confirming the board to load Firmware to

Click “Upload Firmware”, and Mission Planner will scan the COM port, put the CubePilot in Bootloader mode, and load the selected firmware.

Configuring the GPS

ArduPilot’s Here3 GPS Notes can be found at: https://docs.cubepilot.org/user-guides/here-3/here-3-manual

Even if the project will not utilize a GPS module (i.e., indoor rover), it is wise to configure the settings now so that it can be easily added later.

With the USB cable connected, at the top right, select the port that says MAVLINK, then click the Connect button. Mission Planner should then start losing the parameter list, and then go into Live Streaming Data mode.

COM Port Listings

Then, go to the Config Page, and then click on Full Parameter List in the sidebar.
This will display a long tree of Parameters.

Expand the CAN Parameter.
Click on “CAN_D1” and verify that the Protocol is set to DRONECAN (1). It should be this by default.
Click on “CAN_D2” and verify that the Protocol is set to DRONECAN (1). It should be this by default.
Click on “CAN_P1” and verify that the Driver is set to FIRST DRIVER (1). If it is not, click on the Value cell and change the drop-down option.
Click on “CAN_P2” and verify that the Driver is set to SECOND DRIVER (2). If it is not, click on the Value cell and change the drop-down option.

Expand the GPS Parameter
Click on “GPS_TYPE” and verify that it is set to DRONECAN (9). If it is not, click on the Value cell and change the drop-down option.

Then, click on “Write Params” on the right sidebar and confirm writing the parameters to the CubeOrange.

CAN Protocol Parameters
CAN Protocol Parameters

Configuring the LEDs

While in Config > Full Parameter List:

Expand the NTF Parameter
Expand the NTF_LED Parameter
Click on “NTF_LED_TYPES”, then Double Click on the Value cell so that a cursor appears. Erase the existing number, and type “123” and press enter.
– Alternatively, Single Click on the Value cell, and a new dialog box will come up. Only the following should be selected (as a starting point):
– – Built-in LED
– – Internal ToshibaLED
– – Oreo LED
– – DroneCAN
– – NCP5623 External
Then close the dialog box.

Then, click on “Write Params” on the right sidebar and confirm writing the parameters to the CubeOrange.

LED Parameters

After applying all the Parameter changes, the CubeOrange must be rebooted. Unplug the USB power, wait a few seconds, and reconnect USB power. The CubeOrange will then start in Bootloader mode, then Operational mode.

Basic Operation / Verification

ArduPilot’s Mission Planner Notes can be found at: https://ardupilot.org/rover/docs/common-connect-mission-planner-autopilot.html

In Mission Planner, click on Data tab at top left.

With the USB cable connected, at the top right, select the port that says MAVLINK, then click the Connect button. Mission Planner should then start losing the parameter list, and then go into Live Streaming Data mode.

COM Port Listing
Mission Planner Home Screen

While the CubeOrange has an integrated IMU, keep in mind that IMU’s can have a massive margin of error – demonstrated by a static object showing a vertical speed. This is why GPS is best, however GPS does not work indoors.

However, the IMU functions well for roll and pitch, as shown below.

IMU Monitor showing Roll and Pitch
Image 1: Roll with no pitch; Image 2: Pitch with no roll; Image 3: Roll and pitch combined.

Configuring IMU and Compass

In Mission Planner, go to the Setup Page, expand Mandatory Hardware, and then Accel Calibration.

It is advised to re-calibrate the IMU periodically, especially after moving the project (from Lab to Outside, Outside to Lab, or even between the labs).

First, have the vehicle in the flat and level position.
Then, click on “Calibrate Accel“.
Under the green button, Mission Planner will instruct you to position the vehicle a specific way, then click “Done” to complete that step. You will do this for all 6 axis: FLAT, LEFT SIDE, RIGHT SIDE, NOSE DOWN, NOSE UP, UPSIDE-DOWN.

Second, return the vehicle to the flat and level position.
Then, click on “Calibrate Level”.

Third, with the vehicle still flat and level, click on “Simple Accel Cal”.

IMU Calibration Screen

Next, move down to the Compass Settings.

Two compasses should be detected: the one onboard the Cube Orange and the one inside the Here3 GPS module (if attached).

Using Telemetry Radios

ArduPilot’s guide for the RFD900x radios can be found at: https://ardupilot.org/copter/docs/common-configuring-a-telemetry-radio-using-mission-planner.html and https://ardupilot.org/copter/docs/common-rfd900.html

When plugging the modems into the FTDI cable and the telemetry cable, the red 5-volt wire is always third from the left, under the jumper.

Using the guides above, configure the rfd900x radio using Mission Planner.
Note: The guide says to use 57600 as the baud rate. I found that 57600 is proper for mavlink, but 9600 is proper for running the AT- commands for configuring the modems themselves.

Once configured, select the FTDI’s COM port and 57600, then click Connect. Mission Planner should connect to the CubeOrange just as if you were using as USB cable direct.

RFD900x radio wiring

Pre-Arm Checks

ArduPilot’s Pre-Arm Checks Document can be found at: https://ardupilot.org/copter/docs/common-prearm-safety-checks.html
ArduPilot’s Arming Notes can be found at: https://ardupilot.org/copter/docs/arming_the_motors.html

When the Cube Orange is rebooted and gives the power-on tones, the GPS module should be flashing a double-yellow LED pattern (yellow-yellow-off, yellow-yellow-off). This signifies that the system is stable but dis-armed.

Holding the arm switch (which is on the “GPS 1” harness) for 2 seconds should give an arming tone, and the GPS LEDs will change to a slow blue flash.