📜 ⬆️ ⬇️

DIY Racing FPV Drone (Part 2) - Tuning

In the first part, I described how to assemble a quadrocopter for FPV flights. Now it's time to set it up. If it is interesting, to my blog 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 a fee for it, 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 the firmware:

#define MINIMOSD
#define CLEANFLIGHT


From the parameters I only displayed the battery voltage, flight time and the selected flight mode.



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 to 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, 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 put the latest version of BLHeli (at the time of build 14.5), turned on Damped Light and put Motor Timing on 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 the instruction 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 .
Due to the open firmware code, it has several branches (forks). The most interesting of these is Betaflight from a person named Boris B. The firmware is developing very dynamically and some of its features come 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 differed in unfriendly default settings. The corrected version 2.8.1 RC1 appeared very quickly, but the experience as a programmer prompted me to wait for the release. I did not lose, because at the same time as the release of version 2.8.1, the Betaflight Configurator 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

Did accelerometer calibration.

Ports tab





Configuration Tab

Actually here, almost all settings are made.





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?”
It is necessary to configure failsafe on the receiver 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. The receivers with S.Bus failsafe are configured differently.
Frsky D4R-II has three behaviors when a signal is lost from a transmitter:

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 this mode has a response delay there, 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. Due to the high speed of flights, it will be safer for others.
The nuance 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 second) by pressing the failsafe button with the transmitter turned off ( video instruction ).
On the Failsafe Betaflight Configuratorʻa tab, I did the following:





PID Tuning Tab

PID setup is a process in which you absolutely should not go "without knowing the ford." First of all, a theoretical understanding of these three components is necessary. Here are some 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:


Modes tab

Hung on the switches, the reinforcement of the engines and the Blackbox (AUX1), the activation of the Horizon flight mode (AUX2) and the inclusion of a tweeter (AUX3).
Separately, I want to say about AIRMODE. Initially, it was a unique “trick” 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 quadcopter to keep the set angle even at the minimum gas. That is why it is not recommended to use AIRMODE together with stabilized modes. 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 of 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, as 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 these are present.



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 infographics on the flight video (like this ). Data is written to an external logger or, if memory allows, to the internal memory of a PC. For example, in Naze32 Acro it is not enough, while in Naze32 Deluxe and SPRacingF3 Acro - it is enough, although 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 the recording “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 diagnostics, such data will already be of little use, and for video - the most. In this tab, I did the following:





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 found 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:

set small_angle = 180 #
set vbat_pid_compensation = ON # PID
save #


Also in Betaflight there is a very useful opportunity 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 quadcopter, then enter 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:

serialpassthrough 1 115200


This completes the flight controller setup.

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. Firstly, “falling out” beyond 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 a light taxi driver, 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 shown here . I have a Turnigy 9XR PRO, where 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 console are borderline for PCs and after they are rounded 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 cotton effect, so for myself I chose the minimum value at which the jerking disappeared.
That's all good flights!

Source: https://habr.com/ru/post/395487/


All Articles