Design of Autonomous Quadcopter Using Orientation Sensor with Variations in Load Fulcrum Point

In designing the quadcopter, the main focus is stability and balance. Thus, in the more specific implementation, for example for aerial photography, a quadcopter can also be used as a load carrier. To be able to balance the quadcopter equipped with an orientation sensor on the controller, the orientation sensor includes a gyroscope sensor, accelerometer, and magnetometer. For this reason, it is necessary to have an autonomous stabilizer mechanism that can make the quadcopter stay in a stable and balanced condition even with the additional load. Furthermore, in this research, we will discuss how to determine the PID set points for quadcopter balance that can be tested on loads with different fulcrums. The test is limited to the condition of the quadcopter being hovered for pitch and roll angles. Based on the testing results, it can be concluded that there is a stability response in the Quadcopter. It can be seen from the RMS value obtained that it is by the steady-state tolerance of 2% -5% of the setpoint. Then, the Quadcopter can carry the maximum load with different fulcrums; 950g for fulcrum in the middle of the quadcopter, 580g for the load is placed 6 cm from the middle of the quadcopter, and 310g if the load is placed on one motor.


Introduction
Unmanned Aerial Vehicle (UAV)s are planes that do not require human operators in them, using aerodynamic forces to lift vehicles, can fly independently or be driven remotely, and can carry loads. One example of a UAV is a quadcopter. The quadcopter has the advantage of being able to fly in all directions, airing without a long runway, and moving on three axes. The quadcopter is used for various functions such as those can not be reached by humans such as monitoring road congestion, surveying and mapping, spy robots, and monitoring natural disasters. In designing the quadcopter, the main focus is stability and balance on the quadcopter [1]. The quadcopter must also be able to take orders and fly according to the instructions given; it will be fatal if it does not go as desired. To be able to balance the quadcopter equipped with an orientation sensor on the controller, the orientation sensor includes a gyroscope sensor, accelerometer, and magnetometer [2].
In the study with PID controls able to stabilize complex systems so that it has succeeded in making a quadcopter that can fly stably. Moreover, in the research [3] has succeeded in making a quadcopter that can stabilize itself against the x-axis, using fuzzy methods. In the two studies discussed the balance of the quadcopter only. Thus, in the more specific implementation of a quadcopter, for example for aerial photography [4] [5][6], a quadcopter must be able to carry a camera, and besides that, a quadcopter can also be used as a load carrier. For this reason, it is necessary to have an autonomous stabilizer mechanism on the quadcopter that can make the quadcopter stay in a stable and balanced condition even with the additional load given to the quadcopter. Then this additional load will later have variations in fulcrum point so that a quadcopter system that can carry the load and maintain its balance to the load with a different load fulcrum point can be obtained. Furthermore, in this research, we will discuss how to determine the set points for quadcopter balance and design a stable quadcopter that can be tested on loads with different fulcrums. The balance test is limited to the condition of the quadcopter being hovered for pitch and roll angles. The weight to be tested is 500g and 200g with three load points, namely in the middle position of the quadcopter, the second is between two quadcopter arms, and the third is on one of the quadcopter arms.

Proportional Integrative Derivative (PID) Controller
Proportional Integrative Derivative (PID) is a control system to determine the precision of an instrumentation system with the characteristics of feedback on the system. This PID control component consists of three types, namely Proportional, Integrative, and Derivative [7] [8]. In a control system, there are several types of control actions, including proportional control, integral control, and derivative control. Each of these control actions has certain advantages, where the proportional control action has the advantage of rapid rise time, integral control action has the advantage of minimizing errors, and the derivative control action has the advantage of minimizing errors or reducing overshot/undershot. For this reason, in order to produce output with fast rise time and a small error, we can combine these three control actions into the PID control as in Figure 1. The output value of the PID control is formulated as: (1) Equation (1) describes the output value u(t), which is the sum of proportional gain (Kp), integral gain (Ki), and derivative gain (Kd), each of which is changed by error (e) in a specific interval (t).

Quadcopter Design
The designed Quadcopter as in figure 2 consists of: (1). Brushless motor is a type of motor that has a permanent magnet construction (rotor) and a wire-bound polar stator [9]. Electrical energy is converted into mechanical energy by the influence of magnetic force between the permanent magnet and a polar stator. The number of magnetic poles in the rotor also affects the step size and torque ripple of the motor, (2) Electronic speed controller (ESC) interprets signals from the receiver and works to provide variations in motor speed. The signal on the ESC is a Pulse Width Modulation (PWM) signal, which means that to control the motor speed (RPM) the ESC varies the PWM signal according to the RC transmitter. (3). Propeller produces lift. In Newton's Law of Lifts and deflection of the flow, lifts are generated due to air pressure and compressive forces from the wing area, that the pressure of the wing area does not produce a pure force, but a pressure difference is needed to produce a lift. (4). The Bluetooth module is used as a transmitter and receiver on a quadcopter. Bluetooth is a wireless communication protocol that works on 2.4 GHz radio frequencies [10]. The Bluetooth module used is the HC-05 type. (5). ArduPilot Mega is an electronic kit or an unmanned aerial vehicle electronic circuit board with ATMega328 as its microcontroller. Ardupilot Mega has an MPU-9250 IC as an orientation sensor. This sensor consists of a Motion Tracking 9-axis device that combines a 3-axis gyroscope, 3-axis accelerometer, 3-axis magnetometer and Digital Motion Processor (DMP) all in one chip package with a size of 3x3x1 mm [11].
Quadcopter diagram block can be seen in Figure 3.

Figure 3. Block Diagram of Quadcopter Design
The quadcopter is controlled by computer via Bluetooth signal. Moreover, the Bluetooth module is connected to the Ardupilot so that the quadcopter can be connected to the computer. For balance on the quadcopter using the Accelerometer sensor, Gyroscope, and magnetometer. Then the sensor readings will be processed using PID controls and generated PWM. The PID control parameters, Kp, Ki, and Kd, are obtained from the simulation results. ESC functions to regulate motor speed. Each motor will rotate differently according to the results of processing in the PID control to produce a quadcopter that can fly stably. The motor will be connected to the propeller to produce lift on the quadcopter.
Motor speed will be influenced by orientation data taken by the sensor; if the orientation of the quadcopter is below the balance set point, the motor will be given additional power to move the motor so that the orientation of the quadcopter can reach the balance set point. If the quadcopter's orientation crosses the balance set point, the power supplied to the motor is reduced. Motor control is done by adjusting the power based on the PWM signal based on the PID control output and signal data sent to the Electronic Speed Controller (ESC). The system will continue to operate to correct the orientation of the quadcopter until the desired set point balance is obtained. Calibration set point balance stored in the Microcontroller program, when the system detects the orientation of the quadcopter is by the balance set point, the motor will maintain the orientation of the quadcopter.
The fulcrum of the test load is designed with a distance of one point to another of 5 cm. By placing the load at each different point, it will cause the quadcopter's condition to be tilted; this is where it is arranged so that the quadcopter can fly in a stable move even though it is given a load with a different fulcrum. In Figure 4, the quadcopter position can be seen to get the setpoint value. Based on the results of this processing in Table 1, the set point values will be obtained for use by the PID control. The PID control parameters, Kp, Ki, and Kd, are obtained from the simulation results that have been made used in quadcopter so that the values obtained for controlling the speed of each motor to achieve a balanced state can be compared with the quadcopter in simulation.

Matlab and Simulink Simulation Design of Quadcopter
When the quadcopter flies in three-dimensional space, there are two coordinate systems, namely the body frame which means coordinates that move together with the quadcopter, and inertial frames which mean the reference point coordinates used for a quadcopter. The inertial frame or set point is fixed and immovable so that it can be a reference balance for the quadcopter ( figure 5).
The mathematical model used is the rotational matrix used to change the movement of the quadcopter to match the inertial frame value (equation 2) [12]. means the conversion of the body frame value to the inertial frame value. ϕ (phi), θ (theta), ψ (psi) is a Euler Angle which is the rotation angle formed by a quadcopter when flying against the x, y, and z-axes.

Hardware Implementation
The hardware implementation, as in figure 6 aims to obtain data that will be used to analyze the work of each hardware device.

Brushless Motor
We assume Brushless Motor as a cylinder (figure 7), so we get the data in table 1. Moreover, to find the moment of inertia in the motor, equation 3 and 4 are used [13].

Figure 7. Brushless Motor
The moment of inertia on the motor against the x and y-axis : The moment of motor inertia against the z-axis: Where is the mass of brushless motor, is the perpendicular distance, and is diameter respectively.

ESC (Electronic speed controller)
We assume ESC as a thin plate, so we get the data as in Table 2. Moreover, for the calculation of the moment of inertia using equation (5) and (6) [14].

Figure 8. ESC
The moment of ESC inertia to the x and y-axis : The moment of ESC inertia towards the z-axis is obtained by : (6) Where is the width and is the height of ESC respectively.

Arm
The arm is assumed to be a cylinder, so the arm data is obtained as in Table 2. by using equation 7 calculation of the moment of inertia of the arm against the x and y-axis : Moreover, the calculation of the moment of arm inertia on the z-axis is obtained by using equation 8: Where is a lift and A is an arm of the quadcopter respectively.

Middle Frame
All of the components in the center we assume as a cylinder, data for the middle frame are obtained in Table 2. The quadcopter rotation on the x and y-axes will calculate of the moment of inertia in the middle frame using the rotation equation in the middle of the diameter so that we can calculate the middle frame inertia Moment against the x-axis and y as in equation 9: Moreover, quadcopter rotation on the z-axis, the moment of inertia formula with the middle frame calculate using equation 10 : (10) Where is the middle frame of the quadcopter respectively.
By entering all parameter values, the moment of inertia is obtained for the entire quadcopter, as shown in Table 2. With configurations as in Table 2, the quadcopter can fly with a lift which can be calculated using equation 11 as follows [15]: Where is air density, is speed, is the area of the circle produced by the wing when rotated, is the lift coefficient respectively.
With maximum V: The rotational speed of propellers can be calculated as: Then : Because it uses four motors then Based on the results of the above calculations, the maximum lift can be obtained which can be produced by a quadcopter that has been designed at . Then to be able to fly (hover). A half load is required from the maximum lift, so the quadcopter lift is .

Testing the load value that can be lifted by a quadcopter at a different fulcrum
Testing of loads that can be lifted by a quadcopter can be seen in Figure 9. The test aims to find the maximum load value that can be lifted by a quadcopter. Testing is also done by applying different throttles. Tests are carried out at three different fulcrums. This fulcrum is considered to represent the implementation of a quadcopter as a load carrier. The first test is carried out at the fulcrum in the middle of the quadcopter. We place a digital hanging scale on the bottom of the quadcopter; then the scale is held on the floor, so it stays in the same position. The lift generated by a quadcopter will be represented as a mass by a hanging scale. When the quadcopter is pulled up, the mass value will increase in the quadcopter. The maximum load that can be lifted by quadcopter is 950g besides the load of the quadcopter itself. The second test, we place the load at 6 cm from the midpoint of the quadcopter or between motor 2 and 4. The maximum load that can be lifted by quadcopter is 580g. The third test is to find the maximum load that can be lifted by the load placed on one side of the quadcopter (under motor 2). The maximum load that can be lifted by quadcopter is 310g.
The overall test results can be seen in Table 3. It can be seen that giving different throttle value affects the load that can be lifted by the quadcopter; the higher the value of the throttle will produce a more significant lift.

Analysis of Response Time
We analyze system behavior regarding response time specifications such as overshoot, settling time, peak time, rise time, and steady-state error on quadcopter during hovering. By using the value of Kp = 0.15 Ki = 0.1 and Kd = 0.004, we get the value of roll and pitch on the quadcopter.
Graphs of test results can be seen in figure 10.     It can be seen that the RMS value in test 1 without load slightly exceeds the steady-state reference since the quadcopter has no load to carry, then it moves more when interferences applied to test the stability. However, on tests 2 and 3 get the RMS value that corresponds to the steady-state reference value so that it can be concluded that the quadcopter can fly in a stable state.

Conclusion
Based on the research and testing that has been conducted, it can be concluded that Setpoint quadcopter for the steady or balanced position is 0.0008 o , 0.9 o for roll angle and pitch angle, respectively. There is a stability response in the Quadcopter even though we give a load on a different fulcrum; it can be seen from the RMS value obtained that it is by the steady-state tolerance of 2% -5% of the setpoint. Then, the Quadcopter can carry the maximum load with different fulcrums; if the load is placed at the fulcrum in the middle of the quadcopter, the maximum load is 950g. If the load is placed 6 cm from the middle of the quadcopter, it can carry the maximum load of 580 g. Moreover, if the load is placed on one motor, the maximum load is 310 g. In the development of the next system for future research, the quadcopter balance system will be improved upon landing with a load. Then, we try to display the simulation results visually.