## 3 Results and Discussion
### Tuning
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Errors** & \multicolumn{2}{c}{**Ziegler-Nichols**} & \multicolumn{2}{c}{**AMIGO**} & \multicolumn{2}{c}{**Maintained oscillation**} \\ \cline{2-7}  & **PID** & **PI** & **PID** & **PI** & **PID** & **PI** \\ \hline ISE & 233.1 & 559.5 & 110.7 & 255.5 & 28.0 & 32.1 \\ IAE & 9.9 & 16.0 & 6.8 & 10.4 & 3.2 & 2.7 \\ ITAE & 170.9 & 274.3 & 118.5 & 117.8 & 58.5 & 45.8 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Integral errors for PI and PID controllers. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & \multicolumn{2}{c}{**Ziegler-Nichols**} & \multicolumn{2}{c}{**AMIGO**} & \multicolumn{2}{c}{**Maintained oscillation**} \\ \cline{2-7}  & **PID** & **PI** & **PID** & **PI** & **PID** & **PI** \\ \hline Offset (ppmv) & 3.05 & 3.65 & 2.16 & 2.17 & 2.73 & 4.03 \\ \hline Stabilization time (h) & 0.66 & 0.84 & 0.65 & 0.73 & 0.46 & 0.28 \\ \hline
[H\({}_{2}\)S]average (ppmv) & 98.9 & 99.2 & 99.9 & 99.7 & 99.6 & 99.5 \\ \hline
[H\({}_{2}\)S]min - [H\({}_{2}\)S]max (ppmv) & 96.9–102.0 & 95.5–101.8 & 97.7–102.1 & 97.5–101.5 & 96.8–101.5 & 95.4–102.3 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Comparison of controller response. Figure 2: Controller selection: (**a**) outlet H\({}_{2}\)S concentration for PI and PID controllers; (**b**) nitrate flow rate (controlled variable) for PI and PID controllers. increase as the IL decrease (lower range \(28.10-56.30\) gS-H\({}_{2}\)S m\({}^{-3}\) h\({}^{-1}\)), while the system recovered the control action at the higher values of the H\({}_{2}\)S IL profile studied. However, a completely different pattern was observed under the PI-MO controller (Figure 3b), where the control variable was satisfactory controlled between \(90.40-114.30\) ppmv along the full staircase analyzed profile. Therefore, the PI-MO controller was selected to carry out the study of the control system to changes in the EBRT. Thus, the selection criteria based on integral time can be accepted for controller selection; nevertheless, it is not a definitive criterion, as the above results show. The cause, probably, could be in the tuning process of the controllers and the influence of other disturbances, which was randomly present during data acquisition, which is subsequently used in the error calculation. The stability of the system is more important than the fluctuations in the outlet H\({}_{2}\)S concentration. It is, therefore, desirable to have a low fluctuation of nitrite flow rate, even if this means a fluctuation of the outlet H\({}_{2}\)S concentration. Biogas desulfurization by an anoxic BTF using a nitrification reactor compared to the use of commercial nitrate reduces its environmental impact (61.4%) and bring operational cost down--from 6.31 to 4.34 \(\epsilon\) per kg of S-H\({}_{2}\)S treated [28]. In addition, it is necessary to avoid fluctuations in nitrite flow rate, as these would involve hydraulic residence time fluctuations in the nitrification bioreactor, which could affect its performance [29]. The feasibility of coupling both bioreactors, nitrification and BTF, has been proven at pilot plant [30]. Thus, the use of a PI control system adjusted by the MO method has two important advantages: good adjustment of the outlet H\({}_{2}\)S concentration and low fluctuation of the nitrite flow rate.