ETI. Microproject PDF
ETI. Microproject PDF
PROXIMITY SENSING
A Project report submitted in partial fulfillment of the requirements for the award of the
Degree of
BACHELOR OF TECHNOLOGY
IN
Submitted by
( Permanently Affiliated to AU, Approved by AICTE and Accredited by NBA & NAAC with ‘A’
Grade)Sangivalasa, Bheemili mandal, Visakhapatnam dist.(A.P)2021-2022.
ACKNOWLEDGEMENT
We would like to express our deep gratitude to our project guide Dr.P.Murugapandiyan, M.E,
Ph.D, Associate Professor, Department of Electronics and Communication Engineering, ANITS,
for his guidance with unsurpassed knowledge and immense encouragement. We are grateful to Dr.
V. Rajya Lakshmi, Head of the Department, Electronics and Communication Engineering, for
providing us with the required facilities for the completion of the project work.
We are very much thankful to the Principal and Management, ANITS, Sangivalasa,
for their encouragement and cooperation to carry out this work.
We express our thanks to all teaching faculty of Department of ECE, whose suggestions during
reviews helped us in accomplishment of our project. We would like to thank all non-teaching staff
of the Department of ECE, ANITS for providing great assistance in accomplishment of our project.
We would like to thank our parents, friends, and classmates for their encouragement throughout our
project period. Finally we thank everyone for supporting us directly or indirectly in completing this
project successfully.
PROJECT STUDENTS
(UGC AUTONOMOUS)
(Permanently Affiliated to AU, Approved by AICTE and Accredited by NBA & NAAC)
Sangivalasa, Bheemili Mandal, Visakhapatnam dist.(A.P)
CERTIFICATE
This is to certify that the project report entitled “LiDAR MICRO DRONE WITH PROXIMITY
SENSING” submitted by Venkata Gowthami Priya Boddu(318126512009), Shyam Deepak
Kammila(318126512049) and Gudisa Pavan(319126512L04) in partial fulfillment of the
requirements for the award of the Degree of Bachelor of Technology in Electronics &
Communication Engineering of Andhra University, Visakhapatnam is a record of bonafide work
carried out under my guidance and supervision.
CONTENTS Pg.no
ABSTRACT 7
List of Chapters: 8
CHAPTER 1: INTRODUCTION
Introduction 10-12
CHAPTER 2: DRONE ASSEMBLING
2.1 Drone components 13-18
Standard Propellers 14
Pusher Propellers 15
Brushless Motors 15
Landing Gear 16
Electronic Speed Controllers 16
Flight Controller 17
The Receiver 17
The Transmitter 17
GPS Module 18
Battery 18
Camera 18
2.2 Components 14-19
Arudino Pro Mini 19
Pin out and pin names 20
voltage 21
Buzzer 22
LED 22
2.3 Principle of Drone 24-30
Vertical Motion 24
Forwards and Sideways 26
Applications of Drones 27
Classification of Drones 28
Multirotor Drones 28
Fixed Wing Drones 29
Single Rotor Drones 30
Hybrid VTOL 30
How to Make a Drone 32-35
CHAPTER 3: DRONE CONTROLLING
Flight Controllers 37 –41
F3 Evo Controller 37
Hobbypower KK2.15 38
DJI NAZA-M V2 38
New Pixhawk PX4 2.4.6 39
LHI Pro Racing F3 Flight Controller 39
Hobby king Race 32 Micro 40
Taulabs Sparky 2.0 Flight Controller 41
Uses Of Flight Controller 41
Sensors in a flight Controller 42-57
The Accelerometer 42
The Gyroscope 43
Inertia Measurement 43
The Barometer 44
The Distance Sensor 44
LiDAR Module 45
Features for good flight control 46
KK 2.1.5 Flight Controller 47
KK 2.1.5 Flight Controller Manual 48
PI Limits 49
Receiver Test 50
Receiver Sliders 51
Mode Settings 51
Stick Scaling 52
Self-Level Settings 53
Mixer Editor 54
Show Motor Layout 55
Load Motor Layout: Transmitter and Receiver of KK2.1.5 Flight Controller 55
ARDUINO Based Drone With MPU 6050 57
CHAPTER 4 : THE CODE
Code 60-61
CONCLUSION 63
FUTURE SCOPE 63
REFERENCES 64-65
ABSTRACT
Drones are now widely used in a variety of industries in the present era of fast-
moving technology. Drones are used for anything from photography and
cinematography to thermal examinations. The expense of drones is the most
significant concern. Drones are often expensive to buy, and there is a significant risk
of harm while flying them, which is why they are still a very uncommon item. Large
drones can produce a lot of noise and require a lot of open space to fly. They can't fly
indoors, in dense forests, or in locations with a lot of trees. The little drone is made
up of four propeller-driven drone motors, an Arduino Pro Mini F3 EVO controller, a
lidar sensor, and a buzzer. Infrared is used by the LiDAR sensor. The LiDAR sensor
detects obstacles in front of it using infrared technology. If an obstacle is detected,
the lidar signal is decoded by the controller, which then activates a buzzer and a light
to signal the proximity of the object. The user is constantly notified to the vicinity of
the drone by altering the led and buzzer frequency in response to the proximity,
allowing the drone to be flown appropriately to avoid collision. To take off and fly,
the little drone has four motors. To achieve desired flying movement, the flight
controller interprets and uses the RC controller commands through the RF receiver.
The drone uses an Arduino Pro micro to sense the vicinity of other objects using
LiDAR and to control the led and buzzer in response. As a result, we have a small,
lightweight micro drone that can take off from anywhere, fly indoors, in forests, or in
gardens, and detect obstacles using LiDAR proximity sensing.
7
List of Figures:
CHAPTER 2 : Drone Assembling
Block diagram of ICMAS
Arudino Pro Mini
Buzzer
LED
Drone Principle
Forces acting on drone
Fixed Wing drone
Single Rotor drone
Hybrid VTOL
Building the Base of the Drone
Drill holes in the frame to support the motor
Mount the motors on the frame
Zip ties to secure the speed controllers to the bottom of the frame.
Secure the battery to the frame.
Attach the flight controller to the drone frame with zip ties and connect it
Connecting Remote to Drone
8
CHAPTER 3 : Drone Controlling
Accelerometer
Inertia Measurement Unit
Distance Sensor
LiDAR Module
Circuit Diagram for KK 2.1.5 Flight Controller
Transmitter for KK 2.1.5 Flight controller
Receiver for KK2.1.5 Flight Controller
Drone with Arduino and MPU 6050
9
CHAPTER 1
INTRODUCTION
10
INTRODUCTION:
Drones are today widely being used in a number of fields. Applications of drones
ranges from filming and videography to thermal inspections. The major issue
associated with drones is the cost. Drones are generally costly purchase and there is a
huge risk of damage while flying drone that is why drones are still not a very
common gadget. Also large drones make a lot of noise and need a lot of clear space
to fly. They cannot be flown indoors or in dense forests or areas with many trees. So
here we build a micro drone with an obstacle detection feature using LIDAR. This
drone helps you understand drone flying as well as how obstacle sensing can be done
using drones. Also its small size and lower cost makes it less risky to fly it in dense
forest of tricky places.
The mini drone consists of 4 drone motors with propellers with Arduino Pro Mini F3
EVO controller and a lidar sensor and buzzer. The lidar sensor uses IR for detecting
any obstacles in front of it. If any obstacle is detected the lidar signal are decoded by
controller to operate a buzzer and led for indication of obstacle proximity alert. The
user is constantly alerted with about the proximity by modifying the led and buzzer
frequency as per proximity so drone can be controlled accordingly to avoid
collision.
The small drone uses 4 motors to lift off and control the flight. The RC controller
11
commands are interpreted and used by flight controller through the rf receiver to
achieve desired flight movement. The drone makes use of a Arduino Pro mini to
sense the proximity using LIDAR and the operate the led and buzzer accordingly.
Thus we get a lightweight micro drone that can take off from anywhere, fly indoors
or in forests or gardens and sense obstacles using LiDAR proximity .
12
CHAPTER 2
DRONE ASSEMBLING
13
A drone, in technological terms, is an unmanned aircraft. Essentially, a drone is a
flying robot that can be remotely controlled or fly autonomously through software-
controlled flight plans in their embedded systems, working in conjunction with
onboard sensors and GPS.
DRONE COMPONENTS:
Standard Propellers:
The propellers are usually located at the front of the drone/quadcopter. There are
very many variations in terms of size and material used in the manufacture of
propellers. Most of them are made of plastic especially for the smaller drones but the
more expensive ones are made of carbon fiber. Propellers are still being developed
and technological research is still ongoing to create more efficient propellers for both
small and big drones. Propellers are responsible for the direction and motion of the
drone. It is therefore important to ensure that each of the propellers is in good
condition before taking your drone out for flight. A faulty propeller means impaired
flight for the drone and hence an accident. You can also carry an extra set of
propellers just in case you notice some damage that was not there before.
14
Pusher Propellers:
Pusher propellers are the ones responsible for the forward and backward thrust of the
drone during flight. As the name suggest, the pusher propellers will determine the
direction the drone takes either forward or backward. They are normally located at
the back of the drone. They work by cancelling out the motor torques of the drone
during stationary flight leading to forward or backward thrust. Just like the standard
propellers, the pusher propellers can also be made of plastic or carbon fiber
depending on the quality. The more expensive ones are usually made of carbon fiber.
There are different sizes depending on the size of the drone. Some drones provide for
pusher prop guards that will help protect your propellers in the event of an unplanned
crash. Always ensure you inspect your pusher propellers before flight as this will
determinethe efficiency Of the flight.
Brushless Motors:
All drones being manufactured lately use the brushless motors that are considered to
be more efficient in terms of performance and operation as opposed to the brushed
motors. The design of the motor is as important as the drone itself. This is because an
efficient motor means you will be able to save on costs of purchase and maintenance
costs. In addition to that, you will also save on battery life which contributes to
longer flight time when flying your drone. Currently, the drone motor design market
is pretty exciting as companies try to outdo each other in coming up with the most
efficient and best developed motors. The latest in the market is the DJI Inspire 1
which was launched recently. This offers more efficient performance and saves on
battery life. It is also relatively quiet and does not produce a lot of unnecessary
noises.
15
Landing Gear:
Some drones come with helicopter-style landing gears that help in landing the drone.
Drones which require high ground clearance during landing will require a modified
landing gear to allow it to land safely on the ground. In addition to that, delivery
drones that carry parcels or items may need to have a spacious landing gear due to
the space required to hold the items as it touches the ground. However, not all drones
require a landing gear. Some smaller drones will work perfectly fine without a
landing gear and will land safely on their bellies once they touch the ground. Most
drones that fly longer and cover longer distances have fixed landing gears. In some
cases, the landing gear may turn out to be an impediment to the 360 degrees view of
the environment especially for a camera drone. Landing gears also increase the safety
of the drone.
16
Flight Controller:
The flight controller is basically the motherboard of the drone. It is responsible for
all the commands that are issued to the drone by the pilot. It interprets input from the
receiver, the GPS Module, the battery monitor and the onboard sensors. The flight
controller is also responsible for the regulation of the motor speeds through the ESC
and for the steering of the drone. Any commands such as triggering of the camera,
controlling the autopilot mode and other autonomous functions are controlled by the
flight controller. Users will most likely not be required to make any alterations to the
flight controller as this may often affect the performance of the drone.
The Receiver:
The receiver is the unit responsible for the reception of the radio signals sent to the
drone through the controller. The minimum number of channels that are needed to
control a drone are usually 4. However, it is recommended that a provision of 5
channels be made available. There are very many different types of receivers in the
market and all of them can be used when making a drone.
The Transmitter:
The transmitter is the unit responsible for the transmission of the radio signals from
the controller to the drone to issue commands of flight and directions. Just like the
receiver, the transmitter needs to have 4 channels for a drone but 5 is usually
recommended. Different types of receivers are available in the market for drone
manufacturers to choose from. The receiver and the transmitter must use a single
radio signal in order to communicate to the drone during flight. Each radio signal has
a standard code that helps in differentiating the signal from other radio signals in the
air.
17
GPS Module:
The GPS module is responsible for the provision of the drone longitude, latitude and
elevation points. It is a very important component of the drone. Without the GPS
module, drones would not be as important as they are today. The modules helps
drone navigate longer distances and capture details of specific locations on land. The
GPS module also help in returning the drone safely “home” even without navigation
using the FPV. In most modern drones, the GPS module helps in returning the drone
safe to the controller in case it loses connection to the controller. This helps in
keeping the drone safe.
Battery:
The battery is the part of the drone that makes all actions and reactions possible.
Without the battery, the drone would have no power and would therefore not be able
to fly. Different drones have different battery requirements. Smaller drones may need
smaller batteries due to the limited power needs. Bigger drones, on the other hand,
may require a bigger battery with a larger capacity to allow it to power all the
functions of the drone. There is a battery monitor on the drone that helps in providing
battery information to the pilot to monitor the performance of the battery.
Camera:
Some drones come with an inbuilt camera while others have a detachable camera.
The camera helps in taking photos and images from above which forms an important
use of drones. There are different camera types and qualities in the market and a
variety to choose from.
These are basically the main component of a drone. If you ever need to make a
drone, you will need to have all of these in order to have a working drone.
18
COMPONENTS USED IN PROJECT:
• Arduino Pro Mini
• F3 EVO Controller
• LIDAR Module
• Buzzer
• LED
• Drone Motors
• Propellers
• Battery
• Buttons & Switches
• Electrical & Wirings
• Drone Body
• Connectors
• Screws and Fittings
19
It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6
analog inputs, an on-board resonator, a reset button, and holes for mounting pin
headers. A six pin header can be connected to an FTDI cable or Sparkfun breakout
board to provide USB power and communication to the board. The Arduino Pro Mini
is intended for semi-permanent installation in objects or exhibitions. The board
comes without pre-mounted headers, allowing the use of various types of connectors
or direct soldering of wires. The pin layout is compatible with the Arduino Mini.
There are two version of the Pro Mini. One runs at 3.3V and 8 MHz, the other at 5V
and 16 MHz. The Arduino Pro Mini was designed and is manufactured by SparkFun
Electronics. Number of pins: 18+2.The Arduino Pro Micro has 18 easily accessible
pins, that's theoretically enough for a board with up to 81 keys (9*9).However, there
are 2 more pins, used by the onboard LEDs, which can be quite easily turned into
usable pins.
Just follow my Pro Micro upgrade guide and solder your wire to the pad of the
removed resistors of the RX/TX LEDs. This way you can wire up a board with up to
100 keys (using the 18+2 pins in a matrix of 10 rows and 10 columns).The additional
pins are B0 and D5 as described in the ATmega16U4/32U4 data sheet .The
Atmega32u4 has even more GPIO pins (26), which could be available by soldering
directly to the microcontroller, but that's not really for beginners.
Voltage:
The Pro Micro has a built-in voltage regulator (it was designed to run on batteries).
There are two variants of the Pro Micro: One which feeds the AVR 3.3V, and one
which is made to feed it 5V - the 5V version being the most common.
If you do feed it with +5.0V from USB, however, there is a penalty - the voltage
regulator will deliver only +4.9V.
The AVR should run well on 4.9V, but you could also bypass the voltage regulator
by bridging J1 with solder.
• RAW = +5V from the USB port (or power IN if you use battery).
• VCC = +4.9V (or 3.3V) from the voltage regulator, or +5V if bypassed.
On 3.3V, the AVR is limited to 8 MHz and the firmware needs to be made for it but
since most firmwares are made for the Teensy 2.0 which runs always on 5V, if you
have the 3.3V of the Pro Micro you should bridge J1 to run that firmware.
21
BUZZER:
This is Small PCB Mountable 5V Passive Buzzer. It is great to add Audio Alert to
your electronic designs. It operates on 5V supply, uses a coil element to generate an
audible tone.A buzzer or beeper is an audio signaling device,which may be
mechanical, electromechanical, or piezoelectric (piezo for short). Typical uses of
buzzers and beepers include alarm devices, timers, and confirmation of user input
such as a mouse click.
LED:
Fig 2.4)LED
A light-emitting diode (LED) is a semiconductor light source that emits light when
current flows through it. Electrons in the semiconductor recombine with electron
holes, releasing energy in the form of photons. The color of the light (corresponding
to the energy of the photons) is determined by the energy required for electrons to
22
cross the band gap of the semiconductor.[5] White light is obtained by using multiple
semiconductors or a layer of light-emitting phosphor on the semiconductor device.
Appearing as practical electronic components in 1962, the earliest LEDs emitted low-
intensity infrared (IR) light.[7] Infrared LEDs are used in remote-control circuits,
such as those used with a wide variety of consumer electronics. The first visible-light
LEDs were of low intensity and limited to red. Early LEDs were often used as
indicator lamps, replacing small incandescent bulbs, and in seven-segment displays.
Recent developments have produced LEDs available in visible, ultraviolet (UV), and
infrared wavelengths, with high, low, or intermediate light output, for instance white
LEDs suitable for room and outdoor area lighting. LEDs have also given rise to new
types of displays and sensors, while their high switching rates are useful in advanced
communications technology with applications as diverse as aviation lighting, fairy
lights, automotive headlamps, advertising, general lighting, traffic signals, camera
flashes, lighted wallpaper, horticultural grow lights, and medical devices.
LEDs have many advantages over incandescent light sources, including lower power
consumption, longer lifetime, improved physical robustness, smaller size, and faster
switching. In exchange for these generally favorable attributes, disadvantages of
LEDs include electrical limitations to low voltage and generally to DC (not AC)
power, inability to provide steady illumination from a pulsing DC or an AC electrical
supply source, and lesser maximum operating temperature and storage temperature.
In contrast to LEDs, incandescent lamps can be made to intrinsically run at virtually
any supply voltage, can utilize either AC or DC current interchangeably, and will
provide steady illumination when powered by AC or pulsing DC even at a frequency
as low as 50 Hz. LEDs usually need electronic support components to function,
while an incandescent bulb can and usually does operate directly from an
unregulated DC or AC power source.
23
PRINCIPLE OF DRONE:
Drones use rotors for propulsion and control. Think of a rotor as a fan, because they
work pretty much the same. Spinning blades push air down.
Of course, all forces come in pairs, which means that as the rotor pushes down on
the air, the air pushes up on the rotor. This is the basic idea behind lift, which comes
down to controlling the upward and downward force. The faster the rotors spin, the
greater the lift, and vice-versa.
Now, a drone can do three things in the vertical plane: hover, climb, or descend.
To hover, the net thrust of the four rotors pushing the drone up must be equal to the
gravitational force pulling it down.
To climb just increase the thrust (speed) of the four rotors so that there is a non-zero
upward force that is greater than the weight. After that, you could decrease the thrust
a little bit—but there are now three forces on the drone: weight, thrust, and air drag.
So, you will still need for the thrusters to be greater than for just a hover.
Descending requires doing the exact opposite: Simply decrease the rotor thrust
(speed) so the net force is downward.
Let's say you have a hovering drone pointed north and you want to rotate it to face
east. How do you accomplish this by changing the power to the four rotors? Before
answering, I will draw a diagram of the rotors (viewed from above) labeled 1 through
24
Fig2.5)Drone Principle
In this configuration, the red rotors are rotating counterclockwise and the green ones
are rotating clockwise. With the two sets of rotors rotating in opposite directions, the
total angular momentum is zero. Angular momentum is a lot like linear momentum,
and you calculate it by multiplying the angular velocity by the moment of inertia. It
is similar to the mass, except it deals with rotation. The angular momentum depends
on how fast the rotors spin.
If there is no torque on the system (the system here being the drone), then the total
angular momentum must remain constant (zero in this case). Just to make things
easier to understand, I will say the red counterclockwise rotors have a positive
angular momentum and the green clockwise rotors have a negative angular
momentum. I'll assign each rotor a value of +2, +2, -2, -2, which adds up to zero
Let's say to rotate the drone to the right. Decrease the angular velocity of rotor 1 such
that now it has an angular momentum of -1 instead of -2. If nothing else happened,
the total angular momentum of the drone would now be +1. Of course, that can't
happen. So the drone rotates clockwise so that the body of the drone has an angular
momentum of 1.Decreasing the spin of rotor 1 did indeed cause the drone to rotate,
25
but it also decreased the thrust from rotor 1. Now the net upward force does not
equal the gravitational force, and the drone descends. Worse, the thrust forces aren't
balanced, so the drone turn downward.
To rotate the drone without creating all those other problems, decrease the spin of
rotor 1 and 3 and increase the spin for rotors 2 and 4. The angular momentum of the
rotors still doesn't add up to zero, so the drone body must rotate. But the total force
remains equal to the gravitational force and the drone continues to hover. Since the
lower thrust rotors are diagonally opposite from each other, the drone can still stay
balanced.
By increasing the rotation rate of rotors 3 and 4 (the rear ones) and decrease the rate
26
of rotors 1 and 2. The total thrust force will remain equal to the weight, so the drone
will stay at the same vertical level. Also, since one of the rear rotors is spinning.
counterclockwise and the other clockwise, the increased rotation of those rotors will
still produce zero angular momentum. The same holds true for the front rotors, and
so the drone does not rotate. However, the greater force in the back of the drone
means it will tilt forward. Now a slight increase in thrust for all rotors will produce a
net thrust force that has a component to balance the weight along with a forward
motion.
APPLICATIONS OF DRONES:
Drones can assist farmers by measuring and recording the height of crops. They use a
remote sensing technology called Lidar that illuminates the crop with a laser and
calculates distance by measuring what is reflected back.
Drones with biological sensors can fly to unsafe areas to take air quality readings and
check for the presence of specific micro-organisms or atmospheric elements.
During wildfires, drones can survey the extent of the affected areas and determine
how quickly the fires are spreading. Images taken can provide details of the damage
in specific areas.Drones are used by television sport networks to capture sporting
event footage, such as taped and live flyover footage, that would otherwise be
difficult to acquire. The use of drones must comply with regulations from the FAA,
the sports leagues, the venue and local law enforcement.
They can also be used in search and rescue, disaster response, asset protection,
wildlife monitoring, firefighting, communications relay, healthcare and agriculture.
Indoor Drones
Animal Repelling
Children’s fun Toys
27
Advantages:
• Small size and Low Cost
• LIDAR based obstacle sensing
• LED and Buzzer indications as per obstacle distance
• Can Takeoff from ones hand/trees or tight places
• Less Noise and very lightweight design
Disadvantages:
• It has a limited battery Lie
• It has a limited operating range
• Doesn’t auto avoid obstacless
CLASSIFICATION OF DRONES:
The best classification of ‘Drones’ can be made on the basis of aerial platforms.
Based on the type of aerial platform used, there are 4 major types of drones.
Multi-rotor drones can be further classified based on the number of rotors on the
platform. They are Tricopter (3 rotors), Quadcopter (4 rotors), Hexacopter (6
rotors) and Octocopter (8 rotors). Out of these, Quadcopters are the most popular
and widely used variant.
alike. They are used for most common applications like aerial photography, aerial
video surveillance etc. Different types of products are available in this segment in the
28
market – say multi-rotor drones for professional uses like aerial photography (whose
price may range from 500USD to 3K USD) and there are lots of variants for hobby
purposes like amateur drone racing, or leisure flying (price range from 50USD to
400USD). Out of all the 4 drone types (based on aerial platform), multi-rotor drones
are the easiest to manufacture and they are the cheapest option available.
29
Single Rotor Drones:
Single rotor drones look very similar in design & structure to actual helicopters.
Unlike a multi rotor drone, a single rotor model has just one big sized rotor plus a
small sized one on the tail of the drone to control its heading. Single rotor drones are
much efficient than multi rotor versions. They have higher flying times and can even
be powered by gas engines. In aerodynamics, the lower the count of rotors the lesser
will be the spin of the object. And that’s the big reason why quadcopters are more
stable than octocopters. In that sense, single rotor drones are much efficient than
multi-rotor drones.
Hybrid VTOL:
These are hybrid versions combining the benefits of Fixed wing models (higher
flying time) with that of rotor based models (hover). This concept has been tested
from around 1960’s without much success. However, with the advent of new
30
generation sensors (gyros and accelerometers), this concept has got some new life
and direction.
Hybrid VTOL’s are a play of automation and manual gliding. A vertical lift is used
to lift the drone up into the air from the ground. Gyros and accelerometers work in
automated mode (autopilot concept) to keep the drone stabilized in the air. Remote
based (or even programmed) manual control is used to guide the drone on the desired
course.
31
HOW TO MAKE A DRONE ?:
32
Fig 2.9.c) Mount the motors on the frame
fig 2.9.d):Zip ties to secure the speed controllers to the bottom of the frame
33
Fig 2.9.e) Secure the battery to the frame.
Fig2.9.f) Attach the flight controller to the drone frame with zip ties and
connect it.
34
Fig 2.9.g)Connecting remote control to Drone
35
CHAPTER 3
DRONE CONTROLLING
36
FLIGHT CONTROLLERS:
The controllers that are used with quadcopters are just as important as the quality and
capabilities as the quadcopters themselves. Without a quality fly controller to a
quadcopter, the entire thing is practically useless. Applications exist for this purpose,
but some applications are simply not as good as the controllers.
F3 EVO Controller:
The F3 Racing EVO flight controller has features that makes it the board of choice
for your next multirotor (drone) racer build. It has been designed to give awesome
flight performance in a stackable race ready package. It has the latest sensors, race
timing and logging technology backed by excellent connectivity options, all this at a
very affordable price. Featuring a race timing transponder system the F3 EVO Pro
has been designed with the serious racer in mind. Analyze your race and flight
telemetry/blackbox logs using the built-in micro SD card socket. The F3 EVO gives
you all the features you need for the heart of your multirotor whether you are an FPV
racer, aerobatic flyer or do aerial photography, it's the perfect choice.
The F3 Racing Evo runs the open-source Cleanflight flight control (FC) software
which has an ever growing community of friendly developers and users. Being open-
source means that you too can contribute to the system. The hardware was designed
by the lead developer of Cleanflight to be more capable than the previous generation
of STM32F1 based boards. The F3 EVO uses a similar layout to the F3 Acro and
Deluxe boards, the stack pins, ESC/Servo outputs and connectors are in the same
location for maximum mounting compatibility with existing products.
37
calculations that gets more done in less time. The gyroscope and accelerometer
sensors are connected to the fast SPI bus, this enables the software to get more data
even quicker to help stabilize your craft even better.
The Hobbypower KK2.15 is a next generation flight controller board that hosts
multi- rotor drone types. All you have to do is install the board into your drone,
select the type of craft that it is, check the propeller direction and motor layout,
calibrate the ESCs and the radio, and you’re good to go.
This specific board has been updated from the first of its line for a more sensitive
6050 MPU system and an additional auto-levelling function .
The DJI Naza M V2 flight controller has revamped the first of its kind and added
more features. It has support that is specifically designed for hexacopters and
octocopters to ensure that a safe landing is possible should an unexpected motor fail
occur.
The upgraded version includes GPS, RTL, and better position holding capabilities
for improved flight performance. The automatic course deviation compensation
reduces any effect of a magnetic disturbance and overall interference in regard to the
compass, as well.
38
NEW PIXHAWK PX4 2.4.6:
Special features: External multi-colored LED, dual full angle LED, NuttX
RTOX real time operation system, automatic and manual mode, Micro SD
Best for: Aerial photography drones
The New Pixhawk PX4 2.4.6 flight controller board has 32 bit chip technology and
integrated sensor technology. This allows for the need of an 8-bit APM or CPU to be
eliminated. It includes an external multi-colored LED and a main controller
efficiency that allows for alternate backup control.
Both automatic and manual modes are available and provide a redundant power
supply failover and input. The Micro SD allows for images and a storage device
overall.
Special features: RGB LED strip support, Autotune, In-Flight PID Tuning,
blackbox flight data logging, OneShot ESC, additional PID controllers
Best for: Racing mini FPV quadcopters
The LHI Pro Racing F3 Flight Controller is perfect for mini quads that are both
made for racing and have FPV capabilities. It allows for easier maintenance with
future developments with the software, features an RGB LED strip support, blackbox
flight data logging, and allows for multiple different flight controllers.
You can use a CC3D, CJMCU, and a Sparky as your choice. It supports more than 8
RC channels, which makes it perfect for racing.
39
HOBBYKING RACE 32 MICRO:
The HobbyKing Race32 Micro is designed to have a critical weight reduction that
is vital where racing drones are concerned. This allows for less weight and faster
speeds as a result.
The ARM-Cortex M4 Core uses a floating point hardware unit that allows for more
efficient loop times and flight calculations that will be twice as fast when compared
to STM2 F1 boards, the previous generation. It also includes an output dedicated for
programmable LEDs, as well.
40
TAULABS SPARKY 2.0 FLIGHT CONTROLLER:
Special features: Can be connected for better connectivity through an RCVR,
Flexi, 12C Auce, Main, or USB, dual analog input for current monitoring and overall
voltage, runs an external magnetometer, OSD, GPS, FrySky Telemetry support for
Sensor Hub and/orS. Port receivers, 3-axis gyro
Best for: High-speed drones, including racing but more for drones that are
generally fast regardless if they are for racing or not. Also good for drones that use
Waypoint, have a more complicated scripting, such as the PicoC coding, and those
that are used mainly for flight logging
41
SENSORS IN A FLIGHT CONTROLLER:
THE ACCELEROMETER:
First and foremost, almost all flight controllers have an accelerometer. This is
essentially a device that measures the linear acceleration of the copter in a 3-axis
system. This sensor gives an output that allows the user to make an idea of the
position of the drone.
Fig 3.1:Accelerometer
The simple fact that an accelerometer is able to detect and respond to gravity means
that it stays stable in the air, ensuring a smooth flight. The correct way to mount an
accelerometer on to a flight controller board is by aligning the linear axis of the
device with the primary axis of the UAV.
42
THE GYROSCOPE:
Just like the accelerometer, the gyroscope is useful for measuring the rate of angular
change. Once again, this can be measured up to 3 axes. However, you need to do
some iteration in order to get the angle. The rotational axis of the sensor should align
with the UAV axis.
As the name suggests, this sensor is basically an electronic compass placed on the
controller board. This is especially required to align the drone’s direction as
compared to the magnetic field of the earth.
43
THE BAROMETER:
A barometer, as we know, is a device for measuring pressure. A pressure sensor on
the drone can give us an accurate value of the height of the device from the sea level.
The most accurate information about the height is given by the combination of the
pressure sensor and the GPS altitude.
Fig3.3:Distance Sensor
A distance sensor can be ultrasonic, laser or LIDAR technology.
44
LiDAR Module:
Fig3.4:Distance Sensor
The TFMini-S Micro LiDAR Module is a ToF (Time of Flight) LiDAR sensor
capable of measuring the distance to an object as close as 10 centimeters (+/- 6cm up
to 6m) and as far as 12 meters (+/-1% starting at 6m)! As with all LiDAR sensors,
your effective detection distance will vary depending on lighting conditions and the
reflectivity of your target object, but what makes this sensor special is its size.
Measuring only 42x15x16mm, the TFMini-S allows you to integrate LiDAR into
applications traditionally reserved for smaller sensors.
TFMini-S is a single-point ranging LiDAR based on TFmini upgrade. The blind zone
is shortened to 10cm, the outdoor performance and accuracy of different reflectivity
are improved, it can achieve stable, accuracy, sensitive and high frequency range
detection.
Lidar uses ultraviolet, visible, or near infrared light to image objects. It can target a
wide range of materials, including non-metallic objects, rocks, rain, chemical
compounds, aerosols, clouds and even single molecules. A narrow laser beam can
map physical features with very high resolutions; for example, an aircraft can map
terrain at 30-centimetre (12 in) resolution or better.
45
A lidar determines the distance of an object or a surface with the formula :
d = c.t/2
where c is speed of light,d is the distance between the detector and the object or
surface being detected, and t is the time spent for the laser light to travel to the object
or surface being detected, then travel back to the detector.
which allows the device to return to its initial position of takeoff even when the
flyer loses control.
Waypoint navigation – this is another exciting feature in a copter. By
virtue of this quality, the device can follow a few points marked out on a map as
part of the flight plan.
GPS – this feature has been gaining a lot of importance lately. It not only
allows the device to maintain its position but also keeps a record of the flying
data for convenience.
46
KK 2.1.5 FLIGHT CONTROLLER:
The KK2.1.5 is next big evolution of the first generation KK flight control boards.
The KK2.1.5 was engineered from the ground up to bring multi-rotor flight to
everyone, not just the experts. The LCD screen and built in software makes install
and setup easier than ever. A host of multi-rotor craft types are pre-installed, simply
select your craft type, check motor layout/propeller direction, calibrate your ESCs
and radio and you’re ready to go! All of which is done with easy to follow on screen
prompts.
The original KK gyro system has been updated to an incredibly sensitive 6050 MPU
system making this the most stable KK board ever and allowing for the addition of
an auto-level function. At the heart of the KK2.1.5 is an Atmel Mega644PA 8-bit
AVR RISC-based microcontroller with 64k of memory. An additional polarity
protected header has been added for voltage detection, so no need for on-board
soldering.
The KK2.1.5 added polarity protection to the voltage sense header and a fuse
protected buzzer outputs, in case something is accidentally plugged in incorrectly.
The voltage sense line has been updated for better accuracy. The board is clearly
labeled and the voltage sense line color has been changed to red for easy
identification, making installation and connections a snap. identification, making
installation and connections a snap.
47
Fig 3.5:KK 2.1.5 Circuit diagram
48
frequency oscillation.
Too low an I gain will result in a less “locked in” feeling. PI gain adjustment process
Go to the "Receiver Test" menu and use the transmitter trims to set the Roll, Pitch
and Yaw values to zero.
PI limits:
The PI limits are the percentage of motor power that can be used to apply the
correction. These should be left at default. For example, a limit of 20 (20% motor
power to apply the correction) will allow 80% of motor power to be used for
49
commanding a change in direction from the receiver.
Receiver Test:
Displays the receiver signal inputs.
Use the transmitter trims to set the Roll, Pitch and Yaw values to zero.
Ensure the Throttle is 0 and says “Idle” at low throttle and at full throttle, it is greater
than 90 and says “Full”. Adjust transmitter throttle trim for low throttle and end point
for high throttle.
Roll, Pitch and Yaw should all read between -100 to -90 and 90 to 100 at maximum
stick travel. Adjust transmitter end points to achieve this. Do not exceed +/-110.
Ensure Roll, Pitch and Yaw stick commands are correctly shown as Left, Right,
Forward, Back. If not, reverse the throws in your transmitter.
Arm Test will normally show “Safe Zone”. At minimum throttle (throttle 0) and full
right yaw, it should display “Arm”. At minimum throttle (throttle 0) and full left
yaw, it should display “Disarm”. Providing there are no ERRORS on the SAFE
screen, your multicopter should arm and disarm.
If “No signal” is displayed, check connection to the receiver. Also ensure your
receiver is working with your transmitter by connecting a servo to a spare receiver
output.
Check the Auxiliary channel input and reverse the channel in your transmitter if
necessary.
Do not use dual rates on your transmitter. Use Stick Scaling instead. This is very
important on the Yaw channel as a low rate on the Yaw will prevent Arming and
Disarming.
If the receiver values appear random, check the following: -o Receiver connection(s).
Mode Settings, Receiver is correct.
If Mode Settings Channel Map is “Yes”, check Receiver Channel Map.
50
Receiver Sliders:
Displays a graphical representation of the receiver signal inputs.
This is useful to see which transmitter channel is mapped to which input, either in
Receiver Channel Map or in your transmitter.
If you have a standard receiver, it will display the 5 inputs.
If you have a CPPM, Satellite or SBus receiver, it will display 7 inputs.
The servo pulse values, on the right hand side, are approximate and should only be
used as a guide.
Mode Settings:
Various settings – First option listed is the default Self-Level
Aux – AUX channel controls the self-levelling function.
Stick – Turn on Self-levelling by holding the aileron to the right when arming or
disarming. Turn it off with left aileron. Note, if you only connect a 4 channel
receiver to the KK2.1.X with Roll, Pitch, Throttle and Yaw then set Self-Level to
Stick.
Link Roll Pitch:
Yes – Changes to the PI Settings for both Roll and Pitch when you make changes.
No – You need to update the Roll and Pitch PI Settings separately.
Auto Disarm:
Yes – will automatically disarm after 20 seconds when armed and throttle is set to
zero. Note, if Lost Model Alarm is set to “Yes” then you can’t switch Auto Disarm
Off.
No – No Auto Disarm and no Lost Model Alarm.
Receiver (if you change the receiver, you need to power cycle the KK2.1.X)
Std – Standard PPM receiver with 4 or 5 (inc Aux) connections to the KK2.1.X
inputs.
CPPM – Combined PPM receiver connection. This is all receiver channels
combined/multiplexed onto one cable that should be connected to input 1 (top input).
51
DSM2 – A DSM2 satellite receiver (not a main DSM2 receiver) connected to input 3
(middle input) via a level changing cable. Note that the receiver needs to be bound to
the KK2.1.X, not a normal receiver. To bind the DSM2 satellite, hold buttons 2&3
down on power up. The satellite will flash rapidly and you should follow your
transmitter/receiver binding process. Beware that some receivers bind and set the
channels to a failsafe position. You may need to rebind after you set the correct
directions using the Receiver Test menu.
DSMX – A DSMX satellite receiver (not a main DSMX receiver) connected to input
3 (middle input) via a level changing cable. Note that the receiver needs to be bound
to the KK2.1.X, not a normal receiver. To bind the DSMX satellite, hold button 3
down on power up. The satellite will flash rapidly and you should follow your
transmitter/receiver binding process. Beware that some receivers bind and set the
channels to a failsafe position. You may need to rebind after you set the correct
directions using the Receiver Test menu.
SBus – An SBus receiver connected to input 3 (middle input) via an inverter cable.
Channel Map
No – With a standard receiver, it is generally assumed that you will not map any
channels.
Yes – Swap channel order using Receiver Channel Map.
Lost Model Alarm
Yes – When the KK2.1.X Auto Disarms, it will sound the buzzer. Note that Auto
Disarm is forced on when “Yes” is selected.
No – Lost Model Alarm disabled. Set to “No” to allow you to set Auto Disarm to
“No”.
Stick Scaling:
These settings enable you to adjust the sensitivity of the transmitter stick. A higher
number gives more sensitive response. It is used in preference to increasing the rates
in your transmitter. The default values are low for beginners that may not appreciate
52
how sensitive the transmitter sticks can be in controlling a multicopter.
If you want to flip and roll, you will need to increase the Roll and Pitch values.
Increase the Yaw value to yaw to your liking.
Throttle is best left at 90. If you increase it too much, full throttle on the transmitter
will run the motors at maximum and leave no headroom for the PI control loop to
adjust the motors to keep it steady.
Self-level Settings:
Self Level Settings are independent from normal PI settings.
P Gain – The power of the self-levelling. Higher number is stronger. Too high will
cause oscillations. To low and it’s slow to self level.
P limit – Limits the max power of self levelling. Higher number is higher limit.
ACC Trim Roll – compensates for self level drift when the KK2.1.X had the ACC
calibrated when it wasn’t exactly level.
ACC Trim Pitch – compensates for self level drift when the KK2.1.X had the ACC
calibrated when it wasn’t exactly level.
It’s better to calibrate the ACC with the KK2.1.X level rather than use the trims.
Make sure the KK2.1.X is mounted level in the multicopter.
Sensor Test
Displays the raw gyroscope and accelerometer sensor values.
Must show "OK" when stationary.
If it says “Not OK” when stationary, the sensor chip is faulty.
Move the KK2.1.X around to see that the numbers change. In this case, it is fine if
the sensors start reading “Not OK”.
ACC Calibration
Calibrates the accelerometers
Set the multicopter level.
Invoke the acc calibration routine.
53
Do not move the multicopter during calibration.
You will not be able to Arm the KK2.1.X until the calibration routing has been
successful.
If the calibration failed and you did not move the multicopter during calibration then
you have a faulty sensor chip
Mixer Editor:
This menu lets you adjust where and how much signal the motors gets from the
sticks and sensors.
This enables you to make any configuration possible, with up to 8 motors or servos.
To change between the output channels 1-8, press CHANGE when the upper right
number is highlighted.
Throttle – Amount of throttle command. Usually 100% if the output channel is
connected to an ESC.
Aileron – Amount of aileron/roll command. Use positive value for motors on the
right side of the roll axis, and negative for the left side of the roll axis. The value is
given by the motor's distance from the roll axis. More is further away.
Elevator – Amount of elevator/pitch command. Use positive value for motors on the
front side of the pitch axis, and negative for the back side of the pitch axis. The value
is given by the motor's distance from the pitch axis. More is further away.
Rudder – Amount of rudder/yaw command. Usually 100%. Use a positive value for a
CW spinning propeller, and negative for a CCW spinning propeller. This is a very
important setting for reversing the servo direction on tricopters. If your tricopter
starts to pirouette on take off, select the channel that the servo is connected to
(usually output 4 or 7) and change the Rudder value from +100 to -100.
Offset – Applies a constant offset to the channel. Keep this zero when it is an ESC
channel, and around 50% when connected to a servo. Fine tune servo position by
adjusting this value.
Type – Set it to the type (servo or ESC) connected to the channel.
54
For ESC: Output PWM rate is always high. Normally outputs zero when disarmed
or throttle is at idle. Applies the "Minimum Throttle" value from the "Misc. Settings
1" sub- menu when armed and throttle is above zero or when Spin on Arm is “Yes”.
For Servo: Output PWM rate can be high or low. Outputs the offset value when
disarmed.
Rate – High rate (400Hz) for ESC or digital servos, or low rate (50Hz) for analogue
servos.
55
Fig 3.6:Transmitter for KK2.1.5 flight controller
56
ARDUINO BASED DRONE WITH MPU 6050: For this, you will need the
following:
Arduino UNO
MPU-6050 Module
Prototype Board
Female and Male Headers
330-ohm Resistor and an LED
Thin Gauge Wires
HC-05 Bluetooth Module
The Bluetooth module is required only if you want to be able to have an insight into
the parameters and tune the quad through an app, as opposed to taking the laptop
with you out on the field when testing.
57
Fig 3.8:Drone with Arduino and MPU6050
58
CHAPTER 4
THE CODE
59
#define sensor A6 // Sharp IR GP2Y0A41SK0F (4-30cm, analog)
#define buzzer 4 // Onboard Buzzer
#define LEDPin 13 // Onboard LED
int distance;
float volts;
long critcal_distance;
long buzzer_distance;
void setup()
{
Serial.begin(9600); // start the serial port
pinMode(LEDPin, OUTPUT);
pinMode (buzzer, OUTPUT);
}
void loop()
{
// 5V
volts = analogRead(sensor)*0.0048828125; // value from sensor * (5/1024)
distance = 13*pow(volts, -1);// worked out from datasheet graph
check_obstacle(); // Run the fucntion
}
void check_obstacle()
{
if (distance <= 30)// If Object distance is less then or equal to 30cm
{
critcal_distance = map(distance, 2, 60, 254, 0);
60
Serial.print("critcal_distance =");
Serial.println(critcal_distance); // Adjust the delay for Buzzer ON/OFF
if (distance > 25 && distance <= 30) {buzzer_distance = 370;}
else if (distance > 20 && distance <= 25){buzzer_distance = 300;}
else if (distance > 15 && distance <= 20) {buzzer_distance = 170;}
else if (distance > 10 && distance <= 15){buzzer_distance = 110;}
else if (distance > 5 && distance <= 10){buzzer_distance = 75;}
else if (distance > 2 && distance <= 5){buzzer_distance = 35; }
digitalWrite(LEDPin, HIGH);
delay(buzzer_distance);
digitalWrite(LEDPin, LOW);
delay(buzzer_distance);
delay(100);
}
else
{
// Buzzer OFF
analogWrite(buzzer, 0);
}
}
61
Fig 4.1:Flying drone
62
CONCLUSION:
Drones can be used to optimize a farm based on a large range of image data about the
condition of crops, fields and livestock as well as applying pesticides
In our project we use drones for real time adaptive monitoring to check the condition
of the crops from time to time with the use of drones. This methodology can provide
good crop yield, decrease farmers burden of checking the crop field daily. It might
also predict beforehand if the crop is going to be damaged. Furthermore, it can
provide security to the agriculture fields from animals as well as from thievery.
FUTURE SCOPE:
The Future Scope of this drone capable of sensing the obstacles can be modified to
drone getting automatically redirected without any manual controlling.
As of now, its small size and lower cost makes it less risky to fly it in dense forest of
tricky places.There can be many applications where the drone with obstacle detection
is needed. One of the applications is, it can provide security to the agriculture fields
from animals as well as from thievery.
63
REFERENCES
64
sensor employing microelectromechanical systems technology," IEEE Transactions
on Industrial Electronics, vol. 45, no. 6, pp. 886-894, December 1998, doi:
10.1109/41.735332.
7. J. Zhao, Y. Li, B. Zhu, W. Deng, and B. Sun, "Method and Applications of Lidar
Modeling for Virtual Testing of Intelligent Vehicles," IEEE Transactions on
Intelligent Transportation Systems, vol. 22, no. 5, May 2021, pp. 2990-3000, doi:
10.1109/TITS.2020.2978438.
65