A predictive controller based on transient simulations for controlling a power plant

A predictive governor based on an embedded, online transient simulation was commissioned at Tonstad power plant in Norway in December 2014. This governor controls each individual turbine governor by feeding them modified setpoints. Tonstad power plant consists of 4 × 160 MW + 1 × 320 MW high head Francis turbines. With a yearly production of 3888 GWh, it is the largest in Norway. The plant is a typical high head Norwegian plant with very long tunnels and correspondingly active dynamic behaviour. This new governor system continuously simulates the entire plant, and appropriate actions are taken automatically by special algorithms. The simulations are based on the method of characteristics (MOC). The governing system has been in full operational mode since December 19 2014. The testing period also included special acceptance tests to be able to deliver FRR, both on the Nordic grid and on DC cable to Denmark. Although in full operational mode, this system is still a prototype under constant development. It shows a new way of using transient analysis that may become increasingly important in the future with added power from un-regulated sources such as wind, solar and bio.


Introduction
Norwegian hydro power plants are connected to the Nordic grid. Some are in addition also supplying power via DC cables to the European continent. In recent years the frequency on the grid has worsened. This is believed to be caused by increased number of un-regulated producers and the commercialization of electricity production, where price mechanisms and trading (Nord Pool spot market) has created short transient imbalances in production and consumption. Only the last factor is well documented [ii] , and other reasons may also be important. The actual worsening of the frequency [1] is shown in Figure 1 as the number minutes per week the grid was outside specifications. This trend has caused the TSOs on the Nordic grid to take action. One of these actions is the introduction of Frequency Restoration Reserve, or FRR.
Tonstad power plant wanted to participate in delivering FRR, both to the Nordic grid and to the Skagerak 4 cable to Denmark. However, ever since the plant was increased with a 320 MW turbine, 50% increase in power, the plant could not be run fully automatically due to very difficult transient behavior. So difficult in fact it caused several accidents with flushing of gravel traps and damage to turbine wheels and guide vanes. FRR requires fully automatic operation because setpoints come to the plant remotely from the TSO, and the plant has only seconds to respond. A project was started in 2009 to create a system that would control the entire plant based on online transient simulation. This system should run the plant in the most optimal way regarding power surges, yet never allow any restrictions in the water ways to be compromised, surge shaft levels in particular. In addition the system should work as a protection system for the waterways, giving warnings and possibly take actions if something was compromised. Thus two systems were in fact developed. The predictive system to run the plant as optimal as possible while making FRR possible, and the waterway protection system to protect the waterway as well as monitor the predictive system.

Frequency Restauration Reserve (FRR)
The main frequency control of the grid is the so called static droop, also referred to as primary control, implemented in each turbine governor. Lower in the hierarchy is the day to day production planning via Nord Pool [8] . In addition there are more emergency related measures such as starting/stopping of plants and similar measures on the consumption side. Except the primary control, none of these measures are fast, accurate or automatic. In fact, some of the reason for Figure 1 is to be found in the low level of detail in the planning of the day to day production [1] , because the time resolution is 1 hour, while the actual consumption is gradual. FRR [2] was developed to be a fast and accurate means of restoring the frequency back to 50.00 Hz. A somewhat simplistic, but essentially correct view is that the droop, the primary control, acts as a proportional governor. It will always move the guide vanes in the correct direction, but there will also always be a static deviation in the frequency. FRR will remove the deviation, thus acting as an integrator and thereby freeing up the activated primary reserves for further frequency regulation. For the TSOs it is also a means of balancing the net. FRR is a form of LFC (Load Frequency Control), but FRR only has frequency as input and the emphasis is on fast frequency restoration within an entire grid.
FRR is not only useful for the Nordic grid. On DC cable transmissions from Norway to the continent, some percentage of the cable is typically reserved for FRR (or LFC as may be the case). The new 700 MW Skagerrak 4 cable from Norway to Denmark was put in commercial operation December 29 2014, and FRR started January 1 2015. The cable is more or less directly hooked on to Tonstad power-plant, serving all the FRR as well some of the energy transfer.

Plant level specification
FRR is a commercial service, and each power-plant can sell FRR capacity to the TSO and/or on cables to other grids. To be able to deliver FRR, a series of tests has to be done and approved by the TSO or cable operator. Each individual power plant will normally see only a small fraction of the total FRR available on the grid, and the TSO is free to distribute the capacity as they chose. So far the activation of reserves has been parallel and proportional to the available power. A system based on price is planned, where the least costly reserves are activated first [1] , referred to as merit order list. Each power plant has to reserve a "block" of production volume for FRR, and the TSO can then use that block as they chose. This block comes in the form of +-X MW where X can be a number from 5 MW and up. The actual specs for the Nordic grid is given in ref [3] . Figure 2 shows the FRR qualification test by Statnett for operation on the Nordic grid.

Possible problems with FRR
A typical Norwegian power-plant consists of one or several reservoirs, one or several tunnels, thousands of meters in length, surge shaft(s) and penstock. The period of oscillations in the surge shaft is typically 5-15 minutes. They were built before the spot market started, and were designed for steady energy production, filling the reservoirs during summer and fall, and tapping them during winter and spring. In later years, when Nord Pool started in the mid 90's, it has become an economical advantage to be able to produce lots of power for shorter periods of time during each day. The plants were refurbished (and still are), by increasing max power with larger and/or more turbines. This is often done without any modifications to the tunnels or shafts. The result is often the waterways becoming "too narrow" at max power. This is usually solved with restrictions of max power and max power increase within certain conditions. For manual operation, either local or remote, these restrictions pose no particular complications for a seasoned operator. However, when running FRR a large percentage of the plant is outside of the operator's control. Also the timing requirements are so strict that manual control would be unpractical and unreliable.
Another issue at play is power feedback. Turbine governors can run with power feedback, so the actual power produced (PV) is equal to the set-point (SP) plus any addition from the droop. There have been incidents of flooding and emptying of gravel traps when trying power feedback. The exact reasons are still debated, but it can be argued that running a plant with power feedback one will lose the finer control needed when surge shafts are at the lower limits at high power production, especially when precipitation and melting of snow enters the numerous creek shafts along the tunnels. When not running with power feedback, the PV will never hit exactly due to differences in levels and number of turbines in operation etc. Finer adjustments are therefore done manually. This is also the reason why turbines are not normally run in AGC (Automatic Generation Control) mode. Even though fully automatic power control is highly wanted and is already implemented in each turbine governor and in the AGC, these functions are usually turned off and the plants are operated manually due to a simple cost/risk analysis.
When implementing FRR, there is no practical way of running the plant manually anymore. FRR requires continuous fast and accurate response with time constants of seconds, not minutes or hours. Since the existing automatic modes (power feedback and the AGC) are not even good enough without the added complexity of FRR, a more intelligent automatic control system is needed

Tonstad Power Plant
Tonstad power plant is the largest hydro power plant in Norway with an annual production of 3888 GWh. The plant has a total nominal power of 960 MW with four 160 MW Francis and one 320 MW Francis. The layout is typical for plants built in Norway in the 60's and 70's with long tunnels between reservoirs and surge shafts and several large creeks entering at various places along the tunnels. At heavy precipitation and/or melting of snow, the major portion of the water can come from the creeks, not from the reservoirs, and this will affect the dynamic behaviour of the plant, and will also greatly change how much power the plant is able to produce. Water from the creeks will increase the available head, and lower the friction losses of the tunnels. Tonstad was originally built with the four smaller turbines. The fifth and larger turbine was added later. Therefore, also typical, the waterways are narrow for the total nominal power. Tonstad experienced the lack of control with power feedback when they emptied the gravel traps when power feedback was implemented. The power feedback and AGC has since then been turned off.
Then FRR came as a lucrative potential option at Tonstad. Not only FRR for the Nordic grid, but also FRR on the new Skagerrak 4 cable to Denmark. This sparked a development program that should end up in a new governing system enabling FRR and be fully automatic. It should also protect the waterways. "Full" FRR on the Nordic grid from Tonstad started December 19 2014, while FRR on the cable started January 1 2015.

The main method
LVTrans [5] is a transient simulation software for piping systems and is based on the method of characteristics (MOC [6] ). It is developed in LabVIEW and is open source with a BSD license where SINTEF and Bjørnar Svingen own the license. It has been used to simulate hundreds of plants in Norway and elsewhere by Rainpower, Hymatek, Statkraft, NTNU and SINTEF. Each pipe element is solved using MOC while each non-pipe element is solved analytically or numerically. It is "written" in LabVIEW [7] using the graphical "G" programming language. It is 100% transient software. There is no steady state solver, and the software behaves as a simulator running in real time or faster being fully interactive while running. It is 100% modular. Each element (pipe, turbine etc) are literally standalone elements that starts working when hooked up with other elements. Because it is written in "G", it can it can run on any computer that also runs LabVIEW (A PC/Mac, Compact RIO, even modern phones). It is possible for any external device to interact with the simulation while running, and running fast or slow at will. There are no restrictions of the topology.
The embedded version used in the embedded governor is identical to the desktop version, except the elements are stripped off the graphical user interfaces and have a simple programmable interface instead. The power plant can be analysed and simulated on a desktop computer. When things look OK, the entire plant model is downloaded to run as a part of the predictive model. The embedded transient simulation is only one part of what constitutes the predictive model system. The predictive model has to make decisions, it has to communicate and control each turbine governor based on simulations and inputs. Nevertheless, transient analysis of the whole plant is the core of the total predictive system.
Due to the grid code, the functionality of each turbine governor and the parameters has to be preserved to its specifications. This means that the only thing the predictive controller is allowed to do is basically to send set-points to each turbine governor. The power ramp once set and approved by the TSO cannot be varied at will. This restriction is solved by "chopping" up the ramp as an approximate means of extending it. This is exemplified in Figure 3. In addition the available max power is calculated continuously, and set as a limit in the output. The available max power changes continuously based on levels in reservoirs and inflow in creek shafts. The restrictions on adjusting the ramps are however envisioned to be adapted and eased considerably in the future when more non-regulated power (sun and wind in particular) enters, and the frequency governing aspects of hydro power plants get increased value compared to the pure energy production aspects.
The guide vanes have to be controlled by each individual turbine governor according to IEC and local grid code. The predictive controller cannot simply take control of the guide vanes. Therefore the predictive controller is fed the power setpoints, does what needs to be done with them, and send these modified setpoints to each individual turbine governor. This will of course set constrains regarding efficiency in algorithms and simulations. Each individual turbine governor controls the droop functionality, the primary control, and essentially operates exactly as before. For a plant with one turbine one turbine, things can be predicted rather easily. A plant with two or more turbines creates difficulties because the head loss is a function of the total flow. Figure 4 shows the principal effect when changing the set-point for a two turbine plant. Turbine 1 will typically not reach its set-point while turbine 2 will start to lag behind due to the increased friction in tunnels. Power feedback will automatically solve this. However, power feedback will simply increase the guide vane opening indiscriminately, and also not take into account the effect from water entering creeks or the levels of the reservoirs. This can be dangerous when the head loss in the tunnels is large, because the gradient of the head loss becomes steeper with increasing flow. Thus the problem is to solve this with no active power feedback, and still be able to have 100% positive control.  Figure 5 Basic flow chart of the predictive system Figure 5 shows a basic flow chart of the predictive system. The core of the algorithm besides the simulation is the adaptive decisions for how to adjust ramps and restrict output. These decisions are based on a range of parameters ensuring no limits will ever be reached. The system is a continuous loop and new set-points can be entered at any time.
The core of the system is therefore a transient simulation that runs on an embedded computer together with the adaptive and fully automatic decision algorithm. The simulation will always calculate correct setpoints on all turbines, where correct means the adjusted setpoint that causes the measured output of power equal to the wanted power when corrected for droop. This is done up front and the governor will send these directly to each turbine governor with no need for readjustments of the guide vanes. The same simulation will also calculate the transients due to a change in power and make a decision if the transient is OK or not. In addition an algorithm calculates any changes needed to the ramp and finally the system feeds each turbine governor the adjusted setpoints including the eventual adjusted ramp. For this prototype, the system will fall back to the "old" way in case of an error.

Experience so far
At the time of writing, the prototype system has been running continuously for over a year. All the specifications have been fulfilled. The plant can run fully automatically and delivers FRR to the Nordic grid and to the Skagerak 4 cable. Figure 6 and Figure 7 shows time series when all 5 turbines are running, two are running FRR.