# Fault-Tolerant Model Predictive Control Applied to a Sewer Network
## 4 Case Study: Benchmark Simulation Model for Sewer Networks
### Fault-Tolerant Control System for the Sever Network  
A Fault-Tolerant Control system (FTC) will be implemented following the architecture corresponding to a hierarchical control system, as shown in Figure 2:  
As already indicated, the MPC generates the setpoints of the local P-I type regulators by solving a Quadratic Programming (QP) optimization problem considering the measurements of the system variables (levels and flows), the measurable disturbances of the process (inlet flows to the sewer network that comes from urban wastewater and precipitation). At the supervision level is the fault detection and diagnosis system (FDD), which receives the measurements of the system variables and disturbances from the level immediately below and allows the MPC algorithm of that level to be reconfigured after a fault has been detected and diagnosed correctly. To reduce the number of cases in this study, only the possibility of faults in actuators (gates that regulate the flow rate of the tanks) and level sensors of each tank of the network will be considered. The performance of the fault detection system will be studied considering different moments when a fault will occur in the controlled system and two different disturbance scenarios. The faults under study will be:  
* Faults in the level sensors of each tank: the system behavior will be analyzed considering faults in the sensor gain, which is reduced to 10% of its nominal value. * Faults in the actuators: the behavior of the detection and diagnosis system will be studied considering the gate of each tank blocked at 20% of its total opening. Both types of faults are of high magnitude, justified by the reasons explained in the introduction. These faults will occur on the second, fifth or eighth day of the total 10 days for different simulation scenarios. The methodology explained in Section 3 will be applied to the sewer system considering the following parameter values:  
* The length of the sliding window is \(n=50\) because it has been heuristically proven that 50 samples are a suitable value. Matrix \(\mathbf{X}_{p}\in\Re^{n\times m}\) contains these samples. * The data vector \(x\in\Re^{mx1}\), taken from the system, includes the system disturbances, the system state variables (tank levels and flow rates of the link elements 6, 7, 8 and 9), the output flows and output flow setpoints of each tank, so its length is \(m=25\). * A matrix \(\mathbf{X}\in\Re^{nxm}\) is created with normal operating data using the neural network, including disturbances, and, considering a variance percentage of 95%, a fault threshold in that interval of 50 samples is calculated for the \(Q\) statistic. * The number of consecutive alarms considered to be a fault is \(M=20\). This is a suitable value to avoid false detections caused by the strong disturbances affecting the system. Figure 2: Hierarchical fault-tolerant control system. For diagnosis, the residue of the first 10 samples of the set of 20 that were used to detect the fault is evaluated (\(H=10\)), as explained in Section 3. This value has been chosen experimentally. The variable whose mean of the residue is greater than those calculated for the set of 10 samples considered is determined. If this variable is the level of a specific tank, it is considered that the corresponding level sensor fails. If the variable is an outlet flow rate, it follows that the correspondent reservoir gate fails.