Model based control for run-of-river system . Part 2 : Comparison of control structures

Optimal operation and control of a run-of-river hydro power plant depend on good knowledge of the elements of the plant in the form of models. Both the control architecture of the system, i.e. the choice of inputs and outputs, and to what degree a model is used, will affect the achievable control performance. Here, a model of a river reach based on the Saint Venant equations for open channel flow illustrates the dynamics of the run-of-river system. The hyperbolic partial differential equations are discretized using the Kurganov-Petrova central upwind scheme see Part I for details. A comparison is given of achievable control performance using two alternative control signals: the inlet or the outlet volumetric flow rates to the system, in combination with a number of different control structures such as PI control, PI control with Smith predictor, and predictive control. The control objective is to keep the level just in front of the dam as high as possible, and with little variation in the level to avoid overflow over the dam. With a step change in the volumetric inflow to the river reach (disturbance) and using the volumetric outflow as the control signal, PI control gives quite good performance. Model predictive control (MPC) gives superior control in the sense of constraining the variation in the water level, at a cost of longer computational time and thus constraints on possible sample time. Details on controller tuning are given. With volumetric inflow to the river reach as control signal and outflow (production) as disturbance, this introduces a considerable time delay in the control signal. Because of nonlinearity in the system (varying time delay, etc.), it is difficult to achieve stable closed loop performance using a simple PI controller. However, by combining a PI controller with a Smith predictor based on a simple integrator + fixed time delay model, stable closed loop operation is possible with decent control performance. Still, an MPC gives superior performance over the PI controller + Smith predictor, both because the MPC uses a more accurate prediction model and because constraints in the operation are more directly included in the MPC structure. Most theoretical studies do not take into account the resulting time delay caused by the computationally demanding MPC algorithm. Simulation studies indicate that the inherent time delay in injecting the control signal does not seriously degrade the performance of the MPC controller.


Introduction 1.Background
Due to the widespread use of run-of-river hydropower systems and their importance for power production, it is of interest to study possible control structures for such systems.In a first part of this study, a model for a run-of-river system has been developed and discretized using the Kurganov-Petrova central upwind scheme; the model was tuned against experimental data.It is of interest to use this model for comparison of various control structures for controlling a run-of-river hy-dropower system.In the simplest case, an autonomous run-of-river plant can be considered, with volumetric inflow to the reach as well as volumetric outflow from the reach as inputs.The water level at the outlet, in front of the dam, should be as high as possible in order to maximize the power available to the turbines.However, overflow of water over the dam implies loss of production, thus it is important to reduce the dam level variation.Typically, the autonomous plant will use the outflow to produce electricity, thus the outflow is specified by production planners and can be considered a disturbance.The control signal for manipulating the level is thus the inlet flow to the river reach.
Alternatively, the control problem could be reversed: if the inlet flow to the reach in reality is a disturbance, e.g.inflow due to precipitation, inflow from another power plant, etc., the production of power may be considered the control signal used to manipulate the dam level.
More generally, it is possible to consider a sequence of run-of-river systems along a river, and attempt to optimize the control of the total system.River Tinnelva in Telemark, Norway, holds five run-of-river power plants, where the two uppermost ( Årlifoss and Grønvollfoss) are operated by Skagerak Energi AS.In this initial study, the power plant at Grønvollfoss is considered an autonomous power plant.

Previous work
The control of the water level ahead of the power plant plays a significant role both in the power production itself and in the operation of the plant in general.In a previous work by Vytvytskyi (2015), model based control of the Grønvollfoss power plant was studied using the Saint Venant equations discretized with a staggered grid scheme.In another work by Vytvytskyi et al. (2015), a better algorithm for discretizing the Saint Venant equations was implemented, together with improved fitting of the model to experimental data from the Grønvollfoss power plant.Long rivers with many run-of-river plants constitute large scale control and optimization problems; the application of e.g.Model Predictive Control has recently been studied for such systems (Schutter and Scattolini, 2011).

Overview of paper
In this paper, the high resolution discretization of the model of the Grønvollfoss power plant from Vytvytskyi et al. (2015) is used to compare PI control with and without Smith predictor with a model predictive control scheme.The control objective is to keep the water level in the river reach just in front of the dam as high as possible, with little variation under disturbances.The paper is structured as follows: Section 2 gives a functional description of the run-of-river power plant.
Section 3 presents the model of the river reach, the model parameters, and a step test with results which is used to find a simple integrator + time delay model to be used in the Smith predictor.Section 4 presents five different control structures for controlling the dam level.The results are discussed in Section 5, and conclusions are drawn in Section 6.

Functional description
For this run-of-river system, there are two inputs (control input, disturbance) and several possible outputs (measured/performance output) which constitute the control architecture, and which will affect the control performance; see Figure 1.When the Grønvollfoss plant is considered an autonomous plant, the control input could be the outlet flow rate Vout from the river reach (flow through the turbine and possibly through the flood gate opening at Grønvollfoss power plant).In this case, the upstream inlet flow rate to the reach (outlet from Årlifoss power plant) would play the role as a disturbance.Alternatively, the outlet flow rate from Grønvollfoss could be considered given by production planners and as such be considered a disturbance; in this case, the upstream inlet flow rate from Årlifoss would be the control input.
Measured outputs can e.g.be the power production in the Grønvollfoss power plant, the level ahead of the Grønvollfoss dam, and also any other level measured in the river/dam between Årlifoss and Grønvollfoss, e.g. the level exactly after Årlifoss power plant.The power production can also be considered a performance output; however if the outlet flow is specified by production planners, the power production is not a natural performance indicator.The variation of the level ahead of the Grønvollfoss dam can also be a performance output, since this level should be as constant as possible to avoid variation in production.
Here, the Grønvollfoss power plant is considered an autonomous unit.The control input and disturbance pair could thus be the outlet flow rate through the turbine Vout , and the inlet flow rate Vin , respectively.Alternatively, we could consider the control input and disturbance pair to consist of the inlet flow rate and the outlet flow rate, respectively.The power production in the Grønvollfoss power plant and the level ahead of the Grønvollfoss dam are measured.
3 Model presentation

Saint Venant equations
The model of the shallow water system consists of the Saint Venant equations, which are partial differential equations.These equations describe the behavior of the river and are based on the mass and momentum balances, and are tricky to solve numerically.A common way to present the Saint Venant equations for a rectangular channel is in vector form as follows (Sharma, 2015): where: with boundary conditions: Here, A is the wetted cross section area, V is the discharge (the volumetric flow rate), g is the gravitational acceleration, S 0 is the bed slope, S f is the friction slope and w is the width of the river (rectangular channel).
The Finite Volume method is commonly used for solving the shallow water equations.In this work, the Kurganov-Petrova central upwind scheme (Kurganov and Petrova, 2007), which is a second order scheme, is used for the Finite Volume discretization of the run-ofriver model.Details of this scheme are given in Sharma (2015).

Model parameters
The parameters for the model used in this work, are given in Table 1.

Step test and simplified model
In order to design a simple controller for the run-ofriver system, an approximate model consisting of integration, (possibly) time delay and gain is first identified.Figure 2 shows the response from a step test with the outlet flow rate as the control signal, while Figure 3 shows the response from a step test with the inlet flow rate as the control signal.
As seen from these figures, a coarse approximation of the system model is a transfer function as follows: The process gain can be found from the slope of the water level change: Here, h is the step of the water level in some time interval t and V is the step of the control signal.
For the first case, when the control signal is the outlet flow rate, the process gain is K = −0.028/600.40= −1.667• 10 −6 [1/m 2 ] and the time delay τ = 0sec (see Figure 2).In the second case, when the control signal is the inlet flow rate, the process gain is the same but with positive sign: K = 0.028/600.40= 1.667 while the time delay in this case is approximately τ = 720sec (see Figure 3).

Control
4.1 PID controller

PID controller design
The control loop for the system is shown in Figure 4, where the measured signal (the water level ahead of the Grønvollfoss power plant) is compared with the set point (reference value for this level).Then this difference is fed back to the control block, where the control signal is calculated and then injected into the process block (the model of run-of-river system).In the control block, a discrete-time PID controller is implemented using the incremental or velocity algorithm, which is based on two steps (Haugen, 2010): 1.The incremental control value ( u k ) is calculated: 2. The absolute control value (u k ) is calculated:  Here, T s is the sampling interval.K p , T i and T d are controller parameters: control gain, integral time and derivative time, respectively.e is the control error calculated as e k = r k − y k , where r is the set point (reference) value and y is the measured output value from the system.For this system, the control signal has minimum and maximum constraints of the control value, which are 0 m 3 /s for the minimum value and 160 m 3 /s for the maximum.Some constraints for the incremental control value is also introduced ( The set point value is the normal water level ahead of the Grønvollfoss dam and is equal to 144.5 m.a.s.l (meter above sea level).It is a goal to keep the level as constant as possible to avoid variation in the power production.This is why the controller should be tuned to keep the water level ahead of the dam in a window constrained by ±1cm.The controller parameters are unknown and could be tuned for this system using known methods e.g.Good Gain, Ziegler-Nichols or Skogestad's methods (Haugen, 2010;Ruscio, 1992;Skogestad and Grimholt, 2012).

Tuning the PID controller with outlet flow rate as control signal
According to Skogestad's method (Haugen, 2009), a PI controller should be used for this type of system and the parameters for this controller can be found as: Here, T c is a tuning parameter.After some tuning this parameter is chosen to be T c = 300, which leads to controller parameters K p = −2850 and T i = 450.The results of simulating the system with this PI controller is shown in Figure 5, where the top plot shows how the water level ahead of the dam changes with respect to time, and the bottom plot shows the same dependency on time but for inlet (disturbance) and outlet (control signal) volumetric flow rates.Here the disturbance changes after 10 min from 120 m 3 /s to 145 m 3 /s and this new flow rate lasts for 15 min when it drops back to the previous value of 120 m 3 /s.Here, a sampling interval of 5 sec is used.
Figure 5 shows that this PI controller maintains the level close to the set-point.It is also of interest to check how control performance changes when the sampling interval is increased: the above simulation is repeated with identical controller parameters, but with sampling interval changed to 30 sec.The results of this simulation is shown in Figure 6.As the figure shows, increasing the sampling interval leads to inferior control in that the water level breaks the window of constraints, but has the positive effect of reducing the simulation time.Figure 6 also shows the results when the integral time of the of simulation the PI controller is increased, leading to a slightly improved performance (the water level satisfies the window of constraints).

Tuning the PID controller with inlet flow rate as control signal
The step test showed that for the case where the control signal is the inlet flow rate, the time delay in the control signal is considerable and it is expected that the performance of controlling the water level in this case will be inferior.For a system with long time delay and integral action, a simple P controller will suffice since the system itself provides integration.The results of simulating the system with various controller gains are presented in Figure 7.Here we see that the level does not stay close to the set point for any choices of controller gain; increasing the gain leads to a more rapidly oscillating behavior in the water level.With control gain equal to -2 the level is close to the set point initially, but then starts to oscillate and become unstable; Figure 8.As we can see from these figures, the inlet flow rate to the system is not really a good choice as control signal to control the water level ahead of the Grønvollfoss dam.

Tuning PID controller with Smith predictor
One way to improve the PID controller with the inlet flow rate as the control signal is to use a Smith predictor to compensate for the long time delay.The control loop for this case is presented in Figure 9, where for the Smith predictor (process without delay and process delay) the simplified model identified in Section 3 is used; the simplified transfer model is divided in two parts: • Transfer function without time delay (process without delay): h 1 st term (s) = K s .
• Transfer function for time delay (process delay): Again, a simple proportional controller is used to control the process without delay part.By simulating the system with Smith predictor, a suitable control gain of 10 was chosen when the sampling interval was set equal to 5 sec.It is seen form Figure 10 that a P controller with Smith predictor shows much better performance than without the Smith predictor, but still the water level ahead of the dam slightly breaks the window of constraints.Simulation results of the controlled system with a longer sampling interval (30 sec) is shown in Figure 11; this time with an increased control gain (70).This time, that the water level ahead of the dam also slightly breaks the window of constraints, but now it is not only the lower constraint that is broken as in Figure 10, but the upper constraint too.

Design of MPC
The optimization problem that is defined for use in the MPC, consists of both an objective function (criterion) which can be maximized or minimized, and constraints which should be satisfied.Using all information from the previous design of PID controllers, and also from the functional description of the system, the objective function is chosen as follows: Here, h d is the level ahead of the dam and h ref d is the set point value of that water level set to 144.5 m.a.s.l.The difference between these levels is the control error, which should be minimized.The control signal u c is either the inlet or the outlet flow rate.u c is the difference between the previous and current control values, which should be minimized in order to minimize variation in power production.N e is the prediction horizon length for the control error (between the real and referenced water level) and N u is the number of control errors weighed in the objective function.In this work, N e = N u .The weighting factor for the control error is λ e .
In this work, the following inequality constraints are used: • 0 ≤ u c ≤ 160 m 3 /s since Vout can not be more than 160 m 3 /s.
• −1.3 ≤ u c ≤ 1.3 m 3 /s/s since the outlet/inlet volumetric flow rate is not allowed to change faster than 1.3 m 3 /s per sec.With the objective function and constraints formulated, some other parameters for the MPC algorithm should be discussed.The length of the prediction horizon is an important tuning factor.Increasing the length smooths the operation, but increases the computational cost.The number of different control changes also affects the computational cost: if we make the length of the control change horizon N u equal to the prediction horizon N e , we can still reduce the number of unknowns.If we group the control changes into, say, two groups and require that every control change in a particular group has the same value, the number of unknowns in the optimization problem effectively becomes two instead of N u (the length of the control change horizon).

Tuning MPC with the outlet flow rate as the control signal
Here, the MPC will be tuned with different weighting factor for the control error in order to get results for the water level ahead of the Grønvollfoss dam that stays the closest to the set point.The simulations are made over a time period of 100 min with sampling time interval of 30 sec.The prediction horizon is N e = N u = 10, which means that the optimization problem consider a model prediction 5 min into the future (10×30 sec = 300 sec = 5 min) at each sample time.Using a grouping of control inputs with two groups, the number of control signals are reduced from 10 to only 2. The set point value for the water level ahead of the dam is made equal to 144.5 m.a.s.l.(HRV: Highest Regulated Value), which also gives the values for the upper and lower constraints for the controlled water level, equal to 144.51 and 144.49m.a.s.l., respectively.
The disturbance, which is the inlet flow rate, starts at time equal to 10 min and lasts for 15 min as in the case of PID controllers.After some tuning, the best results with MPC are found with weighting factor for the control equal to 2.86 • 10 6 .The results are shown in Figure 12.

Tuning MPC with the inlet flow rate as the control signal
Using the same criterion and constraints as before, but this time with the inlet flow rate as control variable and the outlet flow rate as disturbance, the MPC needs to be returned.After some experimentation, the following parameters are chosen: • The prediction horizon is set to N e = N u = 24, which means that optimization problem will be solved with model predictions of 12 min into the future (approximately equal to the time delay in the control signal).
• The sampling interval is 30 sec.
• The weighting factor for the control error equals 2 • 10 8 .
• Two groups of control changes are used, leading to a reduction from 24 unknowns in the optimization problem to 2 unknowns.
The results of simulating the system with MPC using these parameters, are shown in Figure 13, where the disturbance (the outlet flow rate) changes after 10 min from 120 m 3 /s to 145 m 3 /s and this new flow rate lasts for 15 min before decreasing to the original 120 m 3 /s.
Figure 13 shows that the MPC gives quite good results of keeping the water level close to the set-point, but also with MPC the lower constraint is broken for a short time -as it happened with PID controller + Smith predictor.
From the simulation in Figure 13, we observe that the time delay (ca.12 min) is longer than the 10 min that have passed before the disturbance in the outlet flow takes place.This implies that in the start-up of the MPC simulation, we have not really allowed the MPC to look fully 12 min into the future.Thus, it is of interest to see if the MPC could show better performance if it actually knew the disturbance 12 min before it takes place.To study this, we delay the initiation of the disturbance by 5 min and inject the step change in the outlet flow at 15 min instead of 10 min.The results of this simulation are presented in Figure 14, where the MPC has the same parameters as in Figure 13.
As seen from Figure 14, the water level ahead of the dam is now contained within the window of constraints.

Discussion
It is of interests to compare the studied control structures, and choose the best one.Firstly, the comparison of the PID and MPC controllers for the system with the outlet flow rate as the control signal is done.The results for both these controllers are compared in Figure 15.Here, the PID parameters are T s = 30, K p = −2850, T i = 1450 and the MPC parameters are λ e = 2.86 • 10 6 , N = 10 and T s = 30.Figure 15 shows that the MPC keeps the level ahead of   the power plant slightly better than PID, but of course, the simulation time for the MPC (≈ 1650 sec) is much longer than when using the simple PID controller (≈ 6 sec.); the PID controller can even show better results with shorter sampling time e.g. 5 sec (see Figure 5).Although MPC with a shorter time step will also show better control of the water level, the simulation time in that case will also be much longer.Control of the water level ahead of the dam using the outlet flow rate as the control signal is a relatively easy task, because of the direct action of this outlet flow rate upon the level ahead of the plant.This is why, using MPC is hardly justified with this control architecture.
Next, a comparison of the PID controller with Smith predictor and MPC controller will be done for the system where the inlet flow rate is the control signal.The results of simulation for both of these controllers are shown in Figure 16.Here, the PID parameters are T s = 30, K p = 70 and the MPC parameters are λ e = 2 • 10 8 , N = 24 and T s = 30.This figure shows that the MPC has better control than the PID for the water level ahead of the dam in the case when the inlet flow rate is a control signal and the long time delay for this process exists.This is reasonable, because the MPC uses full nonlinear model for prediction while the PID controller with Smith predictor uses a simplified linear model.In addition, the MPC directly includes the constraints in the water level.
A comparison between Figures 13 and 14 shows that if the disturbance is known perfectly for the entire prediction horizon (Figure 14), performance is better than if the disturbance is only partially known (only for 10 min of the horizon of 12 min at start-up) or uncertain.The simulation time for the MPC is much longer than that for the PID controller + Smith predictor, which is a considerable disadvantage.Moreover, the question arises whether this MPC enables the computation of the control signal within the sample time.To check this, the computation time in each time step for this MPC is presented in Figure 17.Here, it is seen that in the average, the computation time is somewhere between 10-20 sec, and only a handful of times is the computation time longer than the sampling interval.Still, this is problematic, because the MPC simulations are based on the assumption of zero computation time for the control signal, while the actual computation time (10-20 sec) implies that there will be a 10-20 sec delay before the control signal can be injected.It is thus of interest to know to what degree this delay of 10-20 sec will deteriorate the performance of the MPC.To check this, a time delay of 15 sec for the control signal is implemented in the simulation model representing the real river, and the results of the simulations are shown in Figure 18, where the water levels, which are controlled with instantaneous vs. delayed control signal (the inlet flow rate), are presented.This figure shows that the delay in injecting the control signal only leads to a minor deterioration in the performance of the MPC compared to the ideal case of zero computation time.The reason why the deterioration is small, is probably because the grouping of the control changes used in the MPC implies that the computed control signal should give decent performance if it is extended throughout the grouping period.There are only two values of the control signal for the whole prediction horizon, and the groups have been given equal length implying that that in each optimization step, the control signal is assumed to be constant the first 6 min.Thus, a relatively small time delay of 15 sec has only a small effect.
This study has considered a single, autonomous runof-river hydro power plant.Although PID (+ Smith predictor) seems to work well compared to the more advanced MPC strategy, control of a string of power plants along a river may change this result: in that case, the system becomes multivariable, and more complicated to solve.This will also further increase the computation time for MPC, and it may then be necessary to take large scale MPC techniques into use.

Conclusion
In this paper, different control structures have been explored for control of the water level in a run-of-river system has been explored.PID and MPC controllers were discussed together with two possibilities of control architecture: either use of the inlet volumetric flow rate, or the outlet volumetric flow rate as control variable.
The simulations showed that choosing the outlet flow rate as control signal makes the control problem quite easy and leads to very good control even if a PI controller is used.The reason for this is obvious: the outlet flow rate has direct impact on the water level ahead of the dam.However, there may be cases when the inlet flow rate has to be considered as control variable.In that case, the control problem is much more difficult due to the inherent time delay, and MPC gives certain advantages due to a more direct handling of constraints.Still, MPC is much more computationally demanding, leading to a time delay in the injection of the control signal to the system.However, a simple investigation indicates that the computational time delay does not severely deteriorate the performance of the MPC.The reason for this is probably the fact that grouping of control inputs imply that the MPC algorithm implicitly assumes that the control signal is constant for the extended time period of the grouped control inputs.
Apart from the particular results relevant for the run-of-river power plant, this study has also given an illustration of the usefulness of predictors when controlling systems with time delay.In particular, both MPC and PID + Smith predictor handle reasonably well the case of delay in the control input channel, while a controller without predictor struggles to cope with a system with considerable time delay.The more accurate the predictor (MPC with nonlinear model), the better the delay compensation.Furthermore, one example illustrated that when the disturbance is known perfectly in the entire prediction horizon, performance improved compared to when the disturbance is only known partially/is uncertain.

Figure 1 :
Figure 1: Functional description of run-of-river system.

Figure 2 :Figure 3 :Figure 4 :
Figure 2: The step test for the outlet flow rate as the control signal.

Figure 8 :
Figure 8: The results of long simulation with P controller (T s = 5 and K p = 2).

Figure 9 :
Figure 9: The control loop for the system (PID + Smith predictor).

Figure 10 :
Figure 10: The results of simulation of P controller with Smith predictor (T s = 5 and K p = 10).

Figure 11 :
Figure 11: The results of simulation of P controller with Smith predictor (T s = 30 and K p = 70).

Figure 15 :
Figure 15: Comparison of MPC and PID controllers, where the outlet flow rate is a control signal.

Table 1 :
Parameters of the river flow system.Level before dam, m.a.s.l.