The Basics of Quadcopter Anatomy

. Variations of un-maned vehicles or drones are widely used in diverse fields, including monitoring or manipulation with dangerous substances. One of the best drone construction, which can be used in these fields is an X-copter. This paper serves as an introduction to basics of quadcopter anatomy and advice to choose components based on their properties. In addition, it shown variants of connection between microcontroller and motors for test purpose and an example of programming. This information can be used in education process or for those who want to use a microcontroller Raspberry in their work.


Introduction
Drones in different variations are an inherent part of human life, whether from the perspective of entertainment, monitoring or handling with dangerous substances.Most of the drones are based on specialized devices and controlled by radio [1].There can be a different approach to control drones based on universal microcontrollers itself or in combination with flight controller [1].
Today's microcontroller can manage complex applications, because of their fast performance growth in last year's [2].A wide variety of manufacturers create many types of microcontrollers with diverse processors, performance or voltage logic (for example Arduino have 5V logic and Raspberry have 3V logic) [3].These two types of microcontrollers are the most famous variations [4].Both of them provide high performance, and they can be used in many challenging automation applications.Today's generation of the Raspberry microcontrollers provides enough performance to replace standard PC in some audiovisual application, but more importantly in control applications [5].Beside Arduino, it can offer better user interface, because it uses Linux distribution (Raspbian, Ubuntu).
With the use of the wireless extension, which can be achieved by a simple antenna, the device becomes a complex control station [5].
Section 1 describes a performance of propellers.Section 2 shows a basic functionality of DC motors and helps choose the right one.Section 3 describes electronic speed controllers.In section 4 is an insight into an issue of battery component with advantages and disadvantages of individual types.Section 5 presents flight controllers and its function in a system.In section 6 one can see 3 variants of motor connection to microcontroller Raspberry PI 2B.In addition, section 7 describes an example of programming in language Python for the second variant with one brushless motor.

Standard and contra-rotating propellers
The main purpose of propellers is generating torque and thrust.Thanks to this are possible for quadcopter flying and manoeuvre.Propeller's thrust is measured in grams or pounds and the upward thrust, which is needed to hover the drone, must be equal to drone weight.The thrust depends on the speed of spin and flight dynamics of the quadcopter.
When the propellers accelerate down or up, the torque is generated.It lends ability of the quadcopter to rotate on Z-axis.Propellers of multirotor drones do not rotate in the same direction, because the counter rotation forces must be eliminated.There are two types of propellers.One set of propellers is designed to rotate counter-clockwise and the second set is designed to rotate clockwise.If the value of Rotation per Minutes (RPM) of the group of propellers is changed, the drone can rotate on the Z axis.[2]  Another important attribute is a propeller pitch, which is a theoretical distance that propeller will move through the air for every single rotation of the propeller.In real world can be this value affected by the material of propellers, air density and efficiency.The quadcopter is faster if the pitch value is higher [3].Effect of propeller pitch can be explained in an example of two wood screws.The screw on the right side has a higher pitch, and the screw on the left side has a lower pitch.If both screws will be screwed by a screwdriver, the right screw would sink in the wood more.In drone, the propeller with the higher pitch, need the only half rotation to travel the same distance.Design of propeller must be within a specific range of pitch angles to produce required thrust.Flat propellers will not generate any lift, so they are not appropriate to steeply pitched propellers.

Size
The longer propellers can generate more thrust at the same speed.On the other hand, the torque must be higher.The larger propeller does not mean the higher speed of quadcopter, because speed is determined primarily by the propeller pitch.
A maximal length of propeller depends on a quadcopter frame.In particular by taking the smallest dimension of the frame (length or width) and dividing it by 2. The chosen propeller could be slightly smaller to provide a rotation clearance between propellers.There are two used propellers sizing formats: LxPxB and LLPPxB, where L is length, P represent pitch, and B is number of blades [7].

Number of blades
A number of blades have an effect on the efficiency of propellers and generating of thrust.Two blade propellers are more efficient than three or four-bladed propellers, however, it generates less thrust.

Material
The material has a significant effect on stiffness and durability of the propeller.One of the most uses material is plastic compound, which is flexible and bends in cases of crashes [7].On the other hand, its main disadvantages are vibrations, which can affect the flight performance of your drone.The material has also effect to the weight of propeller, which is important to flight performance.Lighter propellers have less moment of inertia that means the motor needs less torque to achieve the same RPM and its change is faster, that leads to better flight response.The weight also affects a vibration of the propeller which is important to minimize.The optimally balanced propeller has no vibration.

Motors
Brushless DC motors (BLDC) are the most used type of motor in the quadcopter.
BLDC is motor with permanent magnet, which is driven by direct current (DC) electricity.Commutation is controlled electronically, instead of a mechanical commutation system, by permanent magnet rotor and stator with a sequence of coils.[7].
The permanent magnet rotates and the current carrying conductors are fixed.The armature coils are switched by transistors at the correct rotor position in such a way that armature field is in space quadrature with the rotor field poles.Rotary encoders (Hall sensors) are used to sense the position of the rotor and are positioned around the stator.The rotor position feedback from the sensor helps to determine when to switch the armature current [7].
The electronic commutation eliminates the commutator arrangement and brushes in classic DC motors.With this commutation is achieved more reliable and quieter operation.
There is a wide variety of physical configuration, which depends on the stator windings.The windings can be configured as single -phase, two -phase, threephase motors.On the other hand, the most used BLDC motors are three-phase [7].The choosing of motors depends on required thrust to get the quadcopter into the air.This need is affected by quadcopter total weight and frame size.An important value for the motor is the Trust to Weight Ratio (TWR), which can be expressed by equitation: Where T is Trust and W represent Weight.To take the quadcopter off, the TWR must be higher than 1.However, to maintain the steady flight is value equal 1 enough.The flight inclination of quadcopter causes the trust vector has vertical and horizontal components.This inclination needs TWR at least 1.3 for maximum angle (approximately 40 degrees in x, y-axis) [8].
In general, the quadcopter should provide twice as much thrust as the weight of drone.If the thrust provided by motors is small, the flying performance will be poor.If the required value of TWR is 2 and there are 4 motors, the thrust which must each motor provided is equal to half of the weight of quadcopter [7].
Size of BLDC motor is indicated by 4 digit-number (XXYY pattern).Where XX represents the stator width and YY represent the stator weight in millimetres.The taller stator can provide more power at higher RPM.On the other hand, the wider stator can provide more torque at lower RPM [8].The second used value in BLDC motors is a kV motor specification.This number is a number of revolutions per minute that the motor will turn when one volt is applied with no load on the motor.If the propeller is attached to the motor, there will be a reduction in the number of RPMs due to the added inertia of the propeller and air resistance.Motors with higher kV spin propellers faster; however, motors with lower kV generate higher torques.That leads to the combination of low kV motors and larger propellers or high kV motors and smaller propellers [7].
Electric motor efficiency is the ratio between mechanical power output and electrical power input.The mechanical power output is determined by the torque and speed required and the electrical power is determined by the voltage and current supply.The motor efficiency is not constant over the thrust profile.To achieve a higher thrust, the motor must draw a more current.Good combination of a drone motor is high trust with a low current draw.Inefficient motors generate small trust or need too much current.Typical drone motor efficiency has a value of 7.
If the motor reaches a maximum RPM, the maximum thrust of a motor torque and propeller combination is achieved.The torque of the motor determines how quickly the motor can vary the speed of the propeller.Motor torque also affects a flying performance.If the motor torque is low, the quadcopter can have a slow response to commands and its flight can be rigid.It is important to find a good balance between motor RPM and torque, assuming that the drone's motor is matching with a propeller.

Electronic speed controller (ESC)
ESC can change motor speed and direction by manipulating voltage that is applied to it.It also can provide controlled start-up for motors, reversing motor rotation or reverse polarity protection, in case of connection positive to negative contacts, protection against fault circuit faults, and providing other various features, like smooth acceleration curves, setting top speed or limiting currents [9].
The controllers switching connection to the motor connected and disconnected around 2 000 times per second by Pulse Width Modulation (PWM).MOSFET transistor is used as a switch instead of a mechanical switch.The speed of switching is fast and motors cannot detect it.It leads to the motors averages these pulses out.If there is 24V battery connected, only half of the time, the motor sees the battery like 12 V and goes at half speed.The speed of switching also affects the motor inductance, which keeps the motor current flowing constantly.However, that current is only flowing for half the time from the battery, so the battery current will be half the motor current.ESC is frequently used in Radio-controlled models, in particular with BLDC motors, where it provides an electronically produced 3-phase electric power low voltage source.The controller has usually 3 sets of wires.The first wire is connected to the main battery of the drone.The second wire is a typical servo wire which is plugged into the receiver's throttle, and the third wire is used for motor power.

Battery
The most used type of batteries is Lithium Polymer (LiPo), which are used smartphones, laptops or tablets.There are two main alternatives to LiPo batteries, a Nickel Metal Hydride (NiMH) and Nickel Cadmium (NiCd) batteries.However, LiPo batteries some significant advantages over NiMH or NiCd batteries.LiPo batteries have higher capacity, discharge and are they are lighter [7].
There are also some disadvantages like a shorter lifespan (300-400 cycles), the possibility of ignition (if there are punctured and vents into the air), and the needs of extra care for storing, charging or discharging [7].
The nominal voltage of a single LiPo cell is 3,7V.To clarify, the nominal voltage is approximately the average of the full charge of 4.2V/cell, and the minimum safe charge of 3.0 V/cell.The number of cells determines the total voltage of the battery.The voltage of battery pack defines a speed of propeller spin because the BLDC motors have a rating designed in kV, which means RPM per volt.
Capacity of the battery is represented in milliamp hours (mAh).On battery is another value, a C rating.The C rating of a LiPo battery is a measure of the safe and continuous maximum discharge current.If the C rating is lower than drone needs, the battery will not be able to deliver sufficient current to motors.The flight performance will be sluggish if it will be underpowered.

Flight controller
The flight controller is a brain of the drone.It is a circuit board which serves as a basic sensory system that detects the orientation of drone and receives user's commands and controls to the motors.The controller is also some kind of HUB for other peripherals, like an SPC, LED etc.As a flight controller can be used a wide variety of devices from the specialised microcontroller to universal microcontrollers, like a Raspberry or Arduino.Choose of Flight controller depends on required properties.
These controllers have differences in hardware but in most cases, it uses different firmware, which can be configured by computer, smartphone and radio controller itself.
The flight controllers use hardware serial port that allows connecting external devices (telemetry, serial radio receivers, and VTX control) to the controller.This port is known as UART (Universal Asynchronous Receiver/Transmitter) and it's formed from 2 pins (RX for receiving data, and TX for transmitting data) [11].In this project was chosen a microcontroller Raspberry Pi 2B as the flight controller, it allows modification in control software programming.

Variants of connection
Connections between main components of the drone can be realized in some variations.It can be used the Raspberry itself without the support of flight controller unit or with the flight controller unit.
On the picture below one can see variant 1 of connection BLDC motor to the Raspberry Pi.In the connection, the red wire of ESC connection is not connected, because it can damage the Raspberry board.In real project is more effective using of power distribution boards and flight control boards, because the Raspberry can cooperate with standard flight controller.These controllers are equipped with base sensors, like an accelerometer and gyroscope.If the Raspberry is used itself without the support of the flight controller, there must be connected a board, which contain the sensory system.Each motor needs to use different GPIO pins.For simplification can be used a breadboard with Hbridge L293D.The H-bridge is a simple circuit, which contains switching elements.These elements are usually Field-Effect Transistors (FET) transistors.All switches can be turned off or on independently.The main advantage of using L293D with Raspberry (it has 3V logic) is that the control of pins need only a little current to control motors.

Programming
There is a wide variety of programming languages, which can be used for Raspberry Pi programming.The common languages are Python, C++, or C, or C#.
Python has been chosen as the programming language in the project.Python is a higher programming language which does not need to have strictly defined variables, unlike C++.In the deeper context, it is a hybrid dynamically interpreted language from a group of scripting languages.Graphics User Interface (GUI) IDLE, which is well organized, was used to develop the software itself [15].
For access to GPIO pin must be imported one of the GPIO libraries like RPIO,RPi.GPIO, gpiozero, pigpio.There is a simple example for controlling one of the BLDC without ESC.As one can see a pin 1 is used in the forward direction and the pin 2 is used in the backward direction.If both of pins are off, the motor is stopped.The program itself is determined for testing of motors and it is not sufficient to use in the real object.Real control program must be complex and as a motor driver will be used ESC.In this case, the driver was only H-Bridge.

Conclusion
Drones or unmanned vehicles are an important part of human life, whether from the perspective of monitoring or handling with dangerous substances.
The paper offers an insight into the issue of understanding of quadcopter components and its selection for real drone.There are described basic principles of motors function, properties of propellers, ESC or flight controllers.Flight controllers are complex devices, specialized for their task.Their circuit contains sensory system and distributes control signals to each motor.However, there is another way to control drone.The universal microcontroller can be used to control it.It brings advantage to universality.The modular system can be created and modified in different ways according to the task.In this paper is used microcontroller Raspberry Pi 2B, which can provide enough performance to run control system for BLDC motors.It can work in the system itself with the sensory circuit or with the support of complex flight controller.
As the main programming language is used python; however, there is also needing to use gpio pins, so the module rpi.gpio or another must be imported into the program.The submitted syntaxes in programs are the elementary way to control dc motors intend to testing motors.
The next work will be focused on extending the control system on a cell phone as a control device, in particular, by using LTE (Long-Term Evolution) technology.The main difference in LTE system will be in control software (android, ios application).An LTE modem must be added to the entire system.Another further work can be aimed at implementation of this control system into a quadcopter chassis.This work was supported by Internal Grant Agency of Tomas Bata University under the project No. IGA/FAI/2018/002.

Fig 1 .
Fig 1 .Pr op el l er Con st r u ct i on [ 6 ] .

Fig 2 .
Fig 2 .Di st r i b u t i on of Pr op et er s [ 7 ] .

Fig 4 .
Fig 4 .BLDC M ot or Pr i n ci p l e [ 8 ] .

Fig 8 .
Fig 8 .ESC Con st r u ct i on [ 10] .1. Solder pads for the 3-BLDC motor phases 2. Negative (-) LIPO connections 3. Positive (+) LIPO Connection 4. Servo signal or input of the PWM signal 5. GND reference of PWM Signal 6. Solder jumper, for altering the direction of Rotation (CW/CCW) 7. Solder jumper, for varying the type of the PWM input signal 8. State LED