Initializing the Flight Controller#

What you will need

  • A base station computer

  • Flight Controller

  • USB to micro USB cable

What you will get

  • An up-to-date, initialized Flight Controller

The Flight Controller (FC) implements several low-level behaviors, e.g., stabilizing the Duckiedrone around roll, pitch, and yaw through three different PID controllers. Correctly configuring the Flight Controller is critical for flying safely.

Installing Cleanflight Configurator (CFC)#

Cleanflight Configurator is an app that allows the base station to connect directly to the Flight Controller and access its configuration interface.

Note

Cleanflight Configurator used to be a Chrome App, however Chrome Apps’ support has been dropped from Google so you will use the native app for your OS.

Steps:

  1. Download the correct version of Cleanflight Configurator v2.4.0 for your OS from this link.

  2. Install Cleanflight Configurator on your system

  3. Start Cleanflight Configurator on your base station. You should see the below interface.

    ../_images/CFC_welcome_screen.png

    Fig. 13 Cleanflight Configurator (CFC) welcome screen#

Flashing the correct firmware#

Updating the Flight Controller firmware (Flashing the Flight Controller)#

Flight Controllers might have different versions of firmware (i.e., the software that runs on the Flight Controller microcontroller) out of the factory. Normally, this only needs to be done once initially. Follow this procedure to update your firmware.

Attention

During flashing, do not press the “Connect” button in Cleanflight Configurator.

Our current target firmware is:

Prepare for flashing the Flight Controller firmware#

Attention

Regardless of the firmware version, if it is the first time setting up the Flight Controller, we recommend performing the below flashing procedure once anyways in order to start from a clean state.

Perform the following 2 steps with the Flight Controller disconnected.

  • In the default Welcome page of Cleanflight Configurator, in the left sidebar, please click on the Firmware Flasher tab

    ../_images/cleanflight_flasher.png

    Fig. 14 Firmware Flasher tab in Cleanflight Configurator#

  • Configure the options in the tab as below:

    ../_images/flasher_parameters.png

    Fig. 15 Firmware Flasher parameters to set#

Different Flight Controller versions#

There are currently 2 types of Flight Controller hardware. Use the steps corresponding to your hardware. Videos for both hardware versions are provided later in the document.

Attention

If you have the OSD version of the Flight Controller you need to solder the micro USB adapter before being able to connect to the base station.

Choose in the following tabs which Flight Controller version you have

See also

Identify your flight controller in this chapter.

You will need to solder the pins to the microUSB board and connect it to the Flight Controller.

what you’ll need

  • soldering tools

  • Flight Controller microUSB board

  • 90° header pins

  • 6 pins cable connector (in the Flight Controller bag)

what you’ll get

  • OSD Flight Controller connected to the base station

  1. Solder the 90° pins to the microUSB board as shown

    ../_images/OSD_usb_board.jpg

    Fig. 16 Pins soldered to the microUSB board#

  2. Connect the 6 pins cable that came with the Flight Controller to the microUSB board according to the following table (there’s one unused GND pin on the board).

    USB board pin

    Cable color

    GND

    Black

    5.0V

    Red

    TXD

    Yellow

    RXD

    Green

    DTR

    White

    ../_images/OSD_usb_board_connection.png

    Fig. 17 USB board pinout connection#

    Attention

    Once you verify the connection between the base station and the Flight Controller, it is recommended to hot glue the pins in place.

    ../_images/OSD_usb_hot_glued.png
  3. Connect the white connector of the 6 pins cable to the Flight Controller port shown here.

    ../_images/usb_connector_port_OSD.jpg

    Fig. 18 Connect the white end of the 6 pin cable to this port on the Flight Controller#

The microUSB port is already soldered to your board, you can go on with the tutorial.

Flashing the Flight Controller#

The videos to flash the ACRO version and the OSD version of Flight Controllers are below in this section, in their respective tab.

A summary is provided here.

Most operations are the same with both versions, and any version-wise operations are written in the respective tab.

Attention

Normally, when connected to the base station, the Flight Controller connects in Normal mode.

This can be identified by:

  • Having a red blinking LED on the Flight Controller board

If this is the case during this section, unplug from base station and try to reactivate bootloader mode as detailed below.

To flash the firmware, we need the Flight Controller to be in bootloader mode.

Start by having the Flight Controller disconnected

  1. Identify the "BO" pins on the board

    ../_images/OSD_boot_pins.jpg

    Fig. 19 Location of the boot pins "BO" on the OSD Flight Controller#

  2. Use some conductive metal tool to short the "BO" while connecting the USB cable

  3. Once connected, you can take the pin-shorting material/tool away

    Check

    there is no red blinking LED. There should be no LED on now on the Flight Controller (there is a red LED on the USB board).

  4. The Flight Controller is now in bootloader mode

  1. Identify the "BOOT" button on the Flight Controller

    ../_images/ACRO_boot_button.jpg

    Fig. 20 Location of the boot button "BOOT" on the ACRO Flight Controller#

  2. hold the “BOOT” button while connecting the Flight Controller to base station

  3. Once connected, one could release the boot button

  4. Check there is a solid blue LED, not a red blinking LED.

  5. The Flight Controller is now in bootloader mode

Now that the Flight Controller is in bootloader mode you can flash the correct firmware:

  1. In the Cleanflight Configurator Firmware Flasher tab, click the Load Firmware [Local] button (bottom right), and select the .hex file downloaded at the beginning of this section.

    Check

    The progress bar should look like “Loaded Local Firmware: (… bytes)”

  2. Click the Flash Firmware button (bottom right) and check the progress bar.

    Check

    The progress bar shows: “Flashing…” => “Verifying…” => “Programming SUCCESSFUL”

    Tip

    In case the progress bar turns red, see the Troubleshooting section below

  3. If successful, without needing to reconnect the cable, the Flight Controller should go back to the Normal mode.

    Check

    1. Verify the red blinking LED is back on

    2. Click “Connect” and verify the firmware version is correct as detailed below

Attention

To see the whole process for your version of the Flight Controller choose the correct tab below:

Connecting to the Flight Controller#

  1. Unplug the battery from your drone

    Attention

    Double-check the battery is unplugged

  2. Connect the micro USB cable from your Flight Controller to your base station

  3. Identify the "Connect" button in the top right corner (right now it will be green as the Flight Controller is not connected yet)

    ../_images/CFC_connect_button.png

    Fig. 21 "Connect" button in the top-right corner of Cleanflight Configurator#

  4. Select the correct connection port

    Tip

    Details might vary depending on available connections on your base station.

    The correct port should start with:

    • Linux/macOS

      • /dev/tty.usbserial*

      • /dev/cu.usbserial*

      • /dev/ttyUSB*

    • Windows

      • COM*

  5. Leave the baud rate (number) at the default value of 115200

  6. Press the “Connect” button and a “Setup” page should greet you with a rendering of your drone (see figure below).

../_images/CFC_setup_screen.png

Fig. 22 Cleanflight Configurator "Setup" page#

Attention

Please check below that you have the correct versions of both:

  • Configurator: 2.4.0

  • Firmware: BTFL 3.3.3

Checking the firmware version#

On the top left of the Cleanflight Configurator interface, one could check for the Firmware version. For example, in the figure below, the firmware version of the Flight Controller is BTFL 3.3.3.

../_images/cleanflight_firmware_version.png

Fig. 23 Top left of Cleanflight Configurator, check Cleanflight Configurator version and Flight Controller firmware version here#

Restoring the correct settings#

We will restore the correct settings for the Flight Controller that reflect the setup we have on Duckiedrones (i.e. Flight Controller upside down, ESCs communication protocol, etc.)

The settings for the Flight Controller can be saved and restored through the CLI interface of Cleanflight, which is akin to a shell used to interact with the firmware.

We have created a file with the required setup for you, so you will only need to restore it without having to tweak parameters through the Cleanflight Configurator.

To do this:

  1. Download this .txt configuration file.

  2. Open it in the notepad app of your base station

  3. Copy all content of the file from the notepad by simply clicking on the text and using CTRL + A or CMD + A

  4. Go in the CLI tab of Cleanflight Configurator

    ../_images/fc_cli_tab.png

    Fig. 24 CLI tab#

  5. Paste all the text you previously copied using CTRL + V or CMD + V in the text field at the bottom (the one with the text Write your command here. Press Tab for AutoComplete).

    ../_images/fc_cli_interface.png

    Fig. 25 CLI interface#

  6. Press Enter on your keyboard to execute the commands and wait for the shell to finish (it should take about 30 seconds)

  7. Save the configuration by executing the command save in the CLI.

The Flight Controller will now reboot and reconnect.

Check

In the setup tab check that the drone now results facing up when the side of the Flight Controller with the chips faces downward.

Troubleshooting#

Troubleshooting

SYMPTOM

The OSD version of the Flight Controller does not enter bootloader mode

RESOLUTION

It is tricky to jump the exposed Boot pins. Try applying a bit of force when pressing on the pins. If possible, also try verifying they have actually been jumped with a multi-meter.

Troubleshooting

SYMPTOM

The progress bar turns red and shows "No response from the bootloader, programming:FAILED"

RESOLUTION

It might happen when, on the Firmware Flasher tab, the Flash Firmware button is clicked. This is likely due to the Flight Controller not being in Bootloader mode. Please double check the indicators of that mode in the section above.

Troubleshooting

SYMPTOM

"Flashing..." started, but progress bar turns red with a "Timeout" error

RESOLUTION

It might happen during “Flashing…” or “Verifying…”. Click the Flash Firmware button and try again

Troubleshooting

SYMPTOM

On Linux, Cleanflight Configurator doesn’t connect to the Flight Controller and an error Failed to open serial port appears in the log

RESOLUTION

This is a permission issue to access the serial port of the Flight Controller. First try to run sudo usermod -a -G dialout <USERNAME> , replacing with your base station username; this will add your user to the group that has access to the serial ports. Reboot for the change to take effect.

If this doesn’t work, the quickest solution is to run sudo chmod 0777 /dev/tty* while Cleanflight Configurator is open, where `/dev/tty* is the port you’re using to connect to the Flight Controller.

This second procedure has to be done each time the Flight Controller is reconnected to the base station.

Troubleshooting

SYMPTOM

I’m using Ubuntu 22.04 and Cleanflight Configurator does not open nor install.

RESOLUTION

If that’s the case use Cleanflight Configurator v2.6.0 from here

Troubleshooting

SYMPTOM

I’m using Ubuntu 22.04 and Cleanflight Configurator freezes when flashing the firmware.

RESOLUTION

Proceed with the following workaround:

  1. Open Cleanflight Configurator.

  2. Go in the Firmware Flasher tab.

  3. Select the Flash on connect option.

  4. Load the firmware with Load Firmware [Local] (the screen will freeze, this is expected).

  5. Connect the flight controller. The flashing will start at this point.

Troubleshooting

SYMPTOM

Other issues

RESOLUTION

We’re happy to support! Please contact our hardware team via email: hardware@duckietown.com