3.3. Selection of Fitness Function
In the optimisation process, defining a fitness function or a cost function is crucial. A fitness function based on the error difference between speed reference, motor, and load speeds has been developed in [
42,
59], or a similar task that used different optimisation algorithms. Similarly, in [
44], a fitness function based on speeds and torques difference is applied. In the above literature, the mean absolute error (MAE) is used as a loss function.
The proposed control structure consists of two parts: a controller and an observer. Since the disturbance integral observer proposed in the paper does not include the parameter T2, it is robust to changes in this parameter. Regardless of the value of T2, the estimation of the torsional torque and its derivative is always correct. The robustness of the system depends on the choice of regulator coefficients: ki, kp, k1 and k4. This is not a simple task. For this reason, the paper uses a metaheuristic algorithm and different forms of the objective function. There is no clear answer in the literature about which form of the function is the most optimal.
In this paper, various fitness functions are explored to optimise PI controller gains (ki and kp) and feedback coefficients (k1 and k4). In general, these fitness functions are divided into three groups.
The first group of fitness functions are based on the discrepancy between reference values (speed and load) and the output of the system (motor and load speeds, as well as electromagnetic torque). Their values are calculated at a single load time constant (T
2 = v
1/v
2/v
3), where v
1 is 0.2 s, v
2 is 0.6 s and v
3 is 1 s. MAE and mean squared error (MSE) are applied as a loss function as shown in Equations (15)–(18). Since results are the same across all the T
2 values, here T
2 = v
1 = 0.2 s is considered.
where N is number of samples; ω
ref is reference speed; m
L is load torque; ω
1(v
1) and ω
2(v
1) are motor and load speeds; and m
e(v
1) is electromagnetic torque at T
2 = v
1 = 0.2 s. The expression ω
ref–ω
2(v
1) minimises the error of load speed compared to the reference signal, whereas ω
1(v
1)–ω
2(v
1) minimises the difference between load and motor speeds. The part referring to the difference between electromagnetic torque and load torque (me(v1)—mL) ensures that the motor provides the right torque to the load.
The second group is based on the same values as the first group. However, the values are calculated at two simultaneous T
2 values (T
2 = v
1 = 0.2 s and T
2 = v
3 = 1 s). The same loss functions, MAE and MSE, are also applied in Equations (19)–(22).
where ω
1(v
3) and ω
2(v
3) are motor and load speed, respectively, and m
e(v
3) is electromagnetic torque at T
2 = v
3 = 1 s.
The third group is also based on the same value as the earlier groups, except the values in this group are calculated for three simultaneous T
2 values (T
2 = v
1 = 0.2 s, T
2 = v
2 = 0.6 s and T
2 = v
3 = 1 s). The developed fitness functions are shown in Equations (23) and (24).
where ω
1(v
2) and ω
2(v
2) are motor and load speed, respectively, and m
e(v
2) is electromagnetic torque at T
2 = v
2 = 0.6 s. The terms ω
1(v
1)–ω
1(v
2), ω
1(v
1)–ω
1(v
3), ω
2(v
1)–ω
2(v
2) and ω
2(v
1)–ω
2(v
3) ensures the motor and load speeds at different T
2 values follow to the motor and load speeds at the nominal T
2. This is intended to reduce stress and oscillations in the drive as T
2 varies.
Weighting coefficients are used for the fitness functions based on speed and torque differences. This is important to prioritise the defined parameters within each fitness function. All the developed fitness functions (f
1 to f
10) serve as cost functions for the proposed optimisation algorithm, with its parameters detailed in
Table 1.
Selecting weighting factors for the proposed objective functions is not an obvious task. Depending on the problem to be solved, different values can be used. In order to find their optimal values, a number of simulation studies are performed. The values of the coefficients ranged from 0.1 to 0.9 (the sum is 1).
Figure 5 shows examples of the values obtained during optimisation for three combinations of coefficients: 0.2–0.8, 0.5–0.5, and 0.8–0.2.
As
Figure 5 shows, the smallest value of the objective function is provided by taking the value of 0.8 for velocities and 0.2 for torques. The posted waveforms are taken for function (17). However, analogous waveforms are obtained for other functions used.
In order to check the repeatability of the obtained solutions, the tests concerning the determination of the optimal value of the objective function were carried out 10 times. Below is an example of the course of the average and best values for the function (17).
As can be seen from the runs in
Figure 6, the initial values in the individual algorithm calls are different. The differences are especially visible in the first five iterations; in the next ones, they are minimised. This indicates the stability and repeatability of the BiOA algorithm. Furthermore, the distribution of the obtained value of the optimized coefficients for 10 runs is presented in
Figure 7. As
Figure 7a,b shows, there is no visible variance, and this shows the good repeatability of BiOA.
To determine the best fitness function, the speed and torque response corresponding to the optimal values of ki, kp, k1 and k4 for each fitness function are compared with those obtained using a system model based on a PI controller and direct feedback from torsional torque and its derivative. In this approach, the PI controller coefficients and direct feedback coefficients are derived using the pole placement method, as indicated in Equations (2)–(5). The error values for the developed fitness functions are based on Equation (25).
where N is number of samples; V
df is speed and torque values from the direct feedback of the model; and V(f
i) is speed and torque values at the provided fitness function (f
i for i = 1, 2,…,10).
To ensure fair comparison of the proposed fitness functions, the test is conducted on same laptop, which has an Intel(R) core (TM) i7-5600U CPU and 8GB RAM.
Table 2,
Table 3 and
Table 4 presents the results obtained after repeated simulation runs and numerous calculations for different load time constants.
From
Table 2,
Table 3 and
Table 4, the following conclusions can be made. Among the first group of fitness functions (f
1 to f
4), f
1 provides a best solution. According to the results from
Table 2, for f
1, the change of error values at nominal T
2 for motor and load speeds, as well as torsional and electromagnetic torques, are 0.29%, 0.34%, 1.82%, and 2.56%, respectively. When T
2 changes to three times its nominal value (
Table 4), the change of error values became 0.8%, 1.21%, 15.36%, and 16.88%, respectively. These results indicate that error values are increased with respect to changes in T
2; this is particularly evident when there is a large variation in the torques. This shows the system depends on the value of T
2, which affects the robustness of the controller. Hence, f
1 and other fitness functions in group 1 are less favourable solution.
The second group consists of fitness functions f
5 to f
8. Among this group, f
5 and f
7 shows a better result compared to f
6 and f
8. Based on the results from
Table 2, for f
7, the change in error values at the nominal T
2 for motor and load speed, as well as torsional and electromagnetic torques, are 0.34%, 0.44%, 2.9%, and 3.79%, respectively. When T
2 increases to three times of its nominal value (
Table 4), the error values are 0.60%, 0.68%, 7.09%, and 7.69%, respectively. These results highlight a slight increase in change error values with changes in T
2. A similar trend is observed for f
5, change errors for motor and load speed, as well as torsional and electromagnetic torques changes from 0.31%, 0.42%, 3.05%, and 3.98% (
Table 2) to 0.45%, 0.60%, 8.12%, and 8.56%, respectively (
Table 4).
From the numerical analysis, it can be concluded that f5 and f7 perform well, exhibiting small error variations. An important observation is that the error variations for motor and load speeds are smaller in f5 than in f7. This is because f5 fully prioritizes speed difference, whereas f7 considers torque differences with a weighting coefficient of 0.2. As a result, the error variations in torques are smaller in f7 compared to f5. Similar performance to f7 is observed in f9.
After careful evaluation of results from
Table 2,
Table 3 and
Table 4 for all variable values (ω
1, ω
2, m
s and m
e) across different T
2 values, the fitness functions f
5, f
7 and f
9 were selected as optimal solution for the optimization problem. The corresponding task parameter values (kp, ki, k1 and k4) from the selected fitness functions are presented in
Table 5, and the convergence curve is indicated in
Figure 8.
From the convergence curve, the smallest convergence value can be seen from
Figure 8a, compared to
Figure 8b,c, which correspond to fitness functions f
5, f
7, and f
9, respectively. From this observation, it can be concluded that a fitness function based primarily on speed differences provides the smallest convergence value.
On the other hand, the convergence value of a fitness function can be affected when it includes the torque differences (as in f7 and f9). This impact depends on the weighting coefficient ([0,1]) assigned to torque differences. A zero-weighting coefficient for torque difference means that the fitness function relies entirely on speed difference (f5), resulting in effective speed control but overlooking the torque control, which may introduce stress in the drive. Therefore, achieving a good balance might be crucial in some cases.
This discussion is further supported by the obtained gain and feedback coefficients, as presented in
Table 5. For f
5, the PI controller focuses on speed regulation, leading to the slightly higher value of ki compared to the ki values in f
7 and f
9. In contrast, for f
7 and f
9, the additional feedback coefficients k1 and k4 are slightly higher than those in f
5. This shows that the feedback coefficients are actively responding to torque variation. However, it is important to maintain appropriate values for the feedback coefficients, as higher values can increase sensitivity to noise, potentially causing system instability. This is particularly important for k4, which is associated with the estimated torsional torque derivative, and which may amplify measurement noise for high values. Therefore, finding a proper balance of weighing coefficients when considering both speed and torque difference in the fitness function is important for stable and effective control.
In this paper, although f5 has lowest convergence value, f7 is selected as the fitness function for the defined optimization problem. This gives the advantage of controlling the speed and torques while maintaining good overall performance. However, as the selected fitness functions provide similar optimal solutions, they all can be applicable for the defined optimization problem.