Controlling the water level in irrigation channels is important for the efficient management of irrigation and water delivery. In this study, the proportional–integral–derivative (PID) controller was implemented in both the HEC-RAS boundary condition, as an internal model, and MATLAB, as an external model. In the latter, the Hydrologic Engineering Center’s (HEC) River Analysis System (HEC-RAS) model was automated for irrigation canals by coding in the MATLAB script. To test the new models, E1R1 (first right bank branch of the first eastern canal in the Dez irrigation network, Khuzestan Province, Iran) irrigation canal data were prepared in HEC-RAS. A flow pattern was provided to simulate the canal water levels. The results showed efficient control of the water level for both models. The maximum and average water depth deviations from the target value were 13% and 4%, respectively, which fall in the good agreement range. The fewer these indicators, the better the performance is. The efficiency and adequacy were close to the ideal value and in the good agreement classes. The equity indicator was 0.013, which is very close to its ideal value of zero, showing efficient water distribution in the tested system. According to the literature for the equity indicator, a range of 0–0.10 is good, a range of 0.11–0.25 is fair, and a range of greater than 0.25 is poor. The results showed that simple and fast implementation is the main advantage of the internal model; however, it is not suitable for implementing complex controllers. Conversely, the external model can be implemented for complicated algorithms without any limitations.