## 5 Neural Control Strategies
### Internal Model Controller  
With both the identification and the inverse controller network trained and tested, we proceed to the developing of an internal model controller. This controller reduces the existing noise and perturbations on the system's response by subtracting the error between the system and the identification network from the input reference of the inverse controller [11; 35]. As shown in Figure 20, a first-order filter is used to provide robustness, in which the time constant is five times higher than the sampling period to ensure closed-loop stability.  
Using a time constant at least five times bigger than the sampling period, that is, \(\tau_{F}=0.02\) s, the transfer function of the filter is given by:  
\[H(z)=\frac{0.1304}{1-0.8696z^{-1}}. \tag{36}\]  
The Simulink diagram of Figure 21 is used to simulate the response of the system. The 10d10n identification network is used as system model and white noise is added to the output to better approximate the response to the real system. The noise has a normal distribution with zero mean (\(\mu=0\)) and variance of \(\sigma^{2}=0.005\).  
\begin{table}
\begin{tabular}{c c c c c c} \hline  & & **Step** & **Sine** & **Saw** & **Total** \\ \hline \multirow{2}{*}{ISE} & \multicolumn{2}{c}{lead–lag} & 1.6828 & 2.2484 & 2.2968 & 6.228 \\ \cline{2-6}  & Inverse Model + Adaptive Block & 0.1166 & 0.1819 & 0.1884 & 0.4869 \\ \hline \multirow{2}{*}{IAE} & \multicolumn{2}{c}{lead–lag} & 8.0435 & 9.0256 & 9.1502 & 26.2193 \\ \cline{2-6}  & Inverse Model + Adaptive Block & 1.0882 & 2.0457 & 1.6444 & 4.7783 \\ \hline \multirow{2}{*}{ITAE} & \multicolumn{2}{c}{lead–lag} & 161.1860 & 179.8254 & 184.7707 & 525.7821 \\ \cline{2-6}  & Inverse Model + Adaptive Block & 18.2365 & 38.6153 & 29.8916 & 85.7434 \\ \hline \end{tabular}
\end{table}
Table 10: ISE, IAE and ITAE values for the lead–lag and the Inverse model with adaptive block.  
Figure 20: Diagram of the internal model controller.  
Figure 22 shows the simulated responses of the system controlled with the inverse and internal model controllers, when subjected to step, sinusoidal, and sawtooth inputs. Both controllers are using an adaptive block to reduce the steady-state error. As can be seen, the noise in the responses with the internal model controller is much smaller when compared with the responses of the inverse model controller. Some oscillations still exist but most of the high frequency noise is eliminated. In Table 11 the indexes of performance ISE, IAE and ITAE are compared, showing the slightly better performance of the internal controller.  
Figure 21: Simulink diagram of the internal model controller.  
Figure 22: Comparison of system responses with the inverse model with adaptive block and internal model.  
However, as represented in Figure 23, the control signal is very similar in both controllers. So, in order to better understand the difference between the control signals, we computed the control effort (\(CE=\int_{0}^{T_{\text{sim}}}u(t)dt\)) for each controller. We get \(CE=56.0820\) for the inverse model and \(CE=55.9194\) for the internal model, which confirms the similarity of both control signals.