DIY Racing FPV Drone (Part 2) - Tuning

  • Tutorial
In the first part, I described how to assemble a quadrocopter for FPV flights. Now it's time to set it up. If interested, welcome under cat.

At once I will make a reservation that I absolutely do not claim to be an expert, this is just the third quadcopter that I have assembled. In addition, customization is a very subjective thing. Nevertheless, I hope that the article will be useful to someone and will help save time.
We proceed directly to the setting. First, more simple things, and then - his majesty flight controller.

MinimOSD firmware and configuration

The most popular (but not the only) MinimOSD firmware is MWOSD . First you need to flash her board, and then configure it. If you can configure the OSD via a PC (for more details, see the section on PC configuration), then the firmware requires an FTDI adapter or Arduink. How to do this through the FTDI programmer, and most importantly, where to get old drivers for it, is shown in this video . The main thing is not to forget to uncomment the following lines in Config.h before flashing: From the parameters, I began to display only the battery voltage, flight time and the selected flight mode.

#define MINIMOSD

Firmware and control settings

For the firmware of the regulators, I also have a special USB adapter, but you can do without it by connecting through the PC. Long thought, put Multishot or already proven Oneshot125? On the one hand, on the outdated F330 chip, the speed of the particular difference is not noticeable, on the other hand, the tune from Star Wars when turned on and, as they say on the forums, is a “cleaner signal”. We decided all non-unit complaints that the motors spontaneously begin to rotate at maximum speed when connected to the CLI. As a result, I installed the latest version of BLHeli (at the time of build 14.5), turned on Damped Light and set Motor Timing to Medium. Later calibrated regulators for this instruction .

Flight controller firmware

At this stage, I was stuck the longest, as there were problems with the firmware. It turned out that the first time it is necessary to sew with the closure of boot-contacts (as in this video ). By the way, sometimes it happens that the PC is write-protected and it is impossible to flash a new firmware. Here is a guide on how to fix it.

Perhaps the most popular firmware today, deservedly so, is Cleanflight . After installing it sufficiently, only configure the receiver protocol and the quadcopter can already quite tolerably fly. Use the friendly GUI Cleanflight Configurator to configure .
Thanks to the open firmware code, it has several branches (forks). The most interesting of them is Betaflightfrom the person under the nickname Boris B. The firmware is developing very dynamically and some of its “features” are then transferred to the “parent” Cleanflight (for example, the Airmode flight mode). The downside of Betaflight is that releases are released quite often, and their stability is not always high. By the way, this reason delayed the writing of this article for several weeks. At the time of the completion of the quadcopter assembly, version 2.8.0 was just released, which had a couple of errors and was distinguished by unfriendly default settings. The corrected version 2.8.1 RC1 appeared very quickly, but the experience as a programmer prompted me to wait for a release. I didn’t lose it, because simultaneously with the release of version 2.8.1, the Betaflight Configurator also appeared.. We can say that this is a new stage in the history of this firmware. The fact is that as it evolved, Betaflight moved further and further away from Cleanflight and the configurator of the latter became more and more useless, since most of the settings were still made via the CLI console. By the way, at the time of the preparation of this article, Betaflight version number 2.9.0 has already been released, but due to negative reviews I did not update to it.
Below I will describe in detail how I set up my quadrocopter via the Betaflight Configurator.

PC setup via Betaflight Configurator

Setup Tab

Made accelerometer calibration.

Ports tab

  • In order for OSD to work, I enabled MSP for the UART2 port.
  • Do not turn off MSP for the UART1 port. It is parallelized with USB and disabling data transfer, you are no longer a connector to a PC via a USB connector.

Configuration Tab

Actually here, almost all settings are made.

  • In the “Board and Sensor Alignment” section, I indicated that my PC is rotated 90 degrees along the yaw axis. The correctness of this parameter can then be checked in the Setup tab.
  • In “Reciever Mode” I chose RX_PPM.
  • I chose ONESHOT125 as a protocol of regulators (why not MULTISHOT, I wrote above).
  • Disconnected "Unsynced PWM output", again, because I do not use MULTISHOT.
  • So that the motors always rotated in a fired state, turned off MOTOR_STOP.
  • I turned on the “Disarm motors regardless of throttle value” option, as I will do arm motors on a separate channel.
  • Reduced the value of "Minimum Throttle" to 1030. This is the idling speed, selected subjectively.
  • Enabled the “VBAT” option to activate the battery charge indicator. I did not change the remaining parameters in the “Battery Voltage” section, since the charge readings correspond to reality. If there is an error in them, it can be removed by setting “Voltage Scale”.
  • In “Other Features,” I activated BLACKBOX, SUPEREXPO_RATES, as well as LED_STRIP and turned off AIRMODE. I will tell about it a little lower.

Failsafe tab

C failsafe, everything turned out to be somewhat more complicated than I had seen before. On specialized forums, sometimes there are holivars on the topic “where is it better to set up failsafe: on the receiver or on a PC?” Actually, is this the correct question: “where is it better to set up failsafe: only on the receiver or on the receiver and on the PC?”
Configure failsafe on the receiver is necessary in any case. Here it is necessary to make an important clarification that we are talking about the receiver Frsky D4R-II, working under the PPM protocol. With receivers with S.Bus failsafe is configured differently.
Frsky D4R-II has three behaviors when the signal from the transmitter is lost:
  • transmit to the PC a signal that simulates the preset positions of the sticks and switches (Pre-set Positions mode, it was he who is described in the manual)
  • continue to transmit to the PC the latest data received from the transmitter (Hold Last Position mode)
  • stop transmitting the signal to the PC (No Pulse mode)

By default, the Frsky D4R-II is set to Hold Last Position, which contributes to the distance of the device to distant distances. So if you use failsafe only on the receiver, you need to configure the Pre-set Positions mode. Another thing is that failsafe is activated even with a short signal loss. It will be very unpleasant if the signal is restored in a split second, and the quadcopter has already picked up the motors and falls down. The situation can be improved by the failsafe setting on the PC, since there this mode has a response delay, which serves as a filter against short-term signal losses. In addition, there is a custom script, according to which the quadcopter will behave if failsafe is activated. For example, you can turn on the mode with stabilization and try to sit down more or less gently or even activate RTH if it is. But in practice, such things are in demand on large vehicles with GPS, and on small and fast, experienced pilots are advised not to split hairs and turn off the motors after the loss of the signal. Because of the high speed of flights, it will be safer for others.
The caveat is that if the receiver is set to Pre-set Positions or Hold Last Position, the PC will not even know that a signal loss has occurred. Thus, failsafe on a PC can only be used if the receiver is set to No Pulse. On the Frsky D4R-II, it is set by short-term (less than 1 sec) by pressing the failsafe button while the transmitter is turned off ( video instruction ).
On the Failsafe Betaflight Configuratorʻa tab, I did the following:

  • In the “Channel Fallback Settings” section I set the values ​​of the transmitter switches that will need to be simulated. In my case, only turned on the squeaker on AUX3.
  • Activated Failsafe Stage 2.
  • Established a delay of activation of the failsafe mode 1 sec (value 10 in the item “Guard time for stage 2 activation ...”)
  • Established the time of the motors after activation failsafe 1 sec (the value of 10 in the paragraph Failsafe Throttle Low delay).
  • In the Failsafe Procedure, I chose a scenario with a fall (Drop), rather than an attempt at a smooth landing (Land).

PID Tuning Tab

PID setup is a process in which you absolutely shouldn't go “without knowing the ford”. First of all, a theoretical understanding of these three components is necessary. Here are a few articles that can help with this:

I do not feel ready for such a setup, so I left the default values, the benefit of Betaflight allows you to fly well with them. But I did make two changes:
  • Chose Float in the PID Math section. This is the LuxFloat mode receiver from Cleanflight and it is recommended to install it only for PCs with F3 or F4 processors.
  • Chose MEASUREMENT in the “Derivative method” section. In short, MEASUREMENT is preferable for freestyle, and ERROR for racing.

Modes tab

Hung on the switches reinforcing engines and Blackbox (AUX1), the activation of the flight mode Horizon (AUX2) and the inclusion of tweeters (AUX3).
Separately, I want to say about AIRMODE. Initially, it was a unique “chip” of Betaflight, but at some point it became so popular that Boris B shared it with the authors of Cleanflight and now this mode is available there too.
Despite the fact that AIRMODE is displayed as a separate flight mode, it is rather an additional option than a full mode. It allows the quadrocopter to keep the set angle even at the minimum gas. That is why it is not recommended to use AIRMODE together with modes with stabilization. In addition, landing with AIRMODE is also not an easy process: the quadrocopter starts jumping like a frog. Experienced pilots prefer to simply “drop” a quadrocopter, turning off the motors a couple dozen centimeters above the ground. By the way, if you have the motor stop at zero gas (option MOTOR_STOP in the Configuration tab) and AIRMODE is working at the same time, the motors will not stop, since AIRMODE has a higher priority.
In Betaflight version 2.8.1, a new feature appeared: you can turn on AIRMODE in the background (something like a passive perk in games) and then it is always active and will not be displayed in the Modes tab, or, as before, hang it on or channel. This is done in the "Other Features" tab Configuration.
I didn’t turn on AIRMODE in the background because I’m also using the HORIZON stabilized mode. Thus, I have two flight modes on AUX1: HORIZON (for flights with stabilization and landing) and ACRO + AIRMODE.

LED Strip Tab

I set up my backlight to display warnings, turn / brake indication and blue light when none of this exists.

Blackbox tab

The Blackbox is the quadrocopter's black box. It is needed for diagnostics, more accurate PID settings, and also so that you can overlay the infographic on the flight video (as here). Data is written to an external logger or, if memory allows, to the internal memory of a PC. For example, the Naze32 Acro is not enough, while the Naze32 Deluxe and the SPRacingF3 Acro have enough, though not by much. With the default settings, flight data of 3-4 minutes can be recorded on 2MB of memory, which is very short. The situation is aggravated by the fact that it is impossible to realize writing “in a circle,” as in automobile recorders, because of the low read / write speed of the memory. The only option is to reduce the write speed several times. For the diagnosis of such data will already be of little use, and for the video - the most it. In this tab, I did the following:

  • I chose to write to the internal memory (option “On-board dataflash chip”) in the section “Blackbox logging device”.
  • In the “Portion of flight loop iterations to log” section, I chose 50%, which essentially reduces the recording speed by half.

As I wrote above, the logging is started with the same toggle switch on the equipment as the reinforcement so that the recording starts at the start of the motors. More information about the work and settings of the Blackbox can be read in the manual . Also some useful related links:

CLI tab

CLI is a console through which you can change already more advanced settings, as well as make a backup of all settings. I did the following: Also in Betaflight there is a very useful ability to connect to OSD via PC. Now you can hide this shawl away, without worrying that you may need to connect to it. To connect to the OSD board via a PC, you need to connect the battery to the quadrocopter, then type the serialpassthrough command in the CLI with the necessary parameters, then disconnect (Disconnect) Betaflight from the PC and run MWOSD. I did it the first time. As for the parameters, then for the Micro MinimOSD connected to the UART2 (my case) they are as follows: The configuration of the flight controller is now complete.

set small_angle = 180 # Включить возможность армить моторы даже в перевёрнутом состоянии
set vbat_pid_compensation = ON # Включить компенсацию PID при разрядке батареи
save # Сохранить настройки

serialpassthrough 1 115200

Transmitter Setup

Each pilot adjusts the transmitter (aka “remote”) individually: timers, mixes, voice notifications, and so on. The only thing that is highly desirable to do is to check the minimum, average and maximum values ​​of the control sticks in the configurator. This is done in the Reciever tab. Ideal values ​​are 1000 - 1500 - 2000. In my case, they were 996 - 1508 - 2020, which is not very good. First, the “fallout” outside the range (values ​​less than 1000 and more than 2000) are bad in themselves. Secondly, the central position, which is different from 1500, will be perceived by the PC as an easy taxiing, which it will work on and the quadcopter will constantly be demolished in some direction. In a word, it makes sense to tinker and adjust "as it should."
How to adjust these values ​​on the Taranis transmitter is shownhere . I have a Turnigy 9XR PRO, there it is done at the Limits point. You can also configure through the eePskye program (Limits tab), but this is inconvenient, since the result is not immediately visible in the Betaflight Configurator. Make it necessary for each of the four control channels.
After tuning, the central values ​​approached 1500 as much as possible, but at me they began to “jump” about 5 units in one direction or the other. I do not know what this is connected with, probably, the values ​​of the remote control are borderline for PCs and after they round off this effect is obtained. To solve this problem in Betaflight (and CleanFlight too) there is a special command that sets up filtering of such things.

set deadband = 6

The value can be from 0 to 32 and with its increase the sensitivity of control decreases. Management becomes softer. It should be understood that after a certain threshold, the softness will turn into a cottoniness, so for myself I chose the minimum value at which the jerking disappeared.
That's all good flight!

Also popular now: