Introduction

Compact air vehicles with rotor craft capable of vertical takeoff and landing are called quadcopters. These are similar to helicopter capable of hovering, and because of simple mechanical structure and ease of operating, their demand is increasing since they have no swashplate mechanism. The popularity of quadcopter has increased, and the first quadcopter was developed in 1920s [1, 2]. The increasing demand of quadcopter [3, 4] is due to the research-grade platforms.

The designing and fabrication of quadcopter are challenging. It mainly consists of mathematical model in time and frequency space domain. The quadcopter [5, 6] mathematical model is a nonlinear model.

A quadcopter has four similar dispersed rotors, located at four corners of the square-shaped frame. The electronically operated rotors made it easier to control and hence adaptable for multiple applications. Quadcopter falls under the category of mobile robots with four control inputs having six degrees of freedom (DOF), in which three are translational and three are rotational. This rotational and translational movement makes it flexible in moving in any direction.

Method

The project is divided into different blocks. The microcontroller Atmel 16 is used to control the speed and PWM of the four brushless motors M1, M2, M3, and M4. The flight controller board MinIMU-9, which contains gyroscope, accelerometer, magnetometer, and pressure sensors, is used to adjust control variables raw, pitch, and yaw at every instant with complementary second-order high-pass filter. The bluetooth module HC 05 is powered by LIPO battery and serial communication between android-based applications to control the movements of the quadcopter. The purpose of using LIPO battery is because of its lighter weight and higher efficiency. The output of the PID control system is a PWM signal whose pulse width is varied to control the motor speed. MATLAB software is used to tune the PID control in real systems. Figure 1 shows the block diagram of the quadcopter.

Fig. 1
figure 1

Block diagram of quadcopter

Quadcopter frame design

During the design of the quadcopter frame, the most important factor to determine is the center point of gravitation [7] of the frame. To find the point, two tests were conducted. In suspension test, we tied four arms of the quadcopter to the string and place small weight and checked for the point where system gets perfectly aligned in the air. The weights were placed, and the orientation was noted by the sensors. Secondly, the tipping test was performed in that test the frame of the quadcopter was placed on the rigid pivot, and the point was selected that can withstand the whole of the frame body. In both of the above tests, orientation of the points was close to each other. After determining the point, it was decided to calculate the symmetric coefficient. These coefficients are required to stabilize the body in air. The PID controller [8, 9] was selected because of the ability to tune and handle the nonlinearity of the system at every instant. Tuning was done in MATLAB and repetitive flight testing of the frame has been done. The final successful frame designed was made up of thermopore, which results in stability, and hence, collision issues were resolved.

Flight controller board

The flight controller board used here is mounted with MEMS sensors, i.e., gyroscope, accelerometer, magnetometer, and pressure sensors to control the variables roll, pitch, and yaw for a stable flight. MinIMU-9 board [10] used here is a perception sensor that perceives the information from the environment. This board is interfaced with the microcontroller to send and receive data. Block diagram of the communication is shown in Fig. 2.

Fig. 2
figure 2

Block diagram of the sensor system communication

Brushless DC motors

In this project, the brushless dc motors [11] are used. The value of the thrust per motor is calculated [11] by the following formula:

$$ {\text{Thrust}}\;{\text{one}}\;{\text{each}}\;{\text{motor}} = ({\text{Total}}\;{\text{weight}} \times 2)/4\;{\text{Following}}\;{\text{is}}\;{\text{the}}\;{\text{reason}}\;{\text{for}}\;{\text{selecting}}\;{\text{these}}\;{\text{motors}}\;{\text{in}}\;{\text{this}}\;{\text{project}}. $$
  • These motors are high-speed motors with the operating speed of 10000 rpm either loaded or in unloaded condition.

  • The inner rotor of the motor has low inertia which can be accelerated, decelerated, and can be moved in reverse direction which results in rapid acceleration and response time.

  • These motor are capable of producing high running torque per cubic of a DC motor, which results in increased power density

  • The brushless motors have good lifetime and long running hours approximately 10000 h and hence less chances of replacing or repairing and are very reliable.

  • Propeller Length and Pitch

    In the quadcopter, there are four propellers, two rotating in clockwise and other two in the anticlockwise direction. The length and the pitch of the propeller greatly depend on the speed and stability of the quadcopter. The greater the length and the pitch more power will be used, hence more current will be drawn and vice versa. Therefore, I have used the propeller with shorter length and low pitch because of the stability of the frame during the flight time.

PID controller tuning

PID controller [8, 9] has been selected as the most suitable controller for the quadcopter. The tuning of the control parameter has been done by keeping in view the factors of the balancing the inertial moment and the generated force from the motors. The inertial moment depends on the total mass and motor properties such as payload. A closed-loop control system, i.e., PID controller has been simulated and carefully designed for stabilizing the actual angle from the sensors and desired angle from the pilot. The fine reduced error rate of 0.05 degrees after every 10 s was achieved in the actually designed controller. Figure 3 shows the PID structure at each of the coordinate axis.

Fig. 3
figure 3

PID structure at each of the coordinate axis

Frame stability

The controller used has been simulated/tuned several times to obtain the stability [12, 13] in the frame. The adjustment in the parameters of angular velocities and angular displacements [14] are taken into the account. The roll, pitches, and yaw angles in the body frame are θ = (φ, θ, ψ). The graph of the angular velocities and angular displacement with respect to the roll, pitch, and yaw angles ϕ, θ, and Ψ, respectively, are shown with red, green, and blue lines. The manually generated graphical plot of angular velocities versus time and angular displacement versus time is shown in Fig. 3.

The automatically generated simulation results of angular velocity and angular displacements were far better than the manually generated results. The automatically generated graphical plot of angular velocities versus time and angular displacement versus time is shown in Fig. 4.

Fig. 4
figure 4

Manual generated graph of angular velocities and displacement

From the above simulated results, we inferred that the swings in the values are smaller, overshoots are lesser, and the rate of convergence is faster. The drawback in the automatically tuned angular displacement is the error which converges later then the manually tuned angular displacement.

Flight dynamics

The flight dynamics of the quadcopter generally works in the two frames. The position of the inertial frame is with respect to the ground and the gravitational pull is the negative z-axis of the coordinates. The position of the body frame is with respect to the orientation of the quadcopter, i.e., the rotors direction are in the positive z-axis and the arms of the quadcopter are in x-axis and y-axis. Figure 5 shows the coordinates axis of the body and inertial frame.

Fig. 5
figure 5

Automatic generated graph of angular velocities and displacement

The angular velocity ω is the vector quantity directing in axis of rotation θ is the time derivative of roll, pitch, and yaw. The relation below is used to determine the angular velocity vector ω in body frame where Cφ, Cθ, and Cψ and Sφ, Sθ, and Sψ represent cosine and sine angles, respectively.

$$ \omega = \left[ {\begin{array}{*{20}l} 1 \hfill & \quad 0 \hfill & \quad { - s_{\phi } } \hfill \\ 0 \hfill & \quad {c_{\phi } } \hfill & \quad {c_{\theta } s_{\phi } } \hfill \\ 0 \hfill & \quad { - s_{\phi } } \hfill & \quad {c_{\theta } c_{\phi } } \hfill \\ \end{array} } \right]\dot{\theta } $$

The relationship of the rotation matrix R will transform the body frame to the inertial frame. The matrix is obtained by conventions of the Euler angle, i.e., ZYZ and placing the yaw, pitch, and roll angles of the frame back to its initial values:

$$ R = \left[ {\begin{array}{*{20}l} {c_{\phi } c_{\psi } - c_{\theta } s_{\phi } s_{\psi } } \hfill & \quad { - c_{\psi } s_{\phi } - c_{\phi } c_{\theta } s_{\psi } } \hfill & \quad {s_{\theta } s_{\psi } } \hfill \\ {c_{\theta } c_{\psi } s_{\phi } + c_{\phi } s_{\psi } } \hfill & \quad {c_{\phi } c_{\theta } c_{\psi } - s_{\phi } s_{\psi } } \hfill &\quad { - c_{\psi } s_{\theta } } \hfill \\ {s_{\phi } s_{\theta } } \hfill & \quad {c_{\phi } s_{\theta } } \hfill & \quad {c_{\theta } } \hfill \\ \end{array} } \right]. $$

The purpose of visualization of the quadcopter in three dimensions by using the mathematical model assisted in developing controllers for physical system as well as having rough idea of the rotors relative magnitude of thrust. In Fig. 6, yellow and pink bars represent the thrust magnitude on each of the four rotors.

Fig. 6
figure 6

Body frame and inertial frame axis coordinates

Effect of aerodynamic

The control of the dynamics of the quadcopter at altitudes is assumed to be linear with slow speed. The varying in the speed of the air has significant effect on the dynamics of the system operating at moderate speed. Aerodynamic effect of flapping blades [15, 16] of the rotor affects the direction of the motion and results in the tilts of the rotor plane. To measure the flapping angle, simulated results are given in Fig. 7, which represents the increase in the horizontal force as the speed of the wind increases with time.

Fig. 7
figure 7

Visualization of the quadcopter in three dimensions

The type of blades used also has an effect on the aerodynamic of the system. The direction of the motion of the quadcopter frame is affected by using hinged blades (plastic material) [17] or stiff blades (carbon fiber) [17]. Figure 8 shows the change in the angle of deflection versus the speed of the wind for the stiff and hinged blades. The same results were also observed during the actual flight of the quadcopter (Fig. 9).

Fig. 8
figure 8

Graph of the horizontal force with the increasing wind speed

Fig. 9
figure 9

Graph of the angle of deflection versus the wind speed

Android-based software

The android-based software used in the project is an open source named AR drone free flight [18]. The features of the application are live video camera feed, altitude indicator, emergency landing, error reset option, quadcopter battery indicator, and joystick control. This android application is developed so that its receiver end can be any bluetooth device. We have used HC-05 bluetooth module to operate the quadcopter with this android application.

Bluetooth device

The bluetooth module used here is HC-05 [19], and one end of the module is serially interfaced with microcontroller. The command given from the joystick will be wirelessly communicated to the microcontroller, and quadcopter will navigate accordingly.

Results

The study of the mathematical model and control of the quadcopter is presented. Several tested methods were used for the selection of the material in the design of quadcopter frame. The rotation matrix R is derived from the Euler’s method. The verification of the model was done by performing the simulation and implementation of the thrust magnitude on each of the rotor. Several simulation results on the aerodynamic factor of the frame and selection of the flapping blades and there effect on the angle of deflection was incorporated during the actual design. The motor behavioral modal is determined on the basis of the estimation which was quite near to the actual physical modal.

Conclusion

The stabilization factors of the quadcopter are achieved by simulating the parameters of angular velocities and angular displacement. Interfacing of the microcontroller with the brushless motors, bluetooth module, and flight controller board. Serial communication of the android-based mobile application with the bluetooth module.