Fuzzy Gain Scheduling PID Control for Position of the AR.Drone

Received May 31, 2017 Revised Oct 24, 2017 Accepted Mar 14, 2018 This paper describes the design and implementation of fuzzy gain scheduling PID control for position of the AR.Drone. This control scheme uses 3 PID controllers as the main controller of the AR.Drone, in this case to control pitch, roll and throttle. The process of tuning parameters for each PID is done automatically by scheduling determined by Takagi-Sugeno-Kang (TSK) fuzzy logic model. This paper uses five function sets of PID parameters that will be evaluated by fuzzy logic in order to tune PID controllers. Error position (x,y,z), as inputs of controller, enters the PID Signal block yielding the ouputs in term of error, integral error and differential error. These signal become the inputs of the fuzzy scheduler to yield outputs pitch, roll and throttle to the AR.drone. The control scheme is implemented on the AR.Drone to make it fly to forming a square in the room. The experimental results show that the control scheme can follow the desired points, and process scheduling PID parameters can be shown. Keyword:

clusters. NavData VI sends UDP packets to the Navdata output who ordered AR.Drone to send sensor's data to IP address of the computer. State VI is used to estimate x, y, z position of the Navdata. Some researchers noted having designed PID and Fuzzy controller on the AR.Drone. Prayitno, et al. in [3] designed 2 fuzzy controllers to control the x and y position using pitch and yaw. Indrawati, et al. in [4] and [5] is designed and implemented three pieces of fuzzy logic control to control the position of x, y, z using of pitch, roll and vertical rate of the AR.Drone. They compared various schemes of fuzzy control to position control. Prayitno, et al. in [6] is designed conventional PID control and compared with fuzzy control scheme designed by Indrawati in [5]. Tang in [7] designed a PID controller for waypoint navigation applications and trajectory tracking and vision-based controller for a variety of formation flying. Abbas, et al. in [8] is designed controls for tracking formation quadrotor where the PID controller is implemented in quadrotor leader and directed Lyapunov controller is implemented on the followers. The artificial fish swarm algorithm is used for dynamics optimization of the parameters controllers. Seidabad, et al. in [9] modelled the motion of all quadrotor with Simulink. They are using two types of controllers, which are PID controller and combination of fuzzy-PID controller. The simulation results showed that the hybrid fuzzy-PID controller is more suitable when there has a turbulence. Gautam, et al. in [10] designed a self-tuning PID controller using EKF algorithm that is implemented on quadrotor for attitude and position control of the quadrotor. Ammozgar, et al. in [11] implemented Fuzzy PID Gain-Scheduled to cope with the possible failure of the actuator quadrotor. The two actuator failure schemes are designed, which are the failure of all actuators and single actuator. Prayitno, et al. in [12] implemented other control scheme, H-Infinity, to control pitch and roll of the AR.Drone. Hazzabi,et al. in [13] implemented adaptive FLC-PI, where PI controller parameters are adjusted by fuzzy gain scheduling, to control an induction motor. Syed, et al. in [14] applied fuzzy gain scheduling PI control based on the system's operating conditions for controlling engine power and speed of a power-split HEV in the applied automotive field.
Our paper describes the design and implementation the fuzzy gain scheduling PID control for position of the AR.Drone based on operating conditions. This research is motivated by the fact that in nonlinear system, a single set of PID gain will only be suitable for a given operating point. When the aircraft, in this case the AR.Drone, fly on a different operating point, it would require a different PID gain. In order to make the drone fly to multiple operating points, multiple sets of PID gain is required. The scheduling mechanism is needed in order to determine the PID gain which is appropriate for the current operating point. Once the new operating point is detected, the PID gains can be changed to the appropriate values. The gain scheduler consists of multiple sets of PID gain and the logic for detecting the operating point and choosing the corresponding value of PID Gain. The purpose of this research is to experiment the implementation of fuzzy gain scheduling PID control for position control of AR.Drone in the laboratory. In this research, as the gain scheduler, Takagi-Sugeno-Kang (TSK) fuzzy logic is used. The suitable PID gain function for some operating point is determined by experimentally to get the expected transient response. Five functions of PID gain represent five operating point are used in this research. This research shows that the gain scheduling pid control is successfully applied to AR.Drone position control.

RESEARCH METHOD 2.1. Basic setup of AR.Drone
This research uses LabVIEW software by modifying the program created by [2]. This program uses communication and basic control for AR. The sequence is the sequence number of the command, AR.Drone simply executes a command that has a sequence number larger than the previous sequence number so AR.Drone does not re-do the previous command. The program used in this study uses sequence numbers up to 100 and will be reset to 1 when it reaches 100. The argument is a 32-bit integer with each bit having its own function. Bits 0 through 7 are not used and have a value of 0. Bit 8 is used to set the emergency land mode by giving a value of 1. When bit 8 is 0 then AR.Drone is in normal mode and ready to accept the command. Emergency land mode is a condition where AR.Drone will turn off the entire motor without regard to the given command. Bit 9 is used to set the fly or land mode of AR.Drone. When bit 9 is set 1 then AR.Drone is ordered to fly and vice versa when set 0 then AR.Drone will make a landing. Bits 10 through 31 are not used and have a fixed value of "000000001010101010". c. State ATPCMD is useful for sending commands for AR.Drone to move or maneuver with pitch, roll, yaw and throttle. [Yaw] <CR>. The sequence is the sequence number of the command, AR.Drone simply executes a command that has a sequence number larger than the previous sequence number so AR.Drone does not re-do the previous command. The program used in this study uses sequence numbers up to 100 and will be reset to 1 when it reaches 100. Bit 0 is used to select pitch, roll, and yaw commands sent to AR.Drone or just hover in place. Changing the bit value to 0 means AR.Drone is in hover mode, and changing its value to 1 means AR.Drone can perform translational and rotational movements in the fields of X and Y. Bit 1 is used to instruct AR.Drone to process roll, pitch, yaw, and throttle arguments filled with the desired values for AR.Drone maneuvers. The minimum value for each argument is -1, with a maximum value of 1. These values need to be converted first into hexadecimal numbers and converted back to 32-bit decimal numbers. d. State WATCHDOG is a state assigned to send commands of AT*COMWDG. The command does not require any arguments, as it only serves to keep the connection between the computer and AR.Drone. AT * COMWDG commands must be sent at least every 300 ms (0.3 seconds). If AR.Drone does not receive the command within a period of more than 300 ms, then the commands entered into AR.Drone will be ignored because AR.Drone assumes that the connection between AR.Drone and the controller is being disconnected. The program created for this study of WATCHDOG states is sent every 150 ms, assuming that if the sending command is interrupted and AT*COMWDG is not received by AR.Drone then sending commands at subsequent intervals (300 ms) may prevent disruption of connections between computers and AR.Drone.

The fuzzy gain scheduling PID control
The fuzzy gain scheduling PID control system scheme is implemented on the AR Drone is shown in Figure 1. The movement of drone to the position x, y and z are controlled by 3 controllers; each controls the pitch, roll and vertical rate. The PID controllers are used as the main controller. While fuzzy is used as the scheduler of the gain parameters of PID corresponding to earn operating point of drones, evaluated on the error position. Each fuzzy gain scheduling PID block has the same scheme. Figure 2 shows the Fuzzy gain scheduling PID for x position. For y position and z position have identical scheme. This block consists of PID signals and Fuzzy scheduler. For the PID control, the general equation of the controller is used as shown (1): where: : where ( ) are functions.
In the fuzzy scheduler, error position, ( ), are used as the inputs which will be fuzzified into 5 memberships function; NB:Negative Big (-1 ≤ e ≤ -0.5), NS:Negative Small (-0.5 ≤ e ≤ 0), Z:Zero (-0.5≥e≤0.5), PS:Positive Small (0 ≤ e ≤ 0.5) and PB:Positive Big (0.5 ≤ e ≤ 1). Rules evaluation are defined by using (2), where ( ) are PID equation in (1) based on defined operating points. The operating points are represented in five membership functions above. This research using five same rules for and position control as follows: which is also the procedure for tuning and position. But in this research we used the same parameters for and . a. PC at the ground station has prepared a program with PID controlled system and data acquisition b. Setpoint position selected is ±1 meter and ±0.5 meter in accordance to the defined operating points. c. AR.Drone is flown autonomously by using P-controller setpoint 1 meter from coordinate (0,0,1) to (1,0,1) with a particular . The data of drone is stored and the transient response is analyzed, in this case the rise time and the overshoot. It repeats 5 times. Perform this step using several and select that provide the expected transient response. d. AR.Drone is flown autonomously using PI-controller with values obtained in step 3 and a particular from coordinate (0, 0,1) to (1,0,1). The data of drone is stored and the transient response is analyzed, in this case the rise time and the overshoot. It repeats 5 times. Perform this step using several and select that provide the expected transient response.  Table 2.

R
For rules the function can be combined to get a function, as an output of the controller, as follows

RESULTS AND ANALYSIS
Fuzzy gain scheduling PID algorithm has been designed to be implemented on the AR.Drone 2.0 Elite Edition and tested indoor. The testing room size 6m x 6m x 4m with a floor made of striped line for the drone use its bottom camera to estimate and position in flight. While the position using ultrasonic sensors provided onboard the drone. To test the fuzzy gain scheduling PID algorithm, AR.Drone was flown point to point toward the x-axis from the initial coordinates [0,0,1] to the coordinates [1,0,1]. The same test is also done using PID controller algorithm.The response of AR.Drone will be compared with the test results using PID controller. The results of both are compared and shown in Figure 3. From the test results seen that AR.Drone with PID controller tend to experience overshoot approximately 20%. While AR.Drone with fuzzy gain scheduling PID gives better response with overshoot approximately 10% and settling time about 15 seconds. The next test, AR.Drone will be flown to several positions that form a grid on the coordinates . The testing procedure is performed as follows: a. Enter the reference position that will be addressed by the drones on the front panel of the software that has been made. In this test, a reference that will be addressed is (1.5,0,1.5) then to (1.5,1.5,1.5), and to (0,1.5,1), finally back to the initial position (0,0,1). b. AR.Drone is flown manually to hover at position (0,0,1).  The test result is shown in Figure 4. The picture on the left is the system response in 3 dimensions while the right image is the position response of each coordinate x, y, and z. The depiction of 3D showed that the AR.Drone can go to any desired reference point but it has a relatively large error in the position z. There are 2 of 5 times where the experiment yields a relatively good transient response. Experiments 1 and 3 were late when switching to get to the point (1.5,1.5,1.5). In general, each point can be achieved within a rise time of 10 seconds as seen in the left image. The gain scheduling process during the test is shown in Figure 5. It was taken from of one of the experiments above. It is seen that the journey starts from the initial X position error is 1.5 m so PID control used Gain V, while the Y error is zero so the PID control used Gain III and errors Z 0.5 m, PID control used Gain IV. Along with drone journey towards a point of reference, the gain that works is the contribution of the two gain from appropriate membership function. Control signals, in this case, pitch, roll and throttle produced by fuzzy gain scheduling PID control is shown in Figure 6. In these control signals, there are restrictions on the control signal value ± 0.15 to avoid a collision with the wall due to the cramped indoor space.

CONCLUSION
This paper has implemented fuzzy gain scheduling PID control for position control of AR.Drone. The result of the test, which is to fly to the coordinates ( ) indicates that the PID gain switching process run in accordance with a predetermined operating point. AR.Drone can follow the references given well, but with a small error.