design of a combined observer-controller for irrigation canals

15
Water ResourcesManagement 5: 217-231, 1991. Q 1991 Kluwer Academic Publishers. Printed in the NetherIan&. 217 DESIGN OF A COMBINED OBSERVER-CONTROLLER FOR IRRIGATION CANALS J. Mohan Reddy University of Wyoming Department of Agricultural Engineering Laramie, Wyoming 82071 USA ABSTRACT.Using a linear distributed model of open-channel flow, the canal operation problem was formulated as an optimal control problem, and an algorithm for the gate opening in the presence of unknown external disturbances(changes in flow rate demands) was derived by solving the algebraic Riccati equation. An observer was designed to estimate the values for depth of flow and flow rates at the intermediate nodes based upon measured values of depth at the upstream and downstream ends of a pool. Considering an example, the changes in depths and gate opening obtained from the linearized model were compared with the results obtained from the nonlinear hydrodynamic equations. For an external disturbance of 20% of the initial flow rate in the pool, the difference between the two models in predicting the variation in the upstream and downstream water surface elevations and the change in the upstream gate opening was insignificant. Keywords. Linear distribution model, open-channel flow, canal operation problem, observer-controller, irrigation canals. 1. Introduction With the ever increasing demand for water, the need for improved management of the available water resources is of utmost importance, particularly when the development of new water resources is prohibitively expensive. right quantity Providing the of water at the right time would increase agricultural production. The supply oriented systems have not been able to provide the needed flexibility in terms of water quantity and timing to achieve improved crop yields and water use efficiency. This calls for a more flexible delivery schedule called demand delivery. However, a system designed for a true demand delivery would need a larger canal capacity. A compromise between flexibility and cost would be a limited- rate demand system. Though the on-demand type of delivery schedule offers the flexibility from the farmer's point of view, the operation of the system becomes difficult because of the unknown demands or variations in demands (disturbances). In the past, Zimbelman

Upload: j-mohan-reddy

Post on 10-Jul-2016

213 views

Category:

Documents


1 download

TRANSCRIPT

Water Resources Management 5: 217-231, 1991. Q 1991 Kluwer Academic Publishers. Printed in the NetherIan&.

217

DESIGN OF A COMBINED OBSERVER-CONTROLLER FOR IRRIGATION CANALS

J. Mohan Reddy University of Wyoming Department of Agricultural Engineering Laramie, Wyoming 82071 USA

ABSTRACT. Using a linear distributed model of open-channel flow, the canal operation problem was formulated as an optimal control problem, and an algorithm for the gate opening in the presence of unknown external disturbances(changes in flow rate demands) was derived by solving the algebraic Riccati equation. An observer was designed to estimate the values for depth of flow and flow rates at the intermediate nodes based upon measured values of depth at the upstream and downstream ends of a pool. Considering an example, the changes in depths and gate opening obtained from the linearized model were compared with the results obtained from the nonlinear hydrodynamic equations. For an external disturbance of 20% of the initial flow rate in the pool, the difference between the two models in predicting the variation in the upstream and downstream water surface elevations and the change in the upstream gate opening was insignificant.

Key words. Linear distribution model, open-channel flow, canal operation problem, observer-controller, irrigation canals.

1. Introduction

With the ever increasing demand for water, the need for improved management of the available water resources is of utmost importance, particularly when the development of new water resources is prohibitively expensive. right quantity

Providing the of water at the right time would increase

agricultural production. The supply oriented systems have not been able to provide the needed flexibility in terms of water quantity and timing to achieve improved crop yields and water use efficiency. This calls for a more flexible delivery schedule called demand delivery. However, a system designed for a true demand delivery would need a larger canal capacity. A compromise between flexibility and cost would be a limited- rate demand system.

Though the on-demand type of delivery schedule offers the flexibility from the farmer's point of view, the operation of the system becomes difficult because of the unknown demands or variations in demands (disturbances). In the past, Zimbelman

218 JMOHANRBDDY

(19811, and Burt(1983) have developed some gate control algorithms for operation of irrigation canals. Buyalski and Serfozo(l979) developed the EL-FL0 (Electronic Filter Level Offset) method based upon analog control and a single measurement at the downstream end of the pool. In all these methods, the coefficients in the control algorithm were derived by extensive simulations of the unsteady open-channel flow equations. Recently, Corriga et al (19821, and Balogun(1985) applied the optimal control theory concepts to the operation of irrigation canals. The procedure presented by Corriga et al is tedious, and Balogun's work did not consider the problem of external disturbances (changes in the water withdrawal rates) acting on the system. In addition, all these techniques were developed for a centralized control system, except the one by Burt(1983) which is based upon local control. Hence, the need for a simple procedure to derive control algorithms to operate irrigation canals in the presence of external disturbances is obvious.

Reddy(1990) presented a local optimal control technique for operation of irrigation canals in the presence of external disturbances. The control algorithm was developed assuming that all the state variables would be measured and used in the feedback loop (state feedback) for a given canal pool. This is very expensive when the number of state variables is more, and if flow rates are to be measured. Under these circumstances, an 'estimator' or 'observer' can be used to estimate values for all the state variables given measured values for one or two state variables. These estimated values can then be used in the state feedback loop. Therefore, the objective of this paper is to present a combined observer-controller design technique for operation of irrigation canals in the presence of unknown external disturbances, and to evaluate the performance of the control algorithm using the nonlinear hydrodynamic model of open-channel flow. The analysis is based upon discrete linear optimal control theory.

2. Mathematical Models

In the operation of irrigation canals, decisions regarding the gate opening in response to unknown(random) changes in the water withdrawal rates into the lateral or branch canals is required to maintain the depth of flow or the volume of water in a given pool at the target value. This problem is similar to the process control problem in which the state of the system is maintained close to the desired value by using real- time feedback control. The linear control theory is well developed and is easier to apply than the nonlinear control theory. Therefore, to apply the linear control theory, the Saint-Venant equations of open-channel flow were linearized, and the results obtained using the linear model were evaluated

A COMBINED OBSERVER-CONTROLLER FOR IRRIGATION CANALS 219

using the nonlinear hydrodynamic model. The Saint-Venant equations are given as follows:

aY - = -- at 1,(2+.)

aQ ( a$ -=- II at ax + c&Y ax - s, + Sf)

(1)

in which y = depth of flow, m; Q = flow rate , m3/s; T = top width, m; A = cross-sectional area of flow, m2; S, = canal bed slope; S, = friction slope = Q(Ql/ K2; g = acceleration of gravity, m/s2; q = lateral outflow (or inflow), n?/s/m; K = hydraulic conveyance of the channel =(AR213)/n; n = Manning's friction coefficient: R = hydraulic radius, m; t = time, set; and x = distance, m.

In Eqs. 1 and 2, the spatial derivatives were replaced by finite-difference approximations, by dividing the pool into few segments (N number of nodes). The central-difference scheme was used for the interior nodes (l<J<N), and the forward-difference and the backward-difference were applied to the first and the last nodes, respectively. The turnout was located at the downstream-end of the pool (Fig. 1). To solve

gate i length of reach gate i+l reservoir . .

~ reservoir y(i-1,N)

-Q Y y(i+. ,l)

1 v’

3 4 Reach i

Node numbers lateral withdrawal

Figure 1. Schematic of an irrigation canal pool. The pool is bounded by upstream and downstream reservoirs.

these equations, the boundary conditions at the gate need to be specified. These boundary conditions were expressed in terms of the continuity and the gate discharge equations given by:

220 J.MOHANRBDDY

Continuity Equation:

Qi,N = Qi+l,l + qi (3)

Gate Discharge Equation:

Qi,l = Cd bi Ui 429 (Vi-l,, - yi,lT (4)

Qi,N = Cd bi+l Ui+l \/2g (Yi,N - Yi+l,l) (5)

in which C, = gate discharge coefficient: b, = width of gate 1, m; ui = opening of gate i, m; Y~+~,~= upstream water surface elevation at the first node of pool i+l, m; yI,N = downstream water surface elevation at the last node of pool i, m; Qi,l = flow rate through the upstream gate of pool i, m3/s; Qi,N = flow rate through the downstream gate of pool i, m3/s; q, = flow rate through the turnout in pool i, m3/s/m; i = reach index: and j = node index.

2.1 LINEARIZATION OF THE SYSTEM EQUATIONS

The linearized model was derived based upon an initial steady state condition. Using the Taylor series around the equilibrium point and truncating terms higher than the first- order, the deviation variables were defined as follows:

8Qi.j = Qi,j - QT,j

8yi.j = Yi,j - Yi0.j

(‘5)

(7)

i3ui = ui - up (8)

8ui+l = ui+l - l&l

8qi,j = Qi,j - qio*j

(9)

(10)

in which 6Qi,j = variation in flow rate at node j of pool i, m3/s; 6~,,~ = variation in depth of flow at node j of pool i, m; 6u, = variation in upstream gate opening of pool i, m; 4+1 = variation in downstream gate opening of pool i, m; and 6q,,, = variation in water withdrawal rate at node j of pool i, m3/s/m. Substitution of the above relationships into Eqs. 1 and 2, after applying the finite-difference technique, results in a set of linear equations (Balogun 1985).

A COMBINED OBSERVER-CONTROLLER FOR IRRIGATION CANALS 221

3. Control Theory

The set of linear equations obtained can be presented in a compact form as follows:

by(t) = H 6x(t) (12)

in which 6x(t) = fJ x 1 state vector; au(t) = m x 1 control vector; A = e x e matrix of coefficients referred to as the system matrix: B = e x m control distribution matrix: C = e x k disturbance distribution matrix; 6q(t) = k x 1 matrix representing external disturbances acting on the system: 6y(t) = r vector of outputs; H = a constant r x e matrix: e = number of variables in the system; m = number of controls: k = number of distributed disturbances acting on the system: and r = number of outputs. The discrete-time equivalent of Eqs. (11) and (12) is given by

bx(k+l) = a 6x(k) + r au(k) + 'p ig(k)

iy(k) = H 6x(k) (14)

in which i, r and 'P = discrete-time versions of matrices A, B and C. Equations (11) and (12) or Eqs.(l3) and (14) can be used to simulate the canal dynamics given the initial conditions, the external disturbances acting on the system, and the gate opening. The model would predict the evolution of the system as a function of time. However, in canal operations the gate opening is the unknown. To achieve a desired system dynamics given the initial condition and the disturbances, the selection of an appropriate gate opening becomes a trial and error procedure. The concepts of control theory can be applied to eliminate this trial and error procedure, and derive a direct solution for the gate opening in the presence of disturbances. To apply control theory, the matrices i, I', and P must satisfy the stability, controllability and observability properties(Kwakernaak and Sivan 1972; Kailath 1980; Reddy 1990).

3.1 CONTROLLER DESIGN

The objective of optimal control theory is to find a control law to satisfy the operation of the gate opening in response to the external disturbances, with an acceptable range. In the Linear Quadratic Regulator Theory, the cost function to be minimized is given by:

222 J.MOHANREDDY

J = 5 [8x(k) t Q 8x(k) +8u(k) t R bu(k)l k-l

(15)

where Qtxr = state cost weighting matrix; and R = control cost weighting matrix. The control law for these systems is given by:

bu(k) = -KiX(k) (16)

where XC = the controller gain matrix obtained by solving the matrix Riccati equation. In the implementation of the above control law, it is assumed that measured values for all the state variables are available for feedback (Fig. 2).

Figure 2. Feedback control system with integral control. The estimated values were used in the control loop.

The control law defined by Eq. 16 brings an initially disturbed system to equilibrium condition in the absence of any external disturbances acting on the system. In the operation of irrigation canals, known or unknown disturbances (changes in lateral withdrawal rates) act on the system. In the presence of these external disturbances, the system cannot be returned to the equilibrium condition using the above control law. An integral control can be used to return the system to the equilibrium condition in the presence of externaldisturbances(Kailath 1980;Kwakernaak and Sivan 1972). The integral feedback is achieved by appending additional state variables of the form

A COMBINED OBSERVER-CONTROLLER FOR IRRIGATION CANALS 223

bxJk+l) = D bx(k) + bx,Ud (17)

to the system dynamic equation (Eq. 13 ). This produces a new control law of the form

&z(k) = -KIbx(k) - K, 6x,(k) (18)

The first term in the above equation accounts for the initial disturbances, whereas the second term accounts for the external disturbances (Fig. 2).

2.2 DESIGN OF OBSERVER

It is very expensive to measure all the state variables particularly the flow rates. An 'estimator' or 'observer' can be used to minimize the number of state variables that need to be measured. An observer is a mathematical model of the given system which predicts values for the state variables that are not measured based upon measured values of a few state variables. The observer is basically driven by the error between the measured and predicted values of the selected variables in the system. The observer equation is given as

bf(k+l) = Cp 8f(k) + I'iu(k) + L,[y(k) - HIM(k)] (19)

in which &a(k) = estimated values of the state variables; and L = observer gain matrix. The values of the elements in matrix L depend upon the eigenvalues of the characteristic equation of the estimator-error equation. The Ackermann's formula was used to design the observer. When the estimated values of the state variables are used in the feedback loop, the controller equation(Eq.18) becomes

hi(k) = - Kbf(kf - K, bx,(k) (20)

This equation was used in controlling the irrigation canal by measuring the depths of flow only at the upstream and downstream ends of the pool.

4. Nonlinear Model

Once the controller and the observer are designed, the dynamics of the linear system can be simulated for any arbitrarily selected values of external disturbances. However, since the actual system (flow in irrigation canals) is nonlinear, the performance of the controller and the observer cannot be judged based upon the dynamics of the linear system. In lieu of an actual canal, the nonlinear model of open-

224 J.MOHANREDDY

channel flow is needed to test the performance of the controller and the observer designed based upon the linear model.

The nonlinear equations of open-channel flow were solved using an implicit finite-difference scheme combined with the double-sweep method (Hromadka, Durbin and DeVries, 1985). A single reach of a canal was considered. This model predicts the flow rate, Q(x,t), and the depth of flow, y(x,t), given the initial and the boundary conditions. The controller and the observer equations were added as subroutines to this program. Given the initial flow rate and the target depth at the downstream end of the pool, the model computed the backwater curve. Later on, the downstream flow requirement and the withdrawal rate into the lateral were provided as a boundary condition. The model predicted the depths and flow rates at the nodal points for the next time increment. The computed depths at the upstream and downstream ends of the pool were used with the observer to estimate the flow depths and flow rates at some selected nodal points. These predicted values were then used inthe controller subroutine to estimate the change in the upstream gate opening in order to bring the depth at the downstream-end of the pool close to the target depth. Based upon this gate opening, the new flow rate into the pool at the upstream-end was calculated. This flow rate provided the boundary condition at the upstream-end of the pool. This process was repeated for the entire duration of simulation.

5. Results and Discussion

An example problem was considered in the simulation study. The pool was divided into four segments with five nodes. Data presented in Table I were used to derive the elements of the linearized model, which was then converted into a discrete- time version using a sampling interval of 30 seconds. The downstream depth was used in the integral feedback. Therefore, the form of the integral feedback matrix was as follows:

D = [ 0 0 0 0 0 0 0 1 O]

which was appended to the system dynamic equation, by adding an additional state variable, 6X,, to the problem. It must be emphasized here that, by using one control variable (upstream gate) per pool, only one variable (either the volume of water in the pool or the depth of flow at any one point) can be controlled at the target value. In this case, the depth of flow at the downstream-end of the pool was selected as the target depth; however, depth at any other node can be selected as the target depth. Using the above value of D, and setting R= 500,000 and Q = I, the following elements were obtained

A COMBINED OBSERVER-CONTROLLER FOR IRRIGATION CANALS 225

for the controller gain matrix:

K=[O.ll 0.42 0.003 0.64 0.0002 0.56 0.003 0.62 0.0014]

in which the last element accounts for the integral feedback.

Table I. Data Used in the Simulation Study

Number of pools Length of pool, m Canal bottom slope, m/m Canal bottom width, m Canal side slope, m/m Manning's roughness Number of nodes per pool Upstream invert elevation of pool, m Downstream invert elevation of pool, m Upstream reservoir water surface elevation, m Downstream reservoir water surface elevation, m Required flow rate at end of pool, m3/s Flow rate through turnout, m3/s Gate width, m Gate discharge coefficient Disturbance, m3/s

1.000 7000.000

0.000108 12.250

1.500 0.015 5.000

102.268 101.512 105.790 103.612 40.000

9.000 18.250

0.830 10.000

Duration of Simulation, set 14400.000

It was assumed that measured values for the depth of flow at the upstream and downstream ends of the pool were available for feedback. The values for the rest of the state variables were obtained by using the observer. The following form of the output matrix was used

1 100000000 ST= 000000010 I

in obtaining the elements of the observer gain matrix L. The elements of matrix L are presented below:

0.27 -0.18 -27.39 0.21 32.65 0.13 9.32 0.038 0.00 L=

-0.05 0.26 16.97 -0.24 -54.44 1.05 16.69 0.232 0.00 1 '

The elements of the controller gain matrix K and the observer gain matrix L were included as subroutines in the unsteady open-channel flow model to simulate the dynamics of the canal in the presence of external disturbances acting on the system. In the simulation study, several values were considered for the disturbances. However, only the results

226 J.MOHANREDDY

obtained for a disturbance of 20 % of the flow rate in the canal are presented here.

First the system dynamics was simulated using Eqs. 13 and 18, assuming that values for all the state variables were available for feedback. The variation in the upstream gate opening in response to the disturbance of 10 m3/s was 0.27 m (Fig. 3). Similarly, the maximum variation in the depth of flow at the downstream end of the pool was -0.13 m (Fig. 4). However, as the additional water released into the pool reached the downstream end, the depth of flow gradually moved up towards the target depth. Then the observer was used to simulate the system dynamics. Since the observer usually assumes that the deviation of the system variables at the beginning of the simulation period is zero, the behaviour of the model in terms of predicting the upstream gate opening and the deviation in the depth of flow at the downstream end of the pool was slightly erratic: however, as the time progressed, there was no difference in the results obtained using the state feedback and the results obtained using the output feedback (Figs. 3 and 4). In less than an hour, the difference between the two models was insignificant. It is obvious that the performance of the combined observer- controller algorithm in operating the irrigation canal was satisfactory.

Since the flow in canals is nonlinear in nature, the controller was used in conjunction with a nonlinear unsteady open-channel model to evaluate the performance under simulated field conditions. Once again, the performance of the controller was evaluated first assuming that values for all the state variables (8 in this case) were available. The variation in the upstream gate opening and the deviation in the depth of flow at the downstream end of the pool were found to be satisfactory(Figs. 5 and 6). Obviously, there was some difference between the linear model and the nonlinear model in predicting the gate opening. However, the difference in predicting the deviation in the downstream depth was insignificant between the two models. Both the models (linear and nonlinear) maintained the downstream depth at the target value.

Finally, the performance of the combined observer- controller was evaluated by using it as a subroutine in the open-channel flow model. The predicted variation in the upstream gate opening and the deviation in the depth of flow at the downstream end of the pool were erratic at the beginning of the simulation period, but settled down to a more or less constant value after an hour of simulation (Figs. 7 and 8). This time period is insignificant compared to the total operation period of the canal in a given season.

A COMBINED OBSERVER-CONTROLLER FOR IRRIGATION CANALS 227

‘;;:

SIMULATION FOR A SINGLE REACH disturbance : 10 m-3/6

a

i 0.4

P e -0.1 I I I I I n 0

ril

Figure 3. Predicted variation in upstream gate opening in response to the disturbance. Results were obtained using the linear model.

SIMULATION FOR A SINGLE REACH Di6tUrb6nC6 : 10 m-3/6

c h 0.3 a

; 0.2-

upstream-with observer

upstream-without observer

e

i 0.1

downstream-with observer

0 m Durkm 40f SifLa&n, 22 (tL3&Js~‘6

Figure 4. Predicted variation in the upstream and downstream depths of flow in the pool in response to the -disturbance. Results were obtained using the linear model.

228 J.MOHANRRDDY

C SlMULATlON FOR A SINGLE REACH

h Disturbance : 10 m-3/8

a n 0.4

9

linear model

I n 0 16

I-h

Figure 5. Predicted variation in the upstream gate opening of the pool. Results were obtained using state feedback(assuming all the states were measured).

V a r

SIMULATION FOR A SINGLE REACH disturbance - 10 m-3/8

h -0.2’ 0

m

Figure 6. Predicted variation in the depths of flow at the upstream and downstream ends of pool. Results were obtained using state feedback(assuming all the states were measured).

ACOMBINEDOBSERWR-CONTROLLERFORIRRIGATIONCANALS 229

SIMULATION FOR A SINGLE REACH disturbance : 10 m-318

a 0.0

6 0.5 -

i o.4 - n nonlinear model

G 0.3

a t

0.2 L

e 0.1 -

0 0’ P e -0.1 -I

II 0

Dur’ation’of ;imulLiorlY se: (thIusaZds)18 A

Figure 7. Predicted variation in the upstream gate opening of the pool. The estimated values for the state variables were used-in predicting the gate opening.

SIMULATION FOR A SINGLE REACH disturbance : 10 m-3/8

C h 0.3 a

; 0.2 e

i 0.1 n

J 0 100 200 300 400 500 m Duration of Simulation, set (thousands)

D O e

‘: r&ream-with observer

-0.1

h downstream-without observer

’ -0.2

Figure 8. Predicted variation in the depths of flow at the upstream and downstream ends of the pool. The nonlinear model along with the observer was used to simulate the results.

230 J.MOHANREDDY

It should be emphasized here that under actual field conditions, the unsteady model is not required. Only the elements of the controller gain matrix and the observer gain matrix are needed.

6. Conclusions

The performance of the gate controller algorithm derived using the control theory concepts was found to be satisfactory. The control theory provides a direct way to solve for the elements of the controller algorithm. In addition, the observer eliminates the need for measuring more than two depths (upstream and downstream) per pool. In some cases it may be necessary to measure three depths per pool. The procedure presented is very appropriate to derive a control algorithm to run irrigation canals on either demand or limited-rate demand delivery schedule. Considering only a single pool of a canal, the results so far have been very encouraging. Research is currently underway to extend the same concepts to multiple pools.

7. References

Balogun, 0. (1985). 'Design of real-time feedback control for canals systems using linear-quadratic regulator theory'. Ph.D. thesis, University of California, Davis, California.

Burt, C. M. (1983). 'Regulation of sloping canals by automatic downstream control'. Ph.D. thesis, Utah State University, Logan, Utah.

Buyalski, C. P., and Serfozo, E. A. (1979). 'Electronic filter level offset (EL-FLOW) plus reset equipment for automatic control of canals I. REC-ERC-79-3, Engineering Research Center, U.S. Bureau of Reclamation, Denver, Colorado.

Corriga, G., Sanna, S., and Usai, G. (1982). 'Sub-optimal level control of open-channels'. Proceedinas of the International ASME Conference, Paris, France.

Hromadka, T., Durbin, T.J., and DeVries, J.J. (1985). Computer Methods in Water Resources. Lighthouse Publications, Mission Viejo, California.

Kailath, T. (1980). Linear Svstems. Prentice-Hall, Englewood Cliffs, New Jersey.

Kwakernaak, H., and Sivan, R. (1972). Linear Ootimal Control Systems. John Wiley and Sons, New York.

A COMBINED OBSERVER-CONTROLLER FOR IRRIGATION CANALS 231

Reddy, J.M. (1990). 'Local optimal control of irrigation canals'.Journal of Irrisation and Drainacre Enaineerinq, ASCE, 116(5):616-631.

Zimbelman, D.D. (1981). 'Computerized control of an open- channel water distribution system'. Ph.D. thesis, Arizona State University, Tempe, Arizona.