Initializing the ESCs
Contents
What you will need
A base station computer with a Chrome-based browser
Flight Controller
USB to USB-C cable
A charged LiPo battery
What you will get
Four ESCs running the Bluejay firmware
Initializing the ESCs#
The four Electronic Speed Controllers (ESCs) translate the Flight Controller’s commands into the currents that drive the motors. In this section you will flash the Bluejay firmware onto the four ESCs using the esc-configurator.com web tool.
Danger
Remove the propellers and keep them off for the entire procedure.
1. Flash Betaflight onto the Flight Controller#
The ESC tool does not talk to the ESCs directly. It reaches them by passing through the Flight Controller, and for that to work the Flight Controller needs to be running Betaflight (target firmware BTFL 4.3.2). The Duckiedrone’s Flight Controller does not come with Betaflight, so the first thing to do is flash it.
Start by installing Betaflight Configurator v10.9.0 on your base station and opening it.
Next, open the Firmware Flasher tab from the left sidebar and set the options to match your board, as shown below. The Duckiedrone uses the Mamba F405 MK2, so select the MAMBAF405_2022B target and the BTFL 4.3.2 firmware version.
Fig. 54 Firmware Flasher settings for the Mamba F405 MK2 (BTFL 4.3.2)#
Connecting the Flight Controller and loading it into bootloader mode#
Before you can write new firmware, the Flight Controller has to be in bootloader mode (also called DFU mode). When you plug the board in normally it boots straight into its regular firmware and will not accept a flash, so you need to hold it in bootloader mode while it powers up.
You put the board into bootloader mode with the small BOOT button on the Flight Controller. Locate it first:
Fig. 55 BOOT button location on the Mamba F405 MK2 Flight Controller.#
With the board still disconnected, press and hold the BOOT button while you connect the USB-C cable to your base station, and then release the button. The board is now waiting in bootloader mode.
Attention
Do not press the "Connect" button in Betaflight Configurator during flashing. Betaflight talks to the board over the flashing interface, not the normal serial connection.
Loading and flashing the firmware#
Now that the board is in bootloader mode, download the firmware and write it:
Click
Load Firmware [Cloud]in the bottom-right corner. Betaflight Configurator fetches theBTFL 4.3.2firmware for the target you selected and confirms it is ready to flash.Click
Flash Firmware, also in the bottom-right corner, and watch the progress bar as it works through the write.Check
The progress bar moves through
"Flashing…", then"Verifying…", and finally"Programming SUCCESSFUL".
Once the flash finishes, the board reboots on its own into the new firmware, so there is no need to unplug it. You can confirm it worked by clicking "Connect": the top-left of the interface should report BTFL 4.3.2. When you have checked the version, click "Disconnect" so the serial port is free for the ESC tool in the next step.
2. Connect to the ESCs#
Note
Use a Chrome-based browser (Google Chrome, Microsoft Edge, and so on).
Make sure the motors do not have propellers attached.
Disconnect Betaflight (if on), or any other programs that might be using the serial port the flight controller is connected to.
In Chrome, go to the ESC Configurator web tool.
Click
Select Serial Portin the top-right corner. In the prompt that appears, select the serial port whose name containsBetaflight STM32F405. If multiple USB serial devices are connected, unplug the Flight Controller and observe which port disappears, then reconnect it and select the port that reappears.Once the port is identified, select it and click
Connect.
Fig. 56 Serial port selection prompt.#
Verify the message “Unique device ID received” appears (this means your FC can talk to the ESC).
Fig. 57 Verify a Unique device ID has been received.#
Attention
The ESCs cannot draw power from the Flight Controller over USB. You have to connect the LiPo battery for them to power up and accept programming. If this is the first time you are plugging in the battery, be particularly careful to notice if anything is becoming particularly hot, and be ready to unplug the battery if so.
Connect the LiPo battery to the Duckiedrone. Bluejay will detect it:
Fig. 58 Bluejay will detect the battery when plugged in.#
3. Flash Bluejay#
Click
Read Setup. The tool passes through the Flight Controller and reads all four ESCs. Each one comes up as aBLHeli_SESC on layoutJ-H-15.
Fig. 59 The Duckiedrone DD24-B ESCs ship with BLHeli S on JH15 layout.#
In the firmware selection, set:
Firmware:
BluejayVersion:
0.21.0PWM frequency:
48 kHz
Fig. 60 Upgrading the ESC firmware with specific Bluejay parameters.#
Click
Flash Alland wait for all four ESCs to finish.Attention
Do not disconnect the battery or the USB cable while an ESC is being flashed.
When the flashing completes, click
Read Setuponce more and check that all four ESCs now reportBluejay 0.21.0.
Fig. 61 Validate that the correct firmware has been successfully flashed.#
(optional) 4. Disable the beacon#
By default the ESCs give off a beep after a while without commands, which quickly gets annoying. While you are still in the ESC Configurator, turn it off:
In the
Beacon Delaydrop-down menu, selectInfinite.
Fig. 62 Set
Beacon DelaytoInfiniteto disable the beacon sound.#Click
Write Settingsin the bottom-right corner to save.
Your ESCs are now running Bluejay. Next, continue to Initializing the Flight Controller to flash the PX4 firmware.
Troubleshooting#
Troubleshooting
SYMPTOM
The ESC Configurator does not detect any ESCs after Read Setup.
RESOLUTION
The ESCs are not powered. Check that the LiPo battery is connected to the drone, since the Flight Controller’s USB power is not enough to run the ESCs, and then click Read Setup again.
Troubleshooting
SYMPTOM
On Linux, the ESC Configurator cannot open the serial port (Failed to open serial port).
RESOLUTION
This is a serial-port permission issue. Add your user to the dialout group by running sudo usermod -a -G dialout <username> (replacing <username> with your base station username), then reboot for the change to take effect. If that does not help, run sudo chmod 0777 /dev/ttyACM0 (substituting the port you are using) while the tool is open; this has to be repeated each time the Flight Controller is reconnected.
Troubleshooting
SYMPTOM
Other issues.
RESOLUTION
We are happy to support! Please contact our hardware team via email: hardware@duckietown.com