L SUBRAMANIAM UNIVERSITI TEKNOLOGI MALAYSIA

i WATER LEVEL CONTROL BY USING PLC AND SCADA SYSTEM NAGARAJ A/L SUBRAMANIAM UNIVERSITI TEKNOLOGI MALAYSIA ii PSZ 19:16 (Pind. 1/13) UNIVERSITI ...
Author: Jared Hart
13 downloads 0 Views 4MB Size
i

WATER LEVEL CONTROL BY USING PLC AND SCADA SYSTEM

NAGARAJ A/L SUBRAMANIAM

UNIVERSITI TEKNOLOGI MALAYSIA

ii

PSZ 19:16 (Pind. 1/13)

UNIVERSITI TEKNOLOGI MALAYSIA DECLARATION OF THESIS / UNDERGRADUATE PROJECT PAPER Author’s full name : NAGARAJ A/L SUBRAMANIAM Date of birth

:

31ST JANUARY 1992

Title

:

WATER LEVEL CONTROL BY USING PLC AND SCADA SYSTEM

Academic Session :

2014/2015-II

I declare that this thesis is classified as:



CONFIDENTIAL

(Contains confidential information under the Official Secret Act 1972)*

RESTRICTED

(Contains restricted information as specified by the organization where research was done)*

OPEN ACCESS

I agree that my thesis to be published as online open access (full text)

I acknowledged that Universiti Teknologi Malaysia reserves the right as follows: 1. The thesis is the property of Universiti Teknologi Malaysia. 2. The Library of Universiti Teknologi Malaysia has the right to make copies for academic purposes.

Certified by: SIGNATURE 920131-01-5221 __ (NEW IC NO. / PASSPORT NO.) Date: 23rd JUNE 2015

NOTES: .

*

SIGNATURE OF SUPERVISOR DR. SOPHAN WAHYUDI BIN NAWAWI (NAME OF SUPERVISOR) Date: 23rd JUNE 2015

If the thesis is CONFIDENTAL or RESTRICTED, please attach with the letter from the organization with period and reasons for confidentiality or restriction.

iii

“I hereby declare that I have read this final year project report and in my opinion this final year project report is sufficient in terms of scope and quality for the purpose of awarding the degree of Bachelor of Engineering (Electrical - Mechatronics)”

Signature Name of Supervisor Date

: …………………………………………… DR. SOPHAN WAHYUDI NAWAWI : …………………………………………… 23 JUNE 2015 : ……………………………………………

i

WATER LEVEL CONTROL BY USING PLC AND SCADA SYSTEM

NAGARAJ A/L SUBRAMANIAM

A final year project report submitted in fulfillment of the requirements for the award of the degree of Bachelor of Engineering (Electrical - Mechatronics)

Faculty of Electrical Engineering Universiti Teknologi Malaysia

JUNE 2015

ii

I declare that this final year project report entitled “Water Level Control by Using PLC and SCADA System” is the result of my own research except as cited in the references. The final year project report has not been accepted for any degree and is not concurrently submitted in candidature of any other degree.

Name

: …………………………………………… NAGARAJ A/L SUBRAMANIAM : ……………………………………………

Date

23 JUNE 2015 : ……………………………………………

Signature

iii

To my beloved parents and family members.

iv

ACKNOWLEDGEMENT

This project came from my proposed idea with some suggestions from my supervisor, Dr Sophan Wahyudi Nawawi. The project is done with the guidance given by my supervisor. In my opinion, this project will be very useful and become a new trend in the future. I am very thankful for those who have provided advices and help in this project.

First and foremost, I am very grateful and appreciated with the help of my final year project supervisor who has been guiding and encouraging me throughout the developing process of this project. I am very thankful for his invaluable guidance and support throughout this first semester. Besides, I would like to express my grateful and appreciation for all of my friends who gave me some suggestions and advices in the project.

In addition, my special thanks to my family. They support me both mentally and physically all the time. This allows me to focus on my final year project without any worry.

At last, my heartfelt gratitude goes to all the lecturers and course mates who have provided me suggestions and lessons throughout my university life. With their advices and helps, I am able to gain knowledge from them and become a better person. This can be helpful to me on being to be a professional engineer and person in the future.

v

ABSTRACT

The water level control system using Programmable Logic Control (PLC) is an intelligent automatic water level measurement system using an Omron PLC. While people especially in industrial lines have difficulties to measure and control the water level smoothly, this system can be used to provide a better way of controlling the water continuously and guaranteed the accurate reading of water level in minimum time. The water level measurements were controlled by the programmed microcontroller ATmega328 where the program can be modified easily according to the desired depth of water level measurement. The accuracy of water level can be controlled by using the pulse-width modulation (PWM) where the duty cycle is value from 0 to 255. Then the microcontroller will generate the analog output voltage that corresponding to the water level which represented in duty cycle value. So, higher the duty cycle value, the more accurate the analog output voltage. Moreover, ultrasonic sensor provides a high accuracy of water level measurement since it is a non-contact sensor to water and make it easy for operators to do maintenance. SCADA (Supervisory Control and Data Acquisition System) is a crucial system which it will able to provide a real-time monitoring and controlling level of water throughout the operator’s screen. Furthermore, people from engineering fields were able to observe and control the water level remotely in such simple way by using the remote desktop control technology where the network communication done over the internet.

vi

ABSTRAK

Sistem kawalan tahap air dengan menggunakan Programmable Logic Control (PLC) adalah reka bentuk automatik sistem pengukuran tahap air yang pintar menggunakan Omron PLC. Manakala manusia terutama dalam perindustrian mempunyai kesukaran untuk mengukur dan mengawal tahap air dengan lancar, sistem ini boleh memberikan cara yang lebih baik untuk mengawal air secara berterusan dan penjaminan bagi bacaan tahap air yang tepat dalam masa yang minimum. Pengukuran paras air telah dikawal oleh mikropengawal ATmega328 yang telah diprogramkan di mana program ini boleh diubah suai dengan mudah mengikut kedalaman yang dikehendaki bagi pengukuran paras air. Ketepatan paras air boleh dikawal dengan menggunakan modulasi nadi-lebar (PWM) di mana kitar tugas dinilaikan dari 0 hingga 255. Kemudian mikropengawal akan menghasilkan voltan keluaran analog yang sepadan dengan paras air yang mewakili nilai kitar tugas . Jadi, lebih tinggi nilai kitar tugas, lebih tepat voltan output analog.Selain itu, sensor ultrasonik juga memberikan ketepatan yang tinggi bagi pengukuran tahap air kerana ia adalah sensor yang tidak hubungi dengan air dan memudahkan operator untuk melakukan penyelenggaraan. SCADA (Penyeliaan Kawalan dan Sistem Perolehan Data) adalah fungsi yang penting di mana sistem akan dapat memberikan pemantauan dan kawalan tahap air pada masa sebenar melalui skrin kompueter. Tambahan pula, operator dari bidang kejuruteraan dapat memerhati dan mengawal tahap air dengan mudah melalui teknologi kawalan desktop jauh di mana komunikasi rangkaian akan dilakukan melalui internet.

vii

TABLE OF CONTENTS

CHAPTER

1

TITLE

PAGE

DECLARATION

ii

DEDICATION

iii

ACKNOWLEDGEMENT

iv

ABSTRACT

v

ABSTRAK

vi

TABLE OF CONTENTS

vii

LIST OF TABLES

x

LIST OF FIGURES

xi

LIST OF SYMBOLS

xvi

LIST OF ABBREVIATIONS

xvii

LIST OF APPENDICES

xix

INTRODUCTION

1

1.1

Introduction

1

1.2

Fundamental Principles Of Modern SCADA

2

Systems

2

1.3

Problem Statement

3

1.4

Objectives of Research

4

1.5

Scope of Work

5

1.6

Research Methodology

7

LITERATURE REVIEW

10

viii 2.1

Introduction

10

2.2

The Selection of Communication Method

10

2.2.1 SCADA System

11

2.2.2 SCADA System Concept

12

2.2.3 SCADA Hardware

12

2.2.4 SCADA Software

13

2.2.5 Benefits of SCADA systems

14

2.3

The Selection of Controller

15

2.4

The Selection of Hardware

17

2.4.1 Bilge Motor

18

2.4.2 Ultrasonic Sensor

18

2.4.3 Communication between Ultrasonic

21

……...Sensor and PLC 2.5

2.6

The Selection of Software

22

2.5.1 CX-Programmer

22

2.5.2 CX-Supervisor

25

2.5.3 Remote Desktop Control

25

Examples of Related Products

25

2.6.1

26

Project Review on Water Level Sensing Using PLC [20]

2.6.2

Water Level Control System Using PLC

27

and Wireless Sensors [21] 2.6.3

Water Level In Tank Using Level

28

Sensor And Proportional-IntegralDerivative (PID) Controller [22]

3

RESEARCH METHODOLOGY

30

3.1

Introduction

30

3.2

Hardware Design

30

3.2.1 Basic Development Of Project

31

3.2.2 Ultrasonic Sensor

32

3.2.3 Arduino ATmega328

33

3.2.4 The Low Pass Filter

34

ix 3.2.5 The Connection From Low Pass Filter

35

To PLC 3.2.6

4

37

3.3

Software Design

40

3.4

Summary

45

RESULTS AND DISUCSSION

46

4.1

Introduction

46

4.2

Results

46

4.2.1 Hardware Development

47

4.2.2 Software Development

51

Summary

69

CONCLUSION

70

5.1

Introduction

70

5.2

Conclusion

70

5.3

Future Works

71

4.3

5

Type of Inputs And Outputs

REFERENCES

72

Appendices A-B

75-80

x

LIST OF TABLES

TABLE NO.

TITLE

PAGE

1.1

Scope of the Project

6

2.1

Comparisons between Siemen and Omron

26

2.2

Comparisons between proximity sensor and ultrasonic 27 sensor

2.3

Comparisons between floating balloon and ultrasonic 27 sensor

2.4

Comparisons between the PID and PLC controller

28

3.1

Specifications and parameter of Arduino ATmega328 33 board

4.1

List of inputs with their respective address values

48

4.2

List of outputs with their respective address values

49

4.3

Function of Manual switch and Valve Control switch.

54

xi

LIST OF FIGURES

FIGURE NO.

1.1

TITLE

PAGE

A stranger approached the victim when her mother walked

3

away [1]. 1.2

Flowchart of research methodology.

9

2.1

Example of real application of SCADA system.

11

2.2

Typical SCADA system.

14

2.3

The executive procedure of PLC program.

16

2.4

A bilge motor.

18

2.5

A four pins ultrasonic sensor.

19

2.6

Ultrasonic sensor T/R40-16 with externals of element

20

(left) and structure of element (right). 2.7

Example of the commands.

21

2.8

Overall mechanism of the motion parts.

22

2.9

The ladder diagram concepts.

23

2.10

Ladder Diagram contact symbols [17].

23

2.11

Ladder Diagram coil symbols [17].

24

2.12

Display result in DM datum.

24

2.13

29

3.1

Comparison between PID (left) and PLC (right) in term of Time Vs Error curve graph. The overall development of hardware.

3.2

Ultrasonic sensor, HC-SR04 is used for measuring the

33

water level continuously.

32

xii 3.3

Arduino ATmega328 microcontroller is used as the main

34

microcontroller to give out water level in voltage forms. 3.4

Low pass filter.

35

3.5

Built-in analog I/O area of PLC CP1H.

36

3.6

Connection from the output of low pass filter to analog

36

input of PLC. 3.7

Input slide switches for the Auto/Manual Setting, water

37

pump1 control and valve control. 3.8

Input push buttons for start and stop the operation.

38

3.9

(a) Water pump1 to fetch water from storage tank to

38

supplier tank. (b) Water pump2 to supply an exact amount of water from supplier tank. 3.10

Brass micro electric ball valve to supply water out from

39

the supplier tank. 3.11

Green light indicated the operation was turned on while

39

red lights indicated the failure of water pump and valve. 3.12

Buzzer sound.

40

3.13

Arduino software had been used to write the programme

41

and upload to the Arduino board in order to retrieve the water level data. 3.14

The main procedures for designing and run a ladder

42

diagram in a PLC. 3.15

The ladder diagram which had been designed to program

42

and run the PLC. 3.16

The procedures for creating a GUI by using the CX-

43

Supervisor. 3.17

Sample GUI designed using CX-Supervisor.

43

3.18

The procedures for setting up the network communication

44

between two devices. 3.19

TeamViewer software used as a remote support tool for the SCADA system.

44

xiii 4.1

Data collected from an ultrasonic sensor and the result

47

was displayed in a column form by using serial monitor of Arduino IDE. 4.2

The PLC receives 0000 in Hexadecimal (Hex) value when

47

the voltage is approximate to 0V. 4.3

The PLC receives 1771 in Hexadecimal (Hex) value when

48

the voltage is 5.000V. 4.4

Five different types of digital inputs that connected to the

49

Omron PLC. 4.5

Brass Micro Electric Ball Valve.

50

4.6

The system had been tested under auto operation.

50

4.7

List of the point editors.

51

4.8

The type of animations in Cx-Supervisor.

52

4.9

The overall GUI for monitoring and controlling the water

52

level in real-time through the monitor’s screen. 4.10

Graph of water level vs Hexadecimal values.

53

4.11

Process of moving data and data scaling.

53

4.12

(a) Shows ladder diagram where the water level reached at

55

6cm and pump had been turned on automatically (b) shows GUI where the water been fetched to the supplier tank by water pump 1 and valve is turned off at low level. 4.13

(a) Shows ladder diagram where the water level reached at

56

24cm and valve had been turned on automatically (b) shows GUI where the water been supply out from the supplier tank by valve and water pump 1 is turned off at high level. 4.14

(a) Shows ladder diagram where the water pump1 is

57

turned on manually by using the slide switched. (b) Slide switch to turn on water pump1 manually. 4.15

(a) Shows ladder diagram where the water pump1 is turned on manually through screen. (b) Shows the water pump1 is turned on manually.

58

xiv 4.16

The water pump will stop and water level will always

59

maintained at high level when the setting is under manual mode. 4.17

(a) Shows ladder diagram where the valve is turned on

59

manually by using the slide switch. (b) Slide switch to turn on valve manually. 4.18

(a) Shows ladder diagram where the valve is turned on

60

manually through screen. (b) Shows the valve is turned on manually. 4.19

The valve will stop and water level will always

61

maintained at low level when the setting is under manual mode. 4.20

(a) Shows the ladder diagram for Timer 1 (b) shows the

62

ladder diagram for Timer 2. 4.21

The timing process diagram for Timer 1 and 2.

62

4.22

(a) Ladder diagram for inspection of pump failure (b)

63

Ladder diagram for triggering the warning light for pump failure. 4.23

(a) Ladder diagram for inspection of valve failure (b)

64

Ladder diagram for triggering the warning light for valve failure. 4.24

(a) Warning indicator for pump failure at GUI (b)

65

Warning light for pump failure. 4.25

(a) Warning indicator for valve failure at GUI (b)

65

Warning light for valve failure. 4.26

(a) Shows the 1000ml of water had been type through the

66

screen (b) the amount of the water had been displayed through the screen. 4.27

(a) Water is transferring to a container. (b) 1000ml of water had been successfully transferred. (c) Shows the exact amount of water level in a container.

66

xv 4.28

The

connection

done

for

exchanging

polarity

67

Ladder diagram of deactivating the valve within 6

67

automatically inside the PLC. 4.29

seconds. 4.30

(a) TeamViewer software had been installed in server laptop and a smartphone (b) User can remotely view and control the overall process through a smartphone.

68

xvi

LIST OF SYMBOLS

kHz

-

Kilo Frequency, Hertz

mm

-

Millimeter

GHz

-

Giga Frequency, hertz

MB

-

Mega Bytes

kwords

-

Kilo words

V

-

Potential difference, Voltage

cm

-

Centimeter

µs

-

Microsecond

Hex

-

Hexadecimal

xvii

LIST OF ABBREVIATIONS

PLC

-

Programmable Logic Control

SCADA

-

Supervisory Control and Data Acquisition System

GUI

-

Graphical User Interface

USB

-

Universal Serial Bus

DSN

-

Data Source Name

SQL

-

Structured Query Language

HMI

-

Human Machine Interface

RTU

-

Remote Terminal Unit

DCUs

-

Distributed Control Systems

LD

-

Ladder Diagram

FB

-

Functional Blocks

SFC

-

Sequential Functional Charts

IL

-

Instruction List

ST

-

Structure Text

CPU

-

Central processing unit

A/D

-

Analog/Digital

D/A

-

Digital/Analog

IPC

-

Industrial Personal Computer

DM

-

Data Memory

SQL

-

Structured Query Language

IBM

-

International Business Machines

XML

-

Extensible Mark-up Language

MSN

-

The Microsoft Network

SOA

-

Service Oriented Architecture

xviii SSIS

-

Server Integration Services

DTS

-

Data Transformation Services

ETL

-

Extract, Transform and Load

PID

-

Proportional-Integral-Derivative

xix

LIST OF APPENDICES

APPENDIX

TITLE

PAGE

A

Project Management of Project

75

B

Datasheet of Ultrasonic Ranging Module HC-SR04

79

1

CHAPTER 1

INTRODUCTION

1.1

Introduction

Water is commonly used in farming, industry and in domestic. The management of the water resources is becoming the vital problem from all over the world. Water control is usually done is to ensure there’s no wastage of water by overflowing a tank after it exceeding the maximum level that a storage tank can hold. Besides that, the type of ultrasonic sensor is playing vital role where it could able to measure water level in a tank efficiently and more accurately. Besides that, it could provide the water level measurement continuously instead of certain desired levels. From here, a user graphical interface (GUI) can be design for providing real-time monitoring on water level through the operator’s screen instead of do inspection manually in a large storage tank. This will certainly reduce the cost of man power for measuring the water level at real plant site and increase the safety of operators by just viewing and controlling the water level at screen.

2 1.2 Fundamental Principles Of Modern SCADA Systems

In our modern world of manufacturing and industrial processes, leisure and security industries telemetry is often needed to connect equipment and systems separated by huge distances which covered from a few meters to thousands of kilometres. Since the elements of process is difficult to reach physically due to the great distant, thus a SCADA system are recognized where the facility can be operated more efficiently and safely that will resulting in improving the control methods. The commands and programs will be sent by telemetry and monitoring information will be received from these remote locations [1].

Usually the combination of data acquisition and telemetry is referred by SCADA. Its task is to real-time monitoring the processing data by collecting the data process, transferring back to central site and the analysed data will be displaying through the operator screens.

In the early days of data acquisition, production and plant systems were controlled by relay logic and then the digital electronics were united into the relay logic equipment after advent of the CPU and other electronic devices. Due to the more devices in the plant grew needed to be monitor and control, the Programmable Logic Control (PLC) were distributed and made the systems became more intelligent and smaller in size. Figure 1.1 below shows the PLCs and DCS (Distributed Control Systems) [1].

3

Figure 1.1: A stranger approached the victim when her mother walked away [1].

The advantages of the PLC / DCS SCADA systems are the computer can record and store a very large amount of data; the data can be displayed in any way the users require, thousands of sensors over a wide area can be connected to the system, the operator can incorporate real data simulations into the system, many types of data can be controlled from the RTUs and finally the data can be viewed from anywhere, not just on site [1].

The disadvantages are the system is more complicated than the sensor to panel type, there is still a lot of wire to deal with thousands of sensors, the operator can see only as far as the PLC different operating skills are required such as system analysts and programmer [1].

1.3

Problem Statement

i. The sensing is one of the most vital parts in an automation systems and sensing can be done by using a sensor. Sensor is a device that receives energy from a part of the system and converts it into another form as an

4 output for other part of system. The selection of sensors to detect the water level continuously is crucial since it is related with the performance of the system.

ii. PLC is the main process controller as analog signals are like volume controls, with a range of values between zero and full-scale need to be interpret. The plc configuration needs to be at the optimum state to make sure the integration of software and hardware can be run efficiently. iii. Today’s manufacturing processes in an industry are becoming larger and more complex due to the greater safety alert requirement, increased monitoring of loads, increased quantity of goods produced and improved its quality as well. The setup of real-time monitoring and data communication through the monitor screen/client computer should be at first while the system running.

1.4

Objectives of Research

The objectives are: i. To use the suitable type of water level sensor which can provide a continuous analog data reads based on the different water level in a tank. ii. To control the output actuators digitally by comparing the analog input values through the PLC.

iii. To create a real-time monitoring and controlling the overall system through the operator’s screen.

5 iv. To remotely control the water level system at different location by using the remote desktop control technology over the internet.

1.5

Scope of Work

The project aims to develop real-time monitoring and controlling the water level by using PLC and SCADA system. In order to develop the project, two main parts are considered. They are consist of both hardware and software parts.

Hardware part is mainly about the input and output connections to the PLC. The ultrasonic sensor will continuously send the input analog signal in voltage form where PLC will compare the data with desired low water level and high water level through the ladder diagram for manually or automatically trigger the actuators based on input status given by user.

Software part is mainly about the designation of ladder diagram in order to implement the system by using CX-programmer. After that, CX-Supervisor software will be used for designing the graphical user interface (GUI) for real–time monitoring and controlling system. The purpose of SCADA system in this project is for display and control the water level at monitor screen. Finally, remote desktop connection had been used for remotely control the overall system at different location.

The scopes for implementation of this project are first this project consists of incorporation between SCADA system, PLC, water pumps, brass micro electric ball valve, ultrasonic sensor, input switches, buzzer sound and output indicator lights. Second, PLC must able to receive the analog data values from the sensor. Third, developing the SCADA system using CX-Supervisor software and create the remote task.

6 Table 1.1 shows the scope of the project where the application and features of the project, hardware development and software development are listed.

Table 1.1: Scope of the project Parameter

Scope

Application

Water level control system by using PLC and SCADA

Feature

i. Using the wireless sensor to detect the water level. ii. PLC is main controller for water pump and solenoid valve. iii. Using graphical user interface (GUI) for real-time monitoring and controlling. iv. Using remote desktop control technology for control overall system remotely.

Platform

Programmable Logic Controller (PLC)

Programming language

Ladder diagram

using CX-programmer

and CX-

Supervisor for GUI design. Actuator and driver

i. 3.5V to 12V DC water pump for aquarium solar fountain 350L per hour. ii. 12V DC water pump for aquarium solar fountain 650L per hour. iii. 12V DC brass micro electric ball valve.

Sensor

Ultrasonic sensor, HC-SR04

Communication

Universal Serial Bus (USB) and Internet.

technology Performance measurement

i. Test the accuracy of data transferring by sensor to PLC. ii. Test the output signals from PLC to water pump and solenoid valve iii. Test the data that had been extracted and transfer to CX-Supervisor. iv. Test the monitoring and controlling using CXSupervisor. v. Test the network communication

7 1.6

Research Methodology

The project is to design a fully automated water level control by using an Omron PLC. The research methodology is given in Figure 1.2. First of all, literature review is carried out in order to gather the required information including the problem statement that is needed to be solved. Then, the basic communication between a laptop and an Omron PLC is developed via the serial port communication.

After that, the CX-Programmer had been used to create the ladder diagram for implementing the overall system. The connection between an ultrasonic sensor and the PLC had been tested by providing the analog reads from sensor to the PLC. The analog data reads must correspond to the water level that changes continuously in real-time.

Then the CX-programmer will compare the reading of water level within the high level and low level points in the bucket and send a proper output signal to the PLC in order to manually or automatically control the water pump and valve.

Furthermore, CX-supervisor will be used for design the GUI in order to monitoring and control the changes of water level in real-time through the operator’s screen. The purposes of a SCADA system are to extend the operator’s ability to see what is happening in the process and to extend the operator’s ability to make changes to the process [2]. Usually the operators may be able to see directly what is happening and to reach out to make the needed change with their own hand for the very small and simple process. But, when the process gets a bit larger and complicated, it’s impossible for them to handle the process as same way as the smaller tanks. So, SCADA system is the only way to reach out and control those larger water tanks. Moreover, SCADA will presents the real-time process conditions through the operator screen and operator’s reach where the system will allow the operators to adjust process actuators from far distance as well [2].

8 Moreover, TeamViewer software is one of the market leaders in remote desktop control. This software were enabled the network communication between server computer and client computer over the internet in order to control the system remotely at different location. Finally, this project is aiming to create a training kit machine for university’s students that specialize in SCADA system. The architectural of SCADA system will be fully apply into this and becoming an approach of teaching and learning concept towards the modern system. Besides that, the SCADA system is a crucial part in processing area and will make the students to expose with the real life process control in manufacturing and industry areas. The integration of SCADA system, programmable logic controllers (PLC), interface application and network communication will produce a complete industrial training kit machine for students.

9

Figure 1.2: Flowchart of research methodology.

10

CHAPTER 2

LITERATURE REVIEW

2.1

Introduction

This chapter mentions about the definition and usage of SCADA system and the components used for water level control system, similar products which are implemented with certain system or design to assist users. Besides, ultrasonic sensor, and theory of client-server applications are elaborated.

2.2

The Selection of Communication Method

Communication is intended to provide a human operator with updated realtime information about the current state of the remote process being monitored, as well as the ability to manipulate the process remotely

11 2.2.1

SCADA System

Supervisory control and data acquisition (SCADA) systems are essential components of most nations’ critical infrastructures. They control pipelines, water and transportation systems, utilities, refineries, chemical plants, and a wide variety of manufacturing operations.

SCADA delivers controlling with real-time data on production processes, implements more efficient control models, improves plant and personnel safety, and reduces costs of operation. These advantages are made possible by the use of customary hardware and software in SCADA systems combined with better-quality communication protocols and enlarged connectivity to outdoor networks, including the Internet. However, these benefits are obtained at the price of increased vulnerability to attack or wrong movements from a range of external and internal sources [3].

Figure 2.1: Example of real application of SCADA system.

12 2.2.2

SCADA System Concept

A SCADA system consists of input and output signal hardware, controllers, Human Machine Interface (HMI), networks, communication, database and software. SCADA system is the crucial system that control and display of such a site or system. A Remote Terminal Unit (RTU) or a PLC will execute the remote site control. Host control functions are almost constantly constrained to basic site over-ride or supervisory level capability [3].

2.2.3

SCADA Hardware

A SCADA system contains of a quantity of remote terminal units (RTUs) gathering field information and sending that data back to a master station, via a communication system. The master station shows the received data and permits the operator to perform remote tasks.

The accurate and timely information allows for optimization of the plant operation and process. Besides that, this system provided more efficient, reliable and safer operations. This result in a lower cost of operation compared to earlier nonautomated systems

There are five levels on a more complex SCADA system [1]: 

Field level instrumentation and control devices



Marshalling terminals and RTUs



Communication system



The master station(s)



The marketable data handling department computer system

13 The RTU provides an interface to the field analog and digital sensors situated at each remote site. An RTU may be a PLC. The data rate between the RTU and controlled device is relatively high and the control method is normally closed loop [3].

The pathway for communication were provided by the communication system between master station and remote sites via wire, fiber optic, radio, telephone line and even satellite. In order to make an efficient and optimum transfer of data, specific protocols and error detection philosophies were used. Then, the data from the various RTUs were collected by master station and displayed the control of the remote sites to the operators.

2.2.4

SCADA Software

SCADA software can be separated into two types, proprietary or open. The proprietary software was developed by companies to make communicate to their hardware. The main problem with this system is the massive reliance on the supplier of the system. Open software systems have expanded acceptance because of the interoperability to the system. Interoperability is the ability to exchange different manufacturers’ equipment on the same system.

There are only two open software packages available in the market for SCADA systems, which are Citect and WonderWare. Some packages are now including quality management integrated within SCADA system. The typical components of a SCADA system are indicated in below diagram [3].

14

Figure 2.2: Typical SCADA system.

Key Features of SCADA software are [3]:

-

User Interface

- Access to data

-

Graphics displays

- Database

-

Alarms

- Networking

-

Trends

- Fault tolerance and redundancy

-

RTU (and PLC) interface

- Client/Server distributed processing

-

Scalability

2.2.4

Benefits of SCADA systems

The benefits are [4]:

i.

Control units function as PLCs, RTUs, or Distributed Control Systems (DCUs);

ii.

Control units perform advanced measurement and control independent of the central computer;

15

iii.

They communicate with field-based outstations for retrieval of up-to-date process information.

iv.

They maintain a constantly updated set of this information in a database.

v.

They provide an interface that enables human operators to examine and display this information

2.3

The Selection of Controller

Programmable logic controller (PLC), as a type of general industrial control platforms, has made adjustments to the hardware and software in order to familiarise to the industrial field environments although it is still based on the concept of general computers. PLC is rugged device and designed to withstand vibrations, temperature, humidity and noise. In addition, it is easily programmable and primarily use logic and switching functions [5].

Compared with the general computers, it has been added a variety of interface devices, specific monitoring software, as well as a dedicated programming suite [5]. It is these adjustments that make the PLC program different from other computer programs. In fact, the PLC programs from different types and different manufactures are still some differences for they are developed by different programming suites. To facilitate our research, a Backus-Naur Form grammar for PLC program is given after the features of PLC program are described [6].

Compared with other computer programs, PLC programs have four main features as listed below:

16 a) Programming languages

The PLC programming languages are divided into two basic types, graphical languages and text languages. The former contains Ladder Diagram (LD), Function Blocks (FB) and Sequential Function charts (SFC). The latter contains Instruction List (IL) and Structured Text (ST) [7]. In this way, the same function can be written in different programming languages. However, not all of the five programming languages are used so widely. Among them, LD is the most popular one. So it is the focus of our study.

b) Operation Mode

It is reflected mainly in the two aspects, cyclic operation and batch operation [5]. These features are illustrated with the executive procedure of PLC program shown in Figure 2.3.

Figure 2.3: The executive procedure of PLC program.

In the above procedure, PLC collects all the input signals in order and writes them into the input register. Then, its Central processing unit (CPU) scans the program from top to bottom and from left to right. When an input instruction is encountered, the CPU reads the data from the corresponding bits of input or output register and makes the computation. When an output instruction is encountered, the results are written into the output register. After the last statement of the program is executed, the data in the output register will be outputted at a time [6].

17 c) Instruction System

The instruction system for PLC is not only large, but also rather complex. For example, the number of instructions in CPM2A CPU Units is as many as 14 basic instruction and 106 special instructions with 185 variations [8]. It has storage program method with cyclic scan with direct output. In addition, the user can also define new instructions according to requirements.

d) Statements

To the small-sized PLC, they suffer from the constraints of memory, so the scale of program is relatively small and the statements are arranged in order. However, in the medium and large sized PLC, the scale of program is always large and there are usually some hierarchical structures. Here, we only consider the minimal logic unit, which is called routine in Rockwell PLC. In addition, the number of logic variables in a majority of PLC programs is usually more than that of numerical variables for the PLC origins from the electro-mechanical relay. In each statement, there are usually several input variables. As to the output variables, the number of them can be one to several depending on the models of PLC [6].

2.4

The Selection of Hardware

The signals from the PLC’s processor will be converted to levels capable of driving the connected output devices where the output device is addressed as the hardware controller.

18 2.4.1

Bilge Motor

Bilge motor is a waterproofing motor that used to take out the unnecessary water that contaminate at the bottom of a tank. According to this project, bilge motor will be used for fetching water from one bucket to another through a pipe when the water level at the first bucket is below the lower level point.

Figure 2.4: A bilge motor.

2.4.2

Ultrasonic Sensor

The term ultrasound refers to sound waves having a frequency greater than 20 kHz, roughly the upper limit of sound frequencies to which the human ear react. Ultrasonic refers to the body of scientific and practical knowledge associated with the generation, propagation, detection, and use of ultrasound [9]. The first known successful use of ultrasonic was in detecting the position of submarines during World War I. In 1940, F. A. Firestone of the University of Michigan developed the ultrasonic reflect scope, the forerunner of the pulse-echo test system, which runs by generating a succession of ultrasonic pulses, each of short duration, and thus

19 detecting the echoes from subsurface discontinuities in solids [10]. Figure 2.5 shows sample ultrasonic sensor.

Figure 2.5: A Four pins ultrasonic sensor.

The principle advantages of ultrasonic are its ability to penetrate significant depths in many important things, its ability to test from one surface only, precision and sensitivity to minute microstructural changes and its electronic operation, which enables quick and noticeably automated inspection. While it’s main advantages are its manual use needs technicians of considerably native ability, training, experience, and motivation. Second, it is basically a small-area-coverage method; large area coverage requires complex mechanical scanning or transducers array. Third, requires a good essentially intimate, coupling to the article to be tested, a requirement that is often difficult to meet in practice [9].

Furthermore, the ultrasonic sensors will not be affected by transparency colour, gloss, and object surface has slight effect. They can consistently sense liquids, granules solids and powders, and resistant to both light and dust. Transparent and highly reflective items, such as plastic and glass, can cause problems for optical sensors, but they are reliably recognized by ultrasonic technology [11].

The ultrasonic sensor T/R40-16 is a pair of transmitter element T40-16 and receiver element R40-16 as shown in Figure 2.6 (left). The size of element is o16.2 × 12.2[mm]. The directivity is 55°. In this element piezoelectricity is utilized. Its structure consists of defence screen with unimorph structure in which a metal is stuck

20 to piezoelectric ceramics and resonator that radiates ultrasonic waves to the air efficiently as shown in Figure 2.6 (right) [11].

Figure 2.6: Ultrasonic sensor T/R40-16 with externals of element (left) and structure of element (right).

When selecting and using the anti-collision sensor, the dust, fog or steam can affect the accuracy of inductance or photo electricity sensor, so the ultrasonic sensor was better choice of sensor instead of the infrared ray style [12].

Moreover, an ultrasonic wave is created by a transducer and transmitted through a medium to the object to be inspected. In a single sided inspection, the transducer transmits an ultrasonic wave, which is then reflected back to the transducer by deformities or gaps in the structure of the article. These reflected signals can be used to specify that a void is present within the bond, by for example comparing the amplitude of the transmitted and reflected waves [13].

The distance between the first surface of the object and the nominal axis may be identified by transmitting an ultrasonic wave to the first surface and detecting a reflected ultrasonic wave, and may be determined by comparing a reflected wave from a first measurement location to a reflected wave from a second measurement location. The measurement ranges and/or the inspection ranges may be located at predetermined positions on a 1 dimensional or 2 dimensional array corresponding to the first surface of the first object [12].

21 2.4.3

Communication between Ultrasonic Sensor and PLC

The ultrasonic check instrument exports the analog signal when the distance between the host and secondary station decrease to certain degree. Those analog signals become digital signals by 4 Analog/Digital (A/D), and then they are deposited to PLC D100, D102, and drive main PLC and neighbour machine to stop, trigger alarm signal such as acousto-optic alarm at the same time [14].

The ultrasonic transceiver is used to transfer ultrasonic excitation signal, and modulate the echo signals. The gain amplifier in the ultrasonic transceiver is set through the Digital/Analog (D/A) card in the Industrial Personal Computer (IPC) with a constant current signal. And the modulated echo signals are sampled by the A/D card in the IPC [15].

Based on detecting system for locomotive axles, the detecting commands are classified as action commands and assist commands. The action commands are comprised of action head, command and the detail. In Figure 2.7, it shows an example of the instructions which requests the PLC to move the slide A in the positive direction for 100 mm. The two characters “M2” indicate that the object is the slide A, the single symbol “>” indicates the positive direction and the following three numbers “100” indicates the shift distance as 100 mm. The action instructions are all collected in a pair of square brackets. The first two characters tell the command type, so the IPC and PLC can both compare it with the predefined command list and execute actions with the following parameters correspondingly [13].

Figure 2.7: Example of the commands.

22

Figure 2.8: Overall mechanism of the motion parts.

2.5

The Selection of Software

Software is a crucial part for govern and control the entire system for a specific SCADA application. A few type of software had been used for designing the ladder diagram, creating the GUI and establish the network communication between two devices.

2.5.1

CX- Programmer

The PLC programme design is based on the software CX-Programme, and the programming language is ladder diagram. Ladder Diagram is based on a method used to create logic using relays. A Ladder Diagram always has a left hand vertical power rail that notionally supplies power through contacts spread out along horizontal rungs. Each contact represents the state of a Boolean variable. Figure 2.9 depicts the main features of the Ladder Diagram language.

23

Figure 2.9: The ladder diagram concepts.

In this example, PumpDown represents a relay coil which is activated when power is able to flow from the left hand power rail. PumpDown is actually a boolean variable which is set to a true state either when contacts DrainShut and DoorShut are ON, or when contact Manual is ON. The contacts represent the states of Boolean variables. Using the Structured Text (ST) language, the Ladder Diagram in Figure 2.9 is equivalent to [16]: PumpDown := (DrainShut AND DoorShut) OR Manual;

The symbols for different types of contacts and coils are shown in Figures 2.10 and 2.11.

Figure 2.10: Ladder Diagram contact symbols [17].

24

Figure 2.11: Ladder Diagram coil symbols [17].

Experiment and analysis were carried out in CX-programmer part of client, and in CX-programmer part involved two main functions which are Memory relay data of PLC queries and Ladder display queries. They all renovated display result according to the same return datum synchronously [18]. When the system was online, memory relay data of PLC could be queried. Taking data memory (DM) area queries for example, after clicking the button "DM" area, the dialog box of DM area datum which adopted hex was displayed. As shown in Figure 2.12. According the datum, the running status of equipment was able to be judged [20].

Figure 2.12: Display result in DM datum.

25 2.5.2

CX-Supervisor

CX-Supervisor performs monitoring and supervisory tasks of the complete process. It delivers dominant functions for a wide range of PC based requirements and offers the ability to create flexible applications and extend functionality. Past data can be overlaid with new data to compare one period with another [19].

2.5.3

Remote Desktop Control

TeamViewer is one of the market leaders in remote desktop control. This software can be used to communicate within the server and client computer over the internet in such easy way. Besides that, TeamViewer could able to provide a very reliable and secure service cause the user can easy handle the server computer via the network communication at different location.

2.6

Examples of Related Products

The following is three similar products obtained from reliable online sources. These similar products are different kind of available system that can be implemented into the water level control system.

26 2.6.1 Project Review on Water Level Sensing Using PLC [20]

This project is aiming to control the water tanks automatically by using Siemens PLC. The water level can be measured by using inductive proximity sensors (type PNP) in order to set a low level and high level inside the tank. So, the first similarity with this project was to control water level. Second, the central processing unit is the PLC system. PLC is a robust, reliability, system stable and less maintenance controller.

The first difference is the type of PLC used where the Omron type PLC were used for this project. Table 2.1 below shows the comparison between Siemen and Omron PLC. Table 2.1: Comparisons between Siemen and Omron Siemen

Omron

+more professional and heavy

+more user friendly and intuitive

+data memory can be very large (Mega Bytes, MB) , have structures and arrays

- has a data memory max 512 kwords, no structures, no arrays

+ Very good applications.

+very good in a relatively small applications

in

a

complex

+ Expensive but more advanced hardware that greatly simplifies developing and committing of project.

+cheaper and are more cost effective.

The second difference is the type of sensor used to detect the water level. Table 2.2 shows the comparisons between proximity sensor and ultrasonic sensor. In general, ultrasonic sensors are the best choice for transparent targets. They can detect a sheet of transparent plastic film as easily as a wooden pallet.

27 Table 2.2: Comparisons between proximity sensor and ultrasonic sensor Proximity Sensor

Ultrasonic Sensor

- Digital output only where can’t

+ Analog output where it can measure

measure the water level continuously

water level continuously.

- Must contact to water in order to

+ non-contact level measurement

sense a floating object - Greatly affected by ambient light

+ resistant to both light and dust

2.6.2 Water Level Control System Using PLC and Wireless Sensors [21]

This project is aiming to control the water tanks automatically by using Siemens PLC and to present a low cost method for a water level control using a wireless solution. So, the first similarity is to control the water level. Second, the central processing unit is the PLC system. PLC is a robust, reliability, system stable and less maintenance controller.

Then, the first difference is the type of PLC used where the Omron type PLC were used for this project. Table 2.1 below shows the comparison between Siemen and Omron PLC. Second, the type of sensor used to detect the water level. Table 2.3 shows the comparisons between floating balloon and ultrasonic sensor.

Table 2.3: comparisons between floating balloon and ultrasonic sensor Floating balloon

Ultrasonic Sensor

- Digital output only where can’t

+ Analog output where it can measure

measure the water level continuously

water level continuously.

- In order to trigger, it must contact

+ non-contact level measurement

to water

28 - Detect water at certain level only

+ Continuously detect the water level.

2.6.3 Water Level In Tank Using Level Sensor And Proportional-IntegralDerivative (PID) Controller [22]

This project is aiming to control water level using level sensor and PID controller system. So, the first similarity is to control the water level. Second, the type of sensor used to measure the water level which is by using ultrasonic sensor.

Then, the first difference is the type of controller used where PID versus with PLC controller. Table 2.4 shows the comparisons between the PID and PLC controller.

Table 2.4: Comparisons between the PID and PLC controller PID

PLC

a form of closed-loop control

general purpose controller; used to control a machine

It is a mathematical calculation that can control many things.

Controls on the programmed logic.

The controller regulates the feedback loop

programmed using ladder diagram that used to be controlled with relays and timers

basis

of

pre-

The actual comparison can be made from time vs error output curve of PID and PLC [23].

29

Figure 2.13: Comparison between PID (left) and PLC (right) in term of Time Vs Error curve graph.

From the graphs above, the PID control system shows some error but the PLC control system gives a better performances. Besides that, PLC is more cost effective, flexible, reliable and computational abilities allow more sophisticated control [23].

30

CHAPTER 3

RESEARCH METHODOLOGY

3.1

Introduction

The research methodology, which will cover both hardware and software designs for water level control by using Omron PLC.

3.2

Hardware Design

In hardware design, the Programmable Logic controller (PLC) is used as central processing unit for controlling the water level in a bucket. All hardware used including a laptop, Omron PLC, ultrasonic sensor, water pump for aquarium solar fountain, brass micro electric ball valve 12 voltage, two buckets and a pipe. A laptop will be connected to the PLC via serial port communication and a laptop for wirelessly communicate with the server laptop.

31 Then, the PLC will receive the analog inputs from Ultrasonic sensor and send the output signals to the aquarium motor and solenoid valve in order to control the water level in the bucket.

3.2.1 Basic Development Of Project

The project is to control the water level in a bucket within the upper level and lower level by fetching water from second bucket when the water level is going to below the lower level of the bucket. The water can be fetched by using an aquarium motor which will be located in the second bucket. Then, the water level will keep rising until it reaches the high level mark in bucket. After that, the motor will stop functioning and the water will poured out through a valve. Ultrasonic sensor will be used for inspect the water level in the first bucket continuously and it will be connect to PLC in order to control the aquarium motor and brass micro electric ball valve as the outputs. PLC will be used to control all these operations. All the data will be extracted and transfer to the CX-Supervisor for further improvement of project in terms of real-monitoring system. Besides that, safety warning light will be triggered whenever there is faulty in either water pump or valve.

32

Figure 3.1: The overall development of hardware.

3.2.2 Ultrasonic Sensor

This ultrasonic module, HC-SR04 is as shown in Figure 3.2. It has 4 pins, which is 5V pin, ground pin, trigger pin and echo pin. Ultrasonic sensor has ultrasonic transmitter and ultrasonic receiver. Its center frequency is 40 kHz with 1 kHz tolerance. The ranging distance is from 2 cm to 400 cm and the resolution is up to 0.3 cm. The effectual angle of this sensor module is less than 15 degree and its measuring angle is 30 degree. The trigger input pulse width is 10 us.

In this project, one distance sensor is used for measuring the water level in a bucket continuously. So, the sensor will be installed on the top of a bucket and it is a non-contact sensor to the water. This sensor was connected to the Arduino Mega 2560.

33

Figure 3.2: Ultrasonic sensor, HC-SR04 is used for measuring the water level continuously.

3.2.3 Arduino Uno R3 (ATMEGA328 – ASSEMBLED)

Microcontroller board, Arduino ATmega328 has has 14 pins for digital input/output (I/O) where there are 6 pins that can be used as PWM outputs. It has 6 analog inputs, a 16 MHz ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset button. In memory specification, the Arduino ATmega328 can store code where it has 32 kB of flash memory where its 0.5 kB is used by boot loader, 2 kB of SRAM and 1 kB of EEPROM. In this project, Arduino Uno is used to convert the water level distances into voltage range of 0 – 5V through the PWM output pin. Table 3.1 shows the specifications and parameter of Arduino ATmega328 board. Figure 3.3 shows the Arduino Uno board.

Table 3.1: Specifications and parameter of Arduino ATmega328 board Specifications

Parameter

Operating Voltage

5V

Input Voltage

7-12V

Digital I/O Pins

14

Analogue input Pins

6

DC Current per I/O Pin

40 mA

34 DC Current for 3.3V Pin

50 mA

Flash Memory

32 kB

SRAM

2 kB

EEPROM

1 kB

Clock Speed

16 MHz

Figure 3.3: Arduino ATmega328 microcontroller is used as the main microcontroller to give out water level in voltage forms.

3.2.4 The Low Pass Filter

The output voltages from the Arduino board were always been fluctuated and difficult to obtain an exact voltage value at certain water level distance. So, the voltages will be connected to the low pass filter before it had been sent directly to the analog input at PLC. Basically, capacitor is used to block DC currents and pass the AC currents. So, suitable values of resistance and capacitance had been chosen and the lower frequency of AC voltages will be filtered by the RC time constant. At the end, the voltage ripples had been prevented and the stable voltage reads can be taken from the output of the low pass filter. Figure below shows the low pass filter circuit design.

35

Figure 3.4: Low pass filter.

3.2.5 The Connection From Low Pass Filter To PLC

In PLC CP1H model XA CPU units, there are four build-in analog input bits where their allocated words are different from each other and the allocated words are CIO 200, CIO 201, CIO 202 and CIO 203. In this project, only one analog input will be used, which is analog input 0 with CIO 200. So, the output voltage from the low pass filter had been directly connected to this analog input and the PLC will receive the inputs in 0 to 5V. After that, the PLC will internally store the voltage values in an address in hexadecimal form, where the hexadecimal value for 0V is 0000 hex while 5V is 177C hex. Figure 3.5 shows the built-in analog I/O area of PLC CP1H. Figure 3.6 shows the connection from the output of low pass filter to analog input of PLC where the red wire indicate the positive output voltage while the green wire indicate the ground connection.

36

Figure 3.5: Built-in analog I/O area of PLC CP1H.

Figure 3.6: Connection from the output of low pass filter to analog input of PLC.

37 3.2.6 Type of Inputs And Outputs

So far, PLC had received analog input in terms of voltage form that corresponding to the water level to control the flow of overall process. Besides that, the PLC still has some other inputs that were connected at digital input terminals. Figure 3.7 shows the Auto/Manual slide switch water pump1 control and valve control slide switch. The operator can use these switches for setting the operation is either automatically or manually control. Once selected the manual switch, operator can use the valve control switch for activating or deactivating the valve and water pump1 switch for activating or deactivating the pump manually. While figure 3.8 shows the input Start and Stop push buttons.

Figure 3.7: Input slide switches for the Auto/Manual Setting, water pump1 control and valve control.

38

Figure 3.8: Input push buttons for start and stop the operation.

In addition, there are several outputs that had been connected to the PLC, such as the two water pumps, valve, warning lights and buzzer sound. The following figures show the type of outputs.

(a)

(b)

Figure 3.9: (a) Water pump1 to fetch water from storage tank to supplier tank. (b) Water pump2 to supply an exact amount of water from supplier tank.

39

Figure 3.10: Brass micro electric ball valve to supply water out from the supplier tank.

Figure 3.11: Green light indicated the operation was turned on while red lights indicated the failure of water pump and valve.

A voltage regulator circuit had been built in order to convert 24V power supply from PLC to 9V supply for the buzzer sound. The buzzer sound will be activated when there is failure of water pump or valve occurred.

40

Figure 3.12: Buzzer sound.

3.3

Software Design

In software development, Arduino software version 1.5.7 had been use to write a programme in order to measure the water level reading from the ultrasonic sensor and convert the water level to the corresponding voltage value between 0V to 5V. Then, ladder diagram instruction had been use to program and run the PLC either for manually or automatically control the actuators which is based on input status given by the user. Besides that, the SCADA system had been created in order to monitor and control the real-time operation system through the operator screen where it will make ease for the users to observes the water level virtually and allowed users to keep on updating the data without wasting time on doing inspection at real water tank. So, the ladder diagram can be created by using the CX-Programmer software while the GUI will be created through the CX-Supervisor and real-time water level will be displaying and controlling through the screen.

Finally, the TeamViewer software had been used to make the network communication between a server computer and a client computer through wirelessly. This software is a free license for personal or non-commercial use only where the

41 communication can be done regardless how far the distances between the two devices by using the internet.

Figure 3.13: Arduino software had been used to write the programme and upload to the Arduino board in order to retrieve the water level data.

42

Figure 3.14: The main procedures for designing and run a ladder diagram in a PLC.

Figure 3.15: The ladder diagram which had been designed to program and run the PLC.

43

Figure 3.16: The procedures for creating a GUI by using the CX-Supervisor.

Figure 3.17: Sample GUI designed using CX-Supervisor.

44

Figure 3.18: The procedures for setting up the network communication between two devices.

Figure 3.19: TeamViewer software used as remote support tool for the SCADA system.

45 3.4

Summary

The hardware design and software design of the project are mentioned in this chapter. The hardware and components are selected, designed and programmed on the main PLC software which is called ladder diagram. All of the hardware and components are placed on a wooden board expect the two water pumps and valve will place inside buckets. Communication between the ladder diagram and the GUI had been done internally without any external supporting devices while the communication between two computers can be done through wirelessly over the internet.

46

CHAPTER 4

RESULTS AND DISCUSSION

4.1

Introduction

In this chapter, results of the project and the problems encountered throughout the developing process are discussed. Each hardware and component’s functionality is tested and displayed through Ladder Diagram development (LDD). Besides, the project live test result in the indoor environment is evaluated in order to make sure the functionality of ladder diagram with all the inputs and outputs system.

4.2

Results

The project involves both hardware and software. All hardware was connected to PLC CP1H and the data was collected.

47 4.2.1

Hardware Development

First and foremost, ultrasonic sensor was connected with Arduino ATmega328 board. Only one ultrasonic sensor had been used in this project. Figure 4.1 shows the snapshot of ultrasonic sensor output program was displayed in a column form by using Arduino IDE serial monitor.

Figure 4.1: Data collected from an ultrasonic sensor and the result was displayed in a column form by using serial monitor of Arduino IDE.

Secondly, an experiment had been carried out in order to determine whether the PLC could able to receive analog data values and convert into the respective hexadecimal values as shown in figures below. So, the laptop will runs the ladder diagram and a voltage supplier had been directly connected to the PLC analog input at address 200. The voltage 0 to 5V were been adjusted by using a variable resistor.

Figure 4.2: The PLC receives 0000 in Hexadecimal (Hex) value when the voltage is approximate to 0V.

48

Figure 4.3: The PLC receives 1771 in Hexadecimal (Hex) value when the voltage is 5.000V.

Third, different types of inputs were connected at different input terminals on PLC CP1H. Push button switch and slide switch are the two different types of switches that had been used as input for PLC. Furthermore, each switch was connected to the supply voltage of 24V in order to activate those relays whenever the particular switch had been turned ON. Table 4.1 shows the list of inputs with their respective address values used in PLC.

Table 4.1: List of inputs with their respective address values Inputs

Type of Switch

Address Value

OFF

Push Button Switch

0.00

ON

Push Button Switch

0.02

Auto/Manual Switch

Slide Switch

0.04

Valve Control Switch

Slide Switch

0.08

Water Pump1 Control Switch

Slide Switch

0.09

49

Figure 4.4: Five different types of digital inputs that connected to the Omron PLC.

Fourth, different types of outputs were connected at different output terminals on PLC CP1H where each output has different indication. Moreover, each output were provided power supply at different voltage levels, so that the particular output will be activated whenever their relay is turned ON. Table 4.2 shows the list of the outputs and their respective address values used in PLC.

Table 4.2: List of outputs with their respective address values Outputs Green Light

Address Value 100.07

Function Light is turned on when the operation has started and turned off when the operation has stopped.

Red Light 1

100.04

It’s a warning light in case the water pump had failed to operate.

Red Light 2

100.05

It’s a warning light in case the valve had failed to operate.

Buzzer sound

100.06

It’s a warning sound in case either water pump or valve had failed to operate.

Water Pump 1

100.00

To fetch water to the supplier tank when the water reached at low level.

Valve

100.01

To supply water from the supplier tank when it reached at high level.

Water Pump 2

101.07

To supply water according to the exact volume of water needed by users.

50

Figure 4.5: Brass Micro Electric Ball Valve.

All of the hardware and components are programmed in the main programme called ladder diagram. The communication between laptop and PLC is via Universal Serial Port (USB) connection. Figure 4.7 shows the performance test of the project is carried out in indoor environment.

Figure 4.6: The system had been tested under auto operation.

51 4.2.2

Software Development

In software development, there are three types of software had been used in this project, which are called cx-programmer that used for creating the ladder diagram, cx- supervisor that used for designing the GUI for the overall system and TeamViewer for creating network communication between two devices.

It is important to create the points editor in the Cx-Supervisor before proceed to creating the GUI. Each point editors will be assigned to a specific address value which took directly from the programmed ladder diagram and act as the address value for the GUI. Figure 4.7 shows list of the point editors.

Figure 4.7: List of the point editors.

After that, animation editor had been used to assign the type of animation to a specific figure inside the GUI. Then, the selected animation type will refer to the specific point editor’s values in order to implement the overall GUI smoothly. Figure 4.8 shows the type of animation in Cx-Supervisor. Finally the complete set of GUI had been successfully created by using the Cs-Supervisor and able to run simultaneously with the PLC. Figure 4.9 shows the overall GUI of water level

52 control. The graph shows the water level in supplier tank against the current time where the water level will keep updating for every second and allow o users to scroll back to view the history of water level for pass an hour ago.

Figure 4.8: The type of animations in Cx-Supervisor.

Figure 4.9: The overall GUI for monitoring and controlling the water level in realtime through the monitor’s screen.

53 First and foremost, scaling for the 0 to 5V range corresponds to the hexadecimal values 0000 to 1771 (0 to 6000) had to be done in ladder diagram since the PLC received the analog voltage input. Scaling part is necessary in order for doing real water level comparisons from 6cm until 24cm for the upcoming process. Figure below shows the graph of water level (cm) versus the hexadecimal values. The hexadecimal values that representing the voltage values can be easily transform into the water level based on this graph. For example, voltage at 2.5V and 5V will be represented to the water level of 15cm and 30cm respectively.

Water Level (cm) 30

0

Hexadecimal Values 0

1771

Figure 4.10: Graph of water level vs Hexadecimal values

Figure 4.11 shows the first step in ladder diagram where data from analog input address of 200 had been transfered to the D0 before implementation of the scaling process.

Figure 4.11: Process of moving data and data scaling.

54 After that, Auto/Manual setting ,Valve control and Water Pump1control were been installed to the PLC as inputs. The function of these switches were allowed users either to manually or automatically control the water level controlling system. Table 4.3 shows the functions of each switch.

Table 4.3: Function of Manual switch and Valve Control switch. Auto/Manual

Valve

Water Pump 1

Setting

Control

Control Switch

Consequences

Switch Auto

ON /OFF

ON/OFF

When water at low level, the pump will start automatically to fetch water to the supplier tank and Off at high level. Valve will start automatically when water reached at high level and off at low level. The process will continue keep going on.

Manual

OFF

ON/OFF

Water pump1 can be ON/OFF between the low level and high level.

ON/OFF

OFF

Valve can be ON/OFF between the low level and high level.

55 Secondly, comparison between water levels had been perform before the system decided to activated either the water pump or the valve. The low level mark will be at 6cm while the high level mark will at 24cm inside the bucket. The results for the water level comparisons in Auto mode and their consequences were shown in Figures 4.12 and 4.13.

(a)

(b)

(a)

(b) Figure 4.12: (a) Shows ladder diagram where the water level reached at 6cm and pump had been turned on automatically (b) shows GUI where the water been fetched to the supplier tank by water pump 1 and valve is turned off at low level.

56

(a)

(b) Figure 4.13: (a) Shows ladder diagram where the water level reached at 24cm and valve had been turned on automatically (b) shows GUI where the water been supply out from the supplier tank by valve and water pump 1 is turned off at high level.

57 While in manual mode, water pump1 and valve can be manually turned on or off at any level within the low and high level marked in the supplier tank. The results for the water level comparisons in manual mode and their consequences were shown in Figures 4.14 and 4.15.

(a)

(b) Figure 4.14: (a) Shows ladder diagram where the water pump1 is turned on manually by using the slide switched. (b) Slide switch to turn on water pump1 manually.

58

(a)

(b) Figure 4.15: (a) Shows ladder diagram where the water pump1 is turned on manually through screen. (b) Shows the water pump1 is turned on manually.

59

Figure 4.16: The water pump will stop and water level will always maintained at high level when the setting is under manual mode.

(a)

(b) Figure 4.17: (a) Shows ladder diagram where the valve is turned on manually by using the slide switch. (b) Slide switch to turn on valve manually.

60

(a)

(b) Figure 4.18: (a) Shows ladder diagram where the valve is turned on manually through screen. (b) Shows the valve is turned on manually.

61

Figure 4.19: The valve will stop and water level will always maintained at low level when the setting is under manual mode.

After that, monitoring for the failure of a machines or equipment was extremely a crucial step that needs to be considering during operating a system. The purposes for this step were to ensure the safety of the working environment and to prevent the output yield been cut down for long period after failure of a certain part. So, water pump and valve had been continuously monitored in this project. This step can be done by keep updating the water levels whenever the water pump or valve had been activated. Data update cycle timing are varies according to the water flow rates given by the water pump and valve. The higher the water flow rate, the faster the data update will be taken. Since the water flow rate through the valve and pump are almost same, so it has equal updating time. For valve and pump, there were two different timers been used to collecting data at two different periods where the gap between each timer were 5 second, means the water level will always keep updated for every 5 seconds. Figure 4.20 until 4.21 shows the steps of designing timer update for the valve and pump1.

62

(a)

(b) Figure 4.20: (a) Shows the ladder diagram for Timer 1 (b) shows the ladder diagram for Timer 2.

Timer 1: T001: 3s

T002: 13s

Timer 2: T003: 8s

T004: 3s

T001: 3s

T005: 5s

Figure 4.21: The timing process diagram for Timer 1 and 2.

Moreover, the data at two different timing will be stored at two different data memories called D400 and D500 before the system were proceed for comparisons between each data. Hold on timing will be provided at 9 seconds so that the latest updated data had been stored inside the data memories before the comparisons process had been carried on. Figure 4.22 and 4.23 shows the ladder diagram for inspection of valve and water pump1 failure.

63

(a)

(b) Figure 4.22: (a) Ladder diagram for inspection of pump failure (b) Ladder diagram for triggering the warning light for pump failure.

64

(a)

(b) Figure 4.23: (a) Ladder diagram for inspection of valve failure (b) Ladder diagram for triggering the warning light for valve failure.

65

(a)

(b) Figure 4.24: (a) Warning indicator for pump failure at GUI (b) Warning light for pump failure.

(a)

(b) Figure 4.25: (a) Warning indicator for valve failure at GUI (b) Warning light for valve failure.

66 Moreover, there is an additional feature had been included in the SCADA system where the user could able to transfer the exact amount of water to a container by editing the desired volume of water through the monitor’s screen.

(a)

(b)

Figure 4.26: (a) Shows the 1000ml of water had been type through the screen (b) the amount of the water had been displayed through the screen.

(a)

(b)

(c) Figure 4.27: (a) Water is transferring to a container. (b) 1000ml of water had been successfully transferred. (c) Shows the exact amount of water level in a container.

67 In addition, the selected brass micro electric ball valve is kind of tricky valve that had been used in this project. This is due to the controlling activation or deactivation of the valve where voltage of 12V had to supply to the positive terminal of the valve while the ground had to connect to the negative terminal whenever to make the valve to turn on. During the deactivation, the polarity of the voltage supplier had to exchange manually where the 12V had to supply to the negative terminal of the valve while the ground had to connect to the positive terminal.

12V

Ground

+ Valve 101.04

100.01 101.00

- Valve + 100.02

101.05

Figure 4.28: The connection done for exchanging polarity automatically inside the PLC.

There is a timing delay happened from activation to deactivation of the valve with total 6 seconds where the first 3 seconds were used to disconnect the valve from the voltage supplier and the following 3 seconds will reconnect back the 12V supply to the different polarities of the valve. This safety step need to be done because the positive terminal of the valve might have the 12V supply if the exchanging polarity happen immediately and it will cause the clashing of different charge in the same terminal and might bring the failure to the valve. Figure 4.29 shows the ladder diagram for deactivating the valve within 6 seconds.

Figure 4.29: Ladder diagram of deactivating the valve within 6 seconds.

68 After that, SCADA system is not only allowed user to view and control the overall system at workplace’s computer, but it also permit the user to remotely control the overall system at different location as well. This could be done by using software called as TeamViewer, one of the market leaders in remote desktop control. TeamViewer not only restricted to the network communication between two computers, but it also allows the network communication between a computer and a smartphone over the internet. Smartphone is a much portable device than a laptop and the user will always carry their smartphone no matter where they go. TeamViewer is a reliable and provide high level security for the communication. Figure 4.30 shows the communication between a server laptop to a smartphone by using the TeamViewer. The configuration steps were explained in Chapter 3.

(a)

(b) Figure 4.30: (a) TeamViewer software had been installed in server laptop and a smartphone (b) User can remotely view and control the overall process through a smartphone.

69 4.3

Summary

As a result, after completing both hardware and software development, a performance test is carried out in order to test the functionality of water level control by using PLC and SCADA system. User can control the system in two different ways, either by using switches or control through the monitor’s screen. In addition, user can manually select the setting mode either in manual or auto mode before pressing the start button. Besides that, the water level will keep updating for every second and user could able to observe the history of water level for the pass one hour ago through the SCADA system. On the other hand, valve and water pump2 had been use to supply water out from the supplier tank. So, user can easily transfer the exact amount of water to a container as well. Finally, user could able to done the network communication by using the TeamViewer software and allow them to access and control the overall process at different location.

70

CHAPTER 5

CONCLUSION

5.1

Introduction

This chapter covers on the conclusion and recommendations for project’s future works in order to improve the project.

5.2

Conclusion

As a conclusion, non-contact ultrasonic sensor is the better way of measuring the water level continuously and maintenance could be done easily in case any error happened to the sensor since it going to locate at the top of the tank instead of inside the tank. Besides that, PLC model CP1H is very good in relative small application and SCADA system had provided such a convenient approach of real-time monitoring and controlling the water level by manually or automatically based on input status given by users. In addition, remote control had played a vital role in this project where the network communication could be done from a server laptop with either a client laptop or a smartphone. So, users have multiple device choices for

71 remotely view and control the overall system in real-time at a different location over the internet.

5.3

Future Works

Firstly, the GUI should be enhanced and designed for the actuators failure where the GUI itself could be able to trigger the sound as well through laptop’s speaker besides displaying the error only. Secondly, an interlock safety should be developed in order to prevent the happening of overflow of liquid in a tank. So, an additional digital type sensor such as proximity sensor should place above the high level for continuously detecting the overflow of liquid and able to shut down the overall process. Lastly, an improved in water level updating is necessary from 5 second to 1 second as one of the important criteria had been considered in real industry places. So, better pump and valve need be installed where it can performance a very quickly rising and dropping of liquid level in a supplier tank and causing much faster of updating of liquid level as well.

72

REFERENCES

[1]

David Bailey, E.W., Practical SCADA For Industry. 2003, Oxford: Elsevier Press.

[2]

A.Boyer, S., SCADA: Supervisory Control And Data Acquisition. 4th ed. 2010, Research Triangle Park: International Society of Automation.

[3]

L.Krutz, R., Securing SCADA Systems. 2006, Indianapolis: Wiley Publishing,Inc.

[4]

Shaw, W.T., CYBERSECURITY For SCADA Systems. 2006, PennWell Corporation: USA.

[5]

Hu, X., Programmable Logic Controller Tutorial (Basics) [M]. 2007, Beijing: Publishing House of Electronics Industry.

[6]

Wang, D. and Q. Zhao. Static slicing for PLC program with ladder transformation. in Control Conference (CCC), 2010 29th Chinese. 2010.

[7]

R.Huuk, Software Verification for Programmable Logic Controllers. 2003: PhD Thesis, Kiel.

[8]

A Beginner's Guide to Omron PLC. 2001, Singapore: Innovation in the Solution Age.

73 [9]

Yu, G., Tool wear monitoring in turning operations using ultrasonic waves and artificial neural networks. 2002, The University of Wisconsin Milwaukee: Ann Arbor. p. 94-94 p.

[10]

Brady, D.E. and R.K. Stanley, Nondestructive evaluation: A tool in design

[11]

Gasser, A. and C. Peace, Sensing With Sound. Assembly, 2008. 51(2): p. 4849.

[12]

Zhaoping, T. and S. Jianping. The parallel communication application in cranes stride over a same rack. in Computer-Aided Industrial Design & Conceptual Design, 2009. CAID & CD 2009. IEEE 10th International Conference on. 2009.

[13]

Rolls-Royce PLC; Patent Application Titled "Ultrasonic Inspection Method" Published Online. Chemicals & Chemistry, 2014: p. 7077.

[14]

Haruyama, K., et al. Development of the detection and reporting device for patients' getting out of bed using ultrasonic radar and power line communication. in SICE, 2007 Annual Conference. 2007.

[15]

Cheng, Z., et al. Notice of Retraction
An enhanced ultrasonic automatic detecting system for locomotive axles. in Artificial Intelligence, Management Science and Electronic Commerce (AIMSEC), 2011 2nd International Conference on. 2011.

[16]

Ladder Diagram, in Programming Industrial Control Systems Using IEC 1131-3. 1998, Institution of Engineering and Technology. p. 151-168.

[17]

E.F, C., A relational model of data for large shared databanks. Commun. ACM,, 1970: p. 13(6):377–387

74 [18]

Qi, X. and S. Lin. Research on the remote monitoring and controlling based on VSP. in Computing, Communication, Control, and Management, 2009. CCCM 2009. ISECS International Colloquium on. 2009.

[19]

Henderson, H., EtherCAT based system treats commercial waste efficiently, in PACE. 2013, Reed Business Information Pty Ltd, a division of Reed Elsevier Inc.: Chatswood.

[20]

Osama Mahfooz, M.M.a.A.I., Project Review on Water Level Sensing Using PLC. 2012.

[21]

Cosmina Illes, G.N.P. and I. Filip, Water Level Control System Using PLC and Wireless Sensors. 2013, University of Timisoara, Engineering Faculty of Hunedoara.

[22]

Abdullah, M.A.B., Water Level In Tank Using Level Sensor And Pid Controller. 2008, Universiti Malaysia Pahang.

[23]

Sk Hasan Hafizul Haque, H.M.I.H. and S.M.A. Hossain, Comparison of Control System Using PLC & PID. 2014, University of Bridgeport, Bridgeport, Connecticut, USA.

75

APPENDIX A

PROJECT MANAGEMENT

A.1

Introduction

Project management is a management discipline to manage a complex project which includes the application of knowledge, skills, tools, and techniques. In order to achieve expectation or demand of a project, a good management must be practised. The priority concerned are the research scope, time, budget and human resource to handle the project development. Gantt chart and milestone had been tabulated in order to provide a guideline to handle this project.

In addition, cost estimation on the required hardware and components is listed to ensure the expenses is within budget but able to reach the project requirement. Thus, final cost estimation could be evaluated.

76 A.2

Project Schedule

Project Gantt chart and milestone for semesters one and two are shown in Tables 1 and 2 respectively. This table shows that it is very important to study literature review throughout the process of project development. The project is categorised in two parts, which is hardware development as well as software development. There is overlapped development where the communication between hardware and software has to be tested during the developing to make sure both systems can function properly. This project schedule is important to ensure the project can be done according to the guideline and complete on time efficiently.

Table A.1: Gantt chart of Project for Two Semesters

Semester 1, 2014/15 No

Semester 2, 2014/15

Activities

1

Literature review

2

Hardware development

9

10 11 12

A

B

1

2

3

4

5

6

D

E

F

G

H

2.1 Circuit design 2.2 Hardware and components testing 3

Software development 3.1 Creating the ladder diagram program 3.2 Creating GUI

4

Network Communication

5

Performance analysis

6

Writing: proposal, report, slides and thesis.

7

Milestones

C

7

8

77 Table A.2: Project Milestones Milestones A

Complete Task Initial proposal of topic

Date 7/9/14

Identify problem statements and objectives

21/9 – 27/9/14

Finishing the introduction and start the

1/10 – 28/10/14

literature review B

Selecting the most suitable type of PLC Buying all the required hardware and

1/11 – 5/11/14 7/11 - 20/11/2014

components

C

Circuit design is completed

29/11/2014

FYP 1 Seminar

15/12/2014

Final FYP 1 report

29/12/2014

Start design for the ladder diagram and testing for the analog input from sensor. D

Doing modification on ladder diagram Hardware and components testing

E

F

Doing modification on ladder diagram

25/1/2015 10/2 – 28/2/2015 15/2/2015 1/3 - 30/3/2015

Hardware testing by using the PLC

10/3 – 20/3/2015

Start creating the GUI application

22/3/2015

The ladder diagram is completed

20/4/2015

GUI is completed and communicate with PLC Software and hardware testing G

17/12/2014 –

Doing the network communication between the

22/4 - 25/4/2015 28/4/2015 1/5 – 9/5/2015

server laptop and a client laptop Performance Analysis in indoor environment

10/5/2015

Done poster

12/5/2015

FYP 2 Seminar and demonstration at EESS

19/5/2015

2015 H

FYP thesis/report draft & Turnitin Report,

8/6/2015

Journal-style scientific paper FYP 2 Report submission (hardcover) and CD (softcopy)

22/6/2015

78 A.3

Cost Estimation

Cost of estimation for hardware and components is as shown in Table A.3.

Table A.3: Cost for Hardware and Components Component Name

Cost

Subtotal

Unit

Price

(For 1

Range

per Unit

Unit)

Bucket

2

RM 14.50

RM 29.00

Ultrasonic Ranging Module

1

RM 45.00

RM45.00

Arduino ATmega328

1

RM 55.00

RM 55.00

1

RM 54.00

RM 54.00

1

RM 104.20

RM 104.20

1

RM 270.00

RM 270.00

Plastic Pipe for 1Meter long

2

RM 3.50

RM 7.00

Pipe Connector

3

RM 1.00

RM 3.00

Teflon Tape

1

RM 1.00

RM 1.00

Cellophane Tape

1

RM 2.00

RM 2.00

Contact Grip Glue

1

RM 3.50

RM 3.50

LED Pilot Lamp

3

RM 3.80

RM 11.40

Push Button

2

RM 8.00

RM 16.00

USB and Parallel Printer Cable

1

RM 9.00

RM 9.00

Cross Over Cable

1

RM 8.90

RM 8.90

12V/2.5Ah Lead Acid Battery

1

RM 51.00

RM 51.00

Solder Lead

1

RM 29.50

RM 29.50

microcontroller 3.5V to 12V DC water pump for aquarium solar fountain 350L per hour 840L/H DC 12V CPU Cooling Brushless Water Pump fountain 1/2'' Brass Micro Electric Ball Valve 12V Voltage

Subtotal

RM 699.50

79

APPENDIX B

DATASHEET OF ULTRASONIC RANGING MODULE HC-SR04

80