0% found this document useful (0 votes)
110 views58 pages

Darlington's Thesis-Updated

This document is a project report submitted by Darlington Jerry Yawson to fulfill requirements for a Bachelor of Science degree in Environmental and Safety Engineering at the University of Mines and Technology in Tarkwa, Ghana. The report describes the development of a computer simulation and theoretical control system called CoagiT to control coagulation pH in a water treatment process. CoagiT was developed using instrumentation and control principles as well as Visual Basic programming. It can operate in both manual and automatic modes to maintain the optimum pH range for coagulation and ensure effective water treatment. The application has the potential to reduce problems associated with improper pH control during coagulation.

Uploaded by

kingsley peprah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
110 views58 pages

Darlington's Thesis-Updated

This document is a project report submitted by Darlington Jerry Yawson to fulfill requirements for a Bachelor of Science degree in Environmental and Safety Engineering at the University of Mines and Technology in Tarkwa, Ghana. The report describes the development of a computer simulation and theoretical control system called CoagiT to control coagulation pH in a water treatment process. CoagiT was developed using instrumentation and control principles as well as Visual Basic programming. It can operate in both manual and automatic modes to maintain the optimum pH range for coagulation and ensure effective water treatment. The application has the potential to reduce problems associated with improper pH control during coagulation.

Uploaded by

kingsley peprah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

UNIVERSITY OF MINES AND TECHNOLOGY (UMaT)

TARKWA

FACULTY OF MINERAL RESOURCES TECHNOLOGY


DEPARTMENT OF ENVIRONMENTAL AND SAFETY ENGINEERING

A PROJECT REPORT ENTITLED

COMPUTER SIMULATION AND THEORETICAL CONTROL OF A


COAGULATION pH SYSTEM IN WATER TREATMENT

BY
DARLINGTON JERRY YAWSON

SUBMITTED IN PARTIAL FULFILMENT OF THE REQUIREMENTS FOR THE


AWARD OF BACHELOR OF SCIENCE DEGREE IN ENVIRONMENTAL AND
SAFETY ENGINEERING

PROJECT SUPERVISOR

…………………………..
DR SHADRACK FOSU

TARKWA, GHANA

JUNE, 2018
DECLARATION

I declare that this project work is my own work. It is being submitted for the degree of
Bachelor of Science in Environmental and Safety Engineering in the University of Mines
and Technology (UMaT), Tarkwa. It has not been submitted for any degree or examination
in any other University.

…………………………..
(Darlington Jerry Yawson)

………..day of June, 2018.

i
ABSTRACT

Coagulation is an important process in water treatment operations. Inorganic coagulants


such as aluminium salts consume alkalinity and may necessitate the addition of alkaline
agent such as lime during coagulation. The pH of coagulation is very critical. Aluminium
salts used as the basis of this work are most effective around a pH range of 5.5-6.5. It is an
imperative to attain this pH after the coagulant has been added. In this study, a typical
coagulation pH control application called CoagiT has been developed. CoagiT seeks to
maintain the optimum pH necessary for effective coagulation in water treatment. The
application was developed using instrumentation and control principles and Visual Basic
programming algorithms. The application can operate in both manual and automatic modes.
In the manual mode, when the measured pH value of the coagulation water is not equal to
the set point pH, the application alerts an operator (by sounding an alarm) and suggests the
percentage by which the lime supply rate should be adjusted to achieve the set point. In the
automatic mode, the application automatically adjusts the lime supply rate to achieve the set
point pH with the help of a pH transmitter and a pH indicating controller. CoagiT may be
useful in reducing the problems (of poor floc formation, less efficient filtration, wastage of
expensive chemicals and health hazards to consumers) associated with ineffective
coagulation due to improper pH control during water treatment.

ii
I dedicate this report to my parents,
Mr Godwin Ewle Yawson and Madam Elizabeth Adjei
and my siblings,
Justice, Carl, Genevieve, Wynnard and Teddy.

iii
ACKNOWLEDGEMENTS

First and foremost, I am forever grateful to God Almighty for His abundant grace and
protection.

My utmost appreciation to my able supervisor, Dr Shadrack Fosu, for his effective and
patient supervision, guidance and motivation provided in the course of this research work.
I would also like to extend my sincere gratitude to all the lecturers of the Environmental and
Safety Engineering Department for contributing in various ways for the successful
completion of this project.

Special thanks to Mr Emmanuel Asante for contributing immensely to the success of this
project. His unwavering support and guidance with regards to the code works would forever
be appreciated.

I wish to express my heartfelt gratitude to my family (most especially my dad, Mr Ewle


Yawson Godwin), for their support throughout my stay in UMaT.

Finally, a big thank you to all those who contributed in various ways for the successful
completion of this project work.

God richly bless you all.

iv
TABLE OF CONTENTS

Contents Page

DECLARATION i

ABSTRACT ii

ACKNOWLEDGEMENTS iv

TABLE OF CONTENTS v

LIST OF FIGURES viii

CHAPTER 1 INTRODUCTION 1

1.1 Statement of Problem 1

1.2 Project Objectives 2

1.3 Methods and Procedure 2

1.4 Facilities and Resources Utilised 2

1.5 Organisation of Report 3

CHAPTER 2 LITERATURE REVIEW 4

2.1 Overview of Water Treatment 4

2.1.1 The Water Treatment Process 4

2.2 Coagulation 6

2.2.1 Coagulation Mechanisms 8

2.2.2 Factors Affecting Coagulation 9

2.2.3 Coagulation and pH Control 9

2.2.4 Jar Test 10

2.3 Process Control 11

2.3.1 Elements of a Process Control System 11

v
2.3.2 Control Systems and Mechanisms 13

2.4 Computer Programming 14

2.4.1 Programming Steps 14

2.4.2 Programming Errors 16

2.5 Visual Basic 16

2.5.1 Visual Basic Graphical User Interface 17

2.5.2 Advantages of using Visual Basic as a Programming Language 17

2.5.3 Disadvantages of using Visual Basic as a Programming Language 17

CHAPTER 3 DESIGNING AND TESTING OF COAGIT 19

3.1 Purpose and Equations of CoagiT 19

3.1.1 Measured Signal-Measured Value Conversion 19

3.1.2 Error Calculation 19

3.1.3 Motor Speed Adjustment 20

3.1.4 Motor Speed-Lime Flow Rate Conversion 20

3.2 Designing of CoagiT 20

3.2.1 Design of flowchart 21

3.2.2 Development of graphical user interface (GUI) of CoagiT 22

3.3 Coding of CoagiT 22

3.4 Debugging and Testing of CoagiT 22

CHAPTER 4 RESULTS AND DISCUSSION 23

4.1 Operation of CoagiT 23

4.2 Graphical User Interface (GUI) of CoagiT 24

4.2.1 User Controls 24

4.3 Demonstration of CoagiT 26

vi
4.3.1 Automatic Mode 26

4.3.2 Manual Mode 29

4.4 Limitations of CoagiT 33

CHAPTER 5 CONCLUSIONS AND RECOMMENDATIONS 34

5.1 Conclusions 34

5.2 Recommendations 34

REFERENCES 35

APPENDIX 39

APPENDIX A CODES OF COAGIT 39

vii
LIST OF FIGURES

Figure Title Page

2.1 Typical Water Treatment Process 5


2.2 Coagulation of Fine Clay Particles 7
2.3 Elements of Process Control 12
3.1 Flowchart of CoagiT 21
4.1 P&ID of a Coagulation pH Control System 24
4.2 GUI of CoagiT after Loading 26
4.3 GUI when Measured Value is 1.5 pH (Automatic Mode) 28
4.4 GUI after the Lime Conveyor Motor Speed has been adjusted 28
to 77% (Automatic Mode)
4.5 GUI when Measured Value is 6.2 pH (Automatic Mode) 29
4.6 GUI after the Lime Conveyor Motor Speed has been adjusted 29
to 77% (Automatic Mode)
4.7 GUI when Measured Value is 2.0 pH (Manual Mode) 31
4.8 GUI after the Lime Conveyor Motor Speed has been manually 31
adjusted to 69%
4.9 GUI when Measured Value is 6.0 pH (Manual Mode) 32
4.10 GUI after the Lime Conveyor Motor Speed has been manually 32
adjusted to 8%

viii
CHAPTER 1

INTRODUCTION

1.1 Statement of Problem

Coagulation is an important process in water treatment operations. It forms the foundation


of the entire water treatment process and as such can have dramatic effect (positive or
negative) on the performance of downstream unit processes (Linder and Zachman, 2009).
Coagulation involves the destabilisation and subsequent aggregation of suspended and
colloidal particles from raw water through the addition of coagulation chemicals called
coagulants (Bello et al., 2014). Effective coagulation is vital to achieve operational
efficiency of water treatment plants, compliance with standards set by regulatory agencies
and provision of consistent potable water for consumption. Otherwise, the water treatment
process will result in wastage of expensive chemicals, poor floc formation, less efficient
filtration and health hazards to final consumers (Cox et al., 2001). The key issue about the
process is that, coagulants operates best only within a specific range of pH values and hence
the process effectiveness depend on the control of pH of the raw water (Koohestanian et al.,
2008).

According to Anon (2018a), coagulation is effective within a feed water pH of 5.5-6.5 for
alum salts and pH of 4.5-5.5 for ferric chloride salts. However, most inorganic coagulants
decrease the alkalinity of the feed water and hence increase in coagulant dose decreases the
pH of the feed water (Gebbie, 2006). In order to counter-act the effect of coagulants on pH
and ensure effective coagulation, most water treatment facilities use pH control methods
such as the addition of lime to adjust and maintain the pH to the optimal range (Gebbie,
2006).

Adjusting the lime feed rate to achieve the optimal pH range or set point for effective
coagulation is tedious and often involves the use of the trial and error approach. As a result,
a more reliable, accurate and efficient control system in the form of a computer
programming software is needed. This software together with analytical sensors should be
able to automatically adjust the pH of the feed water to its set point by adjusting and
controlling the lime dose rate. Also, it should be able to alert operators to dose in the correct
amount of lime that would adjust the pH to the set point when operating in the manual mode.
1
Water treatment facilities in Ghana, however, do not have any control system for pH control
during coagulation.

Therefore, this project seeks to simulate a coagulation pH control system and develop an
application to control the pH of the feed water during coagulation in water treatment systems
by adopting and modifying the Process and Instrumentation Diagram (P & ID) shown in
Figure 4.1 in chapter 4 of this document using Visual Basic programming language.

1.2 Project Objectives

The objective of the project is to simulate a coagulation pH control system and develop a
computer programming software that would:
a) Run in two modes - automatic and manual;
b) Measure and alert operators if the desired coagulation pH is not achieved in the
manual mode; and
c) Adjust the rate of supply of lime in the system to achieve the desired coagulation
pH in the automatic mode.

1.3 Methods and Procedure

The following methods and procedure were used:


a) Review of relevant literature;
b) Consultation with lecturers, experts and supervisor;
c) Interview with water treatment operators for more information on coagulation and
pH control; and
d) Design and Coding of the software using Visual Basic (VB) programming language
and process control.

1.4 Facilities and Resources Utilised

The facilities and resources used for project are:


a) The library of University of Mines and Technology (UMaT);
b) Visual Studio 2012 software (Developed by Microsoft Corporation); and
c) The computer centre of University of Mines and Technology.

2
1.5 Organisation of Report

The project report comprises five (5) chapters-the introductory chapter, three (3) central
chapters and the concluding chapter, and they are:
Chapter 1: Introduction
Chapter 2: Literature Review
Chapter 3: Designing and Testing of software
Chapter 4: Results and Discussion
Chapter 5: Conclusions and Recommendations

3
CHAPTER 2

LITERATURE REVIEW

2.1 Overview of Water Treatment

Most ground waters and surface waters contain impurities that make them unhealthy for any
specific end-use and as such need to be treated (Anon, 2018b). Water treatment basically
involves the process of making a polluted water pure and more acceptable for a particular
end-use. The end-use may be for irrigation purpose, domestic use, drinking, industrial water
supply, water recreation, or many other uses. The end-use may also involve returning the
water to the environment without any negative impact on it.

The water treatment process ensures that contaminants and other undesirable components
found in the water are removed, or their concentrations are reduced so as to make the water
whole for its intended end-use (Anon, 2018b).

2.1.1 The Water Treatment Process

Water treatment plants, in compliance with government regulations, are constructed to


provide safe water supply for any end-use. According to Erdei (1963), modern water
treatment plants are constructed to remove suspended particles from the water and destroy
microorganisms that manage to survive coagulation/flocculation and filtration processes.
Figure 2.1 shows a typical water treatment flowsheet showing all necessary units process.

4
Figure 2.1 Typical Water Treatment Plant Process (Luedke, 2007)

The method and degree of water treatment are primarily dependent on the properties of the
raw water and therefore serves as important considerations for environmental engineers
(Weiner and Mathews, 2003). The water treatment process can be grouped into four main
categories (Luedke, 2007): Preliminary treatment, Pre-treatment, Filtration and Post-
Chemical Treatment.

Preliminary Treatment

Preliminary treatment reduces the load on subsequent treatment processes as well as protect
plant equipment by removing some of the impurities from the raw water supply. It involves
processes such as; screening of large debris and aquatic life, pre-sedimentation of silt, sand
and other gritty materials, and micro straining of small debris and algae.

Pre-Treatment

Pre-treatment processes are designed to remove suspended and colloidal particles from the
raw water supply after it has gone through the preliminary treatment stage. They reduce the
load on the filtration process. It includes processes such as coagulation/flocculation and
sedimentation/clarification. Coagulation help make non-settleable particles settleable
whereas flocculation promotes particle size growth by bringing coagulated particles

5
together (Lui and Liptak, 1997). Sedimentation/clarification methods are employed to
remove flocculated particles from the raw water.

Filtration

Two types of filtration processes are commonly used - gravity filters and pressure filters.
Both filtration systems use sand or sand/anthracite/quartz multi-media as the filtering media.
As water passes through the media, particles that have escaped the preliminary and pre-
treatment stages are trapped in the media, allowing only clean water to come out.

Post Treatment

Filtered water is referred to as treated water (Luedke, 2007). The post treatment process
involves disinfection of the filtered water. Chlorine is usually used for the disinfection, and
the amount used is determined by the total filtered water flow, the amount of water being
pumped into the distribution system from the clearwell, and the amount of contact time
required as the filtered water passes through the clearwell (Luedke, 2007). Granular
activated carbon (GAC) are sometimes used at this stage for taste and odour control,
fluoridation and stabilization.

2.2 Coagulation

Most natural waters contain dissolved and suspended particles. These particles are difficult
to remove because they are very small and often colloidal in size. The surface charge of
colloidal particles is mostly pH dependent; at pH 6 and above, most colloidal particles in
natural waters possess negative surface charges (Manahan, 2009). This develops repulsion
among the particles and hence are unable to come together to form particles dense enough
to settle by gravity (Weiner and Mathews, 2003; Manahan, 2009). In order to bring the
particles together and form agglomerates that can be removed by gravity clarification and/or
filtration, they have to be neutralized or destabilized. The process of neutralizing or
destabilizing the charged particles is called coagulation, (Kuphaldt, 2008). Charge
neutralization is achieved by the addition of a coagulant, which neutralizes the negative
surface charge by its positive charge. Coagulated particles are then aggregated to larger
particle sizes and settled by the addition of a flocculant. The coagulation process is
illustrated in Figure 2.2.

6
Figure 2.2 Coagulation of Fine Clay Particles (Connelly and Richardson, 1984)

A coagulant, according to Smith and Scott (2005), is any chemical that is added to raw water
with the purpose of achieving coagulation. The type of coagulants used for a given raw
water depends strongly on the quality of the raw water (Pernitsky, 2001). Coagulants may
be classified as organic or inorganic (Gebbie, 2006). Inorganic coagulants include those
commonly used chemicals that rely on aluminium or iron: Examples are; aluminum sulfate
(alum), ferrous sulphate (copperas), aluminium chloride, ferric sulphate, and ferric chloride.
These coagulants are used to coagulate small particles into larger flocs that can effectively
be removed in subsequent separation processes such as sedimentation and/or filtration
(Amirtharajah and O’Melia, 1990).

Inorganic coagulants used for the treatment of portable water exhibit the following
characteristics (Ndur, 2018):
a) They are nontoxic at the working dosage;
b) They have a high charge density; and
c) They are insoluble in the neutral pH range.

Organic coagulants include polyDADMAC (polydiallyldimethyl ammonium chloride)


range of cationic polymers.

7
Coagulation processes are majorly carried out to reduce turbidity and get rid of dissolved
organic carbon (or colour) from raw water (Tseng et al., 2000). These major reasons make
the coagulation process an important part of drinking water operations (Bello et al., 2016).

2.2.1 Coagulation Mechanisms

As noted by Duan and Gregory (2003), coagulation is generally explained in terms of two
different mechanisms: charge neutralization and sweep flocculation. Each mechanism is
dependent on coagulant dose. Higher doses favours sweep flocculation whereas relatively
lower doses leads to charge neutralization (Anon, 2018a).

Charge Neutralization

Inorganic coagulants (such as alum, ferrous sulphate) most often work through charge
neutralization. When these metal-based coagulants are added to the raw water in small
concentrations, they dissociates and form metal ions. When alum/copperas are used,
Al3+/Fe2+ are released into the water. Liberated Al3+/Fe2+ and OH– ions react to form various
monomeric and polymeric hydrolysed species (Kushwaha et al., 2010). The polymeric
hydrolysed species have high positive charges, this makes it possible for the species to get
adsorbed to the net negative surface of the colloids or particles found in the raw water.
Adsorption of the metal hydrolysed species on the colloid surface causes charge
neutralization (O’Melia and Weber, 1972). Charge neutralization leads to a significant
reduction of the zeta potential to a level where the colloids or particles are destabilized. The
destabilized particles, along with their adsorbed hydro-metallic hydroxometallic complexes,
aggregate by interparticle Van der Waals forces. These forces are aided by the gentle mixing
in water (Reynold and Richards, 1982).

Sweep Flocculation

Addition of relatively large doses of inorganic coagulants (usually aluminum or iron salts)
into raw water results in the precipitation of the coagulants as hydrous metal oxides. Most
of the colloids and some of dissolved solids are literally swept from the bulk of the raw
water by becoming enmeshed in the settling hydrous oxide floc. This mechanism is called
sweep flocculation. Sweep flocculation is achieved by adding so much coagulant to the
water that the water becomes saturated and the coagulant precipitates out. The particles then
get trapped in the precipitant as it settles down (Duan and Gregory, 2003).
8
Sweep flocculation leads to faster agglomeration of colloids and produces stronger and
larger flocs than charge neutralization: the hydroxide precipitate generated under sweep
flocculation produces a big augmentation in the efficient particle concentration and so a
greater collision rate (Ghernaout, 2015).

2.2.2 Factors Affecting Coagulation

The efficiency of coagulation is dependent on many variables. For a particular water these
may include (Bratby, 2006): pH, type of coagulant used, temperature, coagulant dosage,
turbidity of the water, coagulant feed concentration and dosage of chemical additives other
than the primary coagulant.

pH

Results from the work of Cañizares et al (2009) showed that a slight change in the
coagulation pH could result in a significant change in the efficiency of the coagulation
process and hence pH is one of the main factors that affect coagulation. At varying sample
pH values, the coagulation process may suffer from less than optimum ions being formed
in solution. pH that is too low may not allow the coagulation process to proceed, while high
pH can cause a coagulated particle to re-disperse. For effective coagulation, each coagulant
works in a definite zone or range of optimum pH values as stated in Chapter 1 (Section 1.1).

2.2.3 Coagulation and pH Control

Most metal coagulants are acidic (Ashery et al., 2011), and therefore their addition
consumes alkalinity. For example, when alum is used as a coagulant, it hydrolyses and forms
aluminium hydroxide floc by reacting with the natural alkalinity (usually consists of calcium
bicarbonate), as expressed by Equation 2.1, with the insoluble products (precipitates) in
italics (Bourke et al., 2002):

Al2 (SO4)3 + 3Ca (HCO3)2 = 2Al (OH)3 + 3CaSO4 + 6CO2 …(2.1)

Bourke et al. (2002) indicated that, a 1 mg/L dose of alum reacts with 0.53 mg/L of alkalinity
expressed as CaCO3. Therefore, coagulant addition into waters with low alkalinity may lead
to the consumption of all the alkalinity available in the water and reduce the pH to a value
too low for effective coagulation (Ashery et al, 2011; Gebbie, 2006). In such a situation,
additional alkali such as hydrated lime {Ca (OH) 2}, must be provided to supply the water

9
with the necessary alkalinity to produce the alumimiun hydroxide floc needed for effective
coagulation. This can be expressed by Equation 2.2.

Al2 (SO4)3 + 3Ca (OH)2 = 2Al (OH)3 + 3CaSO4 …(2.2)

The metal hydroxide flocs formed with the use of inorganic coagulants (such as alum) are
known to be insoluble over relatively narrow bands of pH, which may vary with the source
of the raw water (Ashery et al., 2011; Bourke et al., 2002). Therefore, the pH at which
coagulation occurs is the most important parameter for proper coagulation performance
(Ashery et al., 2011; BaiChuan et al., 2010) and hence, pH control is necessary for effective
coagulation. Proper pH control does not only help in efficient removal of turbidity and
colour, but also help to maintain satisfactory minimum levels of dissolved residual
aluminium in the clarified water (Bourke et al., 2002). Results from Hu et al. (2006) also
indicated that proper pH control during coagulation is essential to:
a) Increase the removal of natural organic matter (NOM) from raw water when using
alum;
b) Improve the coagulation process by regulating metal species distributions;
c) Significantly improve the coagulation efficiency of AlCl3 in eutrophic waters;
d) Reduce wastage of chemicals;
e) Obtain good floc formation;
f) Increase efficient filtration; and
g) Reduce health hazards to final consumers.

2.2.4 Jar Test

The jar test is a widely-used laboratory procedure to determine the quantity of coagulation
chemical dosages for water treatment plants. The jar test simulates the
coagulation/flocculation process in a batch mode. It also serves as a model process for
evaluating various coagulation parameters where a full-scale plant is not available (Hannah
et al., 1967). A series of batch tests are run in which pH, coagulant type and dosage and
flocculant are varied to get the optimal dosage (lowest residual turbidity).

Jar tests are generally performed using 6 one-litre samples of the water to be treated. To
these samples a range of coagulant dose is added (one sample is usually a blank).
Immediately after the coagulant is added the samples are "flash mixed" for approximately

10
one minute. The stirrer speed is then reduced to simulate a flocculation basin. Flocculation
mode is generally maintained for about 20 minutes. At the end of the flocculation period the
stirrers are turned off and the floc is allowed to settle for one-half hour. After this settling
period supernatant samples are drawn off from each sample and analysed for turbidity and
sometimes alkalinity and pH.

2.3 Process Control

Marlin, (1995) defined control as the act of maintaining desired conditions in a physical
system by adjusting selected variables in the system and process as used in relation to
process control, according to Fosu (2017), is defined as any operation that utilises resources
to transform inputs into outputs. Process control can therefore be defined as the measures
taken to ensure that a given process produces a desired output by maintaining and adjusting
selected variables in the process. This ensures that the process’s output is stable and
consistent. The complex and heterogeneous nature of processing systems and plants have
made process control gain more prominence in recent history (Oditis and Bicevskis, 2010).
The main task of any process control system is to adjust manipulated variables in order to
maintain controlled variables at set point values following any disturbance. Process control
aims towards safety, environmental protection, equipment protection, smooth operation,
quality control, and profit. These aims are achieved by maintaining selected process
variables as close as possible to their best conditions.

Process control can be applied in areas such as (Minkah, 2017); manufacturing industries,
health sectors, mining and energy production centres, food processing industries and
environmental institutions.

2.3.1 Elements of a Process Control System

Process control systems are made up of four key elements (Fosu, 2017): process,
measurement, evaluation and control. The elements together with the flow of process control
are illustrated in Figure 2.3.

11
Figure 2.3 Elements of Process Control (Fosu, 2017)

Process
A process is the method of changing or refining raw materials to create end products.
Processes are open to disturbances from process activities and/or from environmental
factors. These factors affect the output of the process and thus introduce the need to measure
certain physical quantities.

Measurement

This element senses the process variable of interest with sensors and transmits this
information to the controller (Morrison et al., 1982). Measurement simply involves the
conversion of a dynamic variable to a form that will be interpreted by other elements of the
process control (Minkah, 2017).

Evaluation

This involves the process of examining measurements taken and determining what actions,
if any, should be taken. The evaluation may be performed by an operator, or by an
electronic/pneumatic signal processing, or by a computer-usually the controller (Curtis,
2006).

12
Control

This element maintains the process variable of interest at desired conditions following a
disturbance by physically adjusting selected variables in the system. It is normally called
the final control element. The output signal from a controller drives the final control
element. Control valves, variable speed drives of motors and actuators are some elements
that serve as the final control element (Fosu, 2017).

2.3.2 Control Systems and Mechanisms

The main control systems and mechanisms in process control are automatic or manual
control systems, and feedback or feed-forward control mechanisms. The principles of these
systems and mechanisms are detailed below.

Manual Control Systems vs. Automatic Control Systems

In the manual control system, control of the physical quantity of interest is carried out
continuously by a human operator. The operator takes measurement from the primary
sensing element and acts as the evaluation element or controller (Minkah, 2017). He/she
influences process outputs by adjusting manipulated variables with the aid of the final
control element. In an automatic control system; machines, electronics, or computers
replace the activities of the human operator (Curtis, 2006). The signal from the primary
sensing element is provided as input to a machine, electronic circuit, or computer called the
controller. The controller does the evaluation by comparing the measured value to the set
point and sending a control signal to the final control element to adjust the physical quantity
to obtain the desired process output (Fosu, 2017). The key difference between the manual
and automatic control system is that; in the manual system, the operator makes changes to
the process output directly whereas in the automatic system, he/she only enters the set point
for the controller to use (Minkah, 2017).

Feedback Control Mechanisms vs. Feed-forward Control Mechanisms

Feedback control makes use of a process’ output to influence an input to the same process
(Marlin, 1995). One key advantage of the feedback control mechanism is that it is effective
for all disturbances, however, it does not take control action until the process output variable
has deviated from its set point.

13
Feed-forward control mechanisms use the measurement of a process input as additional
information for enhancing control performance. This measurement provides an "early
warning" that the controlled variable will be upset some time in the future (Marlin, 1995).
With this warning the feed-forward controller has the opportunity to adjust the manipulated
variable before the controlled variable deviates from its set point. Even though the main
advantage of the feed-forward control is that it anticipates and attempts to prevent errors in
the process, external factors such as pipe build ups, temperature, etc. create errors in this
type of control mechanism and consequently affect control performance.

2.4 Computer Programming

A computer is a programmable machine. This means it can execute a programmed list of


instructions and respond to new instructions that it is given. Computer Programming is the
process of developing and implementing various sets of instructions to enable a computer
to do a certain task. Programmes are written to solve problems or perform tasks on a
computer. Programmers translate the solutions or tasks into a language the computer can
understand by writing algorithms. An algorithm is a list of instructions, procedures, or
formulas used to solve a problem.

2.4.1 Programming Steps

In order to develop a computer programme, there are five (5) main steps to follow. These
are (Otoo, 2016):
1. Clarifying Programming Needs;
2. Designing the Programme;
3. Coding the Programme;
4. Testing the Programme; and
5. Documenting and Maintaining the Programme.

Clarifying Programming Needs

This step involves the process of defining the problem. The task of defining the problem
consists of identifying the inputs and outputs of the programme. It is at this step that you
determine how the programme would operate and the type of data required to operate it.
Tests are also carried out to determine the feasibility of the programme at this stage.

14
Designing the Programme

At this step, the programmer plans on how to execute the programme. This can be done by
drawing a flowchart or by writing a pseudocode, or possibly both. A flowchart is a graphical
representation of the logical order involved in the execution of a programme (Otoo, 2016).
It is used to show the sequence with which a programme actually works. Programme
instructions, conditions and decisions are explained using standard flowchart symbols while
the flow or sequence of instructions are shown with the use of connecting arrows. A
pseudocode is an English-like non-standard language that lets you state the order involved
in the execution of the programme. It is however not executable on the computer.

Coding the Programme

The next step after a programme has been designed is to code the programme-that is, to
express the programme in a programming language. The logic from the flowchart or
pseudocode will be translated to a programming language. To get the programme to work,
programmers need to follow exactly the syntax of the language they are using.

Testing the Programme

Eventually, after coding the programme, programmers must prepare to test and debug the
programme. With testing, there are two types: alpha testing and beta testing. Alpha testing
involve checking the syntax of the programme to make sure that the programming language
was used correctly whereas beta testing involve testing the programme by using it in the real
world. Debugging means detecting, locating and correcting bugs (errors), usually by running
the programme.

Documenting and Maintaining the Programme

Documentation is a written detailed description of the programming cycle and specific facts
about the programme. Typical programme documentation materials include the origin and
nature of the problem, a brief narrative description of the programme, logic tools such as
flowcharts and pseudocode and testing results.

15
2.4.2 Programming Errors

Programming is susceptible to three kinds of errors. These are; Syntax, Run-time and
Logical errors (Otoo, 2016).

Syntax Error

This kind of error occurs when a user fails to follow the rules of the programming language
he/she is using when coding. Syntax errors prevent the program from running in the first
place until they are corrected. Their correction is normally easy because a language’s
compiler usually identify the error and alerts users to review it by simply following the rules
of the programming language. Syntax errors could arise due to wrong spelling, incorrect use
of keywords and special characters.

Run-time Error

This is caused by wrong arithmetic execution and the attempt to access unavailable
resources in a programme. This type of error is characterised by halts during execution, after
the programme has passed the syntax test. Run-time error causes an application to freeze
when it is used and its issues are relatively difficult to solve because they only show up
when the programme runs.

Logical Error

This type of error occurs when the programme fails to solve the problem for which it was
developed. The programme runs but gives incorrect results, thus making the application of
the programme useless. Logical errors are the most difficult errors to correct because it
involves the programmer starting the whole planning process over again.

2.5 Visual Basic

Visual Basic (VB) is an Object-Oriented Programming (OOP) Language and development


environment created by Microsoft. It provides a graphical user interface (GUI) that allows
users to place objects into the programme being developed and also allow users to manually
write programme codes. This makes software development in VB easy and efficient
(Thakur, 2018). VB is also an event-driven language because codes in VB are written to
respond to specific events such as; clicking on a button, choosing an item in a list box,

16
closing a window, etc. VB can be used to create large, high quality and powerful Console,
Web and Windows applications. It is mostly used for in-house applications and can also be
used to create certain components for online and desktop applications (Alomari et al., 2014).

2.5.1 Visual Basic Graphical User Interface

Visual Basic allow users to develop programs that can be installed and run on a windows
operating system. The idea behind the Visual Basic system is that the programmer creates
screens (Forms) that comprise the computer program. The programmer places controls
(from a toolbox) that serve different purposes on each form. A control is an object that
appears on the computer screen (Siegle, 2009): It might be text to read, a graphic image to
view, a pull-down menu to use, or a radio button, checkbox, or command button to click.
For example, the Label displays text. The Textbox allows users to input information by
typing. The Button control might be programmed to make an object appear or disappear or
a mathematical formula to be calculated when the button is clicked. Visual Basic
programming is known as object-oriented programming because each object can be set to
perform a variety of functions.

2.5.2 Advantages of using Visual Basic as a Programming Language

There are many features and benefits in Visual Basic that makes it preferable to other
programming languages. These benefits include but not limited to the following (Hassan et
al., 2006):
a) The predictive features in visual basic provides a faster and quicker approach to
software or application development;
b) The object-oriented nature of visual basic allow users to work directly with the
graphics and as well see progress of their work;
c) It also gives an application a great and professional look within less time and without
much effort of coding;
d) It has an error detection function which prompt and notify users about the errors
made in codes.

2.5.3 Disadvantages of using Visual Basic as a Programming Language

According to Turner (2013) and Alomari et al. (2014), Visual Basic (VB) has the following
disadvantages:
17
a) Security vulnerabilities in Visual Basic are known to be much more difficult to fix
than in other programming languages;
b) Functions in Visual Basic force programmers to do the right thing and this can be
time consuming;
c) It is at a disadvantage when compared to Perl because it only runs on only Windows,
while Perl runs on different types of operating systems.

18
CHAPTER 3

DESIGNING AND TESTING OF COAGIT

3.1 Purpose and Equations of CoagiT

CoagiT was developed mainly to measure the coagulation pH of water and ensure that the
pH is within the set point by adjusting the lime dose rate. This ensures effective coagulation
and eliminates the problems (poor floc formation, less efficient filtration, health hazards to
final consumers and non-compliance with government agencies) associated with ineffective
coagulation. CoagiT operates using the equations and interpolations outlined below.

3.1.1 Measured Signal-Measured Value Conversion

Equation 3.1 was used in the programme to convert the measured signal (in milli-amperes)
of the analytical transmitter to a measured pH value (Fosu, 2017). This allows for the
comparison of the measured value with the set point.

MS−LRVs
MV = [( ) × (Spanm )] + LRVm … (3.1)
Spans

where;

MV = Measured value
MS = Measured signal
LRVs = Lower Range Value of the transmitter signal
Spans = Span of transmitter signal
Spanm = Span of measurement
LRVm = Lower Range Value of measurement

3.1.2 Error Calculation

CoagiT uses the difference between the measured value and the set point to adjust the lime
feed rate. This difference is called the error and Equation 3.2 shows how it is calculated
(Fosu, 2017).

Error = |SP − MV| … (3.2)

19
where;

SP = Set point
MV = Measured value

3.1.3 Motor Speed Adjustment

The speed of the lime conveyor motor is adjusted using Equation 3.3.
|SP−MV|
Speed (%) = × Spanm … (3.3)
SP

Where;

SP = Set point
MV = Measured value
Spanm = Span of measurement

3.1.4 Motor Speed-Lime Flow Rate Conversion

Each motor speed calculated corresponds to a given flow rate of the lime. Equation 3.4 was
used to convert the motor speed (in percentage) to the corresponding lime feed rate (in grams
per minute).

Speed−LRVspeed
LFR = [( ) × (SpanLFR )] + LRVLFR … (3.4)
Span(speed)

where;

LFR = Lime feed rate


LRVspeed = Lower Range Value of the motor speed
LRVLFR = Lower Range Value of the lime feed rate
Span (speed) = Span of the motor speed
Span (LFR) = Span of lime feed rate

3.2 Designing of CoagiT

The designing phase in the development of CoagiT covered two main areas. They are:
1) Design of flowchart; and
2) Development of graphical user interface (GUI) of CoagiT.

20
3.2.1 Design of flowchart

In order to graphically view the logical steps involved in the execution of CoagiT, a standard
flowchart was designed using standard flowchart symbols as shown in Figure 3.1.

Figure 3.1 Flowchart of CoagiT

21
3.2.2 Development of Graphical User Interface (GUI) of CoagiT

The GUI of CoagiT consist mainly of a user control section and a simulation section. The
user control section was developed using Visual Basic controls such as; buttons, textboxes
and radio buttons. The simulation section was also developed by using Visual Basic controls
such as progress bars and track bars. Other Visual Basic controls such as labels, group boxes
and the picture box found on the GUI were added to give information about the system to
users.

3.3 Coding of CoagiT

After designing CoagiT’s GUI and system flowchart, codes were written with Visual Basic
(Visual Studio 2012) to bring the programme to operation. Declaration statements,
conditional statements (such as if-then statements) and mathematical functions are some
elements that constituted the codes.

In effect, about four hundred (400) lines of programming codes were used in building
CoagiT. The codes are shown in appendix A of this document.

3.4 Debugging and Testing of CoagiT

Debugging of CoagiT was carried out to detect and correct errors in logic and syntax that
were associated with running the programme. CoagiT was also tested using both alpha and
beta testing mechanisms. The alpha testing was carried out by going through all the code
lines to ensure that the correct syntax of Visual Basic was used. This was carried out during
the coding section. Beta testing was also carried out to ensure that the programme responds
and operates effectively as planned. CoagiT was also run on computers with different
operating systems to test how it operates on these systems. Through the test, it was found
out that, CoagiT operates best on Windows 7, 8 and 10 but does not run on Apple Macintosh
operating systems and Android operating systems.

22
CHAPTER 4

RESULTS AND DISCUSSION

4.1 Operation of CoagiT

The software was developed by modifying and simulating the Process and Instrumentation
Diagram (P&ID) of the coagulation pH control system shown in Figure 4.1. In the P&ID
shown, raw water (influent) and coagulant flow into a mixing chamber containing a motor-
controlled mixing agitator for rapid mixing of solution. The solution moves into a contact
zone with a pH transmitter (AT) to measure the pH of the solution and transmit this
measured pH in its equivalent electrical signal (4-20mA) to a pH indicating controller (AIC).
The pH indicating controller compares the signal from the pH transmitter to a set point (SP)
within the AIC and sends a control signal based on the difference between the measured
signal and the set point (i.e. the error) to a variable speed drive of a conveyer to adjust its
speed, this subsequently controls the lime feed rate into the mixing chamber. This simple
feedback mechanism is the fundamental framework guiding the operation of the software.

CoagiT measures the pH of the solution upon the addition of the coagulant. This measured
pH is normally below the set point and as such the application triggers the addition of lime
to the solution (by adjusting the speed of the lime conveyor motor) to bring the pH back to
the set point. CoagiT has options to operate either in the manual mode or in the automatic
mode. When operating in the manual mode (i.e. in the absence of a pH indicating controller),
CoagiT has been designed to accept pH measurements from a transmitter and compare it
with the set point. If there are any deviations, it triggers an alarm to alert plant operators of
the possible deviation and as well suggest to plant operators the percentage by which the
speed of the lime conveyor motor be adjusted to obtain the set point. Plant operators can
adjust the speed of the lime conveyor motor from the application until the required
coagulation pH is achieved.

In the automatic mode, CoagiT accept measurements from a transmitter, compares it with
the set point and adjusts the speed of the lime conveyor motor automatically depending on
the measured value using the pH indicating controller. This ensures that the optimum
coagulation pH is achieved.

23
Figure 4.1 P&ID of a Coagulation pH Control System (Kuphaldt, 2008)

4.2 Graphical User Interface (GUI) of CoagiT

The Graphical User Interface (GUI) of CoagiT was designed in such a way that, it is simple
and easy to operate. It is made up of user controls and a simulation section (Figure 4.2). The
simulation section consists of controls (such as the progress bar) to show the flow of raw
water (influent) into the system and coagulated water out of the system. When CoagiT is
running, the progress bar depicts the flow of water through the system with a green colour
code. The simulation section also has radio buttons to allow/restrict the flow of water out of
the system.

User controls found on the GUI of CoagiT accept inputs or actions from users to function.
Other controls such as labels and the picture box found on the GUI provides information
about the system to users. Figure 4.2 below shows the Graphical User Interface (GUI) of
CoagiT when the process has not started running.

4.2.1 User Controls

User controls found on the GUI of CoagiT include buttons, radio buttons, textboxes and a
tract bar. Their purposes are elaborated below.

24
Radio button

CoagiT uses radio buttons to select the mode of operation (automatic or manual) and to
show the state of the outlet valve (i.e. open or close).

Textboxes

There are two textboxes on the GUI of CoagiT to accept set point and measured value inputs.
In order to ensure efficient operation of the application, the textboxes are programmed to
reject inputs other than numeric characters and also accept inputs that are only in the range
of applicability.

Track bar

The track bars found on the GUI are used to adjust the speeds of the conveyor motors
carrying the lime and the coagulant.

Buttons

Buttons such as Start, Continue, Stop, Reset, Accept and Apply found on the GUI of CoagiT
are used to initiate commands and events. The buttons and their uses are explained below.

Start button: When clicked, the start button starts the flow of the influent through the mixing
chamber to the contact zone in the simulation section.

Accept button: Upon clicking, this button accepts the measured value input from the pH
sensor and converts it to the required signal that will be transmitted to the pH indicating
controller.

Continue button: This button gives command depending on the mode of operation of
CoagiT. In the automatic mode, the continue button upon clicking adjusts the speed of the
lime conveyor motor and as well resume the flow of water in the simulation section. In the
manual mode, the continue button upon clicking gives the percentage speed by which the
lime conveyor motor need to be adjusted.

Apply button: This button pops up when the continue button is clicked in the manual mode.
When clicked, the apply button applies the adjusted speed of the lime conveyor motor and
resumes the flow of water in the simulation section.

25
Stop button: When clicked, this button stops the flow of water in the simulation section of
the GUI of CoagiT.

Reset button: When clicked, the reset button resets all inputs to default. It also clears the
water in the simulation section.

Figure 4.2 GUI of CoagiT after Loading

4.3 Demonstration of CoagiT

During start up, raw water (influent) enters into the mixing chamber (this is seen on the GUI
as described in section 4.2 of this chapter). Coagulant is added to the influent in this
chamber. The addition of coagulant is confirmed by the change in value of the track bar at
the coagulant supply and the change in colour of the discharge pipe carrying the coagulant
to the mixing chamber on the GUI (the colour of the discharge pipe changes to red as shown
in Figure 4.3). The solution (raw water and coagulant) then flows into the contact zone
where there is a pH transmitter to measure and record the pH of the solution. Actions are
taken depending on the mode of operation of the programme.

4.3.1 Automatic Mode

In the automatic mode, when coagulant addition causes the measured pH value to fall below
the set point, the software automatically adjusts the lime feed rate by adjusting the speed of

26
the lime conveyor motor. This adjustment in lime supply would raise the measured pH value
back to the set point thereby ensuring that the optimum coagulation pH necessary for
effective coagulation is maintained.

For example, assuming a set point of 6.5 pH is entered and the measured pH value after the
addition of the coagulant is 1.5 (as illustrated in Figure 4.3), then an equivalent electrical
signal of the measured value (in this case 7.69 mA) would be sent to the pH analytical
controller. The pH analytical controller would calculate the error/deviation and send a
control signal to adjust the speed of the lime conveyor motor to 77% (as shown in Figure
4.4). This adjustment in motor speed would also change the lime feed rate to 669.90 g/min
as shown in Figure 4.4. The large deviation of the measured value from the set point resulted
in the application adjusting the speed of the lime conveyor motor to as much as 77% since
more of the lime would be needed to bring the measured pH value back to the set point (as
shown in Figure 4.4).

In cases where there is a small deviation of the measured value from the set point, then the
speed of the lime conveyor motor would be adjusted in the same magnitude as the deviation.
Example, when a set point of 6.5 pH is entered and the measured pH value recorded after
coagulant addition is 6.2 (as shown in Figure 4.5), an equivalent electrical signal of 19.26
mA would be sent to the pH analytical controller. The pH analytical controller would
calculate the error/deviation and send a control signal to adjust the speed of the lime
conveyor motor and lime feed rate to 5% and 45.50 g/min respectively (as shown in Figure
4.6). These adjustments in motor speed and lime feed rate would bring the measured pH
value back to the set point as seen in Figure 4.6.

When the measured pH value is equal to the set point (pH = 6.5), the application would
automatically open the outlet valve to allow the coagulated water flow to other unit
processes (such as the settling tank).

27
Figure 4.3 GUI when Measured Value is 1.5 pH (Automatic Mode)

Figure 4.4 GUI after the Lime Conveyor Motor Speed has been adjusted to 77%
(Automatic Mode)

28
Figure 4.5 GUI when Measured Value is 6.2 pH (Automatic Mode)

Figure 4.6 GUI after the Lime Conveyor Motor Speed has been adjusted to 5%
(Automatic Mode)

29
4.3.2 Manual Mode

When operating in the manual mode (i.e. in the absence of an analytical indicating
controller), the application’s main tasks are to:
a) Alert plant operators of any possible deviation of the measured value from the set
point by sounding an alarm and reading out a statement to the operators that,
“coagulation pH is not achieved”; and
b) Suggest to operators the percentage by which the speed of the lime conveyor motor
should be adjusted to achieve the set point.

When the pH transmitter (after the addition of the coagulant) records a pH value other than
the set point, a window form will appear on the GUI of the application with a message
instructing operators to manually adjust the speed of the lime conveyor motor to a value
depending on the magnitude of the error. For example, when a set point of 6.5 pH is entered
and the pH transmitter (after coagulant addition) records a pH value of 2.0, the programme
would calculate the error and through the pop-up window displayed, it will instruct operators
to manually adjust the speed of the lime conveyor motor to 69% (as shown in Figure 4.7).
As can be seen in Figure 4.8, the set point is attained when the speed of the lime conveyor
motor was adjusted to 69%.

Figure 4.7 GUI when Measured Value is 2.0 pH (Manual Mode)

30
Figure 4.8 GUI after the Lime Conveyor Motor Speed has been manually adjusted to
69%

Where the measured value is 6.0 pH (i.e. close to the set point of 6.5 pH), the window form
that would appear contains a message instructing operators to adjust the speed of the lime
conveyor motor to 8% (as shown Figure 4.9). The set point is attained as shown in Figure
4.10 when the lime conveyor motor speed was adjusted to 8%.

In cases where an operator attempts to apply changes in the speed of the lime conveyor
motor other than the one suggested by the application, a message box would show,
instructing operators to ensure that the speed of the lime conveyor motor is adjusted to the
appropriate value.

31
Figure 4.9 GUI when Measured pH Value is 6.0 (Manual Mode)

Figure 4.10 GUI after the Lime Conveyor Motor Speed has been manually adjusted
to 8%

32
4.4 Limitations of CoagiT

VB has only discrete track bars and as a result of this the motor speed only shows integers
by rounding up decimals. Also, VB lacks controls that represent the movement of conveyor
belts and water tanks. As a result, simulating the P&ID in Figure 4.1 in chapter 4 of this
document was quite difficult.

The application works within the following range of parameters: set-point of (6.5 - 8.5) pH;
and measured value of (0 - Set point) pH.

33
CHAPTER 5

CONCLUSIONS AND RECOMMENDATIONS

5.1 Conclusions

A coagulation pH control application called CoagiT has been successfully developed using
process control principles and Visual Basic. The main purpose of the application is to ensure
effective coagulation in water treatment by maintaining the desired coagulation pH.

The application is capable of operating in two modes-manual and automatic. It measures,


alerts and predicts the dosing rates of lime required to maintain the desired coagulation pH
using feedback control mechanisms.

5.2 Recommendations

a) A coagulation pH control system should be developed using other programming


languages such as C++, C#, Java, Matlab etc. to eliminate the limitations of CoagiT
that resulted from the use of Visual Basic.
b) A feed-forward control mechanism should be added to the operation of CoagiT to
reduce errors generated to the minimum.

34
REFERENCES

Alomari, Z., El Halimi, O., Sivaprasad, K. and Pandit, C. (2014), “Comparative Studies of
Six Programming Languages”, Unpublished Study Report, Concordia University,
Montreal, 71 pp.

Anon. (2018a), “Conventional Treatment”, https://iaspub.epa.gov. Accessed: February 4,


2018.

Anon. (2018b), “Water Treatment”, www.wikepedia.com. Accessed: February 17, 2018.

Amirtharajah, A. and O’Melia, C. R. (1990), “Coagulation processes: destabilization,


mixing and flocculation”, Water Quality and Treatment; McGraw-Hill: New York.

Ashery, A.F., Radwan, K. and Rashed, M.I.G. (2011), “The effect of pH control on turbidity
and NOM removal in conventional water treatment”, In Proceedings of the Fifteen
International Water Technology Conference, Alexandria, Egypt, pp. 28-30.

BaiChuan, C., BaoYu, G., ChunHua, X., Ying, F., Xin, L. (2009), “Effects of pH on
coagulation behaviour and floc properties of Yellow River water treatment using ferric
based coagulants”, Chinese Science Bulletin, Vol. 55, No. 14, pp. 1382-1387.

Bello, O., Hamam, Y., and Djouani, K. (2014), “Modelling of a Coagulation Chemical
Dosing Unit for Water Treatment Plants Using Fuzzy Inference System”, In
Proceedings of the 19th IFAC World Congress, pp. 3985-3991.

Bello, O., Hamam, Y., and Djouani, K. (2016), “A comparative study of prediction models
for Coagulation process in drinking Water Treatment Plants”, Int. Journal of Applied
Sciences and Engineering Research, Vol. 5, No. 6 , pp. 1-9, ISSN 2277-9442.

Bourke, N., Carty, G., O’Leary, G., Crowe, M., Page, D. (2002), “Water Treatment
Manuals-Coagulation, Flocculation & Clarification”, Published by the Environmental
Protection Agency, Ireland, pp. 14-19, ISBN: 1-84095-090-0.

Bratby, J. (2006), “Coagulation and flocculation in water and wastewater treatment”; IWA
publishing, London, Seattle.

Cañizares, P., Jiménez, C., Martínez, F., Rodrigo, M.A. and Sáez, C. (2009), “The pH as a
key parameter in the choice between coagulation and electrocoagulation for the

35
treatment of wastewaters”, Journal of Hazardous Materials, Vol. 163, No. 1, pp. 158-
164.

Connelly, L.J. and Richardson, P.F. (1984), “Coagulation and Flocculation in the Mining
Industry,” Symposium on Solids/Liquids Separation and Mixing in Industrial Practice,
AIChE (Pittsburgh Section).

Cox, C., Fletcher, I. and Adgar, A. (2001), “ANN-based sensing and control in the water
industry: A decade of innovation”, In Proceedings of the IEEE International
Symposium on Intelligent Control, Mexico City, Mexico.

Curtis, D. J. (2006) “Process Control Instrumentation Technology”, Pearson Prentice Hall,


8th Edition, Pearson Education, Inc., 685 pp., ISBN 13: 978-1-292-02601-5.

Duan, J. and Gregory, J. (2003), “Coagulation by hrdrolysing metal salts”, Advance Journal
of Colloid and Interface Science, pp. 475–502.

Erdei, J.F. (1963), “Advances in Water Treatment”, American Water Works Association,
Vol. 55, No. 7, pp. 845–856.

Fosu, S. (2017), “Instrumentation and Process Control”, Unpublished BSc Lecture Notes,
University of Mines and Technology, Tarkwa, 100 pp.

Gebbie, P. (2006), “An operator’s guide to water treatment coagulants”, In 31st Annual QLD
Water Industry Workshop—Operations Skills, University Central Queensland –
Rockhampton, pp. 14-20.

Ghernaout, D., Al-Ghonamy, A. I., Boucherit, A., Ghernaout, B., Naceur, M.W.,
Noureddine, N.A., Aichouni, M., Mahjoubi, A.A., Elboughdiri, N.A. (2015),
“Brownian Motion and Coagulation Process”, American Journal of Environmental
Protection, Special Issue: Cleaner and Sustainable Production, Vol. 4, No. 5-1, 2015,
pp. 1-15.

Hannah, S.A., Cohen, J.M. and Robeck, G.G. (1967), “Control techniques for coagulation-
filtration”, American Water Works Association, Vol. 59, No. 9, pp. 1149-1163.

Hassan, A.B., Abolarin, M.S. and Jimoh, O.H. (2006), “The Application of Visual Basic
Computer Programming Language to Simulate Numerical Iterations”, Leonardo
Journal of Sciences, No. 9, pp. 125-136.

36
Hu, C., Liu, H., Qu, J., Wang, D. and Ru, J. (2006), “Coagulation behavior of aluminum
salts in eutrophic water: significance of Al13 species and pH control”, Environmental
science & technology, pp. 325-331.

Koohestanian, A., Hosseini, M. and Abbasian, Z. (2008), “The separation method for
removing of colloidal particles from raw water”, American-Eurasian Journal of
Agricultural and Environmental Science, Vol. 4, No. 2, pp. 266-273.

Kuphaldt, T. R. (2009), “Lessons in Industrial Instrumentation”, Creative Commons


Attribution, California, USA, pp. 980-986.

Kushwaha, J. P., Srivastava, V. C. and Mall, I. D (2010), “Treatment of dairy wastewater


by inorganic coagulants: parametric and disposal studies”, Water Research, pp. 5867-
5874.

Linder, K. and Zachman, B. (2009) “Getting Optimized: Optimize Coagulation and


Flocculation”, American Water Works Association, Vol. 35, No. 4, pp. 8-9.

Luedke, W.P. (2007), “Water Treatment Process Automation and Control”, Emerson
Process Management-Remote Automation Solutions, pp. 1-9.

Lui, D.H.F. and Liptak, B.G. (1997), “Environmental Engineering Handbook”, Lewis
Publishers, 2nd edition, 744 pp.

Manahan, S.E. (2009), “Environmental Chemistry”, CRC Press-Taylor and Francis Group,
9th Edition, pp. 108-111.

Marlin, T.E. (1995), “Process Control-Designing Processes and Control Systems for
Dynamic Performance”, McGraw-Hill, 2nd Edition, 765 pp.

Minkah, P.E. (2017), “Computer Simulation And Modelling Of A Chlorine Monitoring And
Regulation System In Waste Water Treatment”, Unpublished Bsc Project Report,
University Of Mines And Technology, Tarkwa, 55 pp.

Morrison, D.L., Snow, R.H., Lamoureux, J.P. (1982), “Advances in Process Control”,
American Association for the Advancement of Science, Vol. 215, No. 4534, pp. 13-818.

Ndur, S. (2018), “Water and Wastewater Treatment”, Unpublished BSc Lecture 1otes,
University of Mines and Technology, Tarkwa, 102 pp.

37
Oditis, I. and Bicevskis, J. (2010), “The Concept of Automated Process Control”, Computer
Science and Information Technologies, No. 756, pp. 193-203.

O’Melia, R. and Weber, W. J (1972), “Physicochemical Process for Water Quality Control”,
Wiley Publication, New York.

Otoo, H. (2016), “Computer Programming Lecture Material”, Unpublished Bsc Lecture


Notes, University of Mines and Technology, Tarkwa, 114 pp.

Pernitsky, D.J. (2001), “Drinking Water Coagulation with Polyaluminum Coagulants,


Mechanisms and Selection Guidelines”, Ph.D. Dissertation, University of
Massachusetts, Amherst, MA.

Reynold, T. D. and Richards, P. A. (1982), “Unit Operations and Processes in


Environmental

Engineering”, PWS Publishing Company, 2nd Edition.

Siegle, D. (2009), “Developing student programming and problem-solving skills with visual
basic”, Gifted Child Today, pp. 24-29.

Smith, P.G and Scott, J.G. (2005), “Dictionary of water and wastewater management”, IWA
publishing, 2nd edition, 88pp.

Thakur, D. (2018), “What is an IDE”, http://ecomputernotes.com/visual-basic/basic-of-


visual-basic/what-is-an-ide. Accessed: March 12, 2018.

Tseng, T., Segal, B.D., Edwards, M. (2000), “Increasing Alkalinity to Reduce Turbidity”,
American Water Works Association, Vol. 92, No. 6, pp. 44–54.

Turner, S. (2013), “Security vulnerabilities of the top ten programming languages: C, Java,
C++, Objective-C, C#, PHP, Visual Basic, Python, Perl, and Ruby”, Journal of
Technology Research, pp. 1-16.

Weiner, R.F. and Mathews, R. (2003), “Environmental Engineering”, Butterworth


Heinemann Publishers, 4th edition, pp. 93-135.

38
APPENDIX

APPENDIX A

CODES OF COAGIT

Imports System
Imports System.Windows.Forms
Imports System.Globalization

Public Class CoagiT


Dim mSig As Double
Dim signal As Double
Dim error1 As Double
Dim spoint As Double
Dim Atmv As Double
Dim motorspeed As Integer
Dim LFR As Double
Dim ButtonOneClick As Boolean 'Make sure this is before all subs
Sub btnContinue_Click ()
ButtonOneClick = True
End Sub

Public Class Vprogressbar


Inherits ProgressBar
Protected Overrides ReadOnly Property CreateParams() As CreateParams
Get
Dim cp As CreateParams = MyBase.CreateParams
cp.Style = cp.Style Or &H4
Return cp
End Get
End Property
End Class

Private Sub Button4_Click (sender As Object, e As EventArgs) Handles btnStart.Click

39
btnStop.Enabled = True
ProgressBar1.Value = 0
contactpbar.Value = 0
If hmode.Checked = False And amode.Checked = False Then
Beep ()
MessageBox.Show ("Please select mode!!")
ElseIf txtSetpoint.Text = "" Then
Beep ()
MessageBox.Show ("Please enter setpoint")
ElseIf Convert.ToDouble (txtSetpoint.Text) > 8.5 Then
Beep ()
MessageBox.Show ("Maximum value exceeded!! Maximum value for set point is
8.5")
ElseIf Convert.ToDouble (txtSetpoint.Text) < 6.5 Then
Beep ()
MessageBox.Show ("Set point cannot be below 6.5!!!")
Else
Timer1.Start ()
speed_percent.Enabled = False
End If
If amode.Checked = True Then
AIC.Visible = False
open.Enabled = False
close1.Enabled = False
ElseIf hmode.Checked = True Then
AIC.Visible = False
open.Enabled = True
close1.Enabled = True
End If
End Sub

Private Sub Form1_Load (sender As Object, e As EventArgs) Handles MyBase.Load


openclose.Text = "0%"

40
btnAccept.Enabled = False
txtATMV.Enabled = False
btnApply.Enabled = False
btnContinue.Enabled = False
btnStop.Enabled = False
speed_percent.Enabled = False
connector.Visible = False
AIC.Visible = False
End Sub

Private Sub btnStop_Click (sender As Object, e As EventArgs) Handles btnStop.Click


Timer1.Stop ()
contact_timer.Stop ()
contact_out.Stop ()
End Sub

Private Sub amode_CheckedChanged (sender As Object, e As EventArgs) Handles


amode.CheckedChanged
speed_percent.Enabled = False
open.Enabled = False
close1.Enabled = False
close1.Checked = False
open.Checked = False
AIC.Visible = False
connector.Visible = False
End Sub

Private Sub hmode_CheckedChanged (sender As Object, e As EventArgs) Handles


hmode.CheckedChanged
open.Enabled = False
close1.Enabled = False
speed_percent.Enabled = True
open.Checked = False
close1.Checked = False

41
AIC.Visible = False
connector.Visible = False
End Sub

Private Sub Timer1_Tick (sender As Object, e As EventArgs) Handles Timer1.Tick


ProgressBar1.Increment (5)
If ProgressBar1.Value = 100 Then
Mixer_timer.Start ()
End If
End Sub

Private Sub Button1_Click (sender As Object, e As EventArgs) Handles btnReset.Click


openclose.Text = "0%"
btnAccept.Enabled = False
txtATMV.Enabled = False
txtAIC.Text = ""
speed_percent.Value = 0
valve.Enabled = False
btnStart.Enabled = True
btnContinue.Enabled = False
speed_percent.Enabled = False
lblms.Text = "mA"
Timer1.Stop ()
contact_timer.Stop ()
contact_out.Stop ()
contact_in.Stop ()
Mixer_timer.Stop ()
TextBox3.BackColor = Color.OldLace
Label17.BackColor = Color.OldLace
lblLFR.Text = "0"
ProgressBar1.Value = 0
contactpbar.Value = 0
contactoutpbar.Value = 0
mixerpbar.Value = 0
42
contactinpbar.Value = 0
hmode.Checked = False
amode.Checked = False
txtSetpoint.Text = ""
txtATMV.Text = ""
open.Checked = False
close1.Checked = False
End Sub

Private Sub txtSetpoint_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs) Handles txtSetpoint.KeyPress
If Asc(e.KeyChar) <> 13 AndAlso Asc(e.KeyChar) <> 8 AndAlso Not
IsNumeric(e.KeyChar) AndAlso Not e.KeyChar = "." Then
MessageBox.Show("Please enter numbers only")
e.Handled = True
End If
End Sub

Private Sub txttestvalue_KeyPress (By Val sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs)
If Asc(e.KeyChar) <> 13 AndAlso Asc(e.KeyChar) <> 8 AndAlso Not
IsNumeric(e.KeyChar) AndAlso Not e.KeyChar = "." Then
Beep ()
MessageBox.Show("Please enter numbers only")
e.Handled = True
End If
End Sub

Private Sub txtATMV_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs)
If Asc(e.KeyChar) <> 13 AndAlso Asc(e.KeyChar) <> 8 AndAlso Not
IsNumeric(e.KeyChar) Then
Beep ()
MessageBox.Show("Please enter numbers only")

43
e.Handled = True
End If
End Sub

Private Sub centrate_KeyPress(ByVal sender As Object, ByVal e As


System.Windows.Forms.KeyPressEventArgs)
If Asc(e.KeyChar) <> 13 AndAlso Asc(e.KeyChar) <> 8 AndAlso Not
IsNumeric(e.KeyChar) Then
Beep ()
MessageBox.Show("Please enter numbers only")
e.Handled = True
End If
End Sub

Private Sub contact_timer_Tick (sender As Object, e As EventArgs) Handles


contact_timer.Tick
contactpbar.Increment (1)
If contactpbar.Value = 50 Then
contactpbar.Increment (-1)
contact_timer.Stop ()
btnAccept.Enabled = True
txtATMV.Enabled = True
End If
If Atmv < spoint And contactpbar.Value = 90 Then
lblms.Text = "20.00 mA"
txtATMV.Text = spoint
End If
btnStart.Enabled = False
btnContinue.Enabled = True
If contactpbar.Value = contactpbar.Maximum And open.Checked = True Then
contactoutpbar.Increment (5)
End If
End Sub

44
Private Sub contact_out_Tick (sender As Object, e As EventArgs) Handles
contact_out.Tick
Dim spoint As Integer
spoint = Convert.ToInt64(txtSetpoint.Text)
contactoutpbar.Increment (5)
End Sub

Private Sub btnContinue_Click (sender As Object, e As EventArgs) Handles


btnContinue.Click
If txtATMV.Text = "" Then
Beep ()
MessageBox.Show ("Measured Value field cannot be empty")
Exit Sub
End If
spoint = Val(txtSetpoint.Text)
Atmv = Val (txtATMV.Text)
error1 = Math. Abs (Atmv - spoint)
motorspeed = error1 / spoint * 100
speed_percent.Value = motorspeed
openclose.Text = speed_percent.Value.ToString () + "%”
LFR = (motorspeed / 100) * 870
If amode.Checked = True Then
speed_percent.Enabled = False
If Atmv < spoint Then
speed_percent.Value = motorspeed
TextBox3.BackColor = Color.CornflowerBlue
openclose.Text = speed_percent.Value.ToString + "%”
close1.Checked = False
open.Checked = True
lblLFR.Text = Format (LFR, "0.00")
If txtATMV.Text = txtSetpoint.Text Then
close1.Checked = False
open.Checked = True

45
End If
ElseIf Atmv = spoint Then
open.Checked = True
close1.Checked = False
End If
contactpbar.Increment (5)
contact_timer.Start ()
End If
If hmode.Checked = True Then
speed_percent.Enabled = False
btnApply.Enabled = True
AIC.Visible = True
If Atmv < spoint Then
speed_percent.Value = 0
openclose.Text = "0%"
alarm.speak ("Coagulation pH is not achieved")
AIC.Visible = True
txtAIC.Text = "Adjust Speed of the lime conveyor motor to” & Format (motorspeed)
& "%”
alarm.speak (txtAIC.Text)
connector.Visible = True
Exit Sub
If txtATMV.Text = txtSetpoint.Text Then
close1.Checked = False
open.Checked = True
End If
ElseIf Atmv = spoint Then
open.Checked = True
close1.Checked = False
End If
contactpbar.Increment (5)
contact_timer.Start ()

46
AIC.Visible = False
End If
End Sub

Dim alarm = CreateObject ("SAPI.spvoice")

Public Sub OnePing ()


Dim i As Integer
For i = 1 To 100
Beep ()
Next i
End Sub

Private Sub speed_percent_Scroll (sender As Object, e As EventArgs) Handles


speed_percent.Scroll
openclose.Text = Convert.ToString (speed_percent.Value) + "%”
If hmode.Checked = True And Atmv < spoint Then
txtATMV.Text = spoint
End If
End Sub

Private Sub Timer2_Tick (sender As Object, e As EventArgs) Handles contact_in.Tick


contactinpbar.Increment (5)
If contactinpbar.Value = ProgressBar1.Maximum Then
contact_timer.Start ()
End If
End Sub

Private Sub Mixer_timer_Tick (sender As Object, e As EventArgs) Handles


Mixer_timer.Tick
If amode.Checked = True Then
speed_percent.Enabled = False
ElseIf hmode.Checked = True Then
speed_percent.Enabled = True
End If

47
mixerpbar.Increment (1)
If mixerpbar.Value = 5 Then
speed_percent.Enabled = False
ElseIf mixerpbar.Value = 30 Then
Label17.BackColor = Color.Red
End If
If mixerpbar.Value = ProgressBar1.Maximum Then
contact_in.Start ()
End If
End Sub

Private Sub btnAccept_Click (sender As Object, e As EventArgs) Handles


btnAccept.Click
Dim mSig, Atmv, spoint As Double
Atmv = txtATMV.Text
spoint = txtSetpoint.Text
If Atmv < 0 Then
Beep ()
MessageBox.Show ("Minimum measured value is 0")
txtATMV.Text = ""
ElseIf Atmv > spoint Then
Beep ()
MessageBox.Show ("Measured value cannot exceed set point")
txtATMV.Text = ""
Else
mSig = 4 + ((16 * txtATMV.Text) / txtSetpoint.Text)
lblms.Text = Format (mSig, "0.00") & “mA"
End If
End Sub
Private Sub btnApply_Click (sender As Object, e As EventArgs) Handles btnApply.Click

If speed_percent.Value < motorspeed Then


Beep ()

48
MessageBox.Show ("Ensure speed of the lime conveyor motor is adjusted to” &
motorspeed & "%")
ElseIf speed_percent.Value > motorspeed Then
Beep ()
MessageBox.Show ("Ensure speed of the lime conveyor motor is adjusted to” &
motorspeed & "%")
Else
lblLFR.Text = Format (LFR, "0.00")
btnContinue.Enabled = False
open.Checked = True
TextBox3.BackColor = Color.CornflowerBlue
contactpbar.Increment (5)
contact_timer.Start ()
End If
End Sub

End Class

49

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy