Bat Algorithm Based an Adaptive PID Controller Design for Buck Converter Model

The aim of this paper is to design a PID controller based on an on-line tuning bat optimization algorithm for the step-down DC/DC buck converter system which is used in the battery operation of the mobile applications. In this paper, the bat optimization algorithm has been utilized to obtain the optimal parameters of the PID controller as a simple and fast on-line tuning technique to get the best control action for the system. The simulation results using (Matlab Package) show the robustness and the effectiveness of the proposed control system in terms of obtaining a suitable voltage control action as a smooth and unsaturated state of the buck converter input voltage of (3.75) volt that will stabilize the buck converter system performance. The simulation results show also that the proposed control system when compared with the other controllers results has the capability of minimizing the rising time to (0.393 × 10 sec) and the settling time to (2 × 10 sec) in the transient response and minimizing the voltage tracking error of the system output to (zero) volt at the steady state response. Furthermore, the number of fitness evaluations is decreased.


INTRODUCTION
In the last few decades, DC/DC converters have been playing an important role in our life because of its essential use in mobile applications such as computer systems, portable devices, etc. Therefore, the control of these circuits for mobile applications is needed so as to get a voltage regulation with the high conversion efficiency and fast transient response (Abed, et al., 2018) and (Chander, et al., 2013). Buck converter is one of these DC/DC converters which steps down a given DC value (source voltage) into the desired regulated DC output value. The buck converter's output voltage at the load is controlled by varying (modulating) the width of the switch chopped input pulse, which is controlling the duration of the time the electronic switches, MOSFETs, are ON or OFF in one cycle of the operating frequency; this is known as pulse width modulation (Lv, et al., 2015). According to the importance of the buck converters in many industrial and residential applications, a vast amount of control algorithms for these converters have been devoted to their control in order to obtain a fast dynamic response and desired output voltage with variable load current. For instance, sliding model controller, (Chafekar and Mate, 2018), adaptive hysteresis controllers, (Kim, et al., 2012), fuzzy logic controller, (Tapou, et  The main core of the motivation for this work is to deal with the problems that influence the operation of the portable devices by controlling the buck converter dynamic behavior in the closed loop system such as wide range of loading current and variable output voltage values. Therefore, the on-line bat optimization algorithm with the PID controller is proposed in this work. The main points of the contributions of this work are listed as follows:  The bat optimization algorithm is used because it shows fast search ability in the global regions and rapidly on-line tunes the PID controller optimal gains. These optimal gains lead to finding the optimal voltage control law which leads the buck converter output voltage to attain rapidly the reference output voltage.  The adaptation performance of the PID controller based on-line bat algorithm is investigated by changing the buck converter output voltage levels. The remainder of this paper is organized in the following manner: Section two, contains the mathematical model of the synchronous buck converter system. Section three, describes the derivation of the adaptive PID controller. The bat optimization algorithm is explained in section four. Section five presents the numerical simulation results and discussion for the proposed adaptive controller. Finally, the conclusions are explained in section six.

MODELING OF THE SYNCHRONOUS BUCK CONVERTER CIRCUIT
The DC/DC buck converter can be considered as a type of attenuation or chopper circuits, whose output voltage is less than the input voltage, so it is otherwise known as step down converter. The simplified circuit of the synchronous DC/DC buck convertor model that is operating in continuous conduction mode (CCM) with the two n-channel MOSFETs Q1 and Q2 controllable switches is shown in Fig. 1, (Al-Araji, 2017). 64 This type of buck converter replaces the diode rectifier by the Q2 MOS synchronous rectifier which increases the circuit efficiency and the converter uses one inductor and one capacitor as energy storing elements. Though the converter contains L & C, the system becomes non-linear. Therefore the non-linear system is characterized as linear model within certain range and timeperiod by using the state space averaging (SSA) technique which is a very common solution. In CCM, the buck converter operates in two switching modes as follows (Garg, et al., 2015) and (Al-Araji, 2017): (a) When switch Q1 is ON and switch Q2 is OFF for time 0 < t < DT: At this period of time, the inductor current, capacitor voltage and output voltage equations are given as follows: Where : is the input voltage; : is the inductor current; : is the on n-channel resistance of the MOSFET; : is inductor effective series resistance; : is the output voltage of the circuit; : is the load resistor; : is the capacitor voltage; : is capacitor effective series resistance; : is capacitor current; : is the main capacitor; and : is the main inductance.
(b) When switch Q1 is OFF and switch Q2 is ON for time DT < t < T: At this period of time, the inductor current is given by Eq. (4) as follows: In this work, to design adaptive PID controller for DC/DC buck convertor, the transfer function of the duty-cycle to output voltage is required. The SSA technique is used for this purpose. Therefore, the buck converter model represented by Eqs.
(1, 2, 3, and 4) are symbolized in matrix form as follows (Garg, et For switching mode (b), To derive an average model of the power converter over one switching cycle, the equations corresponding to ON state and OFF state are time weighted and averaged as given in Eqs. (9 and 10).
Here , , , and are given by: Where; : is the duty ratio. Now, consider there is a small signal variation ̂ to the duty ratio that will cause a small variation ̂ of the state variable and a small variation ̂ of input voltage . Therefore, the small signals variations are symbolized as follows: Where ̂ is a small-signal variation in the DC or steady-state component , ̂ is a small signal variation in the steady-state or DC component duty-ratio and ̂ is a small-signal variation in the DC input voltage . Therefore, Eq. (9) becomes: To simplify Eq. (18) the steady state part equals to zero (̇= 0) and also ignoring the nonlinear term. Therefore, Eq. (18) can be rewritten as in Eq. (19).
Similarly, Eq. (10) becomes: Equation (21) can be obtained by solving Eqs. (19 and 20) and using Laplace transform with some rearrangements, the transfer function of the buck converter model can be obtained as follows:

ADAPTIVE PID CONTROLLER DESIGN
A PID controller is commonly employed in several industrial applications because it is easy to implement, eliminates the steady state error of the step input response due to the integral action effect, and its parameters can be adjusted easily and separately. The proposed block diagram of this adaptive controller which consists of a PID controller and bat algorithm is shown in Fig. 2.
Where, is the proportional parameter, is the integration parameter, is the differentiation parameter, ( ) is the error signal and ̂( ) is the control action. The discrete-time equation of the PID controller can be obtained by taking the first derivative of Eq. (22) as follows: Applying the Backward difference formula to ̇( ) , ( ) and ( ) as follows: Where; is the sampling time.
Solving for ( ) finally gives the discrete-time PID controller as in Eq. (29): where; = , = * , and = The PID controller structure based on Eq. (29) for controlling the output voltage of a buck converter system is shown in Fig. 3.

BAT OPTIMIZATION ALGORITHM
Bat algorithm is a relatively new meta-heuristic swarm algorithm for global optimization and it is introduced and developed in 2010 by Xin-She Yang. This algorithm is inspired by the echolocation behavior of the microbats, with varying pulse rates of emission and loudness (Yang, 2013).
The bat optimization algorithm can be explained in three main rules: The first rule is estimating the optimal distance to the food using the echolocation phenomena. In the Second rule, the bats fly randomly in the search space with a certain velocity at a certain position with a fixed frequency. However, the wavelength and bat loudness can vary according to their distance between food and the entire bat current position. Finally, the third rule followed by bat algorithm is linearly decreasing the behavior of bat loudness factor (Nor' Azlan, et al., 2018). Step 1: Initialize the algorithm parameters such as dimension of the problem ( ), population size ( ), maximum number of maximum iterations ( ), minimum frequency ( ), maximum frequency ( ), loudness of bats ( ), the initial Pulse emission rate ( ), pulse emission rate of bats ( ), and the initial velocity of bats ( ).

69
Step 2: In bat algorithm, each bat position represents a feasible solution and the initial population for each bat can be generated randomly as in Eq. (30): Where; = 1, … , , = 1, … , , and and are the lower and upper boundaries of dimension respectively.
Step 3: Evaluate the cost function ( ) as in Eq. (31) for each bat and store the results in ( ) vector.
Where; is the desired signal, and is the output signal.
Step 4: Find the best bat position * which is the bat that has the smallest ( ) value among all bats in ( ) vector and consider its ( ) value as ( ).
Step 5: Update the frequency, velocity, and position for the ℎ bat as shown in Eqs. (32, 33, and 34) respectively.
Step 6: A local search is carried out if the rate of pulse emission by the ℎ bat ( ) is less than a randomly generated number, a new solution is generated for the ℎ bat via a random walk to improve the variability of the possible solutions as in Eq. (35).
Where; is a scaling factor generated randomly of interval [-1, 1], and < > is the average loudness of all bats at iteration.
Step 7: Evaluate the cost function value ( ) for the ℎ bat as in Eq. (31) and store the result in ( ) variable.
Step 8: For the ℎ bat, if its new cost function value ( ) is smaller than its previous cost function value and its loudness ( ) is bigger than a randomly generated number then the new values of its cost function, loudness and Pulse rate are calculated as in Eqs. (36, 37, and 38) respectively.
Step 9: For the ℎ bat, if its ( ) is smaller than then the best bat position ( * ) and minimum frequency ( ) can be updated according to the Eqs. (39 and 40). * = (39) = (40) Step 10: If the maximum number of bats ( ) is reached go to Step 11. Otherwise, go to Step 5.
Step 11: Stop if the maximum number of iterations ( ) is reached. Otherwise, Step 5 to Step 11 is repeated. The typical bat algorithm flow chart for the adaptive PID controller is shown in Fig. 4.

SIMULATION RESULTS AND DISCUSSION
The specifications of the Buck converter model are taken from (Al-Araji, 2017 )as shown in Table  1, (Al-Araji, 2017). The on-line bat optimization control algorithm for the PID controller is carried out by using the MATLAB simulation package to obtain the reference output voltage for buck circuit as shown in Fig. 2. The time constant of the system is equal to = 26.14 μsec depending on the natural frequency = 3.4699 × 10 4 rad/sec and the damping ratio = 1.1025 of the Buck converter system. By applying the Shannon theorem, the sampling time of the Buck converter system is equal to 3.6001 μsec.

72
The open-loop step response of the buck converter system output voltage is shown in Fig. 5. From this plot; the buck system has a stable response. In this work, to investigate the performance of the adaptive PID controller shown in Fig. 2 the online bat optimization algorithm methodology has been used. The bat algorithm has the ability to minimize the voltage tracking error with the minimum fitness evaluation number by generating an optimal voltage control action to the buck converter circuit. The bat algorithm parameters used in this control methodology are defined in Table 2. Table 2. The parameters of the bat algorithm.

Parameter Symbol Value
The population size 30 The  Fig. 6 and Table 3.
74 Figure 6. The Output voltage for buck converter system.   The control action response In Fig. 8 of the adaptive PID controller was smooth without oscillation response, no spikes behavior and the action response did not exceed to the saturation state of the input voltage (3.75) volt.   The on-line tuning gains of the proposed adaptive controller , , and ) at each sample by using bat optimization algorithm are depicted in Figs. 10 a, b, and The time constant of the system is equal to = 25.654 μsec depending on the natural frequency = 3.6028 × 10 4 rad/sec and the damping ratio = 1.0819 of the Buck converter system. By applying the Shannon theorem, the sampling time of the Buck converter system is equal to 3.5331 μsec. The output voltage response of the buck converter system to voltage step change (2.25 and 1.75) volt has small over shoot at (0.335 ) and (0.9144 ), respectively with very small oscillation during adding disturbance but at the steady state, the error is equal to zero value as shown in Fig. 11 a. The small value of the error voltage signal between the reference voltage and the output voltage of the buck converter system is shown in Fig. 11 b, the error has a small value at the transient state and in the steady state, the error becomes very close to zero with a very small oscillation. Fig. 11 c shows the response of the control action which has a capability to track the error voltage signal of the buck converter system to follow the reference voltage as step change and reduce the effect of the load resistance disturbance.   Finally, the on-line tuning parameters of the proposed controller ( , , and ) during adding disturbance at each sample by using bat optimization algorithm are depicted in Figs. 13 a, b, .