Control Engineering in Water Resources
EE361. Lectures on Control Engineering in Environment & Sustainability
March 2015
Abubakr Muhammad Director, Laboratory for Cyber Physical Networks and Systems
Dept of Electrical Engineering
SBA School of Science & Engineering
Lahore University of Management Sciences (LUMS), Pakistan
ISLAMABAD: Anticipating a water crisis in the wake of extreme weather conditions, the Indus River System
Authority (Irsa) has asked the government to freeze the country‟s entire development programme for five years
and divert funds for construction of major water reservoirs on war footing as a national priority.
The water regulator, comprising irrigation and engineering experts from all the four provinces and the centre set
up following the 1991 water apportionment accord, did not specifically name the major water reservoirs but
pointed out that at the very minimum 22 million acre feet (MAF) storage capacity should be developed at the
earliest.
“To put an end to the misery faced by the country, the PSDP for all sectors be frozen for at least five years and
funds may be diverted for the construction of mega storages on priority basis in the best interest of public,” Irsa
chairman Raqib Khan wrote to the secretary of water and power.
The letter was issued after a meeting of the Authority, attended by the five members.
http://www.dawn.com/news/1118725
ISLAMABAD: The water regulation and irrigation authorities have found unprecedented variations in
river flow records, resulting in disharmony among provinces and massive water losses.
―According to an official of the Ministry of Water and Power, “disappearance of Indus water” upstream Tarbela
Dam and “erroneous flow measurement by Wapda at Chashma Barrage” had become so serious ….”
“He said Sindh, Balochistan and Punjab had protested over huge water losses between Besham and Tarbela
and faulty measurements at Chashma.”
“Sindh has also complained against wrong measurements between the Chashma and Taunsa and Taunsa and
Guddu barrages, showing more than 50,000 cusec variation, disappearance or unauthorised diversion.”
“The incoming information on various gauging stations along the river was keenly observed and during the
course an astonishing variation in discharge measurement in the range of 33 per cent was observed,” Mr
Bazai said.
“He said the measuring site at Besham, set up by Wapda, was 141km upstream Tarbela and it took just seven
hours for the discharge to reach the dam, yet the recording variation was so huge. On the contrary, the
figure between Tarbela and Kotri, involving 1,451 kilometres and 13 days, was less than 20pc.”
http://www.dawn.com/news/1125409
ISLAMABAD: A fact-finding mission of the Indus River System Authority (Irsa) has said three major
stakeholders in the water sector — Punjab, Sindh and Wapda — are misreporting river flow data,
putting consumers, particularly the tail-end users, at a disadvantage.
“ …. during inspection they recorded river flow at a canal at 12,112 cusecs, but the irrigation department had
been reporting a flow of 11,450 cusecs.”
“ …. at the BS-Feeder canal downstream powerhouse the flow was measured at 16,627 cusecs during the visit
but the officials at the powerhouse had been reporting 14,052 cusecs.”
“ ….. the Irsa team reported 10-15 per cent difference between the flow measured by the independent team and
that reported by the irrigation authorities at Taunsa barrage.”
“ ….. the total difference in the flow recorded by Sindh‟s irrigation officials and that measured by the Irsa team
was as high as 60 per cent. Although the province was getting its full share as allocated by Irsa its internal
situation was very bad.”
“At Ghotki Canal ….. the difference between actual flow and discharges reported by the irrigation authorities
(14,000 cusecs and 8,000 cusecs, respectively) stood at more than 60 per cent.”
http://www.nation.com.pk/lahore/10-May-2014/wapda-irsa-s-negligence-costs-rs3-8b-to-national-kitty
“The need……. was to help improve the water distribution system within the provinces …..for installation of
telemetry system for equitable distribution of river waters among the provinces.”
“The Irsa, with the financial cooperation of the World Bank, had agreed to revive the telemetry system for
automatic measurement of water flows. The bank will give soft loan of $38 million for the project.”
“As per the agreement, 23 sites would be monitored for water regulation and measurement without human
involvement through a satellite system. The Irsa, Wapda and the provincial governments would jointly
control the monitoring system for measurement of water flows.”
“The government should rather introduce modern water measuring systems at the internal canals to remove
grievances of the tail farmers.”
Objectives
• PLO-7: Environment and Sustainability (PEC )
• Deeper motivation: Connecting technology to real-
world and societal grand challenges
• Accessible introduction to cutting-edge research
• Pay attention to the Right Problems!
• Demonstrate how student involvement helps develop
high impact research
Outline
• Motivation
• Water networks : A CPS / IoT perspective
• Open channel hydraulics : obtaining simple models
• System identification : theory to experiments
• Sensing: building telemetry networks
• Control: putting it all together
• Conclusions and outlook
Motivation / Concerns
8
Annual canal diversions and sea escapage Flow reduction due to climate change
Vulnerability sources
Source. UNEP South Asia report, 2008
Agricultural Productivity Loss
Main reason is water!
Basin Management Problem:
A complex system of systems
10
Water
Silt Salt
Courtesy. Asad Abidi, 2009
Managing the World’s Largest Irrigation Network
90,000 Km of watercourses
3 reservoirs, 23 barrages
45 canal commands
36 million acre irrigated area
Regulation Structure
Outline
• Motivation
• Water networks : A CPS / IoT perspective
• Open channel hydraulics : obtaining simple models
• System identification : theory to experiments
• Sensing: building telemetry networks
• Control: putting it all together
• Conclusions and outlook
A Networked Smart Water Grid
Embedded controller
Gate control
Flow Measurements
Wireless connectivity
A Networked Smart Water Grid
Cyber Physical Systems / Internet of Things perspectives
• Physical elements: rivers, watercourses, barrages, weirs, gates, pumps
• Cyber elements : sensors, controllers, comm., services
What type of problems can be solved?
• Increase of distribution efficiency
• Demand based delivery
• Control of nontechnical losses
– Detection of Leak or unauthorized takeoff
– Detection of unauthorized dumps
• System health monitoring
• Flood/breach security
• Real-time scheduling and planning
• Improvement and enforcement of water rights
Outline
• Motivation
• Water networks : A CPS / IoT perspective
• Open channel hydraulics : physical models
• System identification : theory to experiments
• Sensing: building telemetry networks
• Control: putting it all together
• Conclusions and outlook
Open Channel Flows
Typical Canal Pool Structure
• Pools or Reaches.
• Two gates in each pool/reach.
Models of Open Channel Flows
• Two ways to simulate:
– Simple volume balance equations.
– Navier Stokes in 1D (Saint Venant equations).
(Lumped) Volume Balance Model
( ) ( ),in out
dVQ t Q t
dt
3
20.6 .Q gbh
Where,
(Lumped) Volume Balance Model
).()( tQtQdt
dVoutin
.
,
23
23
hcQ
hcQ
outout
inin
3 31 2 2
, 1, 1
( )( ) ( ).i
i in i i out i
dy tc h t c h t
dt
Distributed Model Geometry
Q: Water flow
A: Cross-sectional area
h: Height
P: Wetted Perimeter
B: Base width
R: Hydraulic Radius
Modeling of flow of water
Saint Venant equations
Continuity Equation
Momentum Equation
Frictional Slope
Hydraulic Radius .
,
,
.0)(2
)(
,0
34
2
22
02
2
P
AR
RA
nQS
where
SSgAx
Q
A
Q
x
A
A
Q
B
gA
t
Q
x
Q
t
A
f
f
Preissmann’s Scheme
Preissmann’s Scheme contd.
).())(1(
),(2
1
),)1((2
1))1((
2
1
11
11
1
1
1
1
1
1
1
1
t
ff
x
ff
x
f
t
ff
t
ff
t
f
fffff
k
i
k
i
k
i
k
i
k
i
k
i
k
i
k
i
k
i
k
i
k
i
k
ip
Discretizing PDE
System of equations
• Solved by Newton-Raphson method
• Applying Preissmann‟s equation to St. Venant equation.
• Boundary equations are given as:
.
,
23
23
hcQ
hcQ
outout
inin
Example: Breaches and Dumps
.)(2
)(
,
02
2
A
QdSSgA
x
Q
A
Q
x
A
A
Q
B
gA
t
Q
dx
Q
t
A
f
For Rectangular
Channel:
Leak Simulations
Dumping Simulation
End of Lecture 1
Outline
• Motivation
• Water networks : A CPS / IoT perspective
• Open channel hydraulics: physical models
• System identification : theory to experiments
• Sensing: building telemetry networks
• Control: putting it all together
• Conclusions and outlook
Model Learning for Control
3 31 2 2
, 1, 1
( )( ) ( ).i
i in i i out i
dy tc h t c h t
dt
Abstraction
Physical Models Data Driven Models
(Lumped) Volume Balance Model
).()( tQtQdt
dVoutin
.
,
23
23
hcQ
hcQ
outout
inin
3 31 2 2
, 1, 1
( )( ) ( ).i
i in i i out i
dy tc h t c h t
dt
Plant Model
• Declare
• W.r.t. inflow, a linear transfer function emerges:
ℎ3/2 𝑡 = 𝑢 𝑡 .
System Identification
Idea prototyped in a LUMS MS Thesis 2011.
System Identification contd.
).()()( 12
3
,12
3
,1thcthcty ioutiiinii
Date extracted
Pool 1 2 3
Time delay
(min)
2 3 1
Wave Period
(min)
8 13 7
Ci,in 0.1090 0.1010 0.2340
Ci+1,out 0.1460 0.0910 0.2010
Sy
ste
m Id
en
tifi
ca
tio
n System ID: Experiments
Location:
– KHAIRA Distributory
– Length 87000 feet
– Width 10 feet
– Max height 4 feet
– 3 Minors
– Discharge 87 cusecs
Tested in a LUMS FYP 2013 !
Sy
ste
m Id
en
tifi
ca
tio
n
System ID: Experiments
Procedure: – Water level sensors are placed at appropriate sites along the
canal and communicate through mobile or other networks.
– At the Upstream, Gate is closed and then subsequently
opened to generate a step input.
– The readings are recorded and then used as empirical
output, in conjunction with the input, to perform System
Identification.
Sy
ste
m Id
en
tifi
ca
tio
n
System ID: Gate Modeling
Water Flow: Overshot Gate Water Flow: Undershot Gate
Sy
ste
m Id
en
tifi
ca
tio
n
System ID: Parametric Equation for the given channel
• The parameters
in 𝜃 matrix are
estimated by
the
minimization of
a least-squares
criterion.
System ID: Experiment
Sy
ste
m Id
en
tifi
ca
tio
n
System ID: Least Squares Estimation
• Experimental Setup – Upstream Gate was closed and then opened
– The water level was measured at 50m, 350m and 550m, every 10s.
– The corresponding data was processed and interpolated to obtain a uniformly sampled and synchronized set.
• Estimation – A model was fit to the observed response at 350m and 550m
sensors by linear regression.
– As mentioned earlier, yu was assumed to be constant and p2[k] was taken to be zero to model an „always opened – hypothetical – downstream gate’.
– In addition, yd [k] was taken to be the values of 50m sensor.
– The response delay were inspected from the raw data, which came out be approximately 200s and 350s for the 50m, 350m and 550m sensors respectively.
– Using the above conditions, the response for the sensors at 350m and 550m was estimated
System ID: Least Squares Estimation
System ID: Least Squares Estimation
Sy
ste
m Id
en
tifi
ca
tio
n
System ID: Least Squares Estimation
• Results
– For 350m the estimated parameters were: • θ = [0.0160 -0.3271]x10-3
– For 550m the estimated parameters were: • θ = [0.0152 -0.2737]x10-3
• The estimated parameter values make sense from a physical point of view. – θ1 is positive. It is associated with the inflow of water
– θ2 is negative. It is associated with the outflow of water
– θ2 has a greater magnitude than θ1 because there exists no hydraulic structure at the downstream sensor position, and there is always an outflow at the hypothetical downstream end.
Sy
ste
m Id
en
tifi
ca
tio
n
System ID: Model Validation
• Simulation of Model
• Average Squared Prediction Error
• Comparison of predicted water level with the measured one
System ID: Model Validation
Outline
• Motivation
• Water networks : A CPS / IoT perspective
• Open channel hydraulics: physical models
• System identification : theory to experiments
• Sensing: building telemetry networks
• Control: putting it all together
• Conclusions and outlook
Hydrometry for Open Channel Flows
Objective: Measure flows in distributary canal networks
Hydrometry for Open Channel Flows
• Outdated infrastructure
• Gaps in monitoring expertise
• Objective: To develop a low-cost low-power robust flow gauge
Challenges
• Power / energy autarky
• Communication mode
• Physical security
• Cost / scalability
• Calibration / maintenance
• Data dissemination / services
Solution: A smart metering like approach
Smart Water Grid : LUMS-IWMI collaboration
Goal: To install a network of 20+ sensors at a real site
(distributary network on Hakra Branch, Bahawalnagar)
Smart Water Grid in Bahawalnagar
Ref. Ahmad, Muhammad. IECON 2013
Hakra Branch Distributaries
Packaging / Assembly
Circuitry Enclosure
Material die cast
Aluminum
IP 67 Enclosures
Connectors for external
antenna and
temperature sensors
are also IP67 standard
Prototyped in a LUMS FYP 2012 !
Stilling well / Civil Infrastructure
60cm x 90cm
To secure
electronics
High strength PCC
concrete
No steel
reinforcement for
good GSM
reception
Ultrasonic Sensor
• Maxbotix MB7380 Ultra Sonic Sensor
• 1mm resolution, 1% accuracy
Block diagram of Smart Water Meter
Unit Performance
• 10 months data of a field deployed unit (5R) with 10
minutes sampling interval.
• Average signal level -69dBm
• 42,187 samples
Flow Calibration
• Level to flow calibration
• Hydraulic rating equation (Manning equation)
• “Calibrating” flow from level measurements
Model based Filtering for Sensor Data
• Physical models for
– Pipe blockage
– False ultrasound returns
– Sensor failures
Installation at LUMS
End of Lecture 2
Outline
• Motivation
• Water networks : A CPS / IoT perspective
• Open channel hydraulics: physical models
• System identification : theory to experiments
• Sensing: building telemetry networks
• Control: putting it all together
• Conclusions and outlook
Low level downstream control
Controller Design
• Model
Controller Design
• Model
• Root locus (with 2nd order Pade approx. of delay)
Controller Design
• Model
• Root locus (with 4th order Pade approx. of delay)
Model Refinement
• Wave excitations in the channel: damped oscillations.
• Model is approximate. There are higher-order invisible
modes.
Model Refinement
• Model is approximate. There are higher-order
invisible modes.
Introduce damping / friction
Model Refinement
• Model is approximate. There are higher-order
invisible modes.
Oscillatory mode + damping
How to choose a Controller?
• Water off-takes from channel act as disturbances
– Therefore, Integral action needed for disturbance
rejection (PI control)
• At some higher frequencies, waves in channels may
get excited.
– Therefore, controller should have “low gain” at
wave frequency. (LPF with roll-off)
• Both plant and controller (PI) introduce integrators.
– Therefore, need lead compensation.
Controller Design
• Model
• PI-control + low-pass + lead compensator
PI control LPF Phase Lead
)1(
)1().()(
2
1
sT
sT
s
KKsC i
p
Level regulation (physical simulation)
Closed Loop On-Off Control
Gate Controller: Prototyped in a
LUMS FYP 2014 !
(Farwa Akhtar, Shibal Ibrahim,
Muhammad Soban, Usama Munir)
Downstream Control in Other Parts of the World
• Australia, Europe, USA, China
Networked Control Issues
• So far, plant is single pool
• Control problem is downstream water level
regulation for one pool.
• But irrigation networks are extremely complex,
specially in the Indus basin
• Control effects propagate
• Enters Networked Control Systems !
Network effects
TOP VIEW SIDEVIEW
Controller of last gate sends signal of water
scarcity
Network effects
TOP VIEW SIDEVIEW
Controller of a gate sends signal of water scarcity
Network effects
TOP VIEW SIDEVIEW
Controller of a gate sends signal of water
scarcity
Network effects
TOP VIEW SIDEVIEW
Water starts entering the canal
Network effects
TOP VIEW SIDEVIEW
After reaching the set value controller sends signal to close
upstream gate
Network effects
TOP VIEW SIDEVIEW
After reaching the set value controller sends signal to close
upstream gate
Network effects
TOP VIEW SIDEVIEW
Off take creates water scarcity in a pool
Network effects
TOP VIEW SIDEVIEW
Controller sends signal of water
scarcity
Network effects
TOP VIEW SIDEVIEW
Controller sends signal of water
scarcity
Network effects
TOP VIEW SIDEVIEW
After reaching set value gates are
closed
Network effects
TOP VIEW SIDEVIEW
All gates closed
Irrigation Networked Control Models
• Multiple pools, multiple inputs, multiple outputs
• What about control?
Ref. Cantoni et al. “Control of Large-Scale Irrigation Networks,” IEEE proceedings 2007.
Irrigation Networked Control Models
• Distributed control
• Local controller for each pool
Irrigation Networked Control Models
• Distributed control with feed-forward paths
• Local controller for each pool + comm. with neighbors
Irrigation Networked Control Models
• Centralized control
• All feedback loops closed via a “central processor”.
Irrigation Networked Control Models
• Centralized Vs Distributed control – which is better?
Solid (distributed), dashed (centralized), dotted (with feedfoward)
Ref. Cantoni et al. IEEE proceedings 2007.
CPS Security
• Physical security + Network security = CPS security
• Can we detect
– Illegal dumps?
– Breaches?
– Seepages?
– Non-technical losses?
– covert misappropriations?
Nominal Networked Control System
• LTI plant
• Measurements
• Actuation
• Closed loop response
where,
Ref.. Roy. IEEE Control Systems Magazine, 2015.
Compromised System : Covert Agent
• LTI plant
• Measurements
• Offsets
• Closed loop response
Ref.. Roy. IEEE Control Systems Magazine, 2015.
Impossible to detect if cover agent‟s model ∏u = reality Pu
Irrigation Network Security – Explaining theft
Misappropriation by covert agent Nominal responses
2-input 2-output model
???
Cyber-physical Security (Aside)
• Stuxnet worm attack on Iran‟s nuclear centrifuges (June 2010) and
put its nuclear program many years back
• Relayed fake measurements and destructive actuations in SCADA
control systems to destroy centrifuge yields.
• As we automate further, other critical infrastructures are also prone
to such attacks.
– Power networks
– Water supply
– Traffic control systems
– Air traffic control
– Aviation systems
• Beware the demons of automation !
Ref.. “Cybernetics” by Norbert Wiener. 1948
Conclusions / Final Thoughts
• Canal networks are good candidates for CPS / IoT driven solutions to improve
water efficiency, specially in developing world settings.
• Complex channel models can be simplified to ones that can experimentally
obtained, validated and used for controller synthesis.
• Scalable low-power hydrometry is the key to making complex decision support
systems. There is both a need and a market for it.
• Power and communications are key challenges towards water metering.
• Fault diagnosis, state estimation and autonomic services will be key to deploying
large scale networks.
• Huge potential for system theorists, control engineers, instrumentation and
automation experts. (in addition to informatics, systems analysis, decision
support systems)
Related Publications (2011-2014)
• Saad Aleem, Hasan Nasir, Abubakr Muhammad, "System Identification of Distributory Canals in the
Indus Basin." 19th World Congress of the International Federation of Automatic Control (IFAC 2014),
Cape Town, South Africa, 24-29 August 2014. Preprint
• Talha Manzoor, Sergey Aseev, Elena Rovenskaya, Abubakr Muhammad, "Optimal Control for
Sustainable Consumption of Natural Resources." 19th World Congress of the International Federation
of Automatic Control (IFAC 2014), Cape Town, South Africa, 24-29 August 2014. Preprint
• Zahoor Ahmad and Abubakr Muhammad, "Design, Calibration and Performance of a Low-Power
Wireless Sensor Node for Open Channel Flows", 39th Annual Conference of the IEEE Industrial
Electronics Society (IECON), Vienna, Austria, 2013.
• Zahoor Ahmad, Ehsan U. Asad, Abubakr Muhammad, Waqas Ahmad and Arif Anwar, "Development of
a Low-Power Smart Water Meter for Discharges in Indus Basin Irrigation Network", Wireless Sensor
Networks for Developing Countries, Springer Communications in Computer and Information Science
(CCIS), Volume 366, 2013, pp 1-13. Preprint
• Zaeem Hussain and Abubakr Muhammad, "Sample size reduction in groundwater surveys via sparse
data assimilation," IEEE International Conference on Networking, Sensing and Control (ICNSC), Paris-
Evry University, France 2013. Preprint
• Hasan Nasir and Abubakr Muhammad, "Locating Leaks & Dumps in Open Channels with Minimal
Sensing," IEEE Conference on Control Applications (CCA), Dubrovnik, Croatia 2012. Preprint
• Muhammad Umer Tariq, Hasan Arshad Nasir, Abubakr Muhammad and Marilyn Wolf, “Model-Driven
Performance Analysis of Large Scale Irrigation Networks,” IEEE/ACM International Conference on
Cyber-Physical Systems (ICCPS), Beijing, China, 2012. Preprint
• Hasan Nasir and Abubakr Muhammad, "Feedback Control of Very-Large Scale Irrigation Networks: A
CPS Approach in a Developing-World Setting." 18th World Congress of International Federation of
Automatic Control (IFAC), Milano, Italy, 2011. Preprint