# Optimized Dissolved Oxygen Fuzzy Control for Recombinant _Escherichia coli_ Cultivations
## 2 Theory and Software
### Supersys_Hcdc  
Precise feeding control rate, undesired metabolic by-products production, temperature and pH alterations, variations in DOC, and foam formation can stir a cultivation either to success or failure [1; 2; 3; 4]. Thus, a highly experienced and skilled bioreactor operator is required during the cultivation. However, cultures can take longer than 30 h, uninterruptedly. Therefore, an affordable supervision tool, based on artificial intelligence, could assist and even replace (in several moments) human supervision. Based on these premises, SUPERSYS_HCDC was conceived in the Laboratory for Development and Automation of Bioprocesses, from Federal University of Sao Carlos (Brazil), as one of first complete affordable automation system for monitoring and controlling cultivations, including high-cell density cultivations [21; 22; 23; 47]. Under its supervision, several microorganism cultivations were conducted, such as: _Saccharomyces cerevisiae_, _Pichia pastoris_, _Bacillus megaterium_, and _Escherichia coli_. The program was coded in MATLAB (6.5) and implemented in the LabVIEW (8.0) platform, where the controllers were segmented in control modules, such as: pH and temperature control, alarms, automatic supplementary feeding, and especially, the dissolved oxygen control module [47].  
The hybrid system was developed by combining a digital PID controller in velocity form (manipulating the agitation speed) and a decision tree (manipulating air and oxygen flow rates).  
The PID strategy for agitation speed is described by Equation (1):  
\[\begin{split} gitSp_{t}=AgitSp_{t-1}+k_{c}\{[(SetP-DOC_{t})-(SetP- DOC_{t-1})]+\frac{M}{T_{t}}(SetP-DOC_{t})+\\ \frac{T_{d}}{\Delta t}[(SetP-DOC_{t})-2(SetP-DOC_{t-1})+(SetP-DOC_ {t-2})]\},\end{split} \tag{1}\]  
where \(AgitSp\) is the agitation speed (rpm), \(K_{c}\) (rpm/%), \(T_{t}\) (s.%/rpm), and \(T_{d}\) (rpm. s/%) are the proportional, integral, and derivative constants (respectively), \(SetP\) (%) is the dissolved oxygen concentration setpoint value, DOC (%) is the dissolved oxygen concentration, t is the iteration, and \(\Delta t\) (s) is elapsed time between iterations.  
The pseudocode for air and oxygen flow rates control was based on the decision tree presented in Figure 1, which is interpreted as follows. If DOC is lower than its setpoint value, the decision tree starts by evaluating the agitation speed (\(AgitSp\)). If it is low (lower than 70% of its superior limit-AgitSp\({}_{\text{SL}}\) = 950 rpm), and oxygen is already been injected in the system (\(Q_{O_{2}}\)), air flow rate (Q\({}_{\text{Air}}\)) should be increased by Delta (\(\Delta Q\)), and oxygen enrichment should be decreased by the same amount. However, if the agitation speed is higher than or equal to 99% of its superior limit and DOC < DOC\({}_{\text{IL}}\) (dissolved oxygen inferior limit), then, two options are presented in the decision tree. It is observed if the sums of air and oxygen flow rates have already surpassed the maximum gas flow rate (Q\({}_{\text{max}}\)), then, airflow rate is decreased, and oxygen enrichment is increased. However, then, airflow rate should be increased, and oxygen enrichment should remain constant [21; 22; 23; 47].