Measurement, Modeling, and Optimization Speed Control of BLDC Motor Using Fuzzy-PSO Based Algorithm

Measurement, modeling, and optimization are three important steps that must be done, to solve the instability problems that arise in the BLDC motor speed control system. The purpose of this study is to improve the stability indicator by eliminating the high value of overshoot and steady-state error and increasing the value of rise-time. The method used in this research is to measure the physical parameters of the input and output, to model the BLDC motor plant mathematically and the last is to perform optimization using several control methods such as Proportional Integral Derivative control, fuzzy logic control, and Particle Swarm Optimization algorithm (PSO). Experimental and simulation results show that the PSO algorithm has better results in increasing stability indicators when compared to the other two control methods with a rise time of 0.00121 seconds, settling time of 0.00241 seconds, and 0% overshoot.


I. Introduction
The development of environmentally friendly means of transportation is currently being intensively carried out by automotive companies around the world with the aim of reducing pollution and addressing the decreasing number of nonrenewable petroleum fuels. Of the various kinds of electric vehicles that have been developed, it is the electric bicycle that is most in demand and is the most successful being developed and socialized, especially in America, Europe, China and Japan [1].
Brushless DC (BLDC) motors as part of driving an electric bicycle have non-linear characteristics [2], so that proper control techniques are needed so that non-linear systems can provide good response. Some of the problems that arise are the appearance of unwanted overshoot or oscillations [3]. This is indicated by the values of the rise time, settling time, and peak time which provide information about the speed and 'quality "of the response transient.
PID controller tuned with PSO algorithm is implemented to improve response transients. [4]. PID controllers are widely used in industrial applications, because they have many advantages as well as disadvantages. The advantage of the PID controller is that it is simple and effective, while its weakness is its low ability to deal with system uncertainty against external disturbances. [5]. The performance and speed of a BLDC motor can also be affected when working under load conditions [6]. Therefore, it is necessary to adjust the speed using a controller that can maintain the BLDC motor speed according to the set-point even though it is operating under load conditions. One technique for overcoming the control system's uncertainty is to use intelligent control. The PSO algorithm intelligent control method is utilized to tune the PID controller parameters in this study such that the smallest Integral Time Absolute Error (ITAE) performance value and the maximum response transient value are reached.

II.1 BLDC Motor System Identification
There are two main types of mathematical modeling, namely theoretical modeling and experimental modeling. In theoretical modeling, mathematical models are obtained through physical quantities that have been provided by the company. While the BLDC motor plant with the 350 watt specification used in this study, physical quantities such as the value of stator resistance, stator inductance, constant Back Electromotive Force (BEMF), constant torque, moment of inertia, and friction force are not available. Experimental modeling is required to obtain a mathematical equation in the form of a transfer function. Experiment-based modeling is based on the outcomes of system identification, which involves measuring input and output data. [7] System identification is a technique for determining the mathematical description of a system by analyzing the system's input and output. Models with the Auto Regressive structure with exogenous input (ARX) are often used because of their simplicity and efficiency [8], [9]. The ARX model system's identification is accomplished out using discrete measurement data. The discrete model of the detected object's transfer function equation is described in Fig. 1: Whereas if the system identification is modeled in the form of an ARX model, then the transfer function equation for the discrete model of the identified object is as follows [11] [12]: So that the equation becomes: The stages of system identification used in the BLDC motor speed control system are shown in Fig. 2.

II.2 PID Controller
The PID controller is a feedback controller with three sorts of settings: gain Proportional (Kp), gain Integral (Ki), and gain Derivative(Kd). Each of these settings tries to speed up a system's reaction time, remove offsets, and make a large initial change. The three parameters Kp, Ki, and dan Kd have a significant impact on the PID controller's properties..
Setting the constants Kp, Ti, and Td causes the highlighting of the properties of each element. Therefore, setting the P, PI, or PID constants of the three constants will contribute to the overall system response One of the biggest problems in PID controller design is the problem of tuning to produce the appropriate output. Controller tuning can optimize the process system and minimize errors between process variables and set points. Trial and error method is one of the traditional controller tuning methods which is done based on experience and requires a long time to get the desired results.
The general equation for the PID controller is shown in equation (8). (8) Where are : u(t) : control signal Kp : constant / gain proportional controller Ti : time integral Td : time derivatif e(t) : error

II.3 Fuzzy Logic
In general, fuzzy logic consists of several components, namely fuzzifier, fuzzy rule base, fuzzy inference engine, and defuzzifier [13], as shown in Fig. 3.
In this research, fuzzy logic is applied to the BLDC motor controller using the Mamdani method. The control system is designed with two inputs in the form of an error which is the difference between the set point and the photodiode sensor reading and the delta error which is the first derivative of the error value.
Twenty five basic rules of fuzzy logic which are based on five conditions such as Negatif Big (NB), Negatif Small (NS), Zero (Z), and Positif Small (PS), Positif Big (PB) as shown in Table 1 to Table 3.

II.4. PSO Algorithm
The Particle Swarm Optimization (PSO) algorithm is one of the swarm-based stochastic optimization techniques proposed by Eberhart and Kennedy (1995) and Kennedy and Eberhart (1995) [14]. The PSO algorithm simulates the social behavior of animals, including insects, herds, birds and fish. This flock of birds or fish creates cooperation using their own intellect and is also impacted by the collective group's behavior in pursuit of food, and each member of the flock continues to adapt their search behaviors based on their own and other members' learning experiences. [15]. Thus, if one particle or a bird finds the correct path or the shortest distance to the food source, the rest of the group can immediately follow the path despite their distant location between the groups.
A group is considered a particle of a certain size, and the initial position of each particle lies at a random position in multidimensional space. It is assumed that each particle has two characteristics, namely position and velocity. Each creature called a particle in the flock enters the search space at a certain speed, and tries to find the best speed according to the best speed ever (best) and the best speed (gbest) that all the particles have. In this way, the particles will find the best solution together [16].
The movement of particles of living things looking for food by continuously communicating to determine the direction of their next movement.
According to the information obtained, the team members' actions moved towards the areas with the best food quality. Information obtained through these communications will be updated (updated) from time to time. Move PSO (update position) to get the best speed based on the best speed done before (best) and the best speed (gbest) obtained by all particles. The PSO algorithm equation consists of speed and position, the most basic of which is speed.
The PSO algorithm equation consists of speed and position, the most basic of which is speed [17]: ( +1) = ( ) + ( +1) (10) where, i is the number of particles, j is the number of PID parameters, pbest is the best personal position of the ith particle, gbest is the best global position of the particle for all particles w is the weight of inertia, rand()is a random number generator that is distributed evenly across [0,1], c1 and c2 are correction factors.
Optimization planning in the BLDC motor speed control system is to obtain the optimal PID controller parameters using the PSO algorithm. The control system performance is influenced by the proportional controller parameters (Kp), integral control (Ki), and derivative control (Kd).
PSO algorithm parameters that are planned for the optimization of the BLDC motor speed control system include the number of particles 10 and 20, the number of iterations 10 to 50 with a difference of 10 iterations, the values of C1 and C2 respectively 0.5 and the inertia weight value of 0.5. The stages of the Particle Swarm Optimization (PSO) algorithm to obtain the optimal objective function are as follows:

III. Result and Discussion
The experiments in this study were carried out in several stages, namely modeling the BLDC motor using system identification. System identification uses the polynomial model approach with the ARX method. The second stage is optimization by comparing the use of conventional controls and intelligent controls during open and close loops.
The Proportional Integral Derivative (PID) controller is the traditional control, whereas the smart control, namely fuzzy logic and the PSO algorithm, is used to optimize the PID parameters.

III.1. Mathematical Modelling of BLDC Motor
The results of input and output data retrieval are as many as 30 data within 30 seconds. The input data measured include current, voltage, and motor rotational speed (rpm). The value of the motor voltage and rotational speed are used as input and output data in the System Identification Toolbox (SIT) application program to create a mathematical equation model. If visualized in graphical form, the comparison between input data and output data is as shown in Fig. 5.

III.2. Optimization with PID Controller
A PID controller is used to optimize the BLDC plant motor that has been described in the form of the transfer function equation as indicated in equation 3.1. Table 4 shows the results of the transient response to optimization with a PID controller when kp = 0.019121, ki = 0.016442, and kd = 0.0040554. In terms of the graph, Fig. 6 depicts the outcomes of the BLDC motor speed control optimization using the PID controller.  The optimization of the BLDC motor speed control utilizing the PID controller is still not optimal, as shown in Fig. 6 and 7. This is due to the fact that the values of Kp, Ki, and Kd are still used for parameter selection rather than intelligent control.

III.3. Optimization with PID-PSO Algorithm
The problem with conventional PID controller tuning is solved using the PSO algorithm. Optimization results for several tests with different parameters, namely the number of particles of 50, with the number of iterations 20. The social constant (C1) and Cognitive constant (C2) values are 0.5 each and the inertia weight value is 0.5. shown in Table 5. In Table 5, the response transient value obtained when the value of kp = 17.9032, ki = 3.8949, kd = 0.1858, and the best global fitness value is 1.3101e+06. The optimization results as shown in Table 5, show a very significant increase after the PID controller is optimized using the PSO algorithm. As for the convergence value, a constant value is obtained at the 7th seconds as shown in Fig.  8.   Table 7, with a value of kp = 0.3927, ki = 8.5206, kd = 0.3354, the best global fitness value is 1.2730e+06  Fig. 10, it shows that the addition of the load causes a decrease in stability at the 6th second, but after that it can readjust to the stability position Meanwhile, the convergence graph is shown in Fig. 11, where after being optimized with the PSO algorithm, the convergence parameter value reaches a constant value at the 5th second.  Table 6. In Table 6, shows the transient response value for the rise time, and the settling time decreases more slowly than when there is no additional load.

III.4. Optimization PID Controller with Fuzzy
In the PID controller optimization process using fuzzy logic, there are several results obtained such as a graph of the input to the overall output for parameter values kp, ki, and kd based on predetermined rules, as shown in Fig. 12-14.   Table 7. After being given an additional load at the 6th second, the results that are influenced by the load are shown in Fig. 16.

IV. Conclusion
The results of the design, measurement, testing and simulation for optimization and monitoring of Speed Control of the BLDC motor, the following conclusions are obtained: 1. A mathematical model in the form of a transfer function equation is used to get the results of system identification for the BLDC motor plant using the ARX structure model. 2. The response transient value for optimization using an intelligent control algorithm reduces overshoot and increases the value of the rise and settling time. 3. The results of the implementation of the PSO algorithm achieve stability the best performance. This is shown for the transient response value, namely rise time = 0.00201seconds, settling time = 0.00241, and overshoot = 0%.