Free trial

PVPROG Function

The increasing share of power produced through PV in the grid leads to higher gradients, and especially around noon, to higher peaks of the grid feed‑in. This in turn results in a higher strain on the distribution grids. Batteries can make a positive contribution to this problem. The common practice of systems that are laid out for high degrees of self-consumption, in which all surpluses are stored immediately, however, hardly reduces any feed-in peaks. For this reason, PV battery systems are increasingly only subsidised if the feed‑in power is limited to a certain percentage of the installed nominal PV capacity. Using PV- and load forecasts, the period in which the battery is charged can be shifted towards noon so that the grid feed‑in is limited through the battery system. With this method, curtailment losses can be significantly reduced.

In the following figure (left), the battery is charged as soon as the PV power exceeds the load. When the battery is full, the feed‑in power increases abruptly. All PV surpluses that exceed the feed‑in limit are curtailed. By including locally generated, measurement based PV- and load forecasts the PVprog algorithm determines a dynamic feed‑in limit above which the battery is charged (following figure, right). By temporally shifting the battery charge to noon, a reduction of the curtailment losses as well as a high degree of self‑consumption can be achieved. The algorithm is freely available and can moreover be used commercially, too.


Figure: Power flows in a household with early battery charging (left) and with forecast-based battery charging (right) with a feed-in limit of 50 % of the nominal PV capacity.


To achieve PV production and consumption forecasts with sufficient accuracy and without having to rely on an external communication infrastructure, the PVprog algorithm implements a so‑called adaptive day persistence forecast. For the PV forecasts, the historical generation and an estimation of the theoretical historical power with a clear sky are used. The quotient of the respective energies within the selected persistence time frame is computed and used as a scaling factor for the theoretical clear‑sky power within the forecast horizon. At every optimisation interval (normally every 15 min), the PV forecast is updated (see the following figure).

Figure: Dynamic adjustments of the PV persistence forecasts in the course of the day.

A day persistence is also created for the load forecasts and variably weighted with the mean of the last min over the forecast horizon. Thus, the short‑term forecast is adjusted dynamically according to temporary load peaks, while the forecast over the whole forecast horizon contains has approximately the same energy amount as the load of the previous day. The dynamic adjustment of the load is depicted in the next figure for a selected time frame.

Figure: Dynamic adjustment of the load forecasts in the course of the day.

The battery charge optimisation is performed in an iterative manner. A virtual feed‑in limit is set depending on the battery’s state of charge and is gradually reduced until the energy above the limit is enough to charge the battery as much as possible. This limit is adjusted for the updated forecast at every point in time of optimisation (see the next figure). Using the same method, the PVprog algorithm can control discharging of the battery to cut off as many load peaks as possible.

Figure: Dynamic adjustment of the battery charge and discharge roadmap in the course of the day.

To achieve the set feed‑in limit, the set battery power is continuously adjusted by the difference between the forecasts and the actual measurements. By continually adjusting the battery charge and discharge plan, updated PV and load forecasts can be incorporated and differences of the state of charge between the corrected roadmap and the original roadmap can be balanced.

Usage in Polysun

To perform forecast based battery control in Polysun, the PV power (AC before curtailment) and the load must be passed to the sensors of the programmable controller. The feed‑in limit can be passed via a sensor or per manual input. A manual input of 0 disables the feed‑in and load limitation, respectively. So that no problems arise when generating the forecasts, the variable “TS” (current time step in seconds since the beginning of the simulation) should be passed as a parameter. More than one call of the function in the same simulation time step have no influence on the result; the result of the first call is always returned. For this reason, it is not possible to call two instances of the function in the same time step with different input arguments – except for the frequency of forecast updates and the temporal resolution of the forecasts. Each of these arguments has two possibilities: 1 min and 15 min. A forecast update frequency of 1 min is recommended. The simulation work load can be reduced by setting it to 15 min (resulting in faster simulations). However, this results in a less accurate control and leads to a slightly decreased system performance. Therefore, setting the forecast update frequency to 15 min should only be done for rough system dimensioning in which multiple variants need to be simulated. The fine tuning and final evaluation should always be done with the forecast frequency set to 15 min.

On the contrary, a value of min is recommended for the forecast resolution, to reach a high degree of self‑sufficiency. Should for some reason the feed‑in or load limitation not be achieved as desired (to be expected only in the rarest cases), the forecast resolution can be set to 1 min. It must be kept in mind that the forecast resolution cannot be set to a lower time value than the update frequency. If an unexpected value is input for one of the two arguments, the respective recommended value is used (for technical reasons, no warning is issued).

For the persistence time frame that is looked back into for the PV forecast generation, 3 hours are recommended to achieve stable results. A low time frame leads to a faster adjustment of the virtual feed‑in limits. It can, however, also lead to too intense fluctuations of the battery’s set charging power. With a larger frame, the fluctuations of the feed‑in and load limitations are decreased. But a too large time frame leads to sluggishness of the control algorithm. From experience, a forecast horizon of 15 h can be recommended for the PV feed‑in limitation and 24 h is a good value for load limitation. Persistence time frames and forecast horizons outside of the interval [ 0 h, 24 h] are corrected to the upper or lower boundaries without further warning, respectively.

Two instances of the PVPROG function can be called to limit the grid feed‑in and load supply simultaneously (see standard template 50q). This is possible because charging and discharging of the battery never occur at the same time. This can, however, lead to a decrease in system performance compared to a system with only one of the two limitations, because forecast errors can have a negative influence on the available battery capacity. In individual use cases, a combination may be desirable. To achieve optimal results, the use of weather and load data with a temporal resolution of 1 min (maximum: 15 min) should be used. So that the PV forecasts are completely initialised at the beginning of the simulation, a pre‑simulation of 10 days should be performed.