Proceedings of the 17th World Congress The International Federation of Autoatic Control Seoul, Korea, July 6-11, 28 Leak detection in open water channels Erik Weyer Georges Bastin Departent of Electrical and Electronic Engineering, The University of Melbourne, Parkville VIC 31, Australia (e-ail: e.weyer@ee.unielb.edu.au). Center for Systes Engineering and Applied Mechanics (CESAME), University of Louvain-La-Neuve, Batient Euler, 4 Avenue G. Leaitre, B-1348 Louvain-la Neuve, Belgiu (e-ail: bastin@ina.ucl.ac.be) Abstract: In this paper we present a siple cuulative su algorith for detection of leaks in open water channels. The algorith copares the observed changes in water levels against the known in- and out-flows and raises an alar if they are not in agreeent. The algorith is tested on data fro an irrigation channel with very good results. Leaks are quickly detected and the algorith is robust against uncertainty in the odel paraeters. Keywords: Fault detection, CUSUM algorith, syste identification, leak detection, irrigation channels. 1. INTRODUCTION Water is becoing an increasingly scarce resource in any parts of the world, and agriculture is one of the biggest consuers of water (Mareels et. al. 25). Water for agricultural purposes is often conveyed via a network of open channels. Manageent of such channels ust take into account the required level of service that has to be provided to the farers and the need to conserve water and iniise potential water losses. Ipleentation of autoatic control systes for regulation of the flows and water levels (Cantoni et. al. 27, Dulhoste et. al. 24, Goez et al. 22, de Halleux et. al. 23, Litrico et. al. 25, Ooi and Weyer 27, Schuurans et. al. 1999, Weyer 27) cangive significantiproveentin operationalefficiency, ensuring that enough water is available to farers while iniising losses due to oversupplywhich can cause spillage along the channel and outflows at the end of the channel syste. In addition to losses caused by oversupplyof water, there are also losses due to faults (Bedjaoui et. al. 26) and leaks in the channels. Leaks can e.g. occur in the for of unscheduled offtakes of water or be due to break downs and failures in the (often old) civil engineering infrastructure. A typical exaple is a gate to an escape channel not sealing properly and letting water through even when it is fully closed. It is of course iportant to detect leaks early such that corrective action to reduce the water losses can be taken. In this paper we present a siple algorith for leak detection together with experiental results fro the Coleabally Channel Nuber 6 which is a fully operational irrigation channel. The algorith is a cuulative su (CUSUM) algorith which copares the observed changes This work was supported by Rubicon Systes Australia and the Australian Research Council under the Linkage Grant Schee, Project LP349134. Fig. 1. The Coleabally Channel Nuber 6 in water level against the easured and known in- and out-flows and raises an alar if they are not in agreeent. The paper is organised as follows. In the next section we give a description of the Colebally Channel no. 6 and present the odels used. The leak detection algorith is derived in Section 3 followed by experiental results in Section 4. Conclusions are given in Section 5. 2. CHANNEL DESCRIPTION The experients were carried out at the Coleabally Channel Nuber 6 (Fig. 1) which is a secondary channel to the Coleabally Main Channel in New South Wales, Australia. Fig. 2 shows a scheatic top view of the channel. We refer to a stretch between two gates as a pool. The pools are naed according to the upstrea gate, e.g. the pools in Fig. 2 are Pools 1 to 5. The channel is autoated with overshot gates as shown in Fig. 3 where y i and y i+1 are the upstrea water levels of Gates i and i + 1 978-1-1234-789-2/8/$2. 28 IFAC 7913 1.3182/2876-5-KR-11.1315
17th IFAC World Congress (IFAC'8) Seoul, Korea, July 6-11, 28 work we will focus on Pool 4 and 5 and we will treat the easured offtakes to fars as unknown leaks. Data such as length, width etc. are given in Table 1. Table 1. Data for Pool 4 and 5 Fig. 2. Topview of the Coleabally Channel no. 6 with Gates 1 to 6 (not to scale). y i DATUM h i p i Overshot Gate y ds,i Flow Pool i typical slope 1:1 yi+1 h i+1 Overshot Gate p i+1 Fig. 3. Stretch of an open-water channel with over-shot gates Fig. 4. Photo of Gate 5 respectively, p i and p i+1 are the positions of Gates i and i + 1, and h i and h i+1 are the heads over gates which are the heights of water above the gates. There are two gates at each site as shown in Fig. 4. Both gates operate in parallel, i.e. they always have the sae position. The water levels and gate positions are the easured variables, and the heads are coputed fro these easureents. Water levels are easured using subersible level pressure sensors and gate positions are easured based on the length of the steel cable between the gates and the otors that ove the gates. As the channels are located in rural areas, electric power is supplied by solar panels and data counication takes place via a radio network, see Fig. 4. At each gate there is a icro-processorwhich processes local inforation and inforationcounicatedoverthe radionetwork. Inthis Pool 4 5 Length, 943 1275 Botto width 5.72 5.18 Side slope 2 2 Botto slope 1 4 3.4483 2.6667 Upstrea gate width 1.91 1.91 Downstrea gate width 1.91 1.91 c i,in.341.2 c i+1,out -.341 -.2 τ i 4in 6in 2.1 Models for leak detection For detection purposes a siple volue balance (Weyer (21)) describes the relevant dynaics well. The volue balance is given by dv dt = Q in(t) Q out (t) where V is the volue of the pool and Q in and Q out are the inflow and outflow respectively. The flow over an overshot gate in free flow can be approxiated by (Bos (1978)) Q(t) = ch 3/2 (t) where h is the head over gate and c a proportionality constant. Assuing that the volue of water in a pool is proportional to the downstrea water level, we obtain the following odel for Pool i ẏ i+1 (t) = c i,in h 3/2 i (t τ i )+c i+1,out h 3/2 i+1 (t) d i(t) l i (t) (1) where d i (t) represents known offtakes to fars and side channels in Pool i, and l i (t) represents the effects of leaks and unknown offtakes 1. A tie delay τ i has also been introduced to take into account the tie between water passes the upstrea Gate i and the effects reaches the downstrea Gate i + 1 where y i+1 is easured. As ost offtakes are at the downstrea end of a pool, there is no tie delay in the d i (t) ter. The l i (t) ter is unknown and ay be a (scaled) tie delayed version of an actual leak. This is uniportant as far as detection is concerned, but it ay have to be taken into account if we also want to estiate when a leak started. By replacing the derivative ẏ i+1 (t) by the difference (y i+1 ((k + 1)T) y i+1 (kt))/t where T is the sapling interval, a discrete tie odel can be obtained. Here a sapling interval of 1 inute was used and hence we obtained the odel y i+1 (k + 1) = y i+1 (k)+ c i,in h 3/2 i (k τ i ) + c i+1,out h 3/2 i+1 (k) d i(k) l i (k) (2) The paraeters c i,in, c i+1,out and τ i were estiated fro observed data using prediction error ethods for syste identification (Weyer (21), Ooi et. al. (25), Eurén and Weyer (26)). The paraeters are given in Table 1. 1 For the purpose of this study we have not explicitly considered the effects of rainfall and evaporation. This is often reasonable since rainfall, if easured, can be incorporated in d i (t), and losses due to evaporation are often sall copared to losses due to leaks. 7914
17th IFAC World Congress (IFAC'8) Seoul, Korea, July 6-11, 28 3. CUSUM ALGORITHM FOR LEAK DETECTION Equation (2) expresses the change in water level as a function of the in- and outflows. Intuitively one can therefore detect leaks by coparing the change in water level against the known in- and outflows. In the absence of leaks equation (2) can be written as y i+1 (k + 1) y i+1 (k) c i,in h 3/2 i (k τ i ) c i+1,out h 3/2 i+1 (k) + d i(k) = (3) and when a leak is present the left hand side of (3) becoes negative. With this observation the leak detection proble becoes a standard change detection proble. The variable z i (k + 1) =y i+1 (k + 1) y i+1 (k) c i,in h 3/2 i (k τ i ) c i+1,out h 3/2 i+1 (k) + d i(k) (4) takes on values around zero before a change, and negative values after a change, i.e. when a leak is present. Note that all variables in (4) are easured or known so z i (k) can be coputed on-line. One of the ost well known algoriths for this proble is the cuulative su (CUSUM) algorith (Page (1954), Basseville and Nikiforov (1993), Gustafsson (2)). If a leak is present l g i (l) = z i (k) k=τ i+1 will becoe ore and ore negative as l increases and an alar is raised when a threshold is exceeded. In ipleentations of the CUSUM algorith it is coon to reset g i (l) to zero if it becoes positive and to add a sall positive drift ter to z i (k). As a rule of thub (Gustafsson 2) the drift ter should be chosen equal to half the change we want to detect. The CUSUM algorith can therefore be written as g i (τ i ) = for l = τ i, τ i + 1,... g i (l + 1) = in(g i (l) + z i (l + 1) + a i, ) (5) if g i (l + 1) < γ i Alar tie = l + 1 g i (l + 1) = end %if end %for An alar is raised if g i (l + 1) < γ i, and a i in (5) is the drift ter. The threshold γ i is a trade off between quick detection of leaks and false alar rate. If γ i is sall, leaks will be detected quickly, but the false alar rate will also be high. The last reset tie before the first detection can be taken as a lower estiate for the tie when the leak started since there is no indication (g i (l) + z i (l + 1) + a i was positive) that a leak was present at that tie. 3.1 Robustness with respect to uncertainty in the odel paraeters The CUSUM algorith is quite robust to uncertainty in the odel paraeters since such uncertainty can be copensated for by adjusting the threshold value as shown next. In our case c i,in = c i+1,out since we have identical gates at the upstrea and downstrea end of the channel. Let c i = c i,in. Ignoring the resets and the drift ter, g i (l) can be written as g i (l) =y i+1 (l) y i+1 (τ i ) l l c i (h 3/2 i (k τ i ) h 3/2 i+1 (k)) + d i (k) k=τ i+1 k=τ i+1 and the alar condition becoes ỹ i+1 (l) c i x i (l) < γ i (6) where ỹ i+1 (l) = y i+1 (l) y i+1 (τ i ) + l k=τ d i+1 i(k) and x i (l) = l k=τ i+1 (h3/2 i (k τ i ) h 3/2 i+1 (k)). Fro (6) it can be seen that an incorrect value of the odel paraeter c i can be copensated for by adjusting the threshold γ i. These days irrigation channels often have autoatic control systes for water level regulation and the water level will not vary uch and hence y i+1 (l) y i+1 (τ i ). If in addition there are no known off takes, the alar condition becoes approxiately c i x i (l) < γ i or x i (l) < γ i /c i (7) in which case the effect of an incorrect odel paraeter can be copletely absorbed by adjusting the threshold γ i. (7) is equivalent to onitoring the accuulated flows over the upstrea and downstrea gate and to raise an alar if ore water flows over the upstrea gate than over the downstrea gate which akes sense if the water level is constant and there are no known offtakes. 4. EXPERIMENTAL RESULTS 4.1 Operational conditions The ColeaballyChannelno. 6 is operatedinclosedloop as sketched in Fig. 5. The setpoint for the water level in Pool i is r i+1 (t), and the output of the controllers are u i (t) = h 3/2 i (t). The controller equations are given by U i (s) = C i (s)(r i+1 (s) Y i+1 (s)) + F i (s)u i+1 (s) (8) where U i (s), U i+1 (s), R i+1 (s) and Y i+1 (s) are the Laplace transfor of u i (t), u i+1 (t), r i+1 (t) and y i+1 (t) respectively. The feedback controllers C i (s) are PI controllers augented with lowpass filters, i.e. C i (s) = K i(1 + T i s) T i s 1 1 + T i,f s F i (s) are lowpass filters with gains less than 1 in the pass band. For details see Ooi and Weyer (27). 4.2 Ipleentation issues The easureents required in order to ipleent the CUSUM algorith for Pool i are y i+1, h i and h i+1. This eans that the only data counication that has to take place is between Gate i + 1 and i. As part of the coputations for the controller in Fig. 5 y i+1 and h i+1 are already transitted to Gate i, and hence the leak detection algorith can be executed locally at Gate i without any additional data counication. In other words the leak detection algorith allows for a decentralised ipleentation requiring only neighbouring gates to counicate. Counicationwith a centralnode is only necessary when an alar is raised. 7915
17th IFAC World Congress (IFAC'8) Seoul, Korea, July 6-11, 28 F 4 u 4 = h 3/2 4 h 4 u 5 = h 3/2 5 C 4 y 5 r 5 h 5 h 6 F 5 C 5 y 6 u 6 r 6 y 4 p 4 Pool 4 y 5 p 5 Pool 5 y 6 p 6 Fig. 5. Controller configuration for Pool 4 and 5 1.55 Upstrea water level of gate 5 1.61 Upstrea water level of gate 6 1.6 Meters 1.5 Meters 1.59 1.58 1.45 Head over gate 4 and 5 1.57 Head over gate 5 and 6.2 Meters.2.1 Head over gate 4 Head over gate 5.15.1.5 Head over gate 5 Head over gate 6 Ml/day Calculated flow at Offtake 31 25 2 15 1 5 Fig. 6. Data for Pool 4 4.3 Experiental data The data sets are shown in Fig. 6 and 7. Gate 6 was under anual control and Gate 4 and 5 were controlled as shown in Fig. 5. The flow (head) over Gate 6 was increased at tie 11in causing the water levels to drop before the controllers brought the back. In addition as shown in the botto graph of Fig. 6 an offtake started at tie 7in at location 31 which is just upstrea of Gate 5. At location 32 which is just upstrea of Gate 6 there was a sall ongoing offtake which finished at tie 28in as shown in the botto graph of Fig. 7. For the purpose of this study, these offtakes were treated as unknown leaks. The sapling period for the water levels and the gate positions was T = 1 in. Note that the water levels and gate positions at a site is relative to a local reference points, and hence the easured water levels at Gate 5 and 6 are not directly coparable. Also note that the head over Gate 5 is the sae in Fig. 6 and 7. They look slightly different only because one is drawn with a solid line and the other with a dashed line. 4.4 Results We applied the CUSUM algorith in Section 3 to the data in Fig. 6 and 7. The alar thresholds were set to Ml/day Calculated flow at Offtake 32 6 4 2 Fig. 7. Data for Pool 5 γ i =.15 for both pools. A rule of thub is that the drift ter in (5) should be selected equal to half the change we want to detect (Gustafsson (2)). In irrigation channels we often want to detect quite sall leaks and therefore a i = is often a reasonable choice. However, if we only want to detect leaks larger than say 1 ML/day (.116 3 /sec) rough calculations based on the surface areas of the two pools suggest that the drift ters should be set to a 4 = 3.15 1 5 for Pool 4 and a 5 = 2.44 1 5 for Pool 5. The cuulative su g i (l) with and without the drift ter are shown in Figs. 8 and 9 for Pool 4 and 5 respectively. After each alar g i (l) was reset to zero, and the detection algorith was started over again. The dashed vertical lines arks the alar ties, and the dash dotted lines is the last reset tie before the first alar. Of course, in practice corrective action will be taken to stop the leak, and g i (l) will not be repeatedly reset to zero after an alar. Here we have done it just to illustrate the algoriths capability of detecting leaks. As we can see the offtake in Pool 4 is quickly detected both with and without the drift ter. It starts at tie 7 in and it is detected at tie 96 in. This is not surprising since the offtake is relatively large and the algorith continue to give alar every 1 inutes or so indicating an ongoing leak. The last reset tie is a bit 7916
17th IFAC World Congress (IFAC'8) Seoul, Korea, July 6-11, 28 Pool 4. g(l). No drift ter Pool 4. g(l). Model paraeter is.5.5.5.1.15 Pool 4. g(l). With drift ter.5.1.15 Pool 4. g(l). Model paraeter is.2.5.1.1.15 Fig. 8. Results for Pool 4. a 4 = in the upper plot. Vertical dashed lines are the alar ties. The vertical dash dotted line (the leftost vertical line) is the last reset tie before the first alar..5 Pool 5. g(l). Without drift ter.15 Fig. 1. g 4 (l) for Pool 4 with incorrect odel paraeters. c 4,in =.5 in the upper plot and.2 in the lower plot. Vertical dashed lines are the alar ties. The vertical dash dotted line (the leftost vertical line) is the last reset tie before the first alar. Fro Figs. 8 and 9 it can be seen that even quicker detection could have been achievedin both Pool4 and 5 by using an alar threshold closer to zero, e.g. γ i =.1..1 4.5 Robustness against uncertainty in the odel paraeters..15.5.1 Pool 5. g(l). With drift ter.15 Fig. 9. Results for Pool 5. a 5 = in the upper plot. Vertical dashed lines are the alar ties. The vertical dash dotted line (the leftost vertical line) is the last reset tie before the first alar. before the actual offtake starts when there is no drift ter, but with the drift ter the last reset event in Pool 4 before the first alar occurs at tie 7 inutes which is when the offtake starts, and hence provides in this case an accurate estiate of the start tie of the leak. The offtake in Pool 5 is uch saller, and it is detected after about 1 inutes without a drift ter and only about 1 inutes later with the drift ter. For Pool 5 we only got one alar which is not surprising since the offtake was sall and it also stopped after 28 inutes. Without the drift ter the cuulative su was never reset to, but it was reset a few ties in the first 15 inutes with the drift ter. In order to investigate the robustness we changed the odel paraeter c 4,in = c 5,out for Pool 4 to.2 and.5. For Pool 5 we changed the value of c 5,in = c 6,out to.1,.12 and.28. These values are 4 to 5% above and below the noinal paraeter values, so the errors are quite large. The drift ters a 4 and a 5 were as before and so were the thresholds γ 4 and γ 5. The results are shown in Figs. 1 and 11. Apart fro when c 5,in =.1 the leaks are still detected. This shows that the algorith is robust against uncertainties in the odel paraeters as shown in Section 3.1. When c i,in is saller than the noinal value, it takes a longer tie for the leaks to be detected. Of course there is a liit to how uch uncertainty that can be tolerated, and the leak in Pool 5 was not detected (with the above threshold and drift ter) with c 5,in =.1. However, a sall adjustent of the threshold to say γ 5 =.12 (the horizontal line on the botto graph in Fig. 11) would have been enough to detect the leak. This shows that an error in the odel paraeter can be partly copensated for by adjusting the threshold. 4.6 Future developents In addition to detecting the presence of a leak it ay also be of interest to estiate the size of the leak and the location within the pool of the leak. A possible approach to the first proble is to estiate the slope of g i (l) or to copute the average tie between alars. The size of the leak could then be inferred fro this inforation. 7917
17th IFAC World Congress (IFAC'8) Seoul, Korea, July 6-11, 28.5.1 Pool 5. g(l). Model paraeter =.28.15 Pool 5. g(l). Model paraeter =.12.5.1.15 Pool 5. g(l). Model paraeter =.1.5.1.15 Fig. 11. g 5 (l) for Pool 5 with incorrect odel paraeters c 5,in =.28 in upper plot and.12 in the iddle and.1 in the lower plot. Vertical dashed lines are the alar ties. The vertical dash dotted line (the left ost vertical line) is the last reset tie before the first alar. Based on the tie between alars in the upper plot of Fig. 8 between tie 2 inutes and 3 inutes a rough estiate of the size of the leak is 28 ML/day which is a bit larger than the easured value of 2 ML/day. The reason for this can be twofold: Inaccurate easureent of the flow at the offtake and an error in the estiate of c 4,in and c 5,out. Estiate of the location of the leak is difficult, even with access to easureents of the iediate downstrea water level (y ds,i in Fig. 3). Intuitively, if the leak occurs at the downstrea end, the water level at the downstrea end will start to decrease before the water level at the upstrea end, and vice versa if the leak is at the upstrea end. However, the natural variations in the easured water levels ake it difficult to pinpoint when a water level starts to decrease, and estiates of the location becoe unreliable. 5. CONCLUSIONS In this paper we have developed a siple CUSUM algorith for leak detection in open water channels. The algorith has been successfully tested on data fro an operational irrigation channels with very good results. Leaks were quickly detected, and the algorith was robust againstodel uncertainties. Moreover, it allows for a decentralised ipleentation. REFERENCES Basseville, M., and I.V. Nikiforov (1993). Detection of Abrupt Changes: Theory and Application. Prentice Hall Bedjaoui, N., X. Litrico, D. Koenig and P.O. Malaterre (26). H observer for tie-delay systes Application to FDI for irrigation canals Proceedings of 45th IEEE CDC, pp. 532-537, San Diego, US. Bos, M.G. (Ed.) (1978). Discharge easureent structures. InternationalInstitute forlandreclaationand Iproveent/ILRI, Waageningen, The Netherlands. Cantoni, M., E. Weyer, Y. Li, S.K. Ooi, I. Mareels and M. Ryan (27). Control of Large-Scale Irrigation Networks. IEEE Proceedings special issue on The Eerging Technology of Networked Control Systes, Vol. 95, no. 1, pp. 75-91. Dulhoste, J. -F., D. Georges, and G. Besancon (24). Nonlinear control of open-channel water flow based on collocation control odel. Journal of Hydraulic Engineering, pp. 254-266. Eurén, K., and E. Weyer (27). Syste identification of irrigationchannels with undershot andovershotgates. Control Engineering Practice, Vol. 15, no 7, pp. 813-824. Goez, M., J. Rodellar, and J.A. Mantecon (22). Predictive control ethod for decentralised operation of irrigation canals. Applied Matheatical Modelling Vol. 26, pp. 139-156. Gustafsson, F. (2). Adaptive Filtering and Change Detection. John Wiley. de Halleux, J., C. Prieur, J. -M. Coron, B. d Andréa-Novel and G. Bastin (23). Boundary feedback control in networks of open channels, Autoatica, Vol. 39, no. 8, pp. 1365-1376. Litrico X., V. Froion, J.-P. Baue, C. Arranja and M. Rijo (25). Experiental validation of a ethodology to control irrigation canals based on Saint-Venant equations, Control Engineering Practice, Vol. 13, no. 11, pp. 1425-1437. Mareels, I., E. Weyer, S. K. Ooi, M. Cantoni, Y. Li and G. Nair (25). Systes engineering for irrigation systes: Successes and challenges. Annual Reviews in Control (IFAC), Vol 29. pp. 191-24. Ooi, S.K., M. P. M. Krutzen and E. Weyer (25). On physical and data driven odelling of irrigation channels. Control Engineering Practice Vol. 13, No. 4, pp. 461-471. Ooi, S.K., and E. Weyer (27). Control design for an irrigation channel for physical data, Proceedings of 27 IEEE Multi-conference on Systes and Control, pp. 27-275, Singapore, October 27. Page, E.S. (1954). Continuous inspection schees. Bioetrika, Vol. 41, pp. 1-115. Schuurans, J., A. Hof, S. Dijkstra, O.H. Bosgra and R. Brouwer (1999). Siple water level controller for irrigation and drainage canals. Journal of Irrigation and Drainage Engineering, Vol. 125. no. 4, pp. 189-195. Weyer, E. (21). Syste identification of an open water channel Control Engineering Practice Vol. 9, pp. 1289-1299. Weyer E. (28). Control of irrigation channels. To appear in IEEE Trans on Control Systes Technology. 7918