PLC and SCADA design of a water treatment process

Flexible and reusable PLC software module and SCADA design for the control of a complex water treatment process for EarthTech Ireland

by

Catherine Heintz

This Report is submitted in partial fulfilment of the requirements of the Honours Degree in Electrical and Electronic Engineering (DT021) of the Dublin Institute of Technology

May 9th, 2008

Supervisors: Mr James Shortt and Mr David Berber

School of Electrical Engineering Systems

School of Electronic & Communications Engineering

Acknowledgements

This final year project is the outcome of more than three years of engineering studies: it is the opportunity for the students to apply all the skills learned in the college, and develop design and analytical skills.

The project presented here is a PLC and SCADA design for the flexible control of a water treatment process. It has been given and partially supervised by the company EarthTech Ireland.

The efficient running of this project work couldn’t have been done without the help of several people. I wish to thank:

-Mr James Shortt, my company’s supervisor, for havingentrusted me this project. He always was ready to help me and available to answer my questions.

-Mr David Berber, my college’s supervisor, for him explanations and support.

-All the technical staff I was in contact with and my entourage, for their assistance and advice.

Abstract

The subject of this automation project is the design and implementation of a reusable software module for the control of a complex section of a water treatment process.

The water treatment is accomplished by a Sequential Batch Reactor(SBR)which utilises pumps, blowers and valves. The SBR is connected to the main water treatment system by inlet and outlet pumps. The SBR is utilised to improve the final quality of treated waste water.

The SBR and its connecting equipment are controlled by a Mitsubishi’s Q2UCPU Programmable Logic Controller (PLC), equipped withappropriate digital and analogue inputs and outputs. The PLC is programmed using GX IEC Developer 6.01 software incorporating a Function Block structure with Proportional – Integrator – Derivative (PID) control blocks for the control of the water treatment plant.

A SCADA interface allows the monitoring and control of the whole system and the relevant PLC program variables. The associated mimics present an overview of the water treatment process. The global supervision is implemented by InTouch software using a specifically designed interface.

The communication between the PLC and the controlling elements (SCADA and programming software) is made by Ethernet.

Index

Acknowledgements

Abstract

Chapter 1: Introduction

A)A project given by the company EarthTech

1.Earthtech

2.My supervisors

B)The subject of the project

1.Water treatment process: the Sequential Batch Reactor

2.Objectives

3.The Programmable Logic Controller

4.SCADA Interface

Chapter 2: PLC Programming

A)System presentation

1.PLC Hardware

2.The software GX IEC Developer

3.Communication between GX IEC Developer and the PLC

B)Basic elements

1.Programmable Organization Unit

2.Programming language

3.Function blocks

4.Data types

5.Local and global variables

C)Project design

1.Structure of the different solutions

2.Addresses allocation management

3.Timers

4.Errors control

5.PID Control

6.Tests and the reset of the PLC

Chapter 3: SCADA Programming

A)System presentation

1.The software InTouch

2.Communication between InTouch and the PLC

B)Basic elements

1.Windows

2.Tags

3.Graphical representation of the tags

4.Alarms

5.Mimics

6.Security by access control

C)Project design

1.Choice of the graphics

2.Tests

Chapter 4: Reflections

A)The work schedule

B)Solving the problems

C)Documentation

D)The work with a company

E)A project fully positive on several levels

Chapter 5: Conclusion and future development

A)Feedback of the work done

B)To go further

Sources

Appendix

A)Final SBR function block

B)Control_IN and Control_OUT arrays

C)Log Book

Chapter 1

Introduction

A)A project given by the company EarthTech

  1. Earthtech

Earth Tech, founded in1970, is a vital member of the Tyco International family of companies. They offer two distinct lines of business:

-Consulting, engineering and construction, serving the water / wastewater, transportation, environmental, and facilities markets

-Water Infrastructure Development, providing design, build, finance and operate services

7,000 architects, contractors, engineers and scientists work for the company, which has 130 offices worldwide, in 15 different countries. They are also accomplished business consultants, communications specialists, and advocates – out of necessity, practicality and experience.

Earth Tech employs over 100 employees in Ireland. Earth Tech Ireland’s business is primarily focused on the Water and Wastewater Treatment market sector in the country. They are a leading player in the design, construction and long-term operation of water and waste water treatment facilities.

In the water market, Earth Tech provides a complete range of services to small, intermediate and large water suppliers, from source development, water treatment, storage and distribution, to operation and administrative services.

On the wastewater market, Earth Tech works with public agencies, private utilities, and industrial clients to deliver quality, cost-effective treatment solutions. Their wastewater treatment experience includes municipal and industrial wastewater treatments, wastewater conveyance and water reuse systems for clients around the world.

  1. My supervisors

The company’s supervisor, Mr James Shortt, is responsible for the operations of the controls department which is located at the head office in City West Business Campus. He has worked with this company for over 30 years. He is currently working on new projects for Ballymore Eustace water treatment plant and Portlaoise Sewage treatment plant. He regularly provides projects for DIT students.

The college’s supervisor, David Berber,is graduated from the DIT electrical engineering degree program in 1981, having previously attained the Technician Engineering Diploma in Electrical Engineering. In 1984, David became a full-time lecturer with the School of Control Systems and Electrical Engineering. He specializes in the areas of automation, process control and embedded systems.

B)The subject of the project

The subject offered is a complex automation project which concerns a waste water treatment process.

In the part of the procedure studied, incoming waste water is stored in a tank, before being transferred in a Sequential Batch Reactor (SBR) which operates to give a secondary biological treatment and produce a final work effluent.

  1. Water treatment process: the Sequential Batch Reactor

Sequential Batch Reactors (SBR) are industrial processing tanks for the treatment of wastewater. SBR reactors treat waste water such as output from anaerobic digesters or mechanical biological treatment facilities in batches. Oxygen is bubbled through the waste water to reduce biochemical oxygen demand (BOD) and chemical oxygen demand (COD) to make suitable for discharge into sewers or for use on land.

The installation consists of two identically equipped tanks (CASS) with a common inlet, which can be switched between them. The tanks have a “flow through” system, with raw wastewater (influent) coming in at one end and treated water (effluent) flowing out the other.

Each CASS basin is divided into three zones by internal walls:

-The selector zone is the zone where influent wastewater enters and is mixed with the return activated Sludge,

-The secondary aeration zone periodically aerates the wastewater through a fine bubble aeration system,

-The main aeration zone periodically aerates the wastewater through fine bubble diffusers. It contains a dissolved oxygen sensor and a water level sensing device.

There are three stages to treatment: aeration, settling and decanting, during which the basins are generally continuously filled. (See figure 1 below)

The aeration stage involves adding air to the mixed solids and liquids by blowing the air into penstocks fixed to the floor of the tank. During this period a returned activated sludge (RAS) pump takes mixed liquid and solids (mixed liquids) from the outlet end of the tank to the inlet.

Aeration time varies according to the plant size and the composition/quantity of the incoming liquor, but is typically 60 – 90 minutes.

The settling stage is usually the same length in time as the aeration. During this stage the sludge formed by the bacteria is allowed to settle to the bottom of the tank.

During the decant stage, the treated effluent is removed at a controlled rate using a decanter.

In the studied system, the SBR system contains two CASS basins. One important part of the programming will be to assure the synchronization between the each basin; it is very important that they are not in the same phase at the same time.

Each CASS is equipped with:

-An inlet modulating valve to control the flow into the CASS basin

-A Return Activated Sludge (RAS) pump to return activatedsludge from the main aeration zone to the selector zone, to ensure floc-loading of the activated sludge biomass

-A Surplus Activated Sludge (SAS) pump to periodically remove the surplus activated sludge in a picket fence thickener subject to available capacity

-An effluent decanter

-An air inlet valve to control the air flow during the aerate phase.

In addition, two blowers, one duty and one standby, provide the airflow into both CASS basins.

The equipment is fitted with feedback sensors to detect their position (opening or closed) and states (running or stopped). Each CASS basin is also equipped with other probes and sensors to detect the water level and the incoming flux.

  1. Objectives

This process involves the operation of synchronized pumps, vanes and blowers by a PLC (Programmable Logic Controller) and controlling them from a SCADA interface.

The objective of this project is then to write the PLC code and create a SCADA interface to control the items of plant equipment as documented in the full Function Design Specification (FDS) given by the company.

Here are the full objectives presented in the FDS:

“1. Write a PLC code for both inlet and final pumps and controlling them from SCADA InTouch system.

2. Develop a common Function Block for SBR system using Mitsubishi PLC’s and software IEC Developer Ver 6.01.

3. Generate SCADA Mimics and control screens for SBR, equipment, inlet and final pumps as per FDS.

4. General I/O (Input/Output) list as per FDS.“

  1. The Programmable Logic Controller

A programmable logic controller (PLC) is a digital computer used for automation of industrial processes, such as control of machinery on factory assembly lines. It is designed for multiple inputs and output arrangements, extended temperature ranges, immunity to electrical noise, and resistance to vibration and impact. Programs to control machine operation are typically stored in battery-backed or non-volatile memory. A PLC is an example of a real time system since output results must be produced in response to input conditions within a bounded time, otherwise unintended operation will result.

Programs are compiled thanks to specific software which facilitates users to write their own PLC code for their application.

  1. SCADA Interface

SCADA (Supervisory Control and Data Acquisition) refers to a distributed measurement and control system, which is typically used to perform data collection and control at the supervisory level.

SCADA system is a branch of instrumentation engineering; it includes input-output signal hardware, controllers, human-machine interfacing ("HMI"), networks, communications, databases, and software.

Most site control is performed automatically by remote terminal units (RTU) or by PLC. Host control functions are usually restricted to basic site overriding or supervisory level intervention. For example, a PLC may control the flow of cooling water through part of an industrial process, but the SCADA system may allow operators to change the set points for the flow, and enable alarm conditions, such as loss of flow and high temperature, to be displayed and recorded. The feedback control loop passes through the RTU or PLC, while the SCADA system monitors the overall performance of the loop.


Chapter 2

PLC Programming

A)System presentation

  1. PLC Hardware

The whole programming is tested on a Mitsubishi PLCset with a Q2UCPU composed of seven modules: (See figure below)

-A power supply

-The Q CPU (Central Procession Unit), “brain” of the PLC

-The Ethernet module, to establish the communication between the PLC and the computer

-The digital inputs – QX60

-The digital outputs – QY10

-The analogue inputs – Q64AD

-The analogue outputs – Q64DA

Inputs, for the PLC point of view, are the points where the physical sensors are connected. Outputs are the points which are controlled by the PLC, according to the loaded program. Inputs and outputs can be digital (relays – ON or OFF) or analogue (real value in a specific range). Each type of inputs and outputs are located in a specific module.

Digital inputs are designed by the X letter and output by the Y letter. Each digital module possesses 16 connections (0 to F) whose 6 are connected for a physical use, beside the PLC himself. They don’t require any configuration because, as relays, they only provide two states: on and off.

In addition, four analogue inputs and outputs are available, divided into units (5th unit for the inputs and 6th unit for the outputs) and groups (one different group by input or output); example: U6/G1.

These input and output analogue modules have to be configured. Indeed, the analogue parameter can be provided by a current or a voltage source, and following various ranges: 4 - 20 mA, 0 - 40 mA, 0 - 10 V, -10 – 10 V. Then we have to specify exactly the type of analogue signal for each input and output.

The following setting must be done in the PLC parameters:

Moreover, they need a specific part of programming code to be started. Following the steps explained in the manuals, a self made PLC code was made, which is working but is complicated (See figure below): it is a succession of functions allowing the control of the data.

So an imported function block wasadded as a new library, which is easier to use.

(See figure below)

  1. The software GX IEC Developer

GX IEC Developer 6.01 is the software provided by EarthTech to program the PLC; it is a powerful programming and documentation package. It supports the implementation of the entire PLC range, from the initial project planning to everyday operation. It offers a user-friendly MS Windows environment and a choice of five programming languages to best suit the project.

It is a modified version of the GX Developer software used in the school; the first stage of the project was then to read the documentations of this new software and discover all the programming possibilities that it offers.

As GX IEC Developer has changed over the years, the compiler that turns the drawing into PLC has been improved. Each version produces shorter and more efficient code.

One change from the 5th and 6th version was the handling of the commands like EQ_E (Equals) and GT_E (Greater than). The difference in code produced can cause problems with PLS commands as well as counters and timers.

The running of the project was disturbed by one of these compilation differences.

This syntax had to be changed:

by the following:

Although both of these codes are similar, there was an interaction with the other part of the project. To be absolutely sure that there is not any other interaction, the option “Generate code as in GX IEC Developer 5.02” has be chosen.

  1. Communication between GX IEC Developer and the PLC

The communication between the PLC and the computer, where GX IEC Developer and InTouch are installed, is made by the Ethernet protocol. That was the subject of the last year’s project. Both hardware are then linked by a crossed Ethernet cable (without Hub), and their I.P. address are set in the same subnet; otherwise a router would be needed.

B)Basic elements

The whole code is built with a number of basic parts and following a specific language, which leads to the final result. Here are described the main elements used in the program.

  1. Programmable Organization Unit

Programmable Organization Units (POU) are modules which arranged together into “tasks”, form the whole code. These modules can be from different type, with particular functionalities:

-Function (FUN) and Function Blocks (FB) are programming instructions and can be utilized in every module of the program.

-Program (PRG) is the general POU which is directly complied, and allows loading the Function Blocks or Functions POU.

The final PLC code can be formed with several tasks, managed in function of their priority.

Each POU goes with a “header” file, in which all the variables used are listed and defined by their name, type, initial value, address…

  1. Programming language

The body of each POU can be written in a different programming language. GX IEC Developer provides several choices:

-Text editors: Instruction List and Structured Text

-Graphic editors: Ladder, Function block diagram and Sequential function chart (Grafcet)

Function block diagrams editor allow the programming of function blocs only. It can’t be loaded on its own.

The ladder, with which we can use function block diagrams, has been studied in the college; hence it is the language used for the programming.

  1. Function blocks

Function (FUN) and function blocks (FB) are part of the instruction set. They can be created and reused several time. Functions blocks, contrary to simple functions, can provide several outputs and can make internal variables storage. They have to be instantiated, because they don’t provide the same outputs in function of the inputs.