Autotuning Fuzzy PID Controller for Speed Control of BLDC Motor

—The PID control system is widely used for industrial machine control processes. The success of PID control is determined by tuning PID parameters. In PID control the tuning is carried out offline without taking into account changes that occur in the plant and the disturbances that arise. This study aims to optimize PID parameters online by taking into account the changes that occur in the plant and the disturbances that arise using fuzzy logic-based controls and tested on a BLDC motor which is a non-linear system. Set PID parameters with fuzzy logic using a combination of 49 if-then rules. To set proper PID parameters in real time, a two-level control system was built. The first level to define PID parameters by finding the minimum and maximum values of kp, ki and kd by the reaction method curve. The second level is designing the Fuzzy system to automatically set the PID parameters, then formulating a combination of 49 fuzzy if-then rules to get the value kp, ki, kd, error and change in delta error value. Testing of set point changes at BLDC Motor loads with no load and 0.5kg load and changes in speed get a response from the PID control system with an average value of 0.025 seconds rise time, 0.1625 seconds preset time, and 15.98% overshoot. While the Fuzzy PID control produces an average rise time value of 0.0025 seconds, preset time 0.057 seconds, overshoot of 5.42%.


INTRODUCTION
The PID control system is widely used in industrial control.The success of the PID controller depends on the accuracy in determining the PID constant (amplification) [1].In a control system with PID controllers, there are several types of control measures, namely proportional control measures, integral control measures, and derivative control measures.
Each control action has certain advantages, where the proportional control action has the advantage of being able to improve the transient response, especially the rise time and settling time.The proportional controller has an output proportional to the magnitude of the error signal (the difference between the desired quantity and its actual value).Integral controller functions to produce a system response that has a zero steady state error.A differential controller has the same properties as a derivative operation.A sudden change in controller input will result in a very large and rapid change.When the input does not change, the controller output also does not change, whereas if the input signal changes suddenly and goes up (in the form of a step function), the output produces an impulse-shaped signal.Its benefit-derived control action is to reduce delta errors or reduce overshoot / undershoot.In order to get high output and low errors, we can combine these controls into PID actions.
In PID control, the success is determined by setting the PID parameters which are carried out offline without taking into account changes that occur in the plant and the disturbances that arise.But if there is a change in the plant and there is a disturbance, it is necessary to change the PID parameters so that the optimum results are as determined.These changing conditions of plant changes and disturbances will make the PID control invisible to its maximum performance.
As knowledge-based systems develop, the PID parameter setting can be determined by analyzing the system response, the results of this analysis are formed in several rules.By combining fuzzy logic system rules to determine PID parameters when the system recognizes a plant change or disturbance.And this fuzzy logic system can be adjusted in real time.To achieve this, the control system is formed into a two-level control system [2].The first level is the conventional PID control system.The second level is the fuzzy tuning system for PID parameters in real time.
This study aims to optimize the PID parameters online by paying attention to changes that occur in the plant and the disturbances that arise using fuzzy logic-based control and tested on a BLDC motor which is a non-linear system load.The fuzzy logic rules were tested on a BLDC Motor plant using a combination of 49 if-then rules.
In order to set the correct PID parameters in real time, a two-level control system was built.The first level for defining the PID parameter is by finding the minimum and maximum values of kp, ki and kd by the reaction method curve.The second level is to design a Fuzzy logic system to set PID parameters automatically, then formulate a combination of 49 fuzzy if-then rules to get the values of kp, ki, kd, error and changes in delta error values.

A. Brushless DC Motor (BLDC Motor)
Brushless DC motor (BLDC motor) is a 3 phase AC synchronous electric motor.Synchronous means the magnetic field generated by the stator and the magnetic field generated by the rotor to rotate at the same frequency.BLDC motors do not slip like induction motors.This type of motor has a permanent magnet on the rotor and an electromagnet on the stator.Compared to other types of DC motors, BLDC motors have lower maintenance costs and higher speeds due to not using brushes.Compared to induction motors, BLDC motors have higher efficiency and high starting torque, because the rotor is made of permanent magnets.
The application of a 3-phase ac voltage to the bldc stator is to make the stator rotate magnetic field to attract the rotor magnet.Due to the absence of brushes on the bldc motor, the correct commutation timing is required on this motor so that constant torque and speed are obtained.so that 3 hall sensors are needed.The commutation timing is determined by detecting the rotor magnetic field with the hall sensor to get 6 different timing combinations.These 6 different timing combinations are fed into the electronic circuit driver which is used to control the current flow in the BLDC motor stator coil.The driver functions to regulate which coil will be energized so that the motor can rotate based on the rotor position signal from the hall sensor.The linear voltage equation of Brushless DC motor is expressed as: Irrespective of the transient process of commutation, that is, when the A and B phases are steady conduction, the size of and are equal and the sign is opposite, adn formula (1) can be written as

B. Auto tuning PID
Commonly used characteristics in the arrangement of a system includes, among others stability, accuracy, response speed and sensitivity [3].Proportional control, the output of the system will be proportional to the input.The output signal is an amplification of the error signal by a certain factor, this gain factor is a constant proportional of the system, which is denoted by Kp, where Kp has the response high/fast.
Integral control, its output always changes during deviations, and the speed of change in its output proportional to the deviation, the constant expressed as Ki, where this Ki has high sensitivity, that is by the way reduce the error generated from the signal feedback.The greater the value of Ki, then the sensitivity will be higher, but time needed to achieve more stability fast, and vice versa.
Derivative control works by rate of change of deviation, so that type these controls are always shared with proportional and integral control.The constant is expressed in Kd, where this Kd affect the stability of the system, due to action this control is able to reduce errors.With merging this PID control action then expected to get a response has a high level of stability.
Digital PID is a process of a programs run using computer, where we enter a value Setting Point (SP) and Preset Value (PV) are then the data is processed so that an error obtained is equal to 0, or the value Setting Point = Preset Value [4].To be able to implement the system PID control [4] on the computer, the PID must be changed into the discrete equation: The price of ΔVo is the price of change in output the current output is reduced with the previous output.
So that the equation becomes: In the final state, change Δ to error previously distributed to, Journal of Robotics and Control ISSN: 2715-5072 402 Roedy Kristiyono, Autotuning Fuzzy PID Controller for Speed Control of BLDC Motor The final result of the PID equation is: To get the value of Kp, Ti = 1 / Ki, Td (Kd) then determined by the reaction process curve (Fig. 2), where the system is run openly loop [5].The Ziegler Nichols rule for auto tuning PID calculations is found by the equation:

C. PID Fuzzy Hybrid Control
If -then Rules are a control which will follow a linguistic approach, this system is called a logic control system fuzzy.Where is this fuzzy logic control system has no dependence on variables process control [6].This system is many developed in the field of control engineering, especially for nonlinear and dynamic systems.In industrial applications that require a high speed control system and data accurate output hence the use of control action PID may still be considered lacking satisfying.Because if you use an action PID control, if the control set is very sensitive, then the resulting overshoot / undershoot will be very sensitive, so that the oscillations are generated will be higher, meanwhile when the control is set less sensitive then it happens overshoot / undershoot can be minimized, however the time required will be longer, and this will be a problem in a industrial processes.PID-Fuzzy hybrid control on this research is a fuzzy logic system for tuning the PID control.This control then try to implement on system for controlling the speed of the load/plant namely BLDC motor.The main system is PID control, while fuzzy logic here serves to improve response and recovery time by tuning the values of Kp, Ki and Kd automatic, as seen in fig. 4.
Fuzzy logic control system, two parameters normalization as input (Ne1, Ne2), and one denormalization parameter (Nu) is defined as the output.Normalization process, values increased input between (-1, +1) and the denormalization process, the output value from fuzzy control converted to value on the control terminal.
The fuzzy values are obtained from the mechanism Fuzzy inference must be converted to output value crips (u) with the defuzzifier process.For the purpose of this, the fuzzy triangle membership function defined for each input and value output with seven clusters.Figure 6, describes a membership function used to fuzzify two input values (e1, e2) and defuziffy (u) output from fuzzy control.
For the seven groups in the membership function, the seven linguistic variables are defined as: Big Negative (NB), Negative Medium (NM), Negative Small (NS), Zero (Z), Positive Small (PS), Positive Medium (PM), and Positive Big (PB).

III. RESEARCH METHOD AND RESULTS
The first step taken is study the plant that will be used in this control system.In fig.7 is a BLDC Motor specification used as a plant, with a power of 60 Watt, voltage 24 Volt, current 2.9 Ampere, 3500 rpm.19), ( 20) and ( 21) =   ∝  (21) so that the equation is obtained, =  ′  (0,00048) + 0,00035 From the above equation the values of Kp, Kd and Ki will be varying according to the reading of the results defuzyfication of the three parameters K'p, K'd and α.
While the reading of the value of K'p, K'd and α is like the flow chart of fig.11.So that it can be realized in fuzzy logic.The first stage is establishing the definition of error membership and Δerror into the array structure, then form the membership function of each variable membership error and Δerror.
From the flow chart in Figure 11, program execution is carried out at each sampling, and the crips error and derror values will be entered into its membership function.The result of reading the membership function do the inference process, next do the defuzzyfication process for determine the value of K'p, K'd and α.
The result defuzyfication is a firm value later used by the PID controller as tuning variable.The error value is divided into seven levels (NB, NM, NS, Z, PS, PM, PB), meanwhile the value of the change in derror is also divided into seven levels (DNB, DNM, DNS, DZ, DPS, DPM, DPB).The first letter N, P and D means negative, positive and delta, while the second letters B, M, S and Z mean big, medium, small and zero.In the fuzzy value program routine set point multiplied by 10.Subsequently, a reduction is made based on the system step response, as shown in Figure 14 below Fig 14 .Step system response  At the starting point around a, a large control action signal is required to achieve a fast rise time.To produce a large control action signal required a large proportional gain, a small derivative gain and a large integral gain.From the previous equation it can be determined that if the values of Kp and Kd are obtained, the strengthening of the opposite integral is proportional to , meaning that a small integral strengthening means that  is small.As a result the rules are: From the rules of equations ( 25), ( 26) and ( 27) it can be the third rule of PID constants is determined, and is illustrated in Figure 17.The fuzzy statement can tabulate in table 3, table 4 and table 5, which will then be entered as programming data autotuning fuzzy PID control system is used to regulate speed the BLDC motor.Testing of set point changes at BLDC Motor loads with no load and 0.5kg load and changes in speed get a response from the PID control system can see at table 6.

IV. CONCLUSIONS
From the results of research and discussion, it can be concluded that the control process with a control parameter tuning system PID with Fuzzy logic applied to set the BLDC motor can improve PID control performance.Testing set point change and load changes, generate PID control system response characteristics with an average value, namely rise time 0.025 seconds, settling time 0.1625 seconds, overshoot 15.98%.While autotuning control Fuzzy PID produces an average value rise time 0.0025 seconds, setting time 0.057 seconds, overshoot of 5.42%.

Fig 6 .
Fig 6.Membership function for e and Δe.

Fig 7 .
Fig 7. BLDC Motor spefificationThen with the PSIM software, a simulation of the loading experiment is carried out according to the BLDC motor parameters used.

Fig 8 .
Fig 8. Circuit simulation experiment with BLDC motors using the program PSIM

Figure 18 -
Figure 18-23 is a picture of data measurement of test results is carried out with treats BLDC Motor on variations speed of 1000 rpm and 1500 rpm with and no load 0.5kg.

Fig. 18 .
Fig. 18.Speed to 1500 rpm set point no load

TABLE 2 .
FUZZY LOGIC CONTROL RULES

TABLE 3 .
FUZZY RULES FOR THE K'P PARAMETER

TABLE 6 .
RESULTS OF EXPERIMENTAL MEASURING DATA