# Design of a NARX-ANN-Based SP Controller for Control of an Irrigation Main Canal Pool
## 4 Results and Discussions
Figure 13 illustrates the experimental comparative time responses obtained by the water distribution control system with both designed controllers against the effect of an increment in the lateral discharge (\(q_{1}(t)\)) originated in \(t=\)3800 s, causing a decrement in the water level of approximately 5.0 cm. The value obtained in the gain tuning block of the designed NARX-ANN-based SP controller was \(K(t)=\)0.1. These results support the assumption that the best performance of the control system is obtained with the designed NARX-ANN-based SP controller, which makes it possible to fully reject the negative effect of the load disturbance and restore the setpoint water level of 3.55 m in the canal pool in an approximate time of 700 s, while with the conventional SP this load disturbance is fully rejected in an approximate time of 2200 s, which represents an approximate decrement in the rejection time of 70%. Though conventional SP structures allow very fast responses to setpoint changes of linear systems, their disturbance rejection performance is not good because, though the steady state error caused by a constant disturbance can be driven to zero, the settling time required to achieve this is large. In fact, the basic structure of the SP has been modified several times in the last decades to improve this issue. However, the compromise between the disturbance rejection speed and the closed-loop robustness limits the improvements that can be achieved. An alternative is using the Active Disturbance Rejection Control (ADRC) combined with a SP structure. However, this technique is not well suited to deal with systems with time delay, and the versions that try to copy with this are relatively complicate. We recently developed a modification of the SP structure that included a new feedback term of the error between the real and the predicted outputs [81]. This scheme showed some advantages in rejecting disturbances as well as a better stability robustness than other SP structures. Then, this scheme is a suitable candidate to be used in our canal pool because it yields a faster disturbance rejection, and its improved robustness allows the control system to deal with the nonlinearities of our canal better than other SP schemes. Figure 13: Experimental comparative time responses to the effect of external load disturbance of the water distribution control system with the controllers designed. Moreover, simulations proved that this scheme (in which the linear blocks were substituted by the NARX-ANN blocks in order to better account for the canal nonlinearities) could be further improved by making the gain of that feedback term vary in function of the quotient between the real and the predicted outputs. Then the control scheme implemented in our real canal is [81] but including the feedback term with variable gain that changes according to law (15). Experiments on our canal pool have shown its effectiveness. These experimental results obtained in the considered real operation scenarios of the studied canal pool show that the designed NARX-ANN-based SP controller outperforms the conventional SP in tracking setpoint changes and rejecting disturbances. Moreover, they show that the proposed NARX-ANN and TD-NARX-ANN models accurately reproduce the canal pool nonlinearities and can be implemented in real time, being more accurate than linearized models while being less computationally involved than more exact models based on the numerical solution of the Saint-Venant equations that cannot be implemented in real time applications. The NARX-ANN-Based SP controller designed was implemented in the industrial PC installed in the canal pool under study through a program developed in Matlab. This controller communicates via Matlab/OPC (OLE for Process Control) with the SIMATIC S7-300 PLC for real-time data exchange. The OPC technology is based on a Server/Client architecture and provides standards-based communication between PC and PLC.