Optimization of Renewable Energy-Based Autonomous Device Operation Using Simulation

Off-grid devices, such as autonomous lamps, are finding numerous applications in locations with no power grid availability. These devices rely on built-in generators, usually small PV panels or wind turbines, and batteries which allow the energy to be stored and utilized at appropriate time. Dedicated power device simulators are used to establish possible operation paths given uncertain parameters with regard to power generation, storage and consumption. The obtained data series are integrated into a graph search space which can be processed using various planning algorithms. An example of such scenario is given, along with example data obtained during preliminary research.


Introduction
Protection of the environment and strong emphasis on sustainability have led to increased use and popularisation of renewable energy sources.However, this has resulted in numerous problems related to management of modern power grids: power generation by renewables largely depends on weather conditions, such as insolation for photovoltaic devices and wind intensity for wind turbines.This makes it difficult to react to changes in demand, leading to insufficient power generation during cloudy or still weather or excess power being generated in times of low demand.In extreme cases, this may lead to energy being sold for prices close to zero.
This discrepancy between energy generation and consumption characteristics is sometimes avoided through the use of power storage (e.g.batteries), which can provide a "buffer" for better use of energy.
A more radical version of this concept is materialised as off-grid devices, which are autonomous with regard to power generation and consumption.The primary characteristics of such devices are: • often misaligned power generation and consumption, apparent e.g. in solar-powered lamps, • susceptibility to running out of power, especially during periods of limited generation.
The main operating goal of these off-grid devices is to maintain the desired autonomy, i.e. to guarantee operation until the next opportunity to accumulate more energy.However, algorithms used to control the generation and consumption of energy in such devices are simplistic and do not always yield the optimal results.For example, off-grid lamps often use a simple algorithm which switches the light source on at sunset and off at sunrise.No planning takes place and no knowledge regarding e.g.weather forecast is taken into account, which may result in the energy being consumed before more can be generated.
This problem can be avoided by computing a dispatch plan which dims the lamps during predicted periods of cloudy or windless days.Still, the accuracy and reliability of weather prediction is limited, and the dispatch plan should allow the device to adapt its operation to actual conditions.Therefore, it is important to generate a space of all situations with a certain degree of probability and calculate optimal control strategies for each of them.
The proposed solution relies on using a simulator to predict the behaviour of power generators given assumed uncertainty of input parameters (i.e.weather forecast), possible output parameter values (i.e. the light intensity desired by the user and the minimum admissible one) and synthesising them into a search space in the form of a graph.

State of the Art and Related Work
Simulation tools for generation, storage and consumption of energy are at the core of the proposed methods.They are described in the following sections.

Available Simulation Tools
There are numerous simulation tools available in the field of power systems.They can be divided into the following categories: • isolated simulators -software which simulates an elementary device within the power network, e.g. a single PV panel, implemented as dedicated applications or Matlab modules, • dedicated simulators -software, which simulates a certain class of power network devices operating within a system, e.g. a farm of photovoltaic devices; usually additional functionality can be supplied (for instance, to calculate the autonomy of a renewablepowered system under given load), • integrated simulators -software able to simulate power networks integrating different types of elements, including generators, loads and various power flow analyses.
The choice of the appropriate simulation tool must be based on the support for the desired components, as well as the ease of integration in the workflow, especially if the simulator is to be used as part of an automated process in a batch manner.For that reason, the simulation tool of choice for the presented research was the GridLAB-D software package [1].Developed by the Pacific Northwest National Laboratory and supported by the US Department of Energy, is an advanced, open-source power system simulation tool based on the BSD license.GridLAB-D is a modular system: besides the "central" power flow simulation module, it has dedicated modules for precise simulation of loads (including residential and commercial customers), distributed generation, weather, energy market components, reliability testing (including metrics such as SAIFI or SAIDI), power storage or electric vehicle charging.
The scenario for its utilisation in this research differs from the usual workflow: instead of simulating an entire power grid, it will mostly be used to simulate individual components, such as renewable power source generators or (in the following stages) power storage devices.

Weather Forecast and Modelling
Weather is the basis for prediction of behaviour of renewable generators such as PV panels or wind turbines.In practice, it usually originates from one of the following sources: • statistical data, often contained in Typical Meteorological Year [2], especially popular in America, • weather forecast service APIs, which allow for acquisition of conditions on a particular date, including deviation from typical weather on a given day of year.
Weather forecasting methods themselves are out of scope of this paper.However, it is important to note the possible attributes for weather forecast.
Using GridLAB-D as example, it is possible to distinguish the following attributes for weather [3]: • outside air temperature, • humidity, • recorded wind speed, • direct and indirect solar input, • hourly rainfall, • depth of snow layer.
Each of the attributes is timestamped.Therefore, it is convenient to store weather data in tabular form, often as CSV (comma-separated values) files.
It must be noted that cloudiness is not included in GridLAB-D's weather model, and at the same time, it is crucial to simulate output from PV panels.It may be modelled by adjusting the solar input parameter, but that may require an additional and non-trivial step after the weather data is obtained.Another solution is to use the shading factor parameter of the solar module and use a player object to play back the shading value based on the obtained cloud density.

Simulation of Renewable Power Sources
In order to predict energy generation by renewable sources, two approaches can be used: • simulation-based prediction, based on weather forecast (cf.Section), • statistics-based prediction, based on previously recorded behaviour of renewable sources.
The former, simulation-based approach requires a mathematical model which simulates the behaviour of power generators, as well as data regarding the parameters which affect the generators' behaviournamely, weather data.The advantage of this approach is that no prior operational data needs to be collected to make it work.However, any discrepancy between the model and the actual device characteristics will reduce the accuracy of prediction.
The latter, statistics-based approach utilises collected operational data to predict how a given generator will operate.It requires that a substantial amount of operational data for a given device type is collected under various conditions.However, it can provide more accurate behaviour if the model is not precise or if the characteristics of the device have shifted with time (i.e., the solar panel became dirty).

Simulation of PV devices
The solar GridLAB-D module is responsible for simulation of solar panel behaviour.Although it was initially conceived to assess the impact of solar installations on the thermal performance of buildings [4], several years of development and validation have brought it to the form of a general-purpose solar generation simulator.
The model is parameterised and includes the following attributes [3]:  panel technology (single/multi-crystal silicon, amorphous silicon, GaAs thin film, etc.),  tilt model for tilted array calculations,  method used to adjust the PV array output efficiency for temperatures of the cells,  coefficients for temperature correction formulae, nominal operating cell temperature,  calculated internal temperature of the PV module, outside air temperature,  solar radiation incident upon the solar panel,  insolation level that the cell is rated for,  coefficient for the effects of temperature changes on the actual power output,  coefficient for the effects of temperature changes on the DC terminal voltage,  maximum operating voltage of the PV module,  Voc max of the solar module, open circuit voltage (as specified by the PV manufacturer),  efficiency of power conversion from the solar insolation to DC power,  surface area of the solar module, soiling of the array (representing dirt on the array) panel derating to account for manufacturing variances,  actual power delivered to the inverter,  shading factor for scaling solar power to the array,  tilt angle of PV array,  and the facing direction of the PV array.
In addition, a solar object needs a weather object to perform simulations (or, for initial prototyping, default weather data can be used).

Simulation of wind turbines
Wind turbine simulation is handled by the windturb_dg GridLAB-D model [5].
The model includes the following parameters [3]:  generator type (synchronous, induction),  control mode (constant voltage, constant real power, constant real and reactive output),  turbine model (allowing a selection of vendor-specific and generic models),  turbine geometry, including height and blade diameter,  minimum/maximum operating wind speeds,  maximum/rated coefficients of performance,  power conversion ratio,  and various other power-related parameters.
Similar to the solar module, windturb_dg also needs a weather object.

Simulation of Power Storage
To simplify the model at this stage of research, power storage is assumed to have linear characteristics and constant capacity.Of course, in reality, the behaviour of storage devices such as batteries is much more complex, and their behaviour depends on various factors, such as ambient temperature.Therefore, in the following stages of research, a separate module will be used to simulate precise behaviour of power storage.
GridLAB-D also contains a module to simulate power storage.Therefore, integration should be easy, as it uses the same input/output schemes and weather data as the aforementioned generator simulator modules.

Simulation of Power Consumption
The third crucial factor regarding operation of off-grid devices is the consumption of power.The method for its prediction depends on the type of the device and the user's requirements.As stated in the Introduction, there usually are several options to choose from when it comes to controlling the device operation.For instance, a lamp can be operated on various levels of dimming.
Usually, one of the choices will be the preferred operation mode, and one will fulfil the minimum requirements.
These choices will also depend on other parameters, such as the time of day.There is no need to operate lamps during the day; therefore, given the date and geographic location, a rule will determine the time of sunrise and sunset and set both the required and preferred operation levels to zero between these hours each day.
Also, for more complex solutions, the preferred/required labelling can be extended to an ordered set of priorities, as the users' preferences can depend on multiple parameters.More details on preference modelling can be found e.g. in [6].

Solving Planning Problems via State-Space Search
The actual algorithms used to determine the optimal dispatch plan for a device in the state space are out of scope of this paper.However, a properly formulated search space should allow for utilisation of a wide range of algorithms, including heuristic search algorithms [7,8] such as A-star, or multivariant planning tools such as Wavefront.It is also possible to use hybrid algorithms, e.g. as described in [9].

Proposed Solution
This section describes the proposed algorithm for generation of a search space based on results of simulation.

Structure of States
Time is assumed to be discrete.The granulation of time depends on the resolution of the simulator, weather data, dynamics of the device and required control agility.In the presented examples, 15-minute resolution was used.
Let represent a possible state of the system in the form of a tuple: where: • t j is the timestamp, • g [Wh] is the amount of energy generated during the period ( , ), • h [Wh] is the charge of the battery at time t j , • c [Wh] is the amount of energy consumed during the period ( , ).

Simulation-based generation of states
The approach used to generate state can be summarised as follows: for any given time t j+1 , generate states for all combinations of uncertain parameter values and link them to all preceding states with time t j in respective simulated data series.
Uncertainty of parameters can have the following reasons: • for g (energy generation), it results from assumed uncertainty of weather forecast attributes as described below, • for h (battery charge), no uncertainty is assumed at this time, but it will be introduced in the following stages of research e.g. to compensate for SoH (state of health) variations, • for c (energy consumption), it results from the possible modes the device can operate in during the period ( , ).Generation of all possible c parameter values is straightforward, as it results directly from device operation rules.However, more attention needs to be given to generating all possible g values.
As stated above, uncertainty of power generation will result mostly from uncertain weather forecast.
Let us assume that the weather forecast for time t consists of n attributes (e.g.temperature, insolation, precipitation): ( ) = ( , ,… , ).For each attribute, we establish v i -the variation factor, which defines how much a value can differ from its assumed, predicted value, thus defining the lower and upper bound for the attribute's value.
For example, if we assume that the only uncertain parameter is cloudiness (i.e., v i =0 for all other parameters), at each time point t j , there will be three possible levels of power generation.Actual values for this example have been presented in Figure 1: Figure 1a presents the cloudiness levels obtained from the weather forecast, as well as lower and upper bounds calculated for v i =0.3; Figure 1b presents the insolation calculated for these shading values, and Figure 1c shows the power generated under these conditions by an example PV device.
In this simple case, at any given point, there are at most three possible levels of power generation, which directly relates to the amount of power accumulated in the battery.
Modelling of possible operation modes of devices is out of scope of this paper, but if we assume that the lamp can be either off, on, or operating at half power, at any point there will also be three distinct possibilities for energy consumption.
As the time interval was set at 15 minutes, there will be 96 states in every 24-hour period.Therefore, the maximum number of states in such scenario will be 864.However, simple heuristics can be used to reduce this number significantly a priori: 1.During periods of no power generation (e.g. during the night), there is no uncertainty, as output from PV panels equals zero.However, the reduction will not be as efficient if the device is also equipped with a wind turbine.2. At no point will all three modes for operation be available; if the lamp is to be off, there is no uncertainty; if the lamp is to be lit (during the night), the option to have it off will probably not be acceptable.
The generated state space will actually be a graph containing all possible states the device can achieve at any time, unless the parameter variations exceed the predicted limits.
Such a graph can be used with any planning algorithm to determine the optimal mode of operation.One solution is to apply a penalty for each disallowed state, e.g.states where power consumption (c) exceeds the amount of power accumulated in the battery (h).
That way, the optimal (lowest-cost) paths in the graph will represent any control schemes leading to acceptable behaviour of the device under consideration.

Conclusions and Future Work
The paper presents a novel approach to generating a search space for off-grid device dispatch planning using power device simulators.The advantages of this approach, compared to reactive control or simple stochastic algorithms, is precise representation of the device behaviour and support for uncertainty in any area of operation (e.g.weather, power generation and consumption in different modes).
Most other approaches to predicting the performance of renewable energy sources rely on machine learning, artificial neural networks and similar techniques.This means that they require operational data to have been collected in order to let the algorithms tune their predictions.In applications similar to off-grid lamps, each instance can have different characteristics due to non-uniform component quality and factors such as shading.Simulation-based prediction may improve the accuracy of such a system in the early stages of operation, and can be supplemented by data-based algorithms later on.
Future work involves introduction of more advanced modules for simulating the behaviour of power storage, integration with a rule-based engine designed to run on the embedded controller and field testing.The paper presents a novel approach to generating a search space for off-grid device dispatch planning using dedicated simulators.

Figure 1 .
Figure 1.Example results for simulation of PV panel behaviour; values have been calculated for predicted cloudiness as well as lower and upper bounds for v i =0.3.