PLC Application Exercise - Water Level Control 1. Aim Use a Programmable Logic Controller (PLC) to control a real to life industrial model. 2. Objectives Understand the principles and operation of a tank level control system using float switches and PLC. Create a ladder logic program to control the water level in a process tank and then drain the tank when full. Identify safety critical states in the system and create a sequence in the program to reduce risk to plant and personnel. 3. Theory The rig has two tanks, the supply tank supplies water to the process tank. In a real system, this would be a random supply of water from a source, such as a bore-hole, sewage system or rainfall. The process tank is fitted with two float switches to indicate a low or high water level. The low level float switch is mounted to give a closed circuit when the water level is low. The high level float switch is mounted to give a closed circuit when the water level is high. A pump is fitted to return water back to the supply tank. System Behaviour The START button is pressed. The water level is checked in the process tank. With an empty tank, the low level switch is closed and high level switch open, pump 1 is switched ON. The process tank will start to fill. As the level rises, the low level switch is opened. Once the tank is full, the high level switch is closed and pump 1 is switched OFF. Pump 2 is switched ON, water is drained from the process tank. When the Process tank is empty, the low level switch is closed. The process is repeated, until the STOP button is pressed. 1
4. Apparatus The process rig has a panel with a number of sockets that allow simple connection to a PLC. The rig is powered by a separate 12V Power Supply Unit rated at 5A. The rig is connected to the PLC as shown below: LOW COM HIGH PUMP 1 PUMP 2 PSU 5. Experiment Water level control Study the system behaviour very closely; pay close attention to the states of the inputs when each pump is turned ON/OFF. It is very important that you consider the precise order of inputs and outputs. The tables below show the input and output table and the system state table, which shows both the current and next output state of the system. I/O Table Physical Connection Input 1 Input 2 Input 3 Input 4 Output 1 Output 2 Name START STOP LOW HIGH PUMP1 PUMP2 State Table Inputs Pump 1 Pump 2 State Low High Current Next Current Next Reset/Fail with full tank 0 1 0 0 0 1 Reset/Fail with water in tank 0 0 0 1 0 0 Start with empty tank 1 0 0 1 0 0 Tank filling up 0 0 1 1 0 0 Tank full 0 1 1 0 0 1 Tank being emptied 0 0 0 0 1 1 Tank empty 1 0 0 1 1 0 The two highlighted states show a transition in which one pump is turned off, while the other is turned on. The LOW input STARTS pump 1 and STOPS pump 2 while the HIGH input STARTS pump 2 and STOPS pump 1. No change in output states happen if the tank is being filled or emptied i.e. either of the pumps is on. Create a ladder logic program and test by simulation in Trilogi before uploading to the PLC and twin-tank system. 2
6. How to transfer programs to the PLC This section describes the step by step procedure for transferring programs to the PLC. The example program to transfer will be the simulation Exercise 1 program SimpleIO.pc6. It is essential that you carry out the steps given below exactly. Ensure the PLC is connected to the power supply and switched ON Ensure the power supply of any other Rig connected to the PLC is also switched ON. Ensure that RS232 Serial cable is connected to the PLC s COM port Run the TLserver Software if it not already loaded. You will see the following window appear. Now click on the Serial Port Setup button above. The following window appears: Ensure the message COM1 opened at 38400bps is displayed in the Response window. If not please call the Technician in charge to assist you. If the message confirms that the port is opened as shown above then, proceed to the next page. 3
Click on Controller and select Program transfer to PLC. The following windoww is opened: Now type in 01 in the Detect ID box and click on Memorize Username & Password to clear the Tick sign. This means the PLC should not be set with a username and password. Note: you must not set a Username and Password for any other subsequent experiment or project. Therefore the windoww should appear as shown below before you proceed to the next step. Now click OK. 4
Click Yes to Overwrite PLC s program. The i-trilogi software will now compile the Ladder logic to machine code. If the code contains errors, then the PLC will display an error message that the compilation is not successful. You must then go back to editing and correcting your errors. If the compilation is successful, you will seee the messagee Success! in the Compilation window shown above. Now click on Start Transfer, the following window is displayed: Click on Yes to Reset PLC? 5
The program in the PLC will Execute and read data from input ports or output data to the devices you have programmed. The status of the PLC can be monitored by the following: Click on Controller and select On-Line Monitoring. The following window appears: The status of all devices can be monitored from this window. If A/D converters are used then the Raw Data from the converters can be seen at the top of the window in ADC1-8 boxes. Now activate Digital Input1 by pressing the Dip Switch 1 down to turn it ON and see the LED for Input1 light up, this in turn activates the Output1 Relay and its LED. You will hear a click every time the Relay is energised. This concludes a successful PLC Program transfer. The same procedure is used to transfer any program to the PLC. 6