A quadcopter drone aircraft lifted device and that propelled by 4 horizontal rotors. In quadcopter drone, each rotor consists of 2 or 3 rotor blades. These types of aircraft defined as multicopters. A Drone's primary function is for videography, cinematography, and photography.
Multicopters have several names that depend on the number of propellers mounted on the craft. for example, a 4 propeller multicopter is called a quad-copter and 6 propeller multicopter is called a hexacopter.
This blog will explain quadcopter drone and 15 tips that show how to build the best quadcopter drone with an HD camera. Hopefully, by the end of the blog, you will be able to fly your own quadcopter drone and capture pictures of your favorite places.
Today, flying vehicles are very popular. Even in their primary configuration, controlled by a radio controller, some flying vehicles can be considered robots that respond to their environment to stay in the air.
Flying robots that have altitude sensors can hover in place. If they have a Global Positioning System (GPS) sensors, they know where they are and can fly to a specific location. As more sensors are added, their capabilities increase.
As you will see in this blog, there are some commonalities between mobile robots and flying robots in terms of their command and control. ROS utilizes these commonalities in the structure of the nodes, topics, messages, and services of these two categories of robots.
The topic cmd_vel, which was used for Turtlesim and TurtleBot earlier in this blog, is again used for the simulated and real quadrotors presented in this blog.
For sensors and devices that are common between mobile robots and flying robots, ROS takes advantage of these commonalities through its standard topic and message interfaces.
Just as with other robots, ROS standard topics and messages communicate information from the onboard sensors about the state of the quadrotor and its environment.
This blog begins by providing an overview of how a quadrotor works to stay in the air. The basic steps of learning to fly a quadrotor are discussed so that you can quickly gain expertise in flying.
Three ROS quadrotors are introduced: one simulated quadrotor, Hector, which exists only in Gazebo, and two real quadrotors, a tiny Crazyflie and the Bebop.
The Hector and Crazyflie quadrotors will be controlled through a common Xbox 360 controller interface. The advanced capabilities for SLAM and autonomous navigation will be explored. References are also given for controlling multiple quadrotors using ROS.
We will cover the following topics in this blog:
How quadrotors fly
The capability of the sensors that are used in quadrotors
Techniques and rules for flying quadrotors
Examples of quadrotors using ROS
Flying the simulated Hector Quadrotor
Flying real quadrotors: Crazyflie and Bebop
Quadrotors, sometimes called quadcopters, are part of a broad category of robots called Unmanned Aerial Vehicles (UAVs) that have four motors and propellers to provide lift for the craft.
In this blog, we will introduce some of these flying robots that are controlled by ROS. The blog will consider both simulations and flying the real thing.
The following figure shows the Crazyflie quadrotor that will be discussed later in this blog:
In the image, notice the four propellers or rotors that act to lift the craft vertically for takeoff and keep it in flight at a certain altitude when flying. First, such crafts are classified as rotorcraft because the lift is generated by the rotors shown in the figure, rather than the wings of an airplane.
Second, they are not helicopters, because the main propeller and the tail rotor control the flight of a helicopter. The tail rotor of a helicopter keeps the craft from rotating itself due to the rotation of the main horizontal propeller.
With a quadrotor, all flight maneuvers are made by varying the speed of one or more propellers. The propellers are called fixed-pitch propellers since their angle with respect to the quadrotor body cannot be changed.
There are more sophisticated quadrotors available with propellers that have a variable pitch, but they will not be considered in this blog. On helicopters, the main propeller is a variable-pitch propeller to control the craft’s direction of flight. For a general discussion of quadrotors, visit Quadcopter - Wikipedia.
Why are quadrotors so popular?
Quadrotors are a popular option for hobbyists and researchers. They have a number of attractive characteristics; primarily:
Relatively low-cost compared to other aerial craft
Not too difficult to fly due to electronic stabilization during flight Depending on the size and type, some quadrotors can be flown indoors as well as outdoors
With the addition of a camera, the quadrotor is excellent for outdoor aerial photography
Defining roll, pitch, and yaw
As in any field of robotics, there is a vocabulary which is important for speaking precisely about the operations and tasks involved. A flying craft is said to have six DOF because the position of the craft can be located in space (x, y, and z coordinates) and in orientation with respect to three axes.
This position is usually defined in terms of the position of a fixed point, usually on the ground, such as the point of takeoff. The figure of the plane here shows how the orientation of the plane is defined in terms of angles around the coordinate axes of the airplane itself. The same definition would apply to the quadrotor:
Roll, pitch, and yaw for an airplane
Pitch is the movement of the nose, up or down in forwarding flight. Roll is rotation around the longitudinal axis that runs along the length of the aircraft. Yaw is the movement of the nose to the left or right, which is rotation about the vertical axis. The amount of rotation is typically stated in degrees.
You can imagine two coordinate systems involved in flight. The fixed system usually defined at a ground point and the system belonging to the flying craft. The relationship between these coordinate systems becomes important for flight maneuvers and when making a flight plan.
The important difference between airplane flight control and quadrotor control is that in an airplane, turns and other maneuvers are controlled by the movement of flight surfaces, such as ailerons to control roll and a rudder to control yaw. Pitch is controlled by the elevator.
For fixed-pitch quadrotors, only the speed of the propellers can be controlled. This control determines the direction and orientation of the quadrotor, as well as the speed over the ground.
Turning an aircraft to change its heading is called banking because this requires the aircraft to roll to achieve an angle of bank. When the plane returns to level flight on a new heading, the plane would have no pitch, roll, or yaw with respect to its own coordinate system during straight and level flight.
A quadrotor craft is different in that it can turn on its own yaw axis without banking. It can even fly backward!
How do quadrotors fly?
The quadrotor has two pairs of counter-rotating propellers. When hovering, the propellers rotate at the same speed and provide lift to keep the craft in the air, overcoming the pull of gravity.
They are counter-rotating to negate the torque that would cause the body of the quadrotor to rotate in the opposite direction if only one propeller turning. Since the propellers cannot change pitch, the lift vector is always in a direction perpendicular to the plane of the rotors. The gravity vector is always perpendicular to the ground.
According to our previous discussion of the airplane flying, we expect to control the pitch, roll, and yaw of the quadrotor to control banking and heading, as well as the forward speed. A throttle control varies the speed of rotation of the propellers.
For example, in level flight, if the rotational speed of the propellers is increased, the craft will rise. Thus, what is often called a throttle on the user’s flight controller is really an altitude control for a hovering quadrotor. In forward or backward motion, the throttle does control speed over the ground.
To move the quadrotor forward, the vehicle must tilt in the forward direction, which causes the front of the craft to pitch down. This is done by increasing the rotational speed of the rear pair of propellers. As shown in the figure, the lift vector now has a component in the forward direction, so the craft moves forward.
Thus, the lift vector overcomes the downward force of gravity and the drag force caused by the air resistance as the quadrotor moves through the air. A component of lift is in the forward direction and causes the craft to fly forward.
However, the lift component opposing gravity is slightly reduced. The amount of lift increase to keep the craft level is determined by the flight control software for the quadrotor:
Quadrotor flying forward
The next figure shows a top view of a quadrotor in flight with the forward propeller 1 rotating clockwise (CW) and propeller 4 rotating counterclockwise (CCW). To achieve forward motion, increasing the speed of motor 2 (rotating CW) and motor 3 (rotating CCW) with respect to motors 1 and 4 will cause the craft to pitch down and fly forward:
If you want to roll the quadrotor, the speed of the propellers on one or other of the lateral sides has to be increased, such as motors 2 and 4.
To yaw the craft, the speed of the two motors across from each other diagonally is decreased, and the other two motors are speeded up. This imparts angular torque to the aircraft, which makes it turn. An example of this would be to increase the speed of motors 3 and 4.
If you own a quadrotor, notice the pitch (tilt) of the propeller blades on the propellers that rotate CW and those that rotate CCW. The upward tilt of the blades causes lift by the propeller rotating, with the upward edge cutting into the air.
Unfortunately, determining and setting the rotational speeds of the four propellers for such control in flight is quite difficult. Fortunately, in practice, the calculations for the speed of the propellers are carried out by a microcontroller and the appropriate software when commands are given to maneuver the quadrotor.
The results of the calculations by the microcontroller are output to an electronic motor control unit, which adjusts the speed of the individual propellers.
The algorithm that converts commands from the ground-based control device to the motor controller is typically a PID controller. For those interested in the math, the following website explains PID for quadrotors: Quadcopter PID Explained - Oscar Liang.
In manual flight, the operator commands various maneuvers, such as takeoff, forward flight, and landing using a flight-control unit with joystick-like controls. Many quadrotors also allow control by smartphones, tablets such as iPads, and similar devices.
The software interfaces for many quadrotors are provided by the manufacturer and are unique to that quadrotor. We have chosen quadrotors that can be controlled by ROS to illustrate the use of ROS in flying them.
The basic control of the quadrotor from the ground is to command its altitude by causing it to rise or descend and control its direction and attitude. The attitude of a flying craft represents its pitch and roll or bank with respect to the Earth’s horizon.
The electronic motor control unit of the craft makes the necessary changes or corrections to the speed of the propellers to achieve the result commanded.
Components of a quadrotor
The main components for the flight of a quadrotor craft are the frame, or body, the motors, and the propellers. The body holds onboard flight and motor control circuitry, communications circuitry, and a battery. In flight, the quadrotor reports its condition and other flight information to the ground-based control device using telemetry.
For the quadrotor, telemetry is the wireless transmission of various parameters, such as the battery condition and the position and orientation of the craft. On the craft, there is a set of measuring units called sensors that measure the parameters that are encoded and transmitted to the ground-based control device.
A quadcopter drone is an aerial vehicle that consists of mechanical and electrical components including the frame, motors, and other electronic parts. It usually consists of the following parts:
Electronic speed controllers (ESC)
Battery and a power distribution board (PDB)
Flight controller (FC)
Almost all quadcopter drones are unmanned aerial vehicles (UAV) or drones. This means that the craft is controlled by a pilot on the ground or in another vehicle. Remotely piloted aircraft (RPA) is another definition that can be used.
However, we can separate UAVs into three categories according to the level of artificial intelligence (AI) their craft flight controller has.
Fully remote-controlled vehicles (fully RCV)
This category of craft is fully controlled by a pilot using a ground station. Crafts of this type are preferred by hobbyists.
Hybrid remote-controlled vehicles (hybrid RCV)
It is possible to increase the level of intelligence of a UAV so that it will neither be a fully autonomous vehicle, nor a fully remote controlled one.
The pilot uses a remote control device to communicate between the quadcopter drone and the ground station but now the pilot does not fly the craft as if it's an RCV, the only thing that is required now is to set the points that it should pass (navigation points).
Autonomous flying vehicles
This category of craft has no pilot. All we need to do is connect the battery to the electronic system and let it fly. Quadcopter drones have numerous sensors, such as GPS, accelerometers, cameras, and many more.
Every second, the controller gathers data from all the sensors and after calculations, it autonomously decides how and where it should go according to the mission plan. These are extremely difficult to build, which is the reason why we prefer hybrid RCVs if we need a craft with autonomous functions.
Different frame shapes
Usually, any inexperienced hobbyist who is willing to build a quadcopter drone chooses the X shape, with four motors mounted at the ends. There are plenty of shapes and materials that can be used for this construction.
Each has its own advantages and drawbacks, as it will be explained later on in the subsequent blogs. The X shape is the most common and the first attempt at almost everyone. However, a quadcopter drone can also be created in a Plus or H shape, as shown in the following figure:
Adding more than four motors will result in a different build that might also work. Vehicles like these are defined as hexacopters or octocopters depending on the number of motors used. It should be clear that we can only add two motors at a time; adding only one will not work due to the laws of physics, as will be explained later.
A quadcopter drone consists of four motors. Each motor produces thrust and torque. The quadcopter drone can hover and stay steady over the ground when all four motors have the same torque and the total thrust of the craft is equal to or greater than m*g, where m is the mass of the craft and g is the gravity constant. Motors one and four spin clockwise
Motors two and three, on the other hand, spin counter-clockwise. Since every motor produces torque, motor one cancels out the torque produced by motor four and motor two cancels out the torque produced by motor three.
Let's have a look at the quadcopter drone's maneuvers. Assuming that CM is the center of the craft mass; in order to implement a forward movement, all that is needed is to lower the angular velocity of motor one and two.
As a result, there will be less thrust produced in the front than the rear resulting in the quadcopter drone moving forward.
Similarly, we can lower the angular velocity of motors one and three or three and four and have either left or right movement. Lastly, there is one more maneuver that a quadcopter drone can do.
In order to have yaw rotation, we need to lower the speed of any of the two opposite motors. Actually, doing this will increase or decrease the total left or right torque. This creates an imbalance in the torque between the motors; thus, causing the quadcopter drone to have yaw rotation.
The world is in need of something fast, light, and reliable. This technology is already developed but it is not yet reliable. Therefore, it is too early to use quadcopter drones in our everyday life. However, they can be used in several other ways.
Quadcopter drones are quite interesting. They are used as a research platform for individual researchers and university research groups, to test and evaluate new ideas in a number of different fields, including flight control theory, navigation, real-time systems, robotics, and so on.
Researchers usually build, modify, or observe their maneuvers to develop more stable and promising future crafts. Being a researcher for a system like this requires a very good knowledge of the dynamics and mechanics of aerial vehicles.
Furthermore, test flights cannot be done in real time. Simulation software is an important tool so that researchers can test their algorithms and theories. Anything that passes the simulation stage will be tested in the simulation indoor lab where safety is a number one priority.
Swarms of quadcopter drones can hover information autonomously, perform flying routines, such as flips, dart through hula hoops and organize themselves to fly through windows as a group.
They are relatively cheap, available in a variety of sizes, and their simple mechanical design means that they can be built and maintained by amateurs.
As they are so maneuverable, quadcopter drones can be useful in all kinds of situations and environments. Quadcopter drones capable of autonomous flight can help remove the need for people to put themselves in a number of dangerous positions. This is a prime reason why the research interest has been increasing over the years.
For example, a mountain climber can deploy a quadcopter drone autonomously and check whether he should be more careful or not while climbing. Another idea is to deploy a quadcopter drone in a house to check whether there are human survivors or not in case of a disaster. Autonomous operations are extremely useful in situations such as earthquakes, fires, and so on.
There are several engineering research laboratories that are currently developing more advanced control techniques and applications for quadcopter drones.
These include mainly MIT's Aerospace Controls Lab, ETH's Flying Machine Arena, and University of Pennsylvania's General Robotics, Automation, Sensing and Perception (GRASP) Lab.
By the end of 2014, quadcopter drones were released in the market for the general public. As a result, crafts like quadcopter drones are now used to capture images and videos of areas that are rough or dangerous for humans.
There are many off-the-shelf quadcopter drones that can follow a transmitter bracelet, which can be worn on the arm.
There are quadcopter drones that can follow subjects without bracelets, using image recognition systems such as OpenCV. The most common commercial quadcopter drone is one of the copters, and is named phantom from DJI and has already made hundreds of thousands of dollars in sales all over the world:
Military and law enforcement
Since UAVs are great for surveillance, quadcopter drones are now used by military and law enforcement agencies to search, spy, or even rescue teams in missions. There are projects that are being run by militaries for autonomous indoor 3D scanning.
Quadcopter drones can also save lives! After an earthquake or the collapse of a building, which might cause significant destruction, the response time to search and locate trapped survivors is crucial.
Mini and fast quadcopter drones equipped with cameras can fly among the debris in a safe, cheap, and effective way and locate survivors quickly.
Another scenario worth looking at is people drowning in a sea or lake. Every year, the percentage of accidents is almost the same but now quadcopter drones can change that. There is already an idea of a quadcopter drone equipped with three buoys and able to release them over three possible targets.
The quadcopter drones will be fully remote controlled by a pilot that overviews the whole mission. So, in each mission, a quadcopter drone will be able to increase the probability of a rescue.
Lastly, quadcopter drones are excellent aerial vehicles for transportation of low weight cargo. They can be deployed easily in rough areas or big cities. There is a huge need for a speedy vital organ transportation system in various areas, particularly in Africa where the cost of transportation by road is high and extremely difficult.
Comparison with other aerial vehicles
There are various other aerial vehicles that can be used. Humans have successfully made helicopters and airplanes for transportation, surveillance, and even war. Can Quadcopter drones be used for such causes? Are there any other benefits? Obviously, each vehicle has its own advantages and disadvantages.
Difference between quadcopter drones and Airplanes
Quadcopter drones and almost every other multicopter craft uses its motors and propellers to produce the necessary thrust needed for the lift, whereas airplanes use motors to produce speed.
The lift is achieved by the aerodynamic model of the plane and its wings. So the asset of a quadcopter drone is the stability that it offers; thus providing a great opportunity to capture photos and videos.
On the other hand, airplanes are much faster because of their aerodynamic design and as a result, they need less power than helicopters and quadcopter drones, where all the lift is produced by the motors.
Difference between quadcopter drones and helicopters
The main difference between a quadcopter drone and a helicopter is the number of blades used for the lift. A helicopter's mechanism is extremely difficult to build and work properly, whereas quadcopter drones are pretty simple.
A helicopter produces all the lift needed, which is equal to its weight, with only one blade. As a result, the total mechanism is quite complex.
On the other hand, the stability in a quadcopter drone comes from four motors with their blades and it's quite simple to understand and create. Thus, the mechanism is quite simple. When a blade is spinning, there are two things that happen. First of all, there is a thrust, which lifts the craft.
Secondly, every motor creates torque, which is why a craft with only one blade would spin around itself. In a helicopter, a rear blade is used to prevent the craft from spinning around itself.
On the other hand, in a quadcopter drone, all the lift is produced by the sum of each motor's lift, which must be equal to the quadcopter drone's weight. But, instead of a rear motor to prevent the craft from spinning around, each motor eliminates the torque that the opposite motor produces. As a result, the quadcopter drone hovers steadily without spinning around itself.
In this blog, we will go through almost every crucial component needed for the build. All the parts will be explained and information about the usage of each one will be given. Furthermore, you will be able to find some simple instructions and a list of specifications that you should be aware of when buying a component.
Thus, you will know how to choose your component based on your requirements. Hopefully, by the end of the blog you will be able to estimate the cost of your build and have a total overview.
This is extremely important when building a craft because you always need to be aware of the final purpose. You always need to know and have an abstract picture of the parts you need and how they will be connected.
Radio transmitter and receiver (TX/RX)
It is important to have an overview of the connections between the battery, motors, and the ESCs. The following figure will make this clear:
Motors and propellers
A propeller is mounted on the shaft of the corresponding motor. The total number of motors that are needed depends on the build. For example, quadcopter drones use four motors, hexacopters use six, octocopters use eight, and so on.
Nowadays, brushless outrunner motors are the most common type of motors used; they have minimal friction. A cylindrical shell of magnets rotates on precision bearings around a core of tightly and neatly coiled wire. The propeller is mounted at the top and is rotating at the same angular velocity as the motor.
As a result, thrust is produced and the quadcopter drone lifts from the ground. Every motor requires reasonable maintenance; dirt should be kept out of the motor so that it can spin easily.
Common motor specifications
For every motor, there is a specification manual either provided by the manufacturer or the seller. The following is a list of specifications that almost every motor has:
Max current (A)
Max voltage (V)
An example of the specifications that can be found when choosing a motor is shown in the following table. These specifications were on the same webpage where the motor was bought from.
Furthermore, motors typically specify a recommended battery cell count, for example, 3S, 4S, or even 5S. It is important to buy recommended parts if you are not an expert:
3S (LIPO) 1045(PROP)
Max thrust 850G
ESC recommended 18A
It is important to be aware of each of the following specifications:
The KV value indicates how many RPMs (revolutions per minute) the motor will make when provided with V number of volts. Note that increasing the KV does not mean that your quadcopter drone will fly better or that it will be more stable.
There are many important factors that we should be aware of. For example, more KV means more thrust. As a result, the motors will consume more battery and the flight time will decrease.
The weight value indicates the weight of the motor. Note that we have four motors in our build, so we have to sum up four times the weight of each motor.
The only time when you should worry about the length, shaft, or diameter is when you build your own frame and you have to drill some holes.
Lastly, the current and voltage will have an effect on the electronic speed controller (ESC), which will be mentioned later. For now, just keep in mind that we have to choose the appropriate ESC according to the current and voltage.
The first thing that we should ask ourselves is about the total weight that we are expecting to lift with our quadcopter drone. At first, it is difficult to calculate the weight as we have no idea how much it will be; so we usually choose all the parts apart from the motor and estimate a possible total weight.
Since the weight factor must be eliminated by the total thrust the quadcopter drone produces, it is important to choose a motor that has the desired thrust. Generally, motors should provide a thrust that is two times the weight. This ensures that the quadcopter drone has the best balance over those factors.
Note that it is important to keep the balance. In other words, if the weight is too little or too much, compared to the thrust, the quadcopter drone will either have extreme sensitivity to all its maneuvers or it will not lift at all, respectively.
Motors that fit your needs can be found in the market. However, it is necessary to keep in mind that more weight, even if your motor can eliminate it, means reduced flight time. After all, it's all about the stability and flight time.
Choosing an appropriate propeller
A quadcopter drone uses two clockwise and two counterclockwise propellers. They are usually classified by their length and pitch. For example, 10×4.5 propellers are 10 inches long and have a pitch of 4.5. There are two factors that characterize a propeller, dimension, and material.
Choosing the right dimension
When choosing a propeller dimension, you need to find a good balance between the length and pitch. For quadcopter drones that do acrobatics or fly in races, we need acceleration and this means that we need torque.
So, you will need propellers with a small pitch and high KV motors; so that you have more RPMs and higher torque. As a result, your quadcopter drone will have more acceleration and eventually will be faster.
On the other hand, for larger quadcopter drones that carry payloads such as a camera, large propellers and low KV motors tend to be the best choice. These have rotational momentum and easily maintain your aircraft's stability.
Choosing the right material
There are different types of propellers, such as plastic, carbon fiber, and more. Plastic propellers are cheaper and more flexible. This means that there will be more blade flapping, which will make your quadcopter drone more unsteady; this is something that we don't want. However, in the worst case scenario, if you have an accident with that propeller, you will not have a serious injury.
Also, when plastic hits an object it may not get damaged. On the other hand, carbon fiber propellers have less blade flapping because they are harder. If a spinning carbon fiber propeller touches your skin, it will be a serious injury, so you may have to protect your propellers somehow.
It's important to mention that blade flapping reduces flight time and craft stability. So, for your overall craft build, it's better to buy carbon fiber propellers and keep a safe distance from any person that may be near it.
Gathering more information
It is a good practice to ask questions in Faceblog groups or forums. There are many people who have different builds of quadcopter drones and the information about the motor and propeller used may be valuable.
Furthermore, when buying from eBay or other sites, there are offers along with the motor the recommended you the propellers. Usually, there will be a diagram that explains how much thrust the motor will have as an output when a specific propeller is mounted.
Electronic speed controllers
The electronic speed controller or ESC uses a PWM signal coming from the flight controller to create an average voltage/current to control the speed of the motor. There are three sets of wires; one set goes to the batteries, one set goes to the flight controller, and one set goes to the motors.
It consists of three wires, which we usually define as servo wires, two of which of are marked as Vin (small red) and Ground (small black). The third one is the PWM signal (white) from the flight controller.
The stronger the signal, the more the current through the ESC. It is also connected to the battery via a T connector using a positive and a negative wire. Furthermore, the ESCs output is through the three wires that are all connected to the motor (blue), as shown in the following image.
Lastly, there is another input coming in from the battery. Each ESC has to be connected through a power distribution system to the battery. As shown in the following image, the two left wires (red and black) must be connected to the battery to power up the ESC and the motor.
To sum up, ESCs have an input of 12V (depending on the battery used) and they have wires that go to the motor giving an input to the motors from 1V to 12V.
As mentioned earlier, we need to have two clockwise and two counterclockwise motors. Therefore, by swapping any two of the three wires that connect the motor and the ESC, we can invert the rotation. This is a pre-flight check and will be described in Blog 5, Electronics Installation. For now, connecting the wires in any combination will be fine.
Choosing the appropriate ESC
Many motors have a recommended ESC. The specification that changes in different ESCs is Ampere. When we covered motors in the Common motor specifications section, there was a table that had a recommended ESC of 18A. So according to that motor, the ESC that we buy should be at most 18A.
Battery and charger
Batteries usually last for 10 to 20 minutes. By the end of a flight, you will have to recharge your battery to prepare your quadcopter drone for another flight.
There are various batteries and chargers out there and almost all of them will work. However, when building a quadcopter drone for aerial photography, we will not just hover over the ground so we need something lightweight.
Choosing a battery
A battery can be described by the following factors:
Milliampere hours (mAh)
Number of cells
The following image shows a suitable battery
Most DIY quadcopter drones have a 12.1V battery with 500 to 5000mAh. The total flight time depends on the mAh that your battery has but keep in mind that the higher the mAh the more weight on your quadcopter drone. So it's crucial to have a good balance and not buy a 10,000 mAh battery that will weigh 800 gms.
There are batteries with 2, 3, or 4 cells. You will notice that in specifications the battery will have 3S or 4S. The S rating is the number of cells the battery has. A general rule says, the more the better but it also depends on your charger and on your ESCs.
So to conclude, a good choice should be a battery over 2500mAh but lower than 3500mAh with 12.1V and 3S.
Choosing a compatible charger
The batteries last for 10 to 20 minutes. After that you will need to charge your battery and prepare your craft for another flight. It's crucial to reach over 15% of your total mAh before charging.
Many chargers will notify you with a message of low voltage. There are chargers that charge only LiPo batteries and chargers that charge 2 or 3 different battery types; it really depends on your budget.
However, many people say that a good charger will make your battery last longer and keep your craft from voltage spikes, which may cause a crash.
An IMAX-B6 charger can charge LiPo and other types of batteries. Usually, multicopters use LiPo batteries but there are cases when you might need something else. It's always a good choice to have something compatible with NiHM batteries too.
Power distribution boards
Usually, quadcopter drones have one battery. But how can we connect one battery to four ESCs? A power distribution board is an answer. It is a simple board that has two pins as input to the board and four or more outputs.
Therefore, we can connect our battery and have up to 8 outputs and each one of them is connected to the battery.
There are four blocks of two outputs. Each output consists of two pins: one positive and one negative. There are two more pins, one positive and one negative, for your battery connection.
Make sure that this board does not touch any other conductive material. To conclude we can say that through this board we can power up all our ESCs with the voltage of our battery.
Radio transmitter and receiver
Remotely piloted quadcopter drones are controlled from a ground station using some kind of transmitter and receiver mounted on the craft. This communication system is simple, reliable, and easy to install.
Note that the ground station is actually a pilot with a transmitter in his hands. A ground station can have many more systems but a simplified model of communication is preferred. Transmitters usually look similar to the following screenshot:
They have two sticks and a screen for all the configuration setups. A joystick can also be used as a transmitter but a proper transmitter is recommended for new pilots.
The flight controller that will be described in later blogs has all the configurations needed in case we want to connect a joystick or a transmitter similar to the one shown in the preceding image. Let's have a close look at what a transmitter consists of:
Four channels are used, namely throttle, rudder, aileron, and elevator; yaw, pitch, and roll are fully controlled through these channels. Furthermore, a transmitter is equipped with two or more channels for extra functions.
For example, a pilot may need to light up some LEDs, activate a system while flying or capture an aerial photograph. All these are extra functions that a pilot can activate through any extra channel.
Usually, these systems have some kind of memory that stores its data even if the battery is disconnected. Memory is required to save all the configuration a model has.
For example, let's say that we have two airplanes, one helicopter, and one multicopter and we need to save all the configuration of our models without any conflict. The transmitters have this option and we can try to fly our craft, change the settings, fly again, modify configurations, and then lock our configurations and save them for future flights.
Apart from the four sticks that any pilot uses to control its craft, there should be four trim sticks with which we can change the trim of the craft according to the drag it has.
Assuming that the minimum throttle is 1000 and the maximum is 2000, trimming the throttle channel has an effect on the min-max range. In other words, if we trim the throttle, the minimum may be 1050, 1100 or even 1200.
Practically, at the exact moment that we pull our stick a bit, the minimum throttle will be sent to the flight controller. More information can be found in the later blogs.
For each transmitter, there is a receiver of the same GHz. The receiver simply receives a signal from the specific transmitter and through the right pins passes the signals to the flight controller.
Quadcopter drones can be programmed and controlled in many different ways. Usually, there are two modes: acrobatic and stable mode. The difference is the way the controller board interprets the orientations feedback, together with your RC transmitter joysticks. Even if it is quite strange, it actually consists of two sticks and a tablet where you can see what your quadcopter drone sees:
Creating a Drone Frame
Even the most skilled pilot will find it hard to fly a quadcopter drone built over a badly designed frame. The frame is the base of the quadcopter drone and one of the most important parts.
It is something that cannot be changed easily. Everything is mounted on the frame; thus, removing and changing any component will be very time-consuming.
It will require removing and remounting of all the components. There are various shapes and materials with which we can build a frame and every single one of them has its own advantages and drawbacks, which we will explain later in this blog.
A good and well-built frame ensures a stable and easy flight. On the other hand, a frame that is built quickly with little attention to detail can cause stability problems, drag, and may cause crashes. Since safety is the number one priority, you should be cautious when building your own frame.
In this blog, we will cover the following topics:
The market to buy frames
How to build a DIY frame
What material to use and why
In which shape should you mount your electronics
Market versus DIY
After years of testing and designing, many companies including DJI and Parrot have created some awesome drones. Inspire 1 is currently the best drone from DJI and Parrot quadcopter drones are made on some very beautiful, light, and stable frames.
However, those frames are not customizable. Mounting your own electronics on a market frame may not be possible or may require too many modifications for it to be practical.
Furthermore, there are many simple and very good frames available on websites like http://ebay.com, http://amazon.com, or even http://hobbyking.com. The cost depends on the material and the number of motors that you want to mount.
Buying a frame from websites like the ones mentioned is an excellent choice; if you don't want to mess up by designing and creating your own frame using any kind of material.
In the left-hand side image (DJI HJ450 frame), the frame is made from plastic and in the right-hand side image (X450), the material used is aluminum:
The following image shows two more frames made from aluminum and carbon fiber:
As a third option, we can create our own frame step-by-step. You should keep in mind that a wooden frame will work just fine and your quadcopter drone will fly; however, it is not the best thing you can do. Since the first decision we need to take is what material we are going to use, let's have a look at all the possible materials.
Depending on the budget, various materials can be used to build your own frame or you can buy a market one. A frame does not need to be only one material.
For example, you will notice that many frames consist of a combination of different materials.
Wooden frames are simple, easy to build, and more importantly, you can make any change you may think of, later on. As far as the frame is concerned, the cost of damage after a crash is very low.
These are almost all the advantages of a wooden frame. You can either buy some wood and cut it by yourself or give instructions to your local shop about the dimensions.
Lastly, when creating a wooden frame, make sure to cut it with a laser; this way you will be able to design it precisely according to your dimensions and hopefully have a stable quadcopter drone.
Aluminum is the second and most common material used for quadcopter drones. It is quite simple and lightweight and suitable for hobbyists who seek fun. Aluminum is lighter than wood and is much more stable.
If all the screws and electronics are mounted on the frame with caution, the overall build will be nothing less than a stable, lightweight, and reliable quadcopter drone.
Assuming that we are comparing the materials, a drawback of using aluminum frame could be the weight. Although it's a very good material, there is always something better and more expensive, for example, carbon fiber.
Carbon fiber is by far the best material for crafts. It is light but not so much that it increases the vibrations. It's hard, so it usually prevents your quadcopter drone from getting damaged in a crash; it is complicated too.
Assuming that you need to build a DIY frame with your own design, this material is not so easy to cut. It is also expensive in relation to the other materials.
The last choice is plastic. Plastic is used as a material for frames coming from a manufacturer but most importantly, plastic can be used in 3D printers to design and finally print your own unique frame.
3D printers are an amazing breakthrough, they are small and efficient objects because of their low cost, build, and easy design. Many software, such as Blender, Rhinoceros, and SketchUp can be used to export your own design as a file.
There are plenty of shapes out there and all of them are just fine. There is no big difference in the shape, as long as it is created with caution. Apart from the X and plus shapes, there is an H frame and other more complicated ones.
Generally, most hobbyists choose the frame shape according to what they believe will be more beautiful and elegant.
Furthermore, there are some techniques and shapes that are suitable for fast quadcopter drones, in case you need as much acceleration as you can get. There are not many races out there but, in the future, races using quadcopter drones are going to be very common and everyone will try to get as much acceleration as they can. Note that the discussion in this section of the blog will be about shapes and not sizes.
The X shape
We already mentioned that this kind of shape is the most common of all shapes. The X shape defines the basic shape and it is usually the first attempt to build a quadcopter drone.
The reason that it's defined as X is that the quadcopter drone looks like the Greek letter X from the top view. Each motor is mounted on the edges of the shape and everything else is usually placed at the center.
In comparison to other shapes, this shape is advantageous because the total thrust needed for acceleration is split into two halves since two motors will be used. This also increases our motor efficiency.
Creating a Frame
The plug shape
The plug shape is exactly like the X shape with one difference; moving forward will require one motor and not two, as is the case in the X shape. Also, with a plus shape it's quite difficult to mount a camera at the front because the front propeller is in the way:
The H shape
Like the Greek letter H, with this shape, we can add more electronics, cameras, and DIY stuff that we want on our quadcopter drone. The main difference between the X and plus shapes is the space between the arms. As we can see in the following image, there is plenty of space to mount more than one battery:
The racing shape
Quadcopter drones intended for a race need to have a specific shape. The two front arms must be lesser in length than the two at the back. This increases the acceleration and the quadcopter drone gains more speed.
Furthermore, hobbyists usually try to build as small a quadcopter drone as possible. All the electronics are placed in the center of the total weight, in other words, around the center of gravity.
The stability shape
Quadcopter drones made for aerial photographs and video capturing must have a good stable frame to minimize vibrations. Usually, frames for such a purpose are big.
The four arms have the same length and are very long to increase the stability of the overall system, as compared to the racing shape where all the electronics are placed in the center of the total weight.
Soldering the Electronics
Most components need extra modifications before connecting them together. Electronic speed controllers have to be soldered to the connectors, to make sure that the overall build is highly customizable for future plans.
Note that there is always an option of not using any connector, which will be described later; but if someday you need to modify or add something, you will have to heat the connections and install a new connector, which is not recommended.
Each component has numerous wires with different connectors for different purposes. These connectors allow for easy swapping or upgrading of components, without the need to disorder the wires, which is time-consuming.
Most components come with standard connectors that are already soldered, while others may require you to separately purchase and solder your own connectors.
Bullet connectors are going to be used to connect the motors with the ESC and the T connectors are going to connect the ESCs with the PDB. It's extremely important to place the correct connector in each component.
In every component that is already connected or produces power, we must always use a female connector. We don't want to expose any kind of metal that is connected to power; with this said, we can make the following connections:
Female banana bullet connectors to the 3 wires coming from the motors
Male banana bullets connectors on the 3 wires coming from the ESC
Female T connectors to the wires coming from the PDB
Male T connectors to the wires coming from the ESC
Further, in this blog, we will use the following connectors:
12 pairs of 3.5mm bullet connectors
5 pairs of T connectors
Motors have only three wires coming from their insides. Usually, all three are connected on 3.5mm diameter banana connectors. Obviously, in the worst case scenario, we will have to solder these connectors.
If you have no banana connectors, you should consider buying some, as they are quite easy to install and are reliable. The following image shows wires with and without the banana connector. At the end of the blog, there will be a short guide and instructions on how to solder a connection like this:
An ESC has three wires that must be connected to the motor, two wires for the battery and a servo wire that goes all the way to the flight controller. Unfortunately, almost all of the ESCs come with no connectors. So, it is up to you to do all the work and build up the connections.
As you can see in the following image, the three wires and the connectors have been covered with heat shrink. The reason we are using a heat shrink is to protect the exposed metal of the connector from electrical shorts:
On the other side of the ESC, the black and red wire must be connected to the battery through the power distribution board. Again, this step is optional and we can solder the two wires directly to the power distribution board.
But if we need to modify anything or change our frame later, we will have to remove these connections and heat the solder to disconnect the wires.
The following image depicts the ESC after soldering a T male connector. Note that a female T connector should already be soldered to the power distribution board so that the ESC can be powered on:
Soldering a banana connection
This solder procedure consists of three basic steps:
1. Strip the wire
2. Solder the wire
3. Heat the heat shrink
Stripping the wire
There are many tools that can help you to strip wires. You can buy them at your local hardware store or Internet markets like eBay. Then place your tool about 1 cm from the end of the wire and remove the cover; depending on the wire, you may be able to gently cut your wire with scissors and remove it with your hands:
After stripping, your wire will be ready for soldering:
At this point don't forget to place a heat shrink over the wire because once you connect the wire with the connector, you will not be able to do that.
Be careful when soldering anything. Almost any soldering station has enough heat to injure your skin. So anything that you are trying to solder, do it with caution and with a clear table. Place your wire in the paste, as shown:
Next, we need to place this wire into a banana connector. The wire should be tinned by heating and applying the solder, but make sure not to clump it. It also has to be hot enough. When you do it right, the solder sucks up the wire leads.
The connector will become very hot; so you should hold it with some kind of "helping hand". If you don't have any helping hand you may consider asking for help from a friend. He can hold the wire using any kind of grabber mechanism.
Make sure that you need to keep the wire steady using whatever you can. Lastly, you should use a cardboard. The soldier often drips and cardboard is a cheap and replaceable surface to protect your workbench/table:
Finally, place the wire inside the connector. After you place the wire in the banana connector, keep it steady for about 8 seconds:
After that, just heat the heat shrink to the right position. Note that I had to use a slightly larger heat shrink because the wire could not fit in the connector:
The male half should be covered till the point that it indicates how much of it goes inside the female. To verify if your connection is good, try to pull apart the wire with the banana connector gently.
If you can remove this easily, then repeat all the steps; you will have to solder your first connection correctly. Remember that you need to solder two connections (male and female).
Soldering a T connector
Soldering a T connector is as simple as a banana connector. The only difference is that instead of the one you will have to solder two pins; one for the positive and one for the negative wire. This kind of connector is called T because it consists of two pins in the shape of the Greek letter T.
It is quite useful for these kinds of connections since it can safely prevent reversing the connector, which will damage the battery and electrical components. the connector is half connected (male to female). At the left and the right side, we will solder our wires:
First of all, we need to strip two wires (if they are not already stripped) and find out which one is the positive (+) and the negative (-). Note that almost all batteries already have a T connector and you can easily find out the positive and the negative pin. Be careful not to solder it in the wrong order as this will destroy your battery:
Hold your connector with your helping hand and lace some solder over the pins.
After that, place your wire into the paste as shown in the image in the Soldering a banana connection section.
Insert a heat shrink, for later use. Next, gently place the wire over the pin and solder them together:
Place the heat shrink to the right. If for some reason it cannot be placed over the pin, choose a bigger heat shrink or repeat the step and solder the wire again and try to place as little soldering wire as possible so that the heat shrink can fit over the pin and the wire:
Once everything is ready and the heat shrink is in the right position, try and heat the heat shrink with any kind of heating device, such as a lighter. Do not stay over a specific point for more than 2 seconds.
Try and pass the entire heat shrink 5 to 6 times, slowly. Be careful with the flame, since you can injure your finger or burn the plastic part in the T connector. Do not heat the wire for long because it will get damaged:
Soldering the PDB
The power distribution board is used to connect all your ESCs to your battery. Every single ESC will be connected to a T connector; so we need another T connector mounted on the PDB. Note that you don't need any heat shrink, just put some paste on your wire and solder it to your PDB. Your setup should be something like the following image:
In the previous blog section, we went through the soldering procedure for some of the electronics that needed further modifications. Hopefully, at this point, all our electronics are ready for installation.
In this blog, we will mount the motors, connect the ESC to the motors and the PDB, connect the receiver to the flight controller, and finally power up everything with our battery. Note that all the instructions that follow are crucial for your first flight.
Read every step with caution and if the result is not what you expected it to be, please be patient and repeat the step.
In this blog, we will cover the following topics:
Mounting the propellers
Installing the ESCs
Depending on your motor, this step may be either simple or very complicated. Generally, you need to make two or four holes at the edge of your frame. That or has a reason to exist.
Some market frames look like this:
These have all the necessary holes that you may need, assuming that your motor has normal dimensions. So, there is nothing more to do than taking a screwdriver and placing some screws over the four motors.
But if you try to mount your motors in wood, aluminum, or some other material that has no holes, you will have to do some more work. Almost all the motors have some specifications on the market from which you have bought them, as shown in the following figure:
So, hopefully, you can find the dimensions of the motors and the exact size and spacing of the holes needed. Either you can make some holes with appropriate tools or buy an external motor mount system.
The motors usually have their own screw thread type and you should check that before buying them. It may be useful to buy some screws, but be careful not to buy a long one and damage the inner coils of the motors.
You may have to make some holes for the mount system. It really depends on the system that you buy. Another hack that I have done on my quadcopter drone. It really works. Choose wisely what you will do because it is very important to have a steady and well-mounted motor.
Mounting the propeller
Before mounting the propellers in the correct manner, we need to test each one and determine if they need further balancing. Balancing the propellers is important and an unbalanced propeller results in "shaky" hovering of the quadcopter drone.
To minimize the shaking, you have to constantly fix each drag with the sticks on your remote controller and this is quite annoying; especially when the goal is to capture a clear photograph.
As you can see, the left propeller is perfectly balanced and the right one is not. But how can we fix a badly balanced propeller? We can simply put some low weight on one side of the propeller.
For example, you can use Scotch tape. The weight of a 1x2 cm piece is enough to change the balance. Place the tape on the side that is higher and you will see that the extra weight that we have placed balances the propeller perfectly.
There are other ways of balancing your propeller, such as sandpaper, but you have to be very careful with it.
Now that the propellers are balanced, we have to mount them on our motors. If you take a closer look at a propeller, you will see that you have two clockwise and two counterclockwise.
Motor 1 should have a clockwise propeller, motor 2 should have a counterclockwise propeller, and motor 3 and 4 should have a clockwise and counterclockwise propeller respectively.
There are two clockwise and two counterclockwise propellers. At the opposite motors, we need to use the same propellers. As a result, front-left and back-right will be the right direction propellers and the other two propellers would go to the other two motors.
Note that every propeller screw is different from a normal screw. You have to screw it in the opposite direction because high RPM may loosen the screw. However, there are many motors that have right direction screws, which is also fine, if they are screwed tight enough.
Installing the ESC
Each ESC must be connected to a motor, the flight controller, and the PDB. Connect the three wires of each ESC to the three wires of each motor randomly. You might have connected them wrong, but it's ok. We will test this later and fix it if needed.
Depending on the flight controller you have, you must connect the four servo wires in the right position. The flight controller that we will use is APM v2.8 and you can find the following figure on the official website of ArduPilot.
Lastly, the power distribution board, or PDB, must have four female T connectors and one male. Plug in the four female connectors to each ESC and leave the male for the battery. The battery is the last component that should be connected.
Connecting the receiver
The receiver usually has four to eight channels. Only four of them are necessary for this step. In the following figure, we can find the order in which you must connect your throttle, aileron, elevator, and rudder. Make sure to connect the power and ground pin in the right manner.
Do not forget to tie up the ESC with electrical tape or something else that will make it steady.
Now that everything is connected together, there is only one thing left. Place the battery near the PDB and connect the two T connectors with caution. Note that at this point your quadcopter drone is not ready to fly at all. You have to pass the calibration and the pre-flight testing list before you can actually fly your vehicle.
The point here is just to make sure that everything is working.
A well-built quadcopter drone should have beeps from the ESCs and a red-black LED blinking at the flight controller. If you can hear the beeps and see those LEDs, you did a great job!
Cameras and Extra Functions
You should take the time to learn how to fly and land your quadcopter drone. As soon as you add a high-cost camera or any other equipment, you have to be able to avoid crashing again.
Apart from the camera, there are a lot of extra things that you can add to your craft. Each of them should have a specific reason to exist but it is obvious that your craft's functionality is limitless.
In this blog, we will go through some basic components that you can add to your craft to do some more advanced tasks. Each of the following extra components can be used to capture photos or add a failsafe mechanism. Understand that almost everything in the following list has some weight.
Weight is the worst nightmare for an aerial craft. So, if you are going to use any of them, be sure that you really need. The worst case scenario is to have a quadcopter drone whose weight is more than the thrust that all your motors can provide.
There is no way to lift this craft. But even if you lift it, you don't want to hover with 80% of the maximum thrust. Your craft will be unstable and your flight time will be from 6 to 7 minutes.
Camera for photographs
Camera for FPV (first person view)
Failsafe parachute landing
One or more servomechanisms
Camera for photographs
Whether it is a simple webcam or a professional GoPro camera, you can easily mount it on your quadcopter drone and capture videos or photographs of your flight. There is no one-step guide on how to place your camera on your quadcopter drone.
What you will read next are some basic issues while placing your camera and some things that you should always avoid.
Position in relation to other components
Assuming that your build is an X shaped quadcopter drone, your camera should be placed at a position near the center of mass.
Usually, most cameras weigh more than 100 grams and this weight is enough to change the craft's center of gravity. As a result, depending on the position of the camera, your craft will have an imbalance in weight causing decreased performance and battery life.
This is something we can avoid by keeping the camera position as close to the center of gravity as possible. Take a look at a DJI Phantom drone and its camera position in the following image:
Another issue that we should consider is power interference. Every wire starting from the battery to each component has interference and if the camera is near the 12V wires, it will result in some noise. So you must keep in mind that wires should be at least 1cm away from the flight controller and the camera.
Motors produce more vibration than you think. The vibrations are a source of noise and affect the camera and the flight controller. As far as the camera is concerned, the video that you have captured will be the worst video ever.
The flight controller, on the other hand, must have minimum possible vibrations to minimize the error that is produced and to keep the quadcopter drone stable. There are anti-vibration systems on the market that do a very good job. Here is one of them:
YouTube or other video sharing websites have stabilization algorithms that can somehow produce a more stable video but it's still not the result we want. To minimize the vibrations, we can mount some kind of vibration absorber between the camera and the craft, similar to the ones shown in the following image:
Camera for FPV
First person view, or FPV, is a way of flying your craft that allows you to have eyes in the sky. The feeling, and of course the view, is a lot different than flying without FPV. Even if at first it is difficult to control the quadcopter drone, after a while it is just amazing.
You will need two things to set this up. First, you will need a small camera to mount on your craft. The camera must be connected to an antenna and the antenna will transmit the signal to a ground station antenna. The ground station antenna is always connected to either goggles or a monitor.
Goggles are special glasses that you can wear that provide an FPV in front of your eyes, as you can see in the following image from a YouTube video:
This image is what the drone sees and this is also what you see on your goggles. The goggles look similar to the ones in the following image and they are pretty easy to install:
On the other hand, there are many monitors that can be used for such a cause, such as simple FPV monitors. In the following image, we can see a classic FPV monitor:
Most pilots do not prefer very large monitors because you may need to travel to a park or somewhere else and you need to be able to hold your craft, transmitter case, FPV case, and some more stuff. There are many things that you should have and it's kind of difficult to walk with everything in your arms.
Failsafe parachute landing
Landing is usually the worst part of the flight. It's the most difficult one too! The scenario that we are describing here is when the craft has a problem and it is difficult to land or there isn't much time to land safely on your own.
To avoid crash landings, quadcopter drones can be equipped with parachutes. The APM flight controller has an option of adding a parachute. The hardware mechanism of a parachute must be connected via servo wire to the flight controller and the trigger must be configured through the software.
Parachutes have a very simple way of activating. The bottom side of the parachute is open and the idea is that while the quadcopter drone is flying, the air goes from the bottom side and waits. As soon as we trigger the parachute, the top side will open and the parachute will fill with air, slowing the craft enough for a safe landing.
A servo is a mechanical system that rotates from 0 to 180 degrees. To help you understand the power of the servo mechanism, let's have a look at a common servo and where and how can we use it.
The preceding image is of a simple servo. Usually, a servo consists of two or three different plastic modules that we can easily change according to our goal. The servo is connected with 5V to any device like an Arduino board or most of the flight controllers that support a servo.
You have to identify the servo you bought and connect the wires in the right order according to the preceding image.
One or two servos can be used to create a simple DIY grabber at the bottom of the craft. A servo goes from 0 to 180 degrees, so it's quite simple to create a mechanism similar to this. Furthermore, we can use it to trigger various dropping mechanisms.
Flying in daylight doesn't require any extra components. The craft is visible hovering from the ground and your FPV monitor (if used) should be very clear as far as the light is concerned. On the other hand, when the sun goes down or the sunlight is low, you may consider adding an LED strip.
LED strips are extremely low cost and lightweight. They are a great way of identifying your craft in a low light environment! In most cases they look like in the following image:
LED strips can be cut in small pieces of 5-10cm. The input voltage is about 12V, exactly the voltage of the usual LiPo batteries. Adding an LED strip to your craft will result in something like the following image. Obviously, you can understand its importance in a low light environment.
Arduino boards have been very popular. APM and many other flight controllers all run on an Arduino MEGA or other Arduino-like boards. These boards are quite cheap, easy to install and use. The specifications of an Arduino UNO board are as follows:
An Arduino UNO board looks like this:
Usually, similar to APM flight controllers, if the purpose is to build a flight controller, then Arduino MEGA is the best choice. That's why APM FC is an Arduino MEGA with many other sensors.
Arduino UNO can be used as an extra controller or a board that triggers anything using a time clock, a signal, and so on.
For example, an Arduino UNO can be used to trigger a servo mechanism after two minutes of flight. Since Arduino uses a 5V input, any signal from the transmitter-receiver communication can be easily read and used. There are also various shields for Arduino boards out there.
A shield is a chip that can be mounted on the top of the Arduino boards or can be connected with the appropriate pins, which give some input or output to the user.
There are shields that can be used to mount a SIM card, wireless transmitters, temperature, humidity, or distance sensors, and much more. For more information, visit Arduino's official website at https://www.arduino.cc/.
Being able to know your map location at every single moment is very important for long flights. There are many GPS systems in the market that help your controller and feed it your craft's coordinates.
So, you can get your location as a mark on a map via telemetry and use the Mission Planner software or any other navigation software to place some navigation points and set your quadcopter drone to autopilot.
In the following image, we can see the NEO 6m GPS module. It can be easily mounted on the ArduPilot flight controller and it will feed your craft the required coordinates:
Note that the GPS also has drawbacks. Unfortunately, the GPS as a standalone system cannot get accurate coordinates. As a result, the flight controller uses a GPS module combined with an accelerometer, magnetometer, and maybe some more components. Each of them has small errors but the combination is very good.
A GPS module should not be trusted under cloudy weather, in the rain, or inside buildings. All these situations lower the strength of the signal from the satellite and, as a result, increase errors.
Some Basic Information about Drones
Let's also think of what a Drone isn't. We've all heard that dreaded term … drones. A Drone isn't really a drone in the true sense. Rather, it's defined by the U.S.'s Federal Aviation Administration as an Unmanned Aerial System (UAS).
The term UAS covers a wide array of aircraft, from drones to your average hobby radio-controlled airplanes. Most Drones are piloted in the line of sight (LOS), just as any radio-controlled airplane.
This variety is not considered a drone. Technically, a drone both lies outside LOS and has the capability of autonomous light (autopilot).
With specialized equipment, you can ly a Drone using a first-person view (FPV) camera system, telemetry, and so on, and turn your Drone into a fully autonomous drone. Therefore, some drones are Drones, but not every Drone is a drone.
Most Drone pilots, however, shy away from the term drone. This is because the term drone evokes images of aerial assassinations using missiles and guns mounted on the aircraft.
For instance, in a 2013 article in the Santa Rosa Press Democrat about Drones, a Santa Rosa police officer was quoted as mentioning "flying-by gang shootings" as crimes just around the corner.
Once you know how a Drone lies, the idea of mounting a weapon system onto a Drone is physically laughable and ludicrous. Mounting a firearm to a drone provides such a counterforce (kick) that the mental image of the result conjures Wile E. Coyote chasing the Road Runner. The Drone lying backward as the bullet stays in one place. Comical indeed!
How do Drones flying
Drones flying by utilizing two basic principles: lift and torque. Drones are truly a great exercise in Newtonian Physics (every action has an equal and opposite reaction). In a traditional helicopter, the main rotor spins in one direction.
To keep the body from spinning the other way (remember, every action has an equal and opposite reaction), a tail rotor is implemented in order to put a constant pressure on the tail to keep the body stable. A Drone uses counter-rotating propellers to keep the body stable while the propellers turn.
The axes of rotation on an aircraft are called a pitch, yaw, and roll. Pitch is simply pointing the nose of the aircraft up or down. Yaw is turning the aircraft to the left or right. Roll is turning the aircraft such that the sides go up and down (rolling to the left would make an airplane's left wing dip down).
Drone yaw control
A Drone uses these principles of the pitch, yaw, and roll to its advantage. In the following figure, you can see that propellers 1 and 3 move in one direction, while 2 and 4 moves in the other.
By slowing down 1 and 3 while speeding up 2 and 4, you can make the Drone yaw to the left. The torque of 2 and 4 spinning to the right makes the body spin to the left. Conversely, by slowing down 2 and 4 while speeding up 1 and 3, the Drone yaws to the right.
The principles of Drone lift
So, that takes care of yaw control. Now, how does a Drone move up and down? Here, it's similar to a traditional helicopter. A simple increase in the throttle of all the motors together pushes more air down.
By pushing air down, the Drone rises because the volume of the air slowing down from the rotors has greater thrust than the Drone's weight.
Decrease the speed of the propellers, and the thrust may stay the same as the Drone's weight (providing a hover) or may dip down below the weight of the Drone, causing a descent. The following image shows a good example of a Drone holding a hover:
How a Drone moves
This is truly where a Drone shines. A traditional helicopter is not symmetrical from every angle; therefore, as it lies sideways, the tail wants to swing to the rear and the nose points in the direction of the light.
The wind pushes the tail just like a weather vane. The pilot must counter this by yawing in the same direction as light or stability can become an issue. Drones are symmetrical in every direction. Therefore, moving sideways has the same feel as forwarding light to the pilot.
Just like a traditional helicopter, a Drone moves forward/backward and from side to side by tilting. Tilting the Drone changes the direction of the thrust provided by the rotors.
For example, by dipping the nose and raising the tail, the direction in which the air low is pushed is not only down, but also to the rear of the Drone.
If every action has an equal and opposite reaction, pushing air to the rear of the Drone pushes the Drone forward. To make one side dip, the speed of the propellers is reduced, and to raise another side, the speed of the motors on that side is increased. The following diagram shows how directional light is achieved:
It all seems rather simple, right? Increasing and decreasing the speed of each motor provides movement in any direction. The direction is only dependent on the combination of motors that are increased or decreased.
There are less moving parts in a Drone than in a traditional helicopter. The movement in one direction has the same feel as in any direction because the aerodynamics is symmetrical.
So, why do traditional helicopters exist at all? The reason is that the electronics and components of a Drone have only recently (after the year 2000) begun to be practical and small enough to really make them work. Imagine controlling the speed of each motor independently to control your Drone by feel.
It would be impossible without the help of some very sophisticated electronics. This brings us to the next section. For now, let's get acquainted with what makes up a Drone.
Drone frames come in all shapes and sizes, from basic quadcopters to eight-bladed monster octocopters. They are available for a wide variety of prices too. Sometimes, large frames that cost more are really better.
However, this is rare indeed. We will give you more details later, but note that before you choose any components, you should have your purpose in mind.
Bigger is not always better, and smaller can't carry much weight. In the following image, you can see a hexacopter frame that retails for under 100 USD and can carry quite a bit of weight. Of course, the components required to ly such a beast can cost you well over 3000 USD (not including the batteries).
Motors and propellers
Motors and propellers are the main propulsion systems for your Drone. It's truly where the rubber meets the road. These components are, by far, under the greatest strain of any component of your Drone.
Every ounce of weight that your Drone carries rests on the blades of the propellers. So, as you can tell, strength is a prerequisite.
The bigger are the blades, the more lift there is. However, the bigger the blades, the more is the leverage placed upon the hub of the blades and more strain is exerted. Skimp on the blades and they'll snap, and your whole investment comes crashing to the ground.
Also, the bigger the blade, the stronger the motor must be in order to counteract the torque required to turn the blade. It might seem like the motor doesn't truly have to deal with a lot of resistance.
But that's just not true. If a propeller is moving enough air to lift a couple-dozen pounds into the air, there is a lot of wind resistance that the motor must counteract.
Faster motors are weaker. It's a giant balancing act to figure out how to get the right blades, motors, and so on, to lift your payload for the longest time possible. The following image shows carbon fiber blades attached to motors that spin at 480 RPM per volt (KV):
The electronic speed control
The electronic speed control (ESC) is a marvelous invention. This truly makes lying Drones possible. Electric motors require more voltage to start spinning than to keep spinning at their lowest speed.
Also, as you apply more voltage, they don't necessarily speed up on an even curve. The ESC spikes the voltage to start the motor and eases it back to keep them spinning at a low speed on a low throttle.
Also, as you apply more throttle input, the ESC accelerates the rotor evenly. Furthermore, most ESCs can be programmed to any curve you like. A real tech head can have a field day just programming ESCs.
Don't let that scare you though … most ESCs are preprogrammed with the necessary settings to get you going without ever needing to dive in.
ESCs are the pass-through from the battery to the motor. They must be carefully balanced with the motor to give enough power to the motor and not burn out.
Putting an underpowered ESC in your Drone can cause crashes … or even fires. You must have an individual ESC for every motor. The following image shows all the six ESCs tied down to the hub of this Drone:
The guidance system
Now this is where the real magic happens. To flying a Drone, it literally takes tens-of-thousands of calculations per second to sense whether you're going up or down or whether you are moving, tilting, or rotating, all the while adjusting your motors to counteract these forces to keep your Drone stable. There are several aspects to the guidance system.
Most guidance systems have the same set of sensors nowadays. The main difference from system to system is how fast the calculations are done and the algorithms that are used in the firmware. Yes … I said firmware. These are literally lying computers.
The circular module in the given image is a dual-purpose antenna. It senses both the direction (using a compass) and the GPS location (by using a 6-12 satellite lock system). This provides extremely accurate positional data for the brain to do its work.
In the other section of the photo, you'll see two grey boxes. The one in the background is the sensor box. This includes a 3-axis accelerometer and gyros to determine the pitch, roll, and yaw movement several thousand times a second. Additionally, it contains a barometer to indicate altitude.
The box in the foreground is the main brain that takes all this information and your control inputs (coming in on the left side from the radio receiver), compares that to the GPS and compass data to create an accurate impression of what the drone is doing (as well as what you wish it to do).
And sends speed information to the ESC (out on the right side), and in turn to the motors to move your drone properly and in a stable fashion. Like I said … this is where the magic happens.
Furthermore, there are more add-ons that you can get to interface with your guidance system. Camera gimbals can hook in the WooKong-M (and most other systems), and as the Drone tilts to move, the camera can actually stay level.
Also, onscreen displays (OSD) can be hooked in for your camera transmitter (allowing you to see all the telemetry, including battery life, attitude (orientation), height, and so on, on a viewing monitor while seeing what your camera sees).
This unit communicates with the airborne Drone from the ground using an iPad. You can actually click on a Google Earth map … and the Drone will fly there. Or, you can even draw out preprogrammed light paths. These add-ons are what truly transform a Drone into a drone.
Camera gimbals and transmitters
The term camera gimbal is a short way of saying, "a fancy device that keeps the camera leveled and reduces vibration no matter what the Drone does within reason." So yeah … camera gimbal is much shorter. Generally, these systems hook into your guidance system and are tuned by the pilot (you) to work properly.
Gimbals (good ones at least) are not cheap; the more weight that you want to carry and the more movement you want makes the price go up exponentially. The gimbal in the following image is capable of carrying a DSLR camera. It's made by Photoshop One, and a new one retails for around 800 USD.
Furthermore, it's important to have a good transmitter. It's unheard of for any videographer to blindly shoot a video in a general direction while hoping to capture what he/she wants in a great way.
It's unheard of because it's ludicrous, and the first sign that you've hired the wrong pilot. Transmitter/receiver systems are generally not all that expensive, and you can expect it to be one of the smallest investments you'll make. Be careful though. These can drain power rapidly if you get the wrong one.
Your radio is the primary interface between a human and a machine. It's important to get a good one that feels right for you. The buttons should be easy to find, and it should (above all) be reliable.
FM transmitters are a way of the past. Futaba, with their FASST, and Spektrum/JR (with DSMx) are the waves of the present and future.
No longer do you need to worry about competing transmitters, calling out a channel, or severe fading. The new generation of transmitters/receivers is digitally paired, and have LOS ranges in terms of miles. The following is an image of the Spektrum DX7s transmitter and the AR-8000 receiver with a satellite:
One important application of quadrotors is for aerial photography. Some models have a camera built directly into the body. Other models have cameras attached underneath the body.
Usually, the camera is controlled from the ground to take pictures or videos. In addition, some quadrotors may have a GPS receiver on board. The position of the craft over the Earth is available and some quadrotors can be guided to traverse a selected course through a series of GPS waypoints.
For more information about the GPS system, visit GPS.gov: GPS Overview. There are many models of quadrotors on the market. For a comparison, visit Best Quadcopters and Drones.
Since manufacturers are producing new quadrotors incomplete or kit form, you should check websites that review the latest craft if you are in the market to buy one.
There are a number of communication methods that allow quadrotors to be controlled for autonomous or manually controlled flight. Here are a few examples.
GPS provides position data for your quadrotor if it has a GPS receiver. Using maps for GPS that can be downloaded, you can plot a course for the craft and it will fly that course autonomously.
Wi-Fi communication can allow manual control of the quadrotor using smartphones and tablets. After downloading the manufacturer’s software from a website, a screen appears with an image of flight controls that mimic joysticks that you can use to fly and control the quadrotor.
Data from the quadrotor can also be received on these devices. If the drone has a camera, the camera view can be seen on these devices. Some quadrotors come with their own controllers that usually include joystick-type controls to fly the craft.
The bluetooth connection provides another method for transmitting information to and from the quadrotor. The range of the signal is limited to 10 meters (32 feet) for mobile devices.
Some quadrotors may use Radio Frequency (RF) signals to communicate with the craft. Radio-controlled crafts, such as model airplanes, have been available for many years. These signals allow for a much longer range of communication.
Understanding quadrotor sensors
The onboard flight control circuitry receives information from sensors that provide data about the craft in flight. Some of the possible sensors that determine the attitude, altitude, and direction of flight include.
A gyroscope that determines the attitude of the craft, including its pitch and roll. This indicates the rotational motion of the craft. An accelerometer that determines the rate of change of velocity of the craft with respect to the three axes.
An altimeter or barometer that determines the altitude of the craft above ground. At low altitudes, a down-looking sonar sensor may be used to determine altitudes up to several meters or more. A magnetometer that serves as a compass to indicate the craft’s direction by using the Earth’s magnetic field as a reference.
The accelerometer and magnetometer need calibration to initialize their readings to the conditions where the flights will take place. For each quadrotor, it is therefore important to follow the manufacturer’s instructions carefully to set up the craft before flights.
Inertial measurement unit
The inertial measurement unit (IMU) is a combined gyroscope and accelerometer. This unit will indicate the complete information about the flight characteristics of the quadrotor. Typically, the unit will measure the acceleration and orientation of the flying craft in all three dimensions.
These sensors allow indoor and outdoor flight. However, all the sensors previously mentioned suffering from slight errors that may accumulate during flight, so caution is necessary while flying in confined spaces.
Quadrotor condition sensors
Many quadrotors have sensors that will indicate information about their condition, including the motor temperature and the percentage of battery charge. This information is relayed by telemetry to the ground-based control device.
ROS, with its message passing capability, is ideally suited for the communication of sensor messages between the quadrotor and the ground-based control device. Various types of ROS sensor messages are listed at http://wiki.ros.org/sensor_msgs.
Preparing to fly your quadrotor
Some quadrotors can be dangerous if flown carelessly. Depending on the size, weight, and power of the quadrotor, collisions with the property, people, or pets can cause serious damage.
At the very least, crashing your quadrotor could damage the craft and end your flying career until you purchase a new one or repair the damaged one.
Although this blog is not about flying quadrotors, we believe that some discussion of good flying practice is necessary. This discussion will be particularly helpful to new pilots.
Since this blog is not about flying the quadrotor, but how ROS is used to control the craft, we will refer you to various websites on the Internet. Searching for How to fly a quadrotor or How to fly a quadcopter will yield over one million hits. Therefore, it is better to refine the search and specify the type of quadrotor you wish to fly.
Many websites present articles on flying quadrotors. For example, various tutorials are available on the following websites:
Drone Training, Industry News, & Free Resources | UAV Coach http://uavcoach.com/how-to-fly-a-quadcopter-guide/ There are also many YouTube videos showing quadrotor or quadcopter flying techniques.
Some of the things that should be considered before and during flight are as follows:
Testing your quadrotor
Safety and dangers
Rules and regulations
Testing your quadrotor
When your new quadrotor first arrives, it is natural to want to begin flying immediately. Our suggestion is to be patient and take time to familiarize yourself with the quadrotor and its flight controller.
We found that removing the propellers to test the quadrotor indoors was a good way to understand the craft and its controller without any danger of crashing.
Also, some practice on a simulator such as Hector (described later) will help you understand the flight controls. Remember that the controls will be reversed for direction and pitch control when the quadrotor is flying towards you, as compared to when the craft is flying away from you. A little time using the simulator will improve your flying ability.
Any good pilot follows a checklist before the flight. Some of the basics are as follows: Check that the quadrotor is not damaged and that its battery is charged. Make sure that the flight controller is disarmed so the quadrotor cannot take off until you are ready.
Make sure the area for flight is clear of obstacles and people.
When flying the quadrotor, always be aware of the surroundings and keep the quadrotor in sight. Flying over people or their private property without permission is usually illegal in most countries.
When flying in a public area, inform the police or the appropriate authorities that flights will take place. Be sure to keep the craft well away from buildings, trees, and people.
If flying using GPS, be sure the GPS satellite signals are locked on before flying. It could take several minutes for the onboard GPS receiver to get the signals from at least four satellites.
Precautions when flying your quadrotor
When you are learning, start your flights outdoors in light-wind or no-wind conditions. A high wind can cause the quadrotor to fly out of control. Remember that if the battery fails, the quadrotor will not glide but will fall straight down.
Keep aware of the battery percentage charge and bring the quadrotor to its landing point when the battery charge is low, below 20 percent to be safe.
Tip Use caution when flying quadrotors
Motors can fail and propellers can break due to a hard landing. Communication between the ground-based control device and the quadrotor can be interrupted or lost.
If the motors or propellers are damaged, the controlled flight may be impossible. If the battery drains in flight, the quadrotor will fall to the ground unless it has a fail-safe mode that returns the craft home when the battery is low or communication with the quadrotor is lost.
Following the rules and regulations
Quadrotors are considered drones and these unmanned aircraft systems are regulated. In the United States, the Federal Aviation Administration (FAA) regulates flights and requires the registration of some craft, including quadrotors, based on the weight of the craft.
Around the world, the International Civil Aviation Organization (ICAO) works with many countries to regulate flights.
The FAA has issued guidelines for flying craft in the general category of Model Aircraft with the following guidelines quoted from the website: Fly under the Special Rule for Model Aircraft:
Fly below 400 feet and remain clear of surrounding obstacles Keep the aircraft within a visual line of sight at all times Remain well clear of, and do not interfere with, manned aircraft operations
Don’t fly within 5 miles of an airport unless you contact the airport and control tower before flying
Don’t fly near people or stadiums
Don’t fly an aircraft that weighs more than 55 lbs (24.9 kg)
Don’t be careless or reckless with your unmanned aircraft—you could be fined for endangering people or other aircraft
Be aware that requirements might change and probably will, so keep up with the latest flying regulations for your quadrotor.
Using ROS with UAVs
The ROS wiki currently contains the following list of ROS quadrotors and quadcopters:
AscTec Pelican and Hummingbird quadrotors
View the list at http://wiki.ros.org/Robots in the future for additions to this list and the website http://www.ros.org/news/robots/uavs/ to get the latest ROS UAV news.
A number of universities have adopted using the AscTec Hummingbird as their ROS UAV of choice. For this blog, we present a simulator called Hector Quadrotor and two real quadrotors that use ROS: Crazyflie and Bebop.
Introducing Hector Quadrotor
The hardest part of learning about flying robots is the constant crashing. From learning flight control for the first time to testing new hardware or flight algorithms, the resulting failures can have a huge cost in terms of broken hardware components. To avoid such costs, a simulated air vehicle designed and developed for ROS is ideal.
A simulated quadrotor UAV for the ROS Gazebo environment has been developed by Team Hector of Technische Universität Darmstadt. This quadrotor, called Hector Quadrotor, is enclosed in the hector_quadrotor metapackage.
This metapackage contains the URDF description for the quadrotor UAV, its flight controllers, and launch files for running the quadrotor simulation in Gazebo.
Advanced use of the Hector Quadrotor simulation allows the user to record sensor data such as Lidar, depth camera, and so on. The quadrotor simulation can also be used to test flight algorithms and control approaches in the simulation.
The hector_quadrotor metapackage contains the following key packages:
hector_quadrotor_description: This package provides a URDF model of the Hector Quadrotor UAV and the quadrotor configured with various sensors. Several URDF quadrotor models exist in this package, each configured with specific sensors and controllers.
hector_quadrotor_gazebo: This package contains launch files for executing Gazebo and spawning one or more Hector Quadrotors. hector_quadrotor_gazebo_plugins: This package contains four UAV specific plugins:
The simple controller gazebo_quadrotor_simple_controller subscribes to a cmd_vel topic and calculates the required forces and torques and A sensor plugin gazebo_ros_baro simulates a barometric altimeter
The plugins gazebo_quadrotor_propulsion and gazebo_quadrotor_aerodynamics simulate the propulsion, aerodynamics, and drag from messages containing motor voltages and wind vector input hector_quadrotor_controllers: This package provides a library and a node for controlling a quadrotor using ros_control.
hector_quadrotor_controller_gazebo: This package implements the ros_controlRobotHWSim interface for the quadrotor controller.
hector_quadrotor_model: This package provides libraries used to model several aspects of quadrotor dynamics.
hector_quadrotor_teleop: This package provides a node and launches files for controlling a quadrotor using a joystick or gamepad.
hector_quadrotor_demo: This package provides sample launch files that run the Gazebo quadrotor simulation and hector_slam for indoor and
The entire list of packages for the hector_quadrotor metapackage is given in the next section.
Loading Hector Quadrotor
The repository for the hector_quadrotor software can be found at: https://github.com/tu-darmstadt-ros-pkg/hector_quadrotor.
At the time this blog is being revised, the hector_quadrotor software is in a development release for ROS Kinetic. The instructions for installing this release are provided here, but you should check the GitHub repository identified in the preceding paragraph to determine whether a Debian package has been created.
If it has, you can use the apt-get command to install it on your system. Otherwise, install the Kinetic development release of hector_quadrotor in your catkin workspace using the following commands: $ cd ~/catkin_ws/class='lazy' data-src
init hector https://raw.github.com/tu-darmstadt-ros-pkg/hector_quadrotor/kinetic-devel/tutorials.rosinstall
Prior to performing a catkin_make on your workspace, you will need to install the geographic_msgs package: $ sudo apt-get install ros-kinetic-geographic-msgs
Then proceed with: cd ~/catkin_ws and catkin_make
A large number of ROS packages are downloaded with the hector_quadrotor metapackage, including the metapackages for hector_slam, hector_localization, hector_gazebo, and hector_models.
Within these metapackages, this installation downloads the following packages:
A number of these packages will be discussed as the Hector Quadrotor simulations are described in the next section.
Launching Hector Quadrotor in Gazebo
Two demonstration tutorials are available to provide simulated applications of the Hector Quadrotor for both outdoor and indoor environments. These simulations are described in the next sections.
Before you begin the Hector Quadrotor simulations, check your ROS Master using the following command in your terminal window:
$ echo $ROS_MASTER_URI
If this variable is set to localhost or the IP address of your computer, no action is needed. If not, type the following command:
$ export ROS_MASTER_URI=http://localhost:11311
The preceding command should be typed into every new terminal window that is opened, or it can also be added to your .bashrc file. In the .bashrc file, delete or comment out (with a #) any other commands setting the ROS_MASTER_URI variable.
Flying Hector outdoors
The quadrotor outdoor flight demo software is included as part of the hector_quadrotor metapackage. Start the simulation by typing the following command:
This launch file loads a rolling landscape environment into the Gazebo simulation and spawns a model of the Hector Quadrotor configured with a Hokuyo UTM-30LX sensor.
An RVIZ node is also started and configured specifically for the quadrotor outdoor flight. A large number of flight positions and control parameters are initialized and loaded into the Parameter Server.
Note that the quadrotor propulsion model parameters for the quadrotor_propulsion plugin and quadrotor drag model parameters for the quadrotor_aerodynamics plugin are displayed. Then, look for the four Enabled messages:
Enabled wrench output
Enabled attitude output
Enabled yaw rate output
Enabled thrust output
The following screenshots show both the Gazebo and RVIZ display windows when the Hector outdoor flight simulation is launched:
Hector Quadrotor outdoor Gazebo view
Hector Quadrotor outdoor RVIZ view
The view from the onboard camera can be seen in the lower-left corner of the RVIZ window. If you do not see the camera image on your RVIZ screen, be sure that Camera has been added to your Displays panel on the left and the checkbox has been checked.
If you would like to pilot the quadrotor using the camera, it is best to uncheck the checkboxes for tf and robot_model because the visualizations sometimes block the view.
The quadrotor appears on the ground in the simulation and it is ready for takeoff. Its forward direction is marked by a red mark on its leading motor mount.
To fly the quadrotor, you should launch the joystick controller software for the Xbox 360 controller. In a second terminal window, launch the joystick controller software with a launch file from the hector_quadrotor_teleop package:
This launch file launches the joy node to process all joystick input from the left stick and right stick on the Xbox 360 controller, as shown in the following figure. The message published by joy node contains the current state of the joystick axes and buttons.
The teleop node subscribes to these messages and publishes messages on the topic /command/twist. These messages provide the velocity and direction for the quadrotor flight.
Several other joystick controllers are currently supported by the ROS joy package, including PS3 and Logitech devices. For this launch, the joystick device is accessed as /dev/input/js0 and is initialized with a deadzone value of 0.050000. Parameters to set the joystick buttons and axes are as follows:
These parameters map to the left stick and the right stick controls and buttons on the Xbox 360 controller shown in the following diagram. The directions of the sticks’ controls are as follows:
Forward (Up) is ascending
Backward (Down) is descended
Right is rotated clockwise
Left is rotate counterclockwise
Forward (Up) is fly forward
Backward (Down) is fly backward
Right is fly right
Left is fly left
Xbox 360 joystick controls for Hector
To begin your flight, press and release the Go Button. Now, use the joystick to fly around the simulated outdoor environment. Pressing and holding the Slow Button will cause the quadrotor’s speed to decrease to 20 percent.
Note: Pressing the Stop Button will cause the simulated quadrotor’s motors to stop and the vehicle will drop straight to the ground.
The pilot’s view can be seen in the Camera image view at the bottom-left of the RVIZ screen. Within ROS, a clearer understanding of the interactions between the active nodes and topics can be obtained using the rqt_graph tool.
The following diagram depicts all currently active nodes (except debug nodes) enclosed in oval shapes. These nodes publish to the topics enclosed in rectangles that are pointed to by arrows:
ROS nodes and topics for Hector Quadrotor outdoor flight demo
The command ros topic list will provide a long list of the topics currently being published. Other command-line tools such as ros node, rosmsg, ros param, and ros service will help gather specific information about Hector Quadrotor’s operation.
To understand the orientation of the quadrotor on the screen, use the Gazebo GUI to show the vehicle’s tf reference frame. Select quadrotor in the World panel on the left, and then select the Translation mode on the top Environment toolbar (looks like crossed double-headed arrows).
This selection will bring up the red-green-blue axis for the x-y-z of the tv frame. In the following figure, the x-axis is pointing to the left, the y-axis is pointing to the right (toward the reader), and the z-axis is pointing up:
Hector Quadrotor tf reference frame
A YouTube video of a hector_quadrotor outdoor scenario demo shows the hector_quadrotor in Gazebo operated with a gamepad controller. You can find the video at https://www.youtube.com/watch?v=9CGIcc0jeuI.
Flying Hector indoors
The quadrotor indoor SLAM demo software is included as part of the meta package. To launch the simulation, type the following command:
The following screenshots show both the RVIZ and Gazebo display windows when the Hector indoor simulation is launched:
Hector Quadrotor indoor RVIZ and Gazebo views
If you do not see this image for Gazebo, roll your mouse wheel to zoom out of the image. Then, you will need to rotate the scene to a top-down view in order to find the quadrotor. Click on the icon on the top Environment toolbar to Change the View Angle, then select the top icon View from the top.
The environment was the offices at Willow Garage and Hector starts out on the floor of one of the interior rooms. Just as in the outdoor demo, the xbox_controller.launch file from the hector_quadrotor_teleop package should be executed:
If the quadrotor becomes embedded in the wall, waiting a few seconds should release it and it should (hopefully) end up in an upright position ready to fly again.
If you lose sight of it, zoom out from the Gazebo screen and look from a top-down view. Remember that the Gazebo physics engine is applying minor environment conditions as well. This can create some drifting out of its position.
The rqt graph of the active nodes and topics during the Hector indoor. As Hector is flown around the office environment, the hector_mapping node will be performing SLAM and creating a map of the environment:
ROS nodes and topics for Hector Quadrotor indoor SLAM demo
The 3D robot trajectory is tracked by the hector_trajectory_server node and can be shown in RVIZ. The map, along with the trajectory information, can be saved to a GeoTIFF, file with the following command:
To find the map, use the
In this directory, there will be two parts of the map, labeled hector_slam_map. One file will be a .tfw format and the other a .tif format. The .tfw file is a text file that stores the X and Y pixel size, rotational information and world coordinates for the map that is stored in the .tif file. The .tif file contains the TIFF image of the map.
A YouTube video of hector_quadrotor stack indoor SLAM (https://www.youtube.com/watch?v=IJbJbcZVY28) demo shows the hector_quadrotor in Gazebo operated with a gamepad controller.
Now, we will take a look at real quadrotors. For this blog, we evaluated the entire spectrum of quadrotors that interface with ROS and were available at the time. At the bottom of the price range, the Crazyflie was an easy pick, due to its small size and the advantage of flying it indoors.
The small motors cause the propellers to spin at a high RPM, but the propellers are soft and compliant. Because the vehicle is lightweight, damage to property, people, or the vehicle itself is usually minimal. In addition, replacement parts are inexpensive.