Autonomy Hardware Setup

Raspberry Pi

The Raspberry Pi 5 (RPi 5) is the onboard computer on the drone that runs the Autonomy software. Documentation about the RPi 5 can be found here: Raspberry Pi 5.

Buck Converter

The buck converter is the board that is used to power the RPi 5. At a high level the buck converter converts a 12V input into a 5V output.

image-20240817-170524.png
12V to 5V Buck Converter

The green board attached to the leg of the drone is the buck converter. The USB-C connector should be plugged into the USB-C input on the RPi 5. This supplies power to the RPi 5 on the drone when it is powered on.

Flight Controller

The flight controller is responsible for controls in flight operations. It is akin to the brain of the drone.

Autonomy software communicates with the flight controller to receive data from the drone and send commands. Communication with the flight controller is abstracted through the library DroneKit-Python. More information can be found here: DroneKit-Python.

In order for DroneKit-Python to read and send messages to the flight controller, the correct connection address must be specified so the library reads from the right network or serial port.

Autonomy software requests the following data from the flight controller.

  • Odometry data

    • Position

      • Latitude

      • Longitude

      • Altitude

    • Orientation

      • Yaw

      • Pitch

      • Roll

  • Home Location

    • Latitude of takeoff position

    • Longitude of takeoff position

Note: If you are testing Autonomy software that relies on GPS data (latitude and longitude) the drone must be taken outside so the GPS can get a fix on the drone’s current location.

The following subsections will dive into the different methods for connecting the flight controller with the RPi 5.

FTDI Cable

image-20240818-222008.png
Autonomy FTDI Cable

An FTDI cable converts data sent via the UART protocol to USB data. The USB end plugs into the RPi 5 while the JST connector (white connector) plugs into the flight controller.

The USB end can be plugged into any USB port on the RPi 5. The JST connector must be plugged into TELEM2 as this port is reserved for Autonomy software.

In order for DroneKit-Python to read and send messages to the flight controller, the connection address must be changed to reflect the

Connection Address

To find the connection address when using the FTDI cable, follow the steps below.

  1. If the FTDI cable is already plugged into the RPi 5 disconnect it

  2. Run the command python -m serial.tools.list_ports in the shell

    1. This command will list all of the serial ports in use

  3. Plug in the FTDI cable to the RPi 5

  4. Run the command python -m serial.tools.list_ports again

  5. The connection address is the name of the new serial port that shows up

Header Board

TODO: Take pictures and complete section

The header board uses the secondary UART on the RPi 5. The file name mapped to the secondary UART port is /dev/ttyAMA0. This is the connection address that is needed for the header board.

Troubleshooting Connection

Incorrect Connection Address

Ensure that the connection address is correct.

Oftentimes there is a typo in the connection string or the incorrect connection address is provided. To ensure the connection address is correct check the string again and read through the documentation on the connection address to verify it is the correct one.

Connection address documentation: Connecting to a Vehicle.

Incorrect Baud Rate

The baud rate is a common unit of measurement of symbol rate, which is one of the components that determine the speed of communication over a data channel.

If the baud rate set in Autonomy software doesn’t match the baud rate of the flight controller’s TELEM port DroneKit-Python will not be able to read the data from the flight controller.

Check the baud rate of the TELEM port and compare it to the baud rate specified in code. Verify that the baud rate matches.

Hardware Issues

Sometimes there are problems with the physical connection, such as the wire connecting the flight controller and the RPi 5. To check for hardware issues try switching the cable with a different cable and see if the issue still exists.

CV Camera

For usage of the CV Camera refer to this document: $200 CV Camera.