Propeller Speed Control System on Autonomous Quadcopter with Variations in Load Fulcrum Point

The need for unmanned vehicles is increasingly needed in certain conditions, such as distribution of disaster supply, distribution of medicines, distribution of vaccines in the affected areas in pandemic situations. The various types of goods to be distributed require a different fulcrum. This research implemented PID control for the quadcopter balance control system to achieve stability during hovering. PID control is used to achieve a certain setpoint to produce the required PWM output for the propeller to reach a speed that can fly the quadcopter tilted until it reaches a steadystate. Tests were carried out on the roll and pitch motion of the quadcopter by providing a load. The results show that PID control can be implemented for the quadcopter balance control system during hovering by determining the PID constants for each roll and pitch motion with Kp = 0.15, Kd = 0.108, and Ki = 0.05. The quadcopter takes 3 – 6 seconds to return to the 0-degree setpoint when it is loaded.


Introduction
This aerial explorer robot is often referred to as an Unmanned Aerial Vehicle (UAV). One type of UAV that is widely used is the quadcopter. Quadcopter has many potential uses that can be developed, one of which is the transportation of goods. The need for unmanned vehicles is increasingly needed in certain conditions, such as distribution of disaster supply, distribution of medicines, distribution of vaccines in the affected areas in pandemic situations. The various types of goods to be distributed require a different fulcrum. For the transportation of goods, the mass and the fulcrum of the load affect the rotational speed of the propeller motor, which affects the quadcopter's stability. The modeling and practical control design of a UAV based on a quadcopter have been conducted in several studies. The PID controllers were set for angular position stability (roll and pitch) and yaw speed [1]. In the field of surveillance and remote package delivering systems also developed using microcontrollers that are programmed to turn on the quadrotors using electronic speed controllers and power electronics design considerations [2] [3]. Modeling and simulation of multi-rotors using Spatial Operator Algebra are useful for a minimal range of angles [4]. Quadcopter flight stability is achieved when all propellers generate equal thrust in hover and throttle mode [5]. A workbench prototype testing on a breadboard is important to get initial setups for testing results [6] [7].
Research [8] shows the implementation of UAVs in the agriculture field to spray herbicides. Thus, the stability of a quadcopter flight control for the intended load and various conditions is crucial. The quadcopter model must have parameters on various relationships, including propeller thrust torque, thrust-PWM, and thrust-angular speed to a certain level of accuracy [9] [10]. Various control algorithms have been developed to stabilize the quadcopter over a certain trajectory since it is hard to follow a particular trajectory. In paper [11], a fuzzy-PID controller is designed using MatLab. Low-level controller using robust control techniques also simulated in [12]. The dynamic model of the drones, the control method of the quadcopter unmanned aerial vehicle with four brushless DC motor speed control, is given in [13].
Furthermore, since the quadcopter will carry loads, a mathematical model of the dynamics of motion of a quadcopter is needed taking into account the important effect of the lifting rotors rotation speed change 14]. Our previous research [15] shows stability response in the quadcopter limited to the condition of the quadcopter hovering for pitch and roll angles. We also get the initial setup for the maximum load for different fulcrums; 950g for the 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. So that in this research, a quadcopter was designed that is capable of carrying loads that have different variations in fulcrum and self-stabilizing automatically. PID control is used to achieve a certain setpoint to produce the required PWM output for the propeller to reach a speed that can fly the quadcopter tilted until it reaches a steady-state. Tests were carried out on the roll and pitch motion of the quadcopter by providing a load. This study aims to produce a quadcopter design that can fly stably and be balanced when the load is implemented at different fulcrum points.

Research Methods
Our research is based on an experimental project. It consists of a data reading process and PID control processing based on variations in load fulcrum. The system read the Quadcopter orientation sensor data after being loaded at a predetermined point using the MPU-9250 orientation sensor on the Ardupilot. Then, PID control processing is based on a set point. The PID control processes the data sent from the sensor. The output is a PWM signal used to control the motor to achieve predetermined quadcopter balance points.

Quadcopter Mathematical Model
In three-dimensional space, the quadcopter has two coordinate systems Figure 1) : (1). body frame; coordinates that move together with the quadcopter, and (2) inertial frames; quadcopter's coordinates reference points. The inertial frame or setpoints work as reference balance for the quadcopter. Rotational matrix mathematical models are used to change the quadcopter's movements to match the inertial value of the frame (equation 1).
Where, C b∨i is the conversion of the body frame value to the inertial frame, ϕ(phi), θ(theta), ψ(psi) is a rotational angle formed by the quadcopter when flying against x, y, z axes.
The inertia matrix describes the moment of inertia contained in the quadcopter on each axis.
Where J b is quadcopter inertia in body frame, J xx, J yy, J zz is the quadcopter moment of inertia to each axis.
Motor lift or thrust determines the ability of a quadcopter to fly, calculated by: Where T is the thrust of the motor, C T is the coefficient of thrust in each motor. ρ is the mass density, A r is the propeller rotation area, r is the radius of the rotor, and ϖ 2 is the angular velocity of the rotor.
The body frame also accepts a lift from the rotor. The lift will only affect the Z-axis, so the formula for lift is: The equation for finding a motor RPM is useful for converting PID control output with the following formula: Where c R is Motor RPM constant per input voltage, and b is resistance on the y-axis.

The design of a quadcopter speed control system
The speed control system model is built in the Simulink module of MATLAB. Using the mathematical model described previously, the variables of each pitch angle, roll, and yaw quadcopter can be determined. Furthermore, we design a quadcopter speed control system divided into several function blocks, as shown in Figure 2. In the Attitude Commands block, the data set point for each roll, pitch, yaw, and quadcopter height can be determined as an input of the desired quadcopter condition, then in the Attitude Controller block a PID control data processing for each roll, pitch, yaw and the height of the quadcopter can be seen in Figure 3.  Figure 3, each roll and pitch motion uses two input feedback: the angular acceleration and the Euler kinematic angle. By implementing the PID control, the correction in each motion and the quadcopter's height can be calculated to reach the given setpoint. The output of PID is in the form of power or throttle for each motor that affects the motion of roll, pitch, and quadcopter height.
Then the correction of each motion is processed in the quadcopter control block, the throttle for each motor can be determined. Finally, in the quadcopter dynamic block, the throttle of each motor is converted to RPM by using equation 5, and quadcopter attribute data can be determined in the simulation by implementing equations 1-4.

Test Design
The PID constant value that has been obtained is implemented on the designed quadcopter. The quadcopter is turned on and flown in a hover condition, without any load. The expected outcome of this test is that the quadcopter can reach and stabilize at setpoints of 0 degrees after applying load at the time of hover.
The following test scenario for this test item : a. Load: Weights 700 g, 500 g, and 200 g are given to the quadcopter with a fulcrum variation in the middle point between 2 arms and placed on one quadcopter arm. b. Evaluation: The quadcopter's performance is compared to the simulation to get the percentage of errors to be analyzed.

Hardware Implementation
In this section, hardware testing determines that the designed system works and produces output that matches the purpose. From this test, the obtained data will be used to analyze the work process of each hardware so that we can proceed to the test environment set up. The assembled quadcopter can be seen in Figure 5.

Quadcopter model simulation
The PID control data can be tested and determined using a quadcopter simulation on Matlab with this configuration. The first step in this test is inputting hardware data previously measured to be a model in the simulation, as shown in Figure 4.5.  After the model is obtained, hover conditions with slope disturbance and roll motion is simulated in Figure 7.

Quadcopter Testing
At this stage, the PID test is performed on the designed quadcopter ( Figure 11). The response time of the quadcopter PID control is collected, where the data collection of each roll and pitch motion starts from the time of disturbance or error in the quadcopter. Data were analyzed in several parts, namely roll, pitch, and motor PWM, based on response time, as shown in Figures  12 and 13. By using collected data, calculation of the response time control on the quadcopter was designed as follows ( Figure 12): Based on the calculation of the percent overshoot obtained a value of 20.20%, which means the quadcopter rotates at a pitch motion of 20.20% to achieve a steady-state from the overshoot state. The pitch motion is not given interference, but because of the large output in the roll motion, the disturbance in the pitch motion is a side effect of such an output; thus, resulting in disturbance as small as 5 degrees, can be seen in Figure 12 The reference value of Tr roll is 2 degrees so that the Tr roll time is 0.99 seconds, which means that the quadcopter takes 0.99 seconds to reach 90% of the interval to the setpoint on the roll motion. The Ts roll time is approximately 4.28 seconds, with a Ts reference value of -0.4 degrees from the setpoint. The quadcopter takes 1.4 seconds to reach the peak overshoot value of -12.8 degrees. A value of 23.85% is obtained based on overshoot calculation, which means the quadcopter rotates at a roll motion of 23.85% to reach a steady state. The percent overshoot value occurs because the peak overshoot is much higher than the steady-state value due to the PID control response against temporary disturbances.
Based on the picture, the reference value of Tr pitch is -0.5 degrees, so that the Tr pitch time is 0.7 seconds, which means that the quadcopter takes 0.7 seconds to reach 90% of the interval to the setpoint in pitch motion. Then, the reference value of Ts pitch is approximately 0.1 degrees from the setpoint, and the Ts pitch time is approximately 5.3 seconds. It takes 5.3 seconds to reach a steady state. The reference value of Tp pitch is 2.12 degrees, where this reference value is obtained from the peak value at overshoot, peak time (Tp) is 1.4 seconds, the quadcopter rotates at a pitch motion of 2020% to achieve a steady-state from the overshoot state. The pitch motion is not disturbed, but because of the large output in the roll motion, there is a disturbance in the pitch motion as a side effect of such a large output, but the resulting disturbance is 5 degrees.

Figure 13. Quadcopter Motor PWM Output With PID
The value of each motion still oscillates in the steady-state range because the quadcopter detects an error on the quadcopter's z-axis. It can be proven based on the motor output shown in Fig.  Figure 13, where it can be analyzed that motors 4 and 3 have a higher value than the input PWM setpoint or a steady-state error occurs. Based on the quadcopter configuration that has been designed, if motors 4 and 3 have a higher output than motors 1 and 2, the quadcopter will rotate to the right.

Testing and Analysis of Control Response Times Against Variation of Pivot Points
In the quadcopter (Figure 14), loads are given to the quadcopter with a fulcrum variation in the middle point (700g), between 2 arms (500g), and on one quadcopter arm (200g). The data obtained from the time response analysis for each motor and the response time analysis in this test are divided into 2, namely the transient and steady-state responses.    Figure 15.b shows the results of quadcopter testing when given a 200g load on motor 1. The response time on motor 1 is slower because the PID control detects a more significant disturbance in motor 1 pair, namely motor 2, so motor 1 must be slower than motor 2 to balance quickly. The additional load on the two quadcopter motors affects the roll and pitch motion of 25 degrees and 26.5 degrees. The load also affects the speed of the quadcopter, where the motor experiences a steady-state error. The quadcopter requires 3.86 percent more power on motor 1. 9.8 percent more on motor 2., 4.83 percent more on motor 3, and 4.02 percent more on motor 4 to remain able to hover with a 200g load on motor 2 compared to the hover state without load, the most significant error value occurs in motor 2 where the load is stacked, the closer the motor is to the fulcrum, the greater the error.
Furthermore, for testing with 500g Load on Motor 2 and 4, Figure 15.c. Quadcopter takes 1.8 seconds for motor 1, 1.8 seconds for motor 2, 1.2 seconds for motor 3, and 0.8 seconds for motor 4 to reach 90% of the interval to steady-state. The response time on motors 1 and 3 is slower because the PID control detects a more significant disturbance in its partner, motors 2 and 4, to balance itself quickly. The overshoot value is 0.65% on motor 1, 0.93% on motor 2, 0.09% on motor 3, and 1.54% on motor 4, where this percentage value means the power required for each quadcopter motor to reach a steady-state from the overshoot state. Loads that are only focused on their respective partners so that the motor slows down to balance itself. The additional load on the 2 and 4 quadcopter motors affects the roll and pitch motion of 25 degrees and 26.5 degrees. The quadcopter requires 1.79 percent more power on motor 1, 9.8 percent more power on motor 2, 2.4 percent more on motor 3, and 5.03 percent more power on motor 4 to remain to hover with a 500-gram load between the motors 2 and 4 compared to with no-load hovering state.
Overall test results show in Table 2.

Conclusion
Based on the research and testing, it can be concluded that PID control can be implemented for the quadcopter balance control system during hovering by determining the PID constants for each roll and pitch motion with the constant of Kp = 0.15, Kd = 0.108, and Ki = 0.05. The quadcopter takes 3 -6 seconds to return to the 0-degree setpoint when loaded with various loads and positions. The more significant the tilt error in the quadcopter, the longer it takes to return to the 0-degree setpoint.
In further research, it is necessary to add a system that can automatically detect the load's position so that the quadcopter balanced system can reach the balance point more quickly during hovering.