## 3 Proposed Approach
### Tuning of the PID Parameters Using BB-BC  
Evolutionary algorithms can be applied for the tuning of PID controller gains/parameters to ensure optimal control performance at stable operating conditions. In this paper, the BB-BC algorithm is employed for the offline tuning of the PID parameters (\(k_{p}\), \(k_{i}\), \(k_{d}\)) in the HVAC model. Figure 3 above shows how the control unit consisting of the BB-BC unit and the PID controller is connected in the HVAC system. First, the BB-BC unit produces initial candidates for the PID parameters in the target search space. Next, based on the calculation of the objective function, it produces new candidate solutions around the center of mass until the stop criteria is satisfied. In the design methodology of a PID controller, one of the most important performance criterion is the difference (error) between the plant output and the set point signal. Using this error criterion as the fitness function of the optimization algorithm results in a small overshoot with a long settling time. In general, fitness functions are based on error equations. The following four equations, integral time absolute error (ITAE), integral time square error (ITSE), integral absolute error (IAE), and integral square error (ISE) indicate the most commonly used fitness functions:  
\[ISE=\int e(t)^{2}.dt \tag{10}\]  
\[IAE=\int|e(t)|.dt \tag{11}\]  
\[ITAE=\int t.|e(t)|dt \tag{12}\]  
\[ITSE=\int t.|e(t)^{2}|dt \tag{13}\]  
Fitness functions are not actually limited to the above equations. Engineers can provide custom fitness functions depending on the target design and control system. The overall performance (convergence speed and optimization accuracy) of evolutionary algorithms depends on the fitness function adopted to monitor the optimization search. To choose the optimal fitness function, i.e., the objective function of the BB-BC algorithm, we performed a set of experiments for the four typical error equations. We executed the four formulas of the errors (_ITAE_, _ITSE_, _IAE_, and _ISE_) for different number of iterations, specifically for 100, 200, 500, and 1000 cycles, in order to evaluate the performance of the objective functions. In the objective function used, the added term of control output \(u\times u^{T}\) (_where \(u^{T}\) is the transpose of \(u\)_) seeks to reduce  
Figure 3: Block diagram of conventional HVAC system and control unit structure. the magnitude of the control signal. When the objective function includes the control signal term (\(u\)), the algorithm seeks to minimize it. Therefore, the term \(u\times u^{T}\) is equivalent to squaring every element in \(u\). The objective function that achieved the best performance is the integral time absolute error (\(ITAE\)) with control signal (\(u\)) as reported below in the equation (17). The results of these experiments are shown in Table 2.  
Figure 4 presents the convergence and time response of the PID controller using the four objective functions (\(ITAE\), \(ITSE\), \(IAE\), \(ISE\)) for parameters tuning for different number of iterations (100, 200, 500, and 1000). The curves show how the fitness function response (error) changes during the optimization process of the PID controller using BB-BC algorithm. Among the four traditional objective functions, the integral time absolute error (\(ITAE\)) provides the minimum settling time, peak overshoot, and rise time. As mentioned above, any objective function can be adopted to tune the PID parameters. However, it is hard to reduce the rise time without increasing overshoot. By reducing the rise time, the system will try to follow the set-point faster, which will produce a greater inertia, thus raising the chance of an increased overshoot. As can be seen in Figure 4, although the response signal of \(ITAE\) declines faster, the convergence velocity of \(ITAE\) is obviously the best one compared with the other methods. Note that the integral absolute error (\(IAE\)) provides the best convergence, but its time response (overshoot, rise time, and settling time) is not optimal.