## 2 Materials and Methods
### Tuning of Feedback Control  
Three methods for controller tuning were used--two of them based on Ziegler-Nichols rules (ZN) (step-response and maintained oscillation) and the third using the Approximate M-constrained Integral Gain Optimization (AMIGO). ZN (step-response) and AMIGO methods required a step inlet perturbation and system response, which was monitoring and recording--the inlet H\({}_{2}\)S concentration was increased by 20% from 1900 to 2280 ppmv (IL from 79.80 to 95.80 gS-H\({}_{2}\)S m\({}^{-3}\) h\({}^{-1}\)) until the outlet H\({}_{2}\)S concentration (control variable) was constant (steady state conditions). This increase in the inlet concentration is enough to observe the response of the system without reduction in the removal efficiency of the BTF; the usual critical elimination capacity in anoxic BTF is above 100 gS-H\({}_{2}\)S m\({}^{-3}\) h\({}^{-1}\)[17].  
The graphical information obtained about the process from a step-response test in open loop was used to calculate the gain (K), delay time (L), and constant time (T). K corresponds with response increase, L and T were determined using the maximum slope tangent of the response curve [6]. Thus, the specific gain for each controller can be obtained by the mathematical equations shown in Table 1[18; 19].  
Integral (k\({}_{\mathrm{i}}\)) and derivative (k\({}_{\mathrm{d}}\)) gains can be calculated according to Equation (2) and Equation (3):  
\[k_{i}=\frac{k_{p}}{\tau_{l}} \tag{2}\]  
\[k_{d}=k_{p}\cdot\tau_{D} \tag{3}\]  
Maintained oscillation (MO) tuning method, also known as frequency-response, is based on the fact that most processes have a stable monotonous response to a step input to the system [20]. Experimentally, the BTF was controlled by the action of proportional gain (P controller), at constant inlet H\({}_{2}\)S concentration of 2280 ppmv (IL of 95.80 gS-H\({}_{2}\)S m\({}^{-3}\) h\({}^{-1}\)). Then, the value of the proportional gain was progressively increased from the initial value of 0.07, until the system becomes oscillatory and has continuous cycling (maintained oscillations). At that moment, it reaches the ultimate gain (K\({}_{\mathrm{U}}\)) and the ultimate period (P\({}_{\mathrm{U}}\)) of the oscillations. Thus, the specific parameters for each controller can be calculated using the mathematical equations shown in the Table 2 and Equation (2) and Equation (3) [21].  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Parameters**} & \multicolumn{2}{c}{**Ziegler-Nichols**} & \multicolumn{2}{c}{**AMIGO**} \\ \cline{2-5}  & **PID** & **PI** & **P** & **PID** & **PI** \\ \hline Proportional gain (k\({}_{\mathrm{p}}\)) & \(\frac{12T}{KL}\) & \(\frac{0.9T}{KL}\) & \(\frac{T}{KL}\) & \(\frac{0.2+0.45T}{KL}\) & \(\frac{0.25T}{KL}\) \\ Integral time (\(\tau_{\mathrm{I}}\)) & 2L & 3L & - & \(0.4L+\frac{T}{KL+0.1T}\) & 0.8 T \\ Derivative time (\(\tau_{\mathrm{D}}\)) & L/2 & - & - & \(\frac{0.5T}{0.3L+T}\) & - \\ \hline \hline \end{tabular}
\end{table}
Table 1: Tuning rule for the step response method.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline \multirow{2}{*}{**Parameters**} & **PID** & **PI** & **P** \\ \hline Proportional gain (k\({}_{\mathrm{p}}\)) & 0.6 K\({}_{\mathrm{U}}\) & 0.45 K\({}_{\mathrm{U}}\) & 0.5 K\({}_{\mathrm{U}}\) \\ Integral time (\(\tau_{\mathrm{I}}\)) & 0.5 P\({}_{\mathrm{U}}\) & 0.85 P\({}_{\mathrm{U}}\) & - \\ Derivative time (\(\tau_{\mathrm{D}}\)) & 0.125 P\({}_{\mathrm{U}}\) & - & - \\ \hline \hline \end{tabular}
\end{table}
Table 2: Tuning rule for the maintained oscillation method.