## 4 Case Studies to Validate the Self-Tuning Algorithm
When the output error falls below another fixed threshold \(\mathbf{e}_{1}\) (so, after a limited time period), the control penalty factor returns to the low value \(\rho_{0}=0.0001\), decreasing the control penalty and allowing good control performances, especially a small settling time. Therefore, this constant low value of \(\rho\) is considered as a stationary regime value, being increased only temporarily when a high disturbance acts on the system and, as a consequence, whenever the controlled output error exceeds a certain threshold. Based on the previous consideration, the next case study will test the proposed tuning strategy implementing the previous rules by using a bipositional switch with hysteresis (see Figures 1 and 2). The following parameters must be set: the error values for the switching thresholds (\(e_{1}\) and \(e_{2}\)) and the switching levels of the control penalty factor (\(\rho_{0}\) and \(\rho_{1}\)). In this case, the values of these tuning parameters (determined by multiple tests and ensuring the best results) are: \(e_{1}=0.5\), \(e_{2}=3.5\), \(\rho_{0}=0.0001\) and \(\rho_{1}=0.1\). The first test considers a higher variation of the mechanical torque \(\Delta T_{m}=17\%\), for which none of the constant values of \(\rho\) (see previous cases) can ensure the stability of the control system. The control system response (the terminal voltage) is shown in Figure 4a. Very good performance can be noticed (comparable to those obtained for \(\rho_{0}=0.0001\)--see Figure 3a): small settling time (under 0.5 s), short oscillating transient regime (0.2 s). Also, the control variance is sufficiently penalized (the control values being feasible--see Figure 4b) and the estimates are numerically stable (Figure 4d). For such a higher disturbance (\(\Delta T_{m}=17\%\)), the proposed tuning mechanism is automatically triggered (the output error exceeding the threshold \(e_{2}\)--see Figure 1). As a consequence, an adequate adjustment of the control penalty factor (\(\rho\)) is performed (Figure 4c). At first (for a high output error), a high value \(\rho_{2}=0.1\) is set, with the goal to strongly penalize the control (Figure 4b), thus avoiding the system destabilization. When the output error falls below the certain threshold (\(e_{1}\)--see Figure 1), the control penalty factor returns to the small stationary value \(\rho_{1}\), allowing a reasonable increase of the control to ensure a reduced settling time, a short oscillating transient regime and, thus, the control system performances are very good (Figure 4a). The maximum value of the disturbance for which the enhanced control system operates stable is \(\Delta T_{m}=24\%\) (see Figure 5a). The controlled output has a very good settling time and a short transient regime (under 0.5 s). Also, the tuning mechanism of the control penalty factor is activated for a longer period of time, as in the previous case (Figure 5b). Over this disturbance value (\(\Delta T_{m}\geq 25\%\)), the control system becomes unstable. In conclusion, the proposed control strategy allows an extension of the values' range of disturbance (mechanical torque) up to 50%, from \(\Delta T_{m}=16\%\) (the maximum allowable disturbance for which a small constant \(\rho=0.0001\) still provides good control performance and system stability--see Figure 3a) up to \(\Delta T_{m}=24\%\) (the maximum allowable disturbance for which, only by using the proposed tuning mechanism with a variable control penalty factor \(\rho\in\{0.0001,\ 0.1\}\), the control system remains stable and has good control performances- see Figure 5a). Following this, a similar suite of tests is carried out for the second type of disturbance (the variation of the electrical resistance at the generator terminals, caused by an electrical load/unload). (b) Electrical load (electrical resistance variation \(\Delta T_{m}\))  
As in the previous case (mechanical torque variation), the next performed tests consider the same four values of the control penalty factor.