## 3 Results  
Five types of functions are used for references and disturbances: step, square, sine, sawtooth, and trapezoid. Each function is shown in Figure 7 below. For step signal, there is only one parameter and that is amplitude. For square, sin, and sawtooth signals, there are two parameters, which are amplitude and frequency. For trapezoid signal, there are three parameters, namely maximum, acceleration, and deceleration. For training, ten different reference and ten different disturbance signals are used. This makes up a hundred total reference-disturbance pairs. Below are given the reference and disturbance signal parameters in Tables 1 and 2, respectively. Figure 7: Five types of functions for references and disturbances. Waveforms of reference and disturbance signals are taken to represent the most common signal patterns encountered in control systems. Step and sine references are common for regulation and tracking systems, respectively. Step and sine disturbances represent two main disturbance types: constant disturbance and time-varying disturbance. For these reasons, the training set is constructed with these reference-disturbance pairs. A particle swarm size of 100 is used for training the neural network-based controller for 1000 epochs. An optimal neural weight vector, which is denoted as g below, of size 123, is obtained with the following values:  
g (optimal neural weight vector) = [I  
\(8.05530251\times 10^{-2}\), \(6.80355357\times 10^{-2}\), \(-1.95685395\times 10^{-2}\)]  
Note that, as cost function, average absolute error, which is the average difference between the reference signal and the measured output, is used. The formula for the cost function used is the following:  
\[cost=\frac{1}{N}{\sum_{m=1}^{N}}(\textit{vref}[n]-w[n]), \tag{12}\]  
\begin{table}
\begin{tabular}{c c c c c} \hline
**Signal** & **Type** & **Amplitude (rad/s)** & **Frequency (Hz)** & **Accwhere N is the total number of samples in the experiment and n is the time index of the sample number. The proposed system is compared with the optimal PI controller tuned with the PSO algorithm since it is shown to have better performance than that tuned with [PERSON]'s method in the literature. So, showing the higher performance of the proposed algorithm compared to that of the optimal PI-tuned controller with PSO already ensures a higher performance than for the PI tuned with [PERSON]'s method with the transition rule in comparing performances. The average error for the optimal PI controller on the training set is obtained to be 1.5201955398258502 rad/s. The average error for the optimal neural network-based controller on the training set is reduced to 1.3890762003883137 rad/s. Hence, an approximately 8.6 percent reduction in average error is observed for the training set. Note that the training set corresponds to the expected reference-disturbance pairs. If the expected reference-disturbance pairs are estimated correctly, the resulting controller will be more robust. Below are some examples of system outputs of PI and neural network-based controllers for several reference-disturbance pairs. In Figure 8 below, the result of the experiment run using the following reference-disturbance pair is shown. Training reference type = step \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Signal** & **Type** & **Amplitude** & **Frequency** & **Acc. Time** & **Dec. Time** \\
**Number** & & **(Volts)** & **(Hz)** & **(ms)** & **(ms)** \\ \hline
1 & step & 1 & NA & NA & NA \\
2 & step & 1.5 & NA & NA & NA \\
3 & step & 2 & NA & NA & NA \\
4 & step & 3 & NA & NA & NA \\
5 & sine & 1 & 5 & NA & NA \\
6 & sine & 1 & 20 & NA & NA \\
7 & sine & 2 & 5 & NA & NA \\
8 & sine & 2 & 20 & NA & NA \\
9 & sine & 3 & 5 & NA & NA \\
10 & sine & 3 & 20 & NA & NA \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Disturbance signal values for training set. Figure 8: An illustrative example of neural controller’s high performance.