# Optimal Fractional PID Controller for Buck Converter Using Cohort Intelligent Algorithm
## 3 Methodology
### System Description  
A buck converter system with a fractional order PID controller has been realized in SIMULINK, for voltage mode control, as shown in Figure 3. Table 1 shows the parameters of the buck converter, which are defined for CCM, according to the equations defined in Section 2.1. The mathematical model of the system using state space averaging is usually used in controller design, but this may lead to approximation errors [31]. Hence the circuit with FOPID controller has been simulated in SIMULINK for a more accurate representation of the system. The fractional order integrator and differentiator of the FOPID controller \(G_{c}(s)\) are approximated using the Oustaloup approximation of order 5 in a frequency band of [0.01, 1,000,000] rad/s. The FOPID parameters are calculated by the CI algorithm using an m-file in MATLAB, which calls the SIMULINK circuit repeatedly. The FOPID parameters are selected from a sampling interval \(\phi_{K_{p}}=\phi_{K_{i}}=\phi_{K_{d}}=[0,\,200]\), and \(\phi_{\lambda}=\phi_{\mu}=[0,\,1]\) after some trial runs of the algorithm. The respective objective function (ISE, ITSE, ITAE, or IAE) is calculated in SIMULINK, and the FOPID parameters are continuously updated for each iteration. These parameters and the objective function are returned to the program after the termination condition is achieved. The CI algorithm is used to minimize the respective cost function \(J_{i}\), which can be considered as the behavior of a candidate of a cohort which has to be improved. The controller parameters can be considered to be the characteristics of the candidate, randomly generated from a search space. The steps for the CI algorithm can be summarized as follows [52]:  
1. Select the no. of candidates 'C' of the cohort, the reduction interval '\(r_{i}\)', convergence parameter \(e\), and the maximum no.of iterations \(max_{it}\);
2. The lower bound and upper bound of the controller parameters \(\phi_{K_{p}},\phi_{K_{i}},\phi_{K_{d}},\phi_{\lambda}\) and \(\phi_{\mu}\) are chosen based on some initial runs of the algorithm;
3. For each candidate c in the cohort, the qualities (parameters \(K_{p},K_{i},\lambda,K_{d}\) and \(\mu\)) are generated from the lower and upper bounds as: \[K_{p}^{c}=min(\phi_{K_{p}})+(max(\phi_{K_{p}})-min(\phi_{K_{p}}))*rand(.),\] (13) where rand is a random number between 0 and 1. Similarly, the values for \(K_{i}\), \(K_{d}\), etc., are generated;
4. The overall behavior (J) of each candidate is calculated from the error, as given by Equation (9) (in this case);
5. The probability function for each candidate is calculated as: \[P=\frac{1/J}{\sum_{c=1}^{C}1/J};c=1,2\ldots C\] (14) \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Filter Inductance & 70 \(\mu\)H \\ \hline Filter Capacitance & 22 \(\mu\)F \\ \hline Load resistance, \(R\) & 3 \(\Omega\) \\ \hline Switching frequency & 100 KHz \\ \hline Input voltage & 24 V \\ \hline Output voltage & 15 V \\ \hline Inductor current ripple & 20\% of \(i_{L}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Buck Converter Circuit Parameters. Figure 3: Buck converter with FOPID controller. A roulette wheel approach is used by each candidate to follow another candidate's behavior. This approach uses one generation as the basis of the next generation. The best solution has the highest probability of being followed;
7. Accordingly, each candidate adjusts its sampling interval as shown below for \(K_{p}\): \[\phi_{K_{p}}\;\epsilon\;[K_{p}-||(max(\phi_{K_{p}})-min(\phi_{K_{p}}))*r_{i}/2 ||,Kp+||(max(\phi_{K_{p}})-min(\phi_{K_{p}}))*r_{i}/2||]\] (15) Similarly, the other four parameters also are adjusted;
8. This process continues till the value of J reaches a saturation condition defined as: \[max(J)^{n}-max(J)^{n-1}<=\epsilon\] (16) \[min(J)^{n}-min(J)^{n-1}<=\epsilon\] (17) \[max(J)^{n}-min(J)^{n-1}<=\epsilon\] (18)
9. If the maximum limit of iterations \(max_{it}\) is exceeded or the saturation condition defined in step 8 is reached, then the algorithm terminates.