Research Article Open Access
Irrigation Canal Downstream Water level PLC Control
Khaled Kamel1*, Eman Kamel2
1Computer Science Department, Texas Southern University, Houston, TX.
2PLC Automation, Louisville, KY.
*Corresponding author: Khaled Kamel, Computer Science Department, Texas Southern University, Houston, TX, USA, E-mail: @
Received: October 04, 2016; Accepted: October 10, 2016; Published: November 01, 2016
Citation: Kamel K, Kamel E (2016) Irrigation Canal Downstream Water level PLC Control. J Comp Sci Appl Inform Technol. 1(1): 6.
Abstract
This paper details the real time control in a long irrigation canal downstream water level using the SLC500 Programmable Logic Controller (PLC). The canal is divided into 7 sections, each with its own PLC regulator and associated infrastructure. Irrigation water is channeled through motorized vertical gates. Two pairs of control relays per gate are used to raise and lower the gate for all gates installed at approximately 10 miles sections from the upstream to the downstream agriculture area. Motorized gates, lower and upper pairs, are used to regulate the water flow and thus the downstream level. Fully closed vertical gates will produce continuous reduction in the downstream water level. Low downstream water level will not allow irrigation in the downstream area. Fully raised vertical gates will result in excessive irrigation in the downstream area and thus much wasted water. Adequate regulation of the vertical gates position can maintain desired downstream water levels at different times and thus support required irrigation cycles and preserve water resources at the same time. Coordination among all networked PLC's regulation sites is a must. This paper will briefly focus on the real time aspects of the irrigation canal PLC process control design and implementation. The commissioned system is successively working for years in the implementation site, which covers one of the two major delta irrigation branches from the river Nile in Egypt. An economic feasibility study was completed and reported several years prior to this project funding and implementation [4].
Introduction
In order to simplify this paper discussion, we will assume only two vertical gates for the considered PLC regulator site. The real implementation accommodate and control from 3 to 6 adjacent pair of gates, lower and upper, depending on the width of the irrigation canal at each site. Identical constant speed motors derive each gate [7]. The motors can move the gates up or down but only one motor can run at any time. This is done in order to reduce the overall power requirements of the regulator site. Small variation in gate's position is needed at any time due to water level transient. The lowest position gate is selected for a raise operation and the highest position gate is selected for a lowering command. At start up when both vertical gates are at the same position, the program will determine which gate will run first. Both gates are equipped with position sensors, fully closed, and fully opened limit switches. All regulators / PLC's were networked along with local ready panel mounted on each PLC front cabinet to be used by operator to monitor/ alter any register value. A centralized Human Machine Interfaces (HMI's) was also available. The original project was successfully implemented using the Rockwell Allen Bradley PLC 5/15 infrastructure but redone for this paper using the SLC RSLogix 500 PLC infrastructure [3] and the LogixPro simulator [1]. Both systems are among the most dominant digital PLC control infrastructures worldwide.

Two downstream level sensors provide redundant measurements at two points downstream locations. These sensors must be validated as they should provide similar readings consistent with previous measurements. We will assume two validated sensors input values for this project. Upstream flooding limit switch (not included in this abbreviated discussion / implementation) is used to provide the regulator an indication of possible flooding and thus command the system to raise both gates gradually using the same selection criteria until the flooding condition is removed or downstream level is close to the upstream level.

Each motor is equipped with an overload alarm switch, which is used to trigger any unusual conditions such as over temperature or load. The motors provide an input discrete signal within 5 seconds from start action indicating if the motor is running or not. If a motor fails to start then the fail to start alarm is issued. Motors can also start by activating the Push Button located on the local panel if the AUTO/MAN switch is in manual (MAN) and the LOCAL / REMOTE switch is on LOCAL.A selected motor is scheduled to run for 15 seconds. This is followed by an idle period of 15 minutes. These values are experimental values derived during the system checkout with major help from the manual system operator who was considered the domain expert for this application. No motor is allowed to run during the idle time. This is done to prevent repetitive activation of the motors during downstream water level transient. It is important to keep the gates at close positions in order to minimize the loading on both gates structure. An Emergency Shutdown Switch (ESD) is available to the operator to shut down the system in addition to the START and the STOP push button switches.
Water Level Process Control PLC I / O Map
The first step in the design of a PLC control application is the translation of the process specification to actual input / output resources. This is known as the PLC Input / Output (I/O) map.

This important step lists all I/O tags, assigned PLC addresses, and description. Figure 1 lists the irrigation control system discrete and analog inputs, while Figure 2 shows the corresponding PLC input tags. Figure 3 and Figure 4 repeat the same process for the discrete outputs. Notice that the real analog inputs / outputs for this control process were connected to the PLC using standard analog configured I/O interfaces. We only limited our control to ON / OFF control based on water level analog real time measurements relative to user defined set point for the downstream water level [2].
Automated System Implementation Building Blocks
The CPU supports the following types of subroutines that allow an efficient Structure for the program; File 2 (main file) define the structure of the program and Subroutines (SUB3, SUB4, etc.), which contain the program code that corresponds to specific tasks or combinations of parameters. Each subroutine file provides a set of input and Output parameters for sharing data with the calling file. Figure 5-1 shows the PLC subroutines (Initialization, Alarms, Downstream Average, Set point Validation, Vertical Gate1 Raise, Vertical Gate2 Raise, and Vertical Gate Position. The exact ordering of the implemented subroutine is irrelevant since the scanning of the ladder code is continuous and repeats at high rate, at least three complete scans per second. Critical tasks might require a definite ordering of some functional blocks. Most initialization tasks are executed only once on power up or system reset conditions. The figure shows the project view in Part 1 and the ladder view in Part 2.
Irrigation Canal Control Ladder Software Implementation
The set point validation Subroutine shown in Figure 6 consists of three rungs; set point high limit / low limit validation, and dead band calculations.

The initialization subroutine shown in Figure 7 consists of one rung, which clears the accumulated values for VG1 Raise one Step, VG2 Raise one Step, VG1 Fail to Start, VG2 Fail to start, and the dead time timer as the system is placed in AUTO on start up. All initializations are executed only during the first PLC scan using the first pass instruction. All initializations related to the local HMI, communication with the central site, and system diagnostic functions are not shown.

Alarm Subroutine consists of five parts including Vertical Gate 1 Failed to Start, Vertical Gate 2 Failed to Start, Downstream1 Failed, Downstream2 Failed, and common alarm. If VG1 fail to start, or VG2 fail to start, or DS1 failed, or DS2 failed, the common alarm will be set. Figure 8 shows a ladder logic diagram for the Vertical Gate1 Failed to Start Alarm. The ladder logic for the Vertical Gate2 Failed to Start Alarm is similar. Notice that the failed to start alarm is latched coil as it was one of the conditions for vertical gate to raise/ lower.

Supervisory control is a must for the entire irrigation canal downstream coordination at all sections [8]. One regulation site changes do affect the downstream water level at other sections of the canal. Implemented site control is an ON / OFF strategy,
Figure 1: Irrigation System Inputs
Figure 2: Irrigation System PLC Input Tags
Figure 3: Irrigation System Outputs
Figure 4: Irrigation System PLC Output Tags
which is the most effective for this application due to excessive water transients after each gate activation and the large dead time in the controlled variable, the downstream water level. Each site is equipped with control panels allowing the operation of the gate motors in both manual and remote modes. Those panels are disabled during typical automatic control mode, the AUTO / MANUAL in the AUTO mode.

Figure 9 shows a ladder logic diagram for the Down stream1 Fail Alarm. This diagram assumes greater than or equal and less than or equal instructions and output coil B3/11 tag name (DS1_ Fail). The ladder diagram work as follows: If downstream 1 is greater than or equal downstream average high threshold or less than or equal downstream average low threshold, then power flow to the output coil and B3/11 is set. This is an indication of level sensor 1 failure / alarm.

Figure 10 shows a ladder logic diagram for the Common Alarm. This diagram uses examine if close B3:0/13 tag name (VG1_FTS); examine if close contact B3:0/14 tag name (VG2_FTS), B3:0/11 tag name (DS1_ FAIL), and B3:0/12 tag name (DS2_ FAIL). The logic works as follow; the rung initially during the first scan as
Figure 5-1: Irrigation System PLC Subroutines (project view)
Figure 5-2: Irrigation System PLC Subroutines (ladder view)
Figure 6-1: Set Point Validation Rung 1
Figure 6-2: Set Point Validation Rung 2
Figure 7: Initialization Rung
Figure 8: Vertical Gate1 Failed To Start Rung
vertical gat1 failed to start, or vertical gate2 failed to start, or the downstream1 sensor failed, or the downstream2 failed then the output coil B3/10 tag name (COMMON_ALARM) becomes true.

Downstream Average Subroutine consists of three rungs; which include DS Average, Downstram1 level sensor validation, and Downstream2 level sensor validation. Figure 11 shows a ladder logic diagram for the downstream average. This diagram assumes examine if open contact B3:0/13 tag name (VG1_FTS); examine if open contact B3:0/14 tag name (VG2_FTS), examine if open contact B3:0/11 tag name (DS1_FAIL), examine if open contact B3:0/12 tag name (DS2_FAIL), ADD instruction, and DIV instruction.

Vertical Gate Position subroutine consists of four rungs; vertical gate1 highest in position, vertical gate1 lowest in position, vertical gate2 highest in position, and vertical gate2 lowest in position. As shown in Figure 12 the greater than or equal instruction (GEQ) compares I:1.0 (VG1 Position) to I:1.1 (VG2 Position). Once AUTO / MANUAL Switch is placed in AUTO. If VG1 position is higher than or equal to VG2 position, then the output B3:0/1 Tag Name (VG1_HIGHEST_IN_POS) is set. Notice that if the comparison used is only greater than and the two vertical gates are having equal position, then no gate will be selected to move.

Vertical Gate1 raise Subroutine consists of seven rungs; Vertical Gate1 available, next up, Control UP, Vertical Gate1 Raise One Step Timer ,Vertical Gate1 Dead Time Enable , Dead Time Timer, and Vertical Gate1 Raise One Step. As shown in Figure 13; if AUTO/MANUAL switch is in AUTO, Vertical Gate1 not running, not failed to start, and Local/Remote switch in Remote, then Vertical Gate1 is available (VG1_AV). As shown in Fig. 14, if VG1 is available, lowest in position, not fully raised, and VG2 is not next to go up, then VG1 is next to go up.

As shown in Figure 15, if vertical gate1 next up, Process variable outside the dead band, and set point greater than Downstream Average Level, then CONTROL_UP is set. The "VG1_ CNT_UP" is latched around the GRT instruction due to possible transient in water level measurements.

As shown in Figure 16, vertical gate1 control up acts as a pulse causing T4:0 to start timing and timer timing bit (T4:0/TT) to be set. This timing bit latches around B3:0/3 keeping the timer running for 15 seconds while B3:0/3 is lost due to motor running (Refer to Figure 13).

As shown in Figure 17, while T4:0/TT is ON, ESD is OFF, and dead time timer is not running, vertical gate1 is ON raising the gate one step which is equivalent to 15 seconds.

As shown in Figure 18, if vertical gate1 raise transition from high to low B3:1/0 will be ON for one scan due to the one shot (VG1_DEAD_TIME_OSR). For the Figure 19 rung if B3:1/0 or B3:1/3 is active timer (T4:4) will be set and the timer timing bit T4:4/TT will latch around (B3:1/0 or B3:1/3) which causeT4:4 (Dead Time Timer) to run for 15 minutes.

Vertical Gate 2 Raise Subroutine consists of five Rungs; Vertical Gate2 available, next up, control up, VG2_RAISE_ONE_ STEP timer, and Vertical Gate2 Dead Time Enable. It works the same as for VG1 and has the same logic.
Pre-Implementation Ladder Logic Diagrams
Prior to the implementation of the PLC software control
Figure 9: Downstream1 Transmitter Fail Rung
Figure 10: Common Alarm Rung
Figure 11: Downstream Average Calculations
Figure 12: Vertical Gate1 Highest Position Rung
Figure 13: Vertical Gate1 Available Rung
showing the working details of the process control methodology used. Once these logic diagrams are finalized and approved by all stakeholders, implementation can go forward. The detailed specification for this project including the complete sets of logic diagrams for both of the Allen Bradley SLC500 and the Siemens S7-1200 can be found in Kamel & Kamel [5] and [6].

Logic diagrams are recommended for sound documentation and as means of a transition from specifications to the actual ladder programming implementation. This step as will be briefly
Figure 14: Vertical Gate1 Next to Go Up Rung
Figure 15: Vertical Gate1 up Control Logic
Figure 16: Vertical Gate1 Raise Timer
Figure 17: Vertical Gate1 Raise One Step
Figure 18: Vertical Gate1 Dead Time Enable
Figure 19: Vertical Gate1 Dead Timer
demonstrated using one operation makes ladder programming much easier. The following logic diagram shows the implementation for the vertical gate 1 control available, which is an input condition to VG1 raise operation. Other operations logic diagrams can be constructed in a similar way for vertical gate 1 lowering operation and both the raise and lowering for VG2. "L.T." and "H.T." refers to the low and high thresholds around the downstream water level set point "S.P.", while "D.S.AVE." refers to the average of all redundant downstream water level sensors measurements. . The logic diagrams shown in Figure 20 is divided into three logics entities as follows:

• VG1 available is true; if the AUTO/ MANUAL selector switch is placed in AUTO, the REMOT/LOCAL selector switch is placed in REMOTE, vertical gate 1 is not running, and vertical gate1 not failed to start.
• VG1 next up is true; if VG1 available, VG2 not next to go up, VG1 is not fully raised, and VG1 is lowest in position.
• VG1 control up is true; if VG1 is next to go up, downstream average water level is outside the dead band, and downstream water set point is greater than or equal the downstream average water level.

Figure 21 shows the logic for starting VG1 motor for 15 seconds duration. This raise duration should cause increase in downstream water level, which is expected to stabilize after a 10 minutes idle time. The system enters the idle state after every gate raise or lower operation. No gate movement is permitted during the idle time.
Conclusion
This paper offers readers an insight to PLC programming with focus on real industrial process automation applications. Siemens S7-1200 / Allen Bradley SLC500 PLC hardware configuration and the SIMATIC STEP 7 / RSLogix 500 software were used for this implementation. LogixPro 500 simulation software can also be used to implement and test the required process control without any need for the real PLC hardware. The case study selected for this paper is intended to be a cap stone project encompassing most of the concepts covered in PLC process control and
Figure 19: Vertical Gate1 Dead Timer
demonstrated using one operation makes ladder programming much easier. The following logic diagram shows the implementation for the vertical gate 1 control available, which is an input condition to VG1 raise operation. Other operations logic diagrams can be constructed in a similar way for vertical gate 1 lowering operation and both the raise and lowering for VG2. "L.T." and "H.T." refers to the low and high thresholds around the downstream water level set point "S.P.", while "D.S.AVE." refers to the average of all redundant downstream water level sensors measurements. . The logic diagrams shown in Figure 20 is divided into three logics entities as follows:

• VG1 available is true; if the AUTO/ MANUAL selector switch is placed in AUTO, the REMOT/LOCAL selector switch is placed in REMOTE, vertical gate 1 is not running, and vertical gate1 not failed to start.

• VG1 next up is true; if VG1 available, VG2 not next to go up, VG1 is not fully raised, and VG1 is lowest in position.

• VG1 control up is true; if VG1 is next to go up, downstream average water level is outside the dead band, and downstream water set point is greater than or equal the downstream average water level.

Figure 21 shows the logic for starting VG1 motor for 15 seconds duration. This raise duration should cause increase in downstream water level, which is expected to stabilize after a 10 minutes idle time. The system enters the idle state after every gate raise or lower operation. No gate movement is permitted during the idle time.
Conclusion
This paper offers readers an insight to PLC programming with focus on real industrial process automation applications. Siemens S7-1200 / Allen Bradley SLC500 PLC hardware configuration and the SIMATIC STEP 7 / RSLogix 500 software were used for this implementation. LogixPro 500 simulation software can also be used to implement and test the required process control without any need for the real PLC hardware. The case study selected for this paper is intended to be a cap stone project encompassing most of the concepts covered in PLC process control and
Figure 20: Vertical Gate 1 Control Up Available
Figure 21: VG1 Raise Control Logic Diagram
industrial automation. The project is part of larger irrigation canal control process, which was implemented by the authors several years ago and detailed in a recently published and referenced two text books. The part included in this paper deals with a common process control task in the flow and level ON / OFF control, which has to do with the motors sequencing and control. The coverage in this paper is simplified to an abbreviated one site and is transformed to a newer implementation using the SLC 500 PLC system.
ReferencesTop
  1. LogixPro Simulator for the Allen Bradley SLC 500 programmable logic controllers, The LearningPit.com.
  2. Clemmens A, ASCE M, Strand R J. Downstream-Water-Level Control Test Results on the WM Lateral Canal. Journal of Irrigation and Drainage Engineering. ASCE. 2010.
  3. Rockwell Automation RSLogix 500 family of PLC programming software. Available from: http://www.rockwellautomation.com/ rockwellsoftware/products/rslogix500.page#user-guides.
  4. Abu-El Magad M, Kamel K, Kamel E. Economic Assessment of an Irrigation Canal Automation and Control Project. Journal of Engineering Valuation and Cost Analysis. 2000;4(1).
  5. Khaled K, Eman K . Programmable Logic Controllers: Industrial Control. M c G r a w -Hill Professional. 2013.
  6. Khaled K, Eman K . Hands-On PLC Programming with RSLogix 500 and LogixPro. McGraw-Hill Professional. 2016.
  7. Ganguly A, Kumbhare N, Shinde P, Joshi J. PLC based Control System for Hardening and Tempering Furnace in Heat treatment Plant. International Journal of Advanced Research in Electrical, Electronics and Instrumentation Engineering. 2014;3(4).
  8. Joao Hespanha. Tutorial on Supervisory Control. 2002. Available from: http://www.ece.ucsb.edu/~hespanha/published/tr-tutorial-cdc01. pdf
 
Listing : ICMJE   

Creative Commons License Open Access by Symbiosis is licensed under a Creative Commons Attribution 3.0 Unported License