Chapter 7. Making a Robot Fly

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 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 chapter, there is some commonality between the mobile robots and flying robots in their command and control. ROS utilizes this commonality 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 book is again used for the simulated and real quadrotors presented in this chapter. For sensors and devices that are common between mobile robots and flying robots, ROS takes advantage of this commonality through its standard topic and message interfaces. Just as with other robots, ROS standard topics and messages communicate information from the on-board sensors about the state of the quadrotor and its environment.

This chapter 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, that 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 chapter:

  • How quadrotors fly
  • Capability of sensors that are used in quadrotors
  • Techniques and rules of flying quadrotors
  • Examples of quadrotors using ROS
  • Flying the simulated Hector Quadrotor
  • Flying real quadrotors; Crazyflie and Bebop

Introducing quadrotors

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 chapter, we will introduce some of these flying robots that are controlled by ROS. The chapter will consider both simulations and flying the real thing.

The following figure shows the Crazyflie quadrotor that will be discussed later in this chapter:

Introducing quadrotors

Crazyflie quadrotor

In the image of Crazyflie, notice the four propellers or rotors that act to lift the craft vertically for takeoff and keep it in flight at some altitude when flying. First, such crafts are classified as rotocraft 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 the 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 variable pitch, but they will not be considered in this chapter. In helicopters, the main propeller is a variable-pitch propeller to control the craft's direction of flight.

For a general discussion of quadrotors, visit https://en.wikipedia.org/wiki/Quadcopter.

Why are quadrotors so popular?

Quadrotors are a popular option for hobbyists and researchers. They have attractive characteristics, primarily:

  • Relatively low cost compared to other aerial crafts
  • 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:

Defining roll, pitch, and yaw

Roll, pitch, and yaw for an airplane

Pitch is the movement of the nose, up or down in forward flight. Roll is rotation around the longitudinal axis that runs along the length of the aircraft. Yaw is the movement of the nose to left or right which is rotation about the vertical axis. The amount of rotation is typically stated in degrees.

Tip

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 a plane, 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 backwards!

How do quadrotors fly?

The quadrotor has two pairs of counter-rotating propellers. When hovering, the propellers rotate at the same speed and provide the 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 turned. 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 the 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:

How do quadrotors fly?

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:

How do quadrotors fly?

Quadrotor propellers

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 that 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: http://blog.oscarliang.net/quadcopter-pid-explained-tuning/.

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 of the quadrotors also allow control by smart phones, 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 on-board 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.

Adding sensors

One important application of quadrotors is for aerial photography. Some models have the camera built directly into the body. Other models have cameras attached under 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 through a series of GPS waypoints to traverse a selected course.

For more information about the GPS system, visit http://www.gps.gov/systems/gps/.

There are many models of quadrotors on the market. For a comparison, visit http://quadcopterhq.com/best-quadcopters/.

Since manufacturers are producing new quadrotors in finished or kit form, you should check websites that review the latest crafts if you are in the market to buy one.

Quadrotor communications

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 by smart phones 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.
  • 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.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.59.226.232