Configuring the Flight Controller
Contents
What you will need
A base station computer
An initialized Flight Controller running PX4
ESCs already flashed with Bluejay
A data-capable USB-A-to-USB-C cable and any required adapter
What you will get
A Flight Controller with the Duckiedrone parameters loaded
Configuring the Flight Controller#
In the previous step, the Flight Controller was prepared for configuration by flashing the bootloader and installing PX4. It is now time to access the Flight Controller and configure it for the Duckiedrone DD24-B.
This page describes how to install QGroundControl, connect to the Flight Controller over USB, and configure the vehicle parameters from a Duckietown preset parameters file.
Danger
Before beginning, remove the propellers and disconnect the battery from the PDB.
Installing QGroundControl#
Go to the QGroundControl website and download the installer for the base station operating system (Windows, macOS, or Linux).
Windows: Run the installer and follow the prompts.
macOS: Download the
.dmgfile, open it, and drag the QGroundControl icon into the Applications folder.Linux: Follow the package manager or AppImage instructions provided on the QGroundControl download page.
Once installed, launch QGroundControl.
Connecting to the Flight Controller#
Connect to the Flight Controller over USB:
Connect a data-capable USB-A-to-USB-C cable from the base station to the Flight Controller.
Open QGroundControl on the base station.
QGroundControl automatically detects and connects to the Flight Controller over USB.
Wait a few moments for the top toolbar to show that the vehicle is connected. QGroundControl will then display the summary page.
The Airframe and Sensors sections are red, indicating that they still need to be configured.
Load the preconfigured parameter set#
Open the Parameters tab and load the
.paramsfile:Important
Import exactly this file:
duckiedrone-px4-v4.paramsClick the Parameters tab from the left panel to view the configurable parameters for the vehicle.
In the Parameters screen, click on the Tools menu in the top-right corner.
Select Load from file for review… from the dropdown menu.
Browse to the location of the
.paramsfile on the base station, select it, and click Open.QGroundControl will load and apply the parameters from the file to the vehicle. No errors are reported during this step.
Fig. 63 Load the downloaded parameter file by following these steps.#
Reboot the vehicle#
After loading the parameters, reboot the Flight Controller for changes to take effect.
Select Reboot Vehicle from the Tools menu.
After rebooting, reconnect to the vehicle. QGroundControl then shows a summary page similar to the one below:
Fig. 64 QGroundControl summary page after uploading the Flight Controller parameters, before performing calibrations.#
Enabling vision fusion later
The shipped param file sets EKF2_EV_CTRL = 0 so the EKF does not try to fuse vision before a VIO is online. Once a VIO publishes VISION_POSITION_ESTIMATE / ODOMETRY over MAVLink, raise EKF2_EV_CTRL to 7 (fuse vision position and velocity) or 15 (also fuse vision yaw, recommended on this magless airframe).
Why the Radio page stays red
This is expected. The Duckiedrone has no RC transmitter; the Flight Controller is commanded over MAVLink from the Raspberry Pi, so no radio configuration is needed.
Next step#
On-board calibration is mandatory: the shipped .params file deliberately omits all CAL_* (accelerometer and gyroscope calibration) entries because those are tied to the sensor IDs of a specific board. Calibrate the sensors in Sensor calibration once the Duckiedrone is fully assembled, since the level calibration depends on how the Flight Controller sits in the frame.
Flight Controller tuning#
The Flight Controller stabilizes the Duckiedrone with proportional-integral-derivative (PID) controllers, which use feedback from sensors such as the IMU to follow the commanded attitude and yaw rate. The supplied duckiedrone-px4-v4.params file already contains the tuning for the Duckiedrone DD24-B, so no manual tuning is needed.
Once the Duckiedrone is fully assembled, with its sensors calibrated and its motors configured, it should respond smoothly to roll, pitch, and yaw commands in a test flight, without persistent oscillation or unintended rotation. See Flying the Duckiedrone for the test flight, and Motors and flight if the Duckiedrone oscillates or drifts.
Warning
The Betaflight PID tuning workflow and its recommended values do not apply to the Duckiedrone DD24-B. Do not copy Betaflight-specific PID values onto the PX4 Flight Controller. Betaflight Configurator is used only in Initializing the ESCs, before PX4 is installed.
A validated per-axis PX4 PID-tuning procedure for the Duckiedrone DD24-B is not available yet.
Troubleshooting#
Troubleshooting
SYMPTOM
QGroundControl reports that a parameter failed to load.
RESOLUTION
The duckiedrone-px4-v4.params file loads cleanly in a single pass. A parameter that fails to load means that the Flight Controller runs the wrong firmware build, or that an outdated parameter file was used. Flash the firmware build named in 4. Flash the PX4 firmware, then load duckiedrone-px4-v4.params again.
Troubleshooting
SYMPTOM
The instructions on this page do not work as described.
RESOLUTION
The Duckietown team is happy to help and to hear feedback. Ask a question in the duckietown-sky-help Slack channel. See instructions for joining the Duckietown Slack workspace.