## 3 Methodology and Overall Framework
### Adaptive Process Scheduling
#### 3.4.1 Process Scheduling using a Genetic Algorithm  
We implement an adaptive selection algorithm that decides for a system operation mode, that is, speed interval in our case, according to a changing energy consumption. This selection is towards protecting the system from abnormal conditions as well as keeping a maximum possible operational performance. Given these two optimization conditions, the selection of optimization weights is left to the user to pick a desired balance between power-saving (protective mode) or time-saving (performer mode). Figure 5: The general process of the adaptive scheduling algorithm. The chromosome space contains four genes, which are lower bound speed (\(v_{min}\)), upper bound speed (\(v_{max}\)), lower bound power (\(P_{min}\)) and upper bound power (\(P_{max}\)), as indicated in Table 1. During the operation, we consider the actual torque on the motor as an unknown parameter as it also reflects the abnormal and unknown conditions, that is, disturbances, along with the real load on the conveyor system. Therefore, we use intervals of possible power and speed values in a chromosome design, allowing the load torque to change within that interval. Generating a population of such a chromosome model is not easy on the real system setup as there needs to be almost all possible conditions executed for various values of speed, power and torque (load). We use the generated fingerprint for this purpose, which already covers almost all nominal cases, as depicted in Figure 6, thanks to the digital twin. We note that the power values are directly calculated from the speed values for different torques meaning that they are dependent variables, that is, \(P=f(v,\tau)\) (as described in Section 3.2). We take intervals from the fingerprint each of which define a chromosome, as shown in Figure 6. In this case, the interval size changes the amount of chromosomes in a population, which then affects the performance of the system. This effect is evaluated in Section 4.5.1. The goal is to maximize a fitness function, that is, the optimization algorithm, by seeking a chromosome suggesting a speed value closest to a requested one, and a lowest power value. In other words, the speed should follow the initial operational request whereas the power should be lowered as there is a predicted abnormal load on the system. The fitness function is given in (2). \[F=\alpha\cdot(v_{cltr}-v_{req})+\beta^{{}^{\prime}}\cdot(P_{real}-P_{chr}) \tag{2}\]  
Subject to:  
\[\alpha+\beta^{{}^{\prime}}=1, \tag{3}\]  
where \(v_{req}\) is the initially requested speed value by the system operator and \(v_{cltr}\) and \(P_{chr}\) values are provided by a chromosome. \(v_{cltr}\) is the average speed using the gene values of \(v_{min}\) and \(v_{max}\), and \(P_{chr}\) is the average of \(P_{min}\) and \(P_{max}\). Finally, \(P_{real}\) is the current (real-time) power reading coming from the system. We note that \(P_{chr}\) values are a function of \(v_{cltr}\), so they are proportionally dependent (see in Equation (1)). \(\alpha\) and \(\beta^{{}^{\prime}}\) are normalized weights of speed and power, respectively. The \(\beta^{{}^{\prime}}\) in Equation (2) is an adaptive parameter:  
\[\beta^{{}^{\prime}}=\beta\cdot(1+\left|\frac{Err_{op}}{C}\right|), \tag{4}\] \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Gene** & **1** & **2** & **3** & **4** \\ \hline Label & \(v_{min}\) & \(v_{max}\) & \(P_{min}\) & \(P_{max}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The layout of a chromosome. Figure 6: The upper and lower bound of power given a speed interval define a chromosome. which changes with the calculated PID error, \(Er_{op}\). \(C\) is a constant to control the changing magnitude of \(\beta^{{}^{\prime}}\) and can be tuned by the user. Such an adaptive parameter calculation is devised in order to increase the weight of the power optimization for protection purposes.