Initializing the Flight Controller
Contents
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:
Download the correct version of Cleanflight Configurator v2.4.0 for your OS from this link.
Install Cleanflight Configurator on your system
Start Cleanflight Configurator on your base station. You should see the below interface.
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:
BTFL v3.3.3 (Download the
.hex
file below to your base station) Download BTFL v3.3.3 here
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
tabConfigure the options in the tab as below:
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
Solder the 90° pins to the microUSB board as shown
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
Connect the white connector of the 6 pins cable to the Flight Controller port shown here.
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
Identify the
"BO"
pins on the boardUse some conductive metal tool to short the
"BO"
while connecting the USB cableOnce 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).
The Flight Controller is now in
bootloader mode
Identify the
"BOOT"
button on the Flight Controllerhold the
“BOOT”
button while connecting the Flight Controller to base stationOnce connected, one could release the boot button
Check there is a solid blue LED, not a red blinking LED.
The Flight Controller is now in
bootloader mode
Now that the Flight Controller is in bootloader mode
you can flash the correct firmware:
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)”
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
If successful, without needing to reconnect the cable, the Flight Controller should go back to the
Normal mode
.Check
Verify the red blinking LED is back on
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#
Unplug the battery from your drone
Attention
Double-check the battery is unplugged
Connect the micro USB cable from your Flight Controller to your base station
Identify the
"Connect"
button in the top right corner (right now it will be green as the Flight Controller is not connected yet)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*
Leave the baud rate (number) at the default value of
115200
Press the
“Connect”
button and a“Setup”
page should greet you with a rendering of your drone (see figure below).
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
.
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:
Download this
.txt
configuration file.Open it in the notepad app of your base station
Copy all content of the file from the notepad by simply clicking on the text and using CTRL + A or CMD + A
Go in the
CLI
tab of Cleanflight ConfiguratorPaste 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
).Press
Enter
on your keyboard to execute the commands and wait for the shell to finish (it should take about 30 seconds)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
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:
Open Cleanflight Configurator.
Go in the
Firmware Flasher
tab.Select the
Flash on connect
option.Load the firmware with
Load Firmware [Local]
(the screen will freeze, this is expected).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