How to Make an FPV Race Drone
by shu_engineering in Workshop > Science
1737 Views, 7 Favorites, 0 Comments
How to Make an FPV Race Drone
This project aims to build an FPV race drone with CLRacingF7 Flight Controller and ESC.
Julia Piascik
Supplies
- Carbon Fiber Frame
- 4 sponge pads
- 4 motors
- 16 4 mm screws
- 8 yellow anti-vibration spacers
- 4 long nylon screws
- 4 nylon spacers
- CLRacingF7 ESC
- CLRacingF7 Flight Controller
- Electrical tape or zip ties
- Red wire
- Black wire
- Rubycon 1000uf 35v ZLH Capacitor
- Lumenier Antenna
- Cables for camera, receiver, and VTX transmitter
- Connector grey cover
- XT60 Connector
- TBS Unify Pro 5G8 HV
- FrSky X8R Receiver w/ S-Bus
- RunCam Micro Swift 2
- Taranis Q X7 Radio
- FrSky External Telemetry XJT Module
- Soldering Iron
- BetaFlight
- BLHeliSuite32XM
- Zadig
- Micro USB cable
- 4S 14.8V battery
Base Structure
Put sponge pads on the bottom of the carbon fiber frame. They will protect the drone when landing. Screw on the motors using small screws. Three wires from the motor should align with the frame.
Important: Check that the screws do not touch the motor (if it does, you picked the wrong length of screws.)
Adding the ESC
Attach the four yellow anti-vibration spacers inside the holes (if they’re not fully punched out, feel free to push them out) on the Electronic Speed Controller (ESC).
Use the four long nylon screws packaged with the ESC with four nylon spacers to create a base for the ESC to rest on.
Secure the ESC on this base.
Solder the capacitor on the power pad. This is an electrolytic capacitor, and the white band on one side denotes the negative side. POLARITY IS IMPORTANT! Capacitors wired backward will explode!
Red wire goes to +
Black wire goes to -
This is a thick gauge wire, so put plenty of solder on the pad first. Be careful not to strip too much insulation from the end of the wires. The bare wire should not be bigger than the pad. This wire has very high heat insulation, so it is unnecessary to strip it farther to keep it away from the iron. Solder the power battery leads at a 60-degree angle so they come out around the capacitor.
Using a larger soldering tip helps with larger amounts of solder. Feel free also to crank the iron all the way to the max.
During soldering, heat is not the issue; time is. Do not overheat your capacitor and ESC: do not keep the iron on any pad for ten seconds or so. If the solder doesn’t flow nicely around the pad and the wire by then, try a different one and then return to this one afterward. If you have trouble getting the solder to melt fast enough, try angling the tip of the iron to have as much contact between the side of the tip of the iron and the pad and wire as possible. Try wetting the iron's tip with a little fresh solder to get the heat flowing.
Cut the motor wires long enough to loop around the nylon screw to reach the pads. Each motor wire must be soldered to the three pads closest to that corner. Solder the cables “in order,” so they are not tangled.
Soldering tip: Tin the pads first, solder the wires to the pad, and add solder on top!
The ESC datasheet:
https://cdn.shopify.com/s/files/1/1737/4233/files/CL_ESC_English.pdf?64
Also here.
Adding the XT60 Connector
Feed the connector grey cover on the wires before soldering. No heat shrink is needed when this cover is used properly.
Solder the XT60 connector to the red and black wires. There is a small sign of polarity on the connector. Match the + side to the red wire and the - side to the black wire.
Click the cover on the connector and make sure it is secured.
A multimeter can be used to check for shorts between wires that shouldn't be connected. If the resistance reading shows very low resistance, that indicates the wires are shorted together somewhere when they shouldn't be. Shorts in circuits refer to unintended connections between two points in a circuit that should not be connected. This results in excessive current flow, which can cause overheating, damage, and improper circuit operation.
Connect the Flight controller to the computer using a micro USB cable. If it does not connect automatically, use the following ports:
Windows: Device Manager/Ports
Mac: tty.usbmodem...
Adding the Flight Controller
Connect the Flight Controller (FC) and ESC using the cable in the picture. Watch this VIDEO first. Connect a 4S LIPO battery. You should see red and green LEDs light up. This is a sign that the ESC and FC are alive.
Motor Configuration
Install the latest version of Betaflight Configurator. On Windows: You may need to install the three drivers shown on the Betaflight welcome screen once it runs to see the port below. If you have trouble doing this on a Mac, in Finder, right-click ( using two fingers) and click open.
If there is anything in Betaflight you’d like to know more about, check the official wiki:
https://github.com/betaflight/betaflight/wiki
Open Betaflight and select the identified port. Click “Connect.” You should see a drone simulator on the screen. Move the drone to see if the image also moves. We will see if the motors are spinning in the right direction. Open the motors page. Please pay attention to the displayed rotation on the screen; this is how your motors SHOULD spin. We will turn them on and check if they are spinning correctly.
First, ensure the battery is connected and you see its voltage in the top section next to the disconnect button. Agree to the safety warning, allowing the software to control the motors in the next step. Make sure the motors can spin freely! Slowly move the master control to spin them up at minimum speed. Using individual controls to check the motor's spin is also recommended. You can use your keyboard's up and down arrow keys to decrease the speed to as low as 1005. This way, you can see the motor spin a bit more clearly. Compare the rotation to the drone diagram. Gently touch the side of the motor to feel its direction, don’t press! VIDEO for this step.
Note the numbers of the motors that need to change directions, if any. You will likely have some motors spin in the wrong direction, don’t be alarmed, and don’t look for a pattern!
Install and open BLHeliSuite32XM. Make sure the proper interface is selected: Beta FLight/Cleanflight. Select the drone port and click Connect. If you have trouble connecting, close Betaflight or ensure it is disconnected. Connect the battery to the ESC and click on the check button. You should see the 4 ESCs being populated.
Curious about the colors on the numbers? Info on Oscar Liang’s website says:
ESC #1 should be blue; it means it’s the “master ESC.” If you make a change to the “master ESC” and press the button “Write Setup," the settings will be copied over to the “slave ESC’s.” ESC #2, #3 and #4 should be either green or orange – green means they are the “slave ESC” with the same settings as the master. If they are orange, it means they have different settings. If you don’t have 4 ESCs reported, please stop and try to debug your problem.
Make sure the ESC is powered by the battery.
If it still does not work, you may need to flash the firmware for the ESC board. Please see the How-To for that at the end of this section or check Oscar Liang's guide.
Select the motor you want to reverse by clicking on all the others to deselect them. To verify, let’s ensure that the top part mentions the proper ESC. Let’s reverse the motor! Switch motor direction to “Reversed.” Let’s save it to the ESC by clicking "Write setup" in the lower left corner. You should see a success message.
If not, please check that you completed each step successfully and that the battery is still charged.
Do you want to have fun with some ESC music? Here it is.
HOW - TO
If you have trouble with this utility,
You may need to flash the ESC’s firmware:
(use a Windows PC to do this)
1- Identify your ESC
2- Identify your Arduino Board
3- Find “Digital 2” output and Ground
4- Wire the Arduino to the ESC (Digital 2 pin connects to ESC signal, and ground to ESC
ground)
5- Connect Arduino
6- Download / Install BLHeli
7- Flash Arduino Board - Navigate to the ”Make interfaces” tab in BLHeli. In the far right tab, “Make Arduino Interface Board,” select your Arduino. Select correct com-port, then hit “Make Arduino 4-way Interface”
8- Select Hex file for Arduino - This will vary depending on the board you selected etc., but
for the Mega2560 boards you will select PB2PB3 hex. Flash
9- Connect to ESC - Navigate back to “Atmel ESC” tab. Power your ESC from an external
battery, select correct com-port, and hit connect. Next, hit ”Read Setup”
10- Flash BLHeli - The program will probably ask you if you’d like to flash BLHeli if you
currently have SimonK firmware. If you want to flash BLHeli, hit “yes” when
prompted. Ensure you select your correct ESC in the following menu. When you are
ready, hit “OK” and let the ESC flash
11- Read Setup - Hit “read setup” again to ensure the flashed values loaded. Now setup whatever settings you would like, then click “write setup” to store them to the ESC.
Flight Controller
Let’s connect the video transmitter to the FC.
Be careful not to plug in the video transmitter’s 5V Output to VTX+!
Changing the tip of the soldering iron to be smaller is a good idea so you have more control when soldering.
Transmitter
SmartAudio to TX3
Video to VTXS
GND to VTX-
HV Input to VTX+
Camera
5-36V to CAM+
GND to CAM-
Video to CAMS
OSD to CAMC
Receiver - You can use a jumper wire to connect the male receiver pin to the FC. The - , + , and SBUS_OUT wires should be connected to the bottom right ports. A good diagram for the different ports: https://www.frsky-rc.com/wp-content/uploads/2017/07/Manual/X8R.pdf
+ to 5V
- to GND
S.Port to TX1
SBUS_OUT to RX5
Solder the jumpers indicated in the photo (the wider red rectangle shows which two pads to bridge with solder).
Activating the Video Transreceiver
In BetaFlight, click on “Modes.” If it doesn't connect, make sure BLHeliSuite32XM is closed and disconnected. Then scroll to the USER1 category and click on “Add Range” make it as large as possible (900 - 2100). Click "Save."
Flight Controller Firmware Update
Connect the Flight controller to your computer. Open BetaFlight Configurator. Click on “Firmware Update.” This will take you to the firmware update menu. Select Full Chip Erase. Read carefully all the warnings on this page! Select the proper board type: CLRACINGF7 (CLRA). Now choose the firmware version
(Pick the latest available) Download the firmware by clicking on the “Load Firmware Online” Button. You can track the progress via the bar. When done, it will display “Loaded Online Firmware.” Flash the firmware. As per the warning, ensure you don’t disconnect the drone or allow your computer to sleep.
Congratulations! You have flashed the flight controller.
Zadig (For Windows ONLY)
Download the latest version of Zadig. Once opened, select Options/List All Devices. Then select STM32 BootLoader and install.
BetaFlight Configuration
Port Settings
Hardware I/O resources of the flight controller are listed in the leftmost column, and various ways to use them are listed in the other columns. Change only one column in each row to configure the following:
UART 1 in Telemetry Output select Smartport - Receiver for the radio
UART 3 in Peripherals select VTX (TBS SmartAudio) - Video transmitter
UART 5 Switch on Serial Rx
Configuration Settings
ESC/Motor Features/ESC/Motor Protocol: DSHOT600
Helpful document on ESC protocols and firmware
System Configuration:
Gyro update frequency: 8 kHz
PID loop frequency: 8 kHz
Receiver mode:
Serial based receiver (SPEKSAT, SBUS, SUMD)
Serial receiver provider: SBUS
Telemetry Output ON
AIRMODE ON
OSD ON
ANTI_GRAVITY ON
DYNAMIC_FILTER ON
Taranis Q X7 Setup
Make sure in the bottom right corner outside of the screen ACCST is written. If ACCESS is written, grab a different radio.
For more information on the Taranis, see the manual:
https://drive.google.com/file/d/1zfUWjrmbBZtuef4s27f9s8OVjY4pAwES/view?usp=sharing
Flip over the radio and insert the External XJT module in the back of the radio. Both of the little white switches should be down so that it is in D16 mode. You can look at the manual for more information on the different modes: https://www.frsky-rc.com/wp-content/uploads/2017/07/Manual/XJT.pdf.
Flip the radio back over and turn it on by pressing the power button in the center. Ignore the FailSafe warning (just press a key to dismiss it). Press the menu button (the round button on the left between the PAGE and EXIT buttons) to see the Model selector. Turn the ENT button (rotary selector on the right) to go to an empty model, press ENT, and create a model. Press PAGE to go to page 2/12 of this model. Name your model by using the ENT button and turning the button—press EXIT when finished. Go to page 6/12: MIXER.
There are 4 channels that are currently set:
THR: Throttle (T)
AIL: Ailerons aka roll (R)
ELE: Elevator aka pitch (P)
RUD: Rudder aka yaw (Y)
We will set two more:
Ch5: Arm/Disarm
Ch6: Modes (Angle, horizon, acro)
Ch5: Arm
Enter the name "arm." Source is the switch we will use to arm and disarm the drone. Scroll down to Source on the menu, select using ENT. While it is blinking, flip the SF switch. The source will turn to SF. Press EXIT to save. Press EXIT again to get back to the MIXER to set up Ch6.
Ch6: Mode
Enter the name "ang." Scroll down to Source on the menu, select using ENT. While it is blinking, flip the SA switch. The source will turn to SA. Press EXIT to save. Press EXIT again to return to the MIXER and then to the 2/12 by holding down PAGE to go back a couple of pages.
Binding
First, check your radio. Make sure that it is a Taranis Q X7 ACCST. The name is in the lower right corner of the screen.
Find Mode under “External RF.” It should be XJT D16. If not, select it using ENT and then scroll until you get XJT D16. On the RxNum line, select BND. The radio will either start beeping or show the above image. Select the first option (TELEM ON CH 1 - 8). Your XJT module should also be flashing red with a solid green light.
If you need to update your radio firmware: https://www.youtube.com/watch?v=dJ4dSKjrLxk
Press/hold the F/S button on the receiver WHILE you connect the battery. A red and green light will alternately blink, which means it is ready for binding. Once the FC is on, release the button. Then, click the ENT button on the radio to complete the process. Remove the battery and connect it back. There should be a solid green LED. For a visual tutorial: https://www.youtube.com/watch?v=RH_RuVbF2YU&ab_channel=ProjectBlueFalcon
More BetaFlight Configurations
Mode Settings
For each switch you configure on the Taranis, a range is defined for all but one of the switch’s positions. So for a normal two-position switch, one range is defined. For a 3-way switch, two mutually exclusive ranges are defined. The yellow dot, or tick, below the range line, shows the associated switch’s current position value. User1 is already set.
ARM: This is the CH5 we added to the Taranis model, which will be AUX1. When you flip the arm switch (SF), you will see a yellow tick switching between a high (~2,000) and low (~900) number. We want the range to select only the high number, which is the arm. Move the bars to include this number. In the photo, it is 1825 and 2100.
ANGLE / HORIZON / ACRO: This is the CH6 we added to the Taranis model, which will be AUX2. The default mode is acro. We need to set for angle and horizon. We will use the 3-way switch. By flipping the switch, you will realize the yellow ticks. Make sure the ranges for angle and horizon are selected only as shown in the photo.
BEGINNERS: KEEP IT ON ANGLE MODE ALL THE TIME! (Keep the Taranis’s Flight Mode (SA) switch in the forward position for “Angle” mode)
Video Transmitter Settings
You need to upload VTX tables for frequencies. Here, scroll down to SmartAudio 2.0 (USA) and click the link to copy the JSON code. Go back to Betaflight and click "load from clipboard." Save.
OSD
Click on Font Manager, then upload the default BETAFLIGHT image by clicking the "Upload Font" button.
Receiver
Now that the radio is bound to the receiver go to receiver settings in Betaflight. As you move the radio’s sticks, you can see the associated bars change here in BetaFlight. Test roll, pitch, yaw and throttle. Also aux 1 (arm) and aux 2 (flight mode). If the mapping of the sticks is wrong, change the channel map, which is how roll, pitch, yaw and throttle are interpreted from the radio’s stick movements. TAER1234 worked for this build (each letter in TAER stands for one of the aviation controls: T=throttle, A=ailerons, which control roll, E=elevator, which controls pitch, and rudder, which controls yaw. 1234 are their respective channels: one is forward and back on the left stick, two is side to side on the right stick, three is forward and back on the right stick, and four is side to side on the left stick).
Final Assembly
With the radio receiver and video transmitter working, the drone assembly can now be completed. Put the video transmitter board on the bottom with its antenna hanging out the back of the drone frame. Then the ESC board on top of it. Then the flight controller boarded on top of the ESC. And finally, the receiver board goes on top with its momentary (binding) button facing up, and the antennas go toward the front of the drone and looping through the small holes in the frame so they cannot get sucked into the propellers. Use nylon nuts to bolts to secure the ESC and flight controller boards to the frame (any extra length of the bolts can be trimmed so the frame top will fit on). Before screwing down the frame top, line the receiver’s button up so it is accessible through one of the slots in the top so, in case you need to bind the radio again, you don’t have to take the frame apart to get to the button. Double-check that there are no electrical shorts before powering the drone since it’s easy for contacts to touch when you squeeze everything together, and a short can easily destroy one of the boards.