**Featured Application: Validation of all-sky imager technology at 3 locations: NREL, Joint Base San Antonio, and the Canary Islands, Spain.**

**Abstract:** Increasing photovoltaic (PV) generation in the world's power grid necessitates accurate solar irradiance forecasts to ensure grid stability and reliability. The University of Texas at San Antonio (UTSA) SkyImager was designed as a low cost, edge computing, all-sky imager that provides intra-hour irradiance forecasts. The SkyImager utilizes a single board computer and high-resolution camera with a fisheye lens housed in an all-weather enclosure. General Purpose IO pins allow external sensors to be connected, a unique aspect is the use of only open source software. Code for the SkyImager is written in Python and calls libraries such as OpenCV, Scikit-Learn, SQLite, and Mosquito. The SkyImager was first deployed in 2015 at the National Renewable Energy Laboratory (NREL) as part of the DOE INTEGRATE project. This effort aggregated renewable resources and loads into microgrids which were then controlled by an Energy Management System using the OpenFMB Reference Architecture. In 2016 a second SkyImager was installed at the CPS Energy microgrid at Joint Base San Antonio. As part of a collaborative effort between CPS Energy, UT San Antonio, ENDESA, and Universidad de La Laguna, two SkyImagers have also been deployed in the Canary Islands that utilize stereoscopic images to determine cloud heights. Deployments at three geographically diverse locations not only provided large amounts of image data, but also operational experience under very different climatic conditions. This resulted in improvements/additions to the original design: weatherproofing techniques, environmental sensors, maintenance schedules, optimal deployment locations, OpenFMB protocols, and offloading data to the cloud. Originally, optical flow followed by ray-tracing was used to predict cumulus cloud shadows. The latter problem is ill-posed and was replaced by a machine learning strategy with impressive results. *R*<sup>2</sup> values for the multi-layer perceptron of 0.95 for 5 moderately cloudy days and 1.00 for 5 clear sky days validate using images to determine irradiance. The SkyImager in a distributed environment with cloud-computing will be an integral part of the command and control for today's SmartGrid and Internet of Things.

**Keywords:** distributed PV generation; microgrid; irradiance forecasting; all-sky imager; Raspberry Pi; optical flow; machine learning; cloud-computing; SmartGrid; Internet of Things (IoT)

#### **1. Introduction**

The Department of Energy (DOE) estimates that PV power will grow to 14% of the electricity supply by 2030 as the price of solar electricity reaches a point at which it is cost-competitive with cogen (\$0.06/kwh by 2020). It is imperative that power grid reliability and stability be maintained under this high penetration of low carbon energy [1]. Organizations such as North American Electric Reliability Corporation (NERC) and California Energy Commission (CEC) [2] have formulated several requirements needed in a "grid-friendly" PV power plant. For instance, CEC has developed a set of several smart inverter functionalities such as dynamic volt/var operation and ramp rate control. Existing PV plants do not have these functionalities even though the inverters are capable, due to the lack of communications standards and dynamic control. For PV power plants to participate in energy markets and ancillary services markets, they need to be considered "dispatchable" power plants.

High penetration of PV systems can be achieved if PV inverters [3] participate in the grid frequency regulation by active power control. Currently, frequency disturbances in the grid are handled by load curtailment. The disadvantage of this methodology is that it can cause voltage stress on the distributed generation. The alternative is to operate the PV system below its MPP (Maximum Power Point) to provide active power control. This can be done by modifying the MPP algorithm in such a way that it can track the next MPP point while working in the reduced power mode (RPM). A critical component of coordinated inverter control is forecasted solar power output or forecasted MPP at the array level. Having accurate intra-hour solar forecasts can enable implementation of a coordinated inverter control strategy capable of regulating a set-point, which may be a signal from a utility requiring either power curtailment or frequency regulation. The electric utility industry has yet to see an integrated solution to the dispatchability problem of PV plants, a system solution that effectively integrates intra-hour solar forecasting and smart control of inverters to achieve not only a grid-friendly plant, but also one that provides monetary and efficiency benefits to the PV plant operator.

Microgrids lack the stabilizing effects present in a large urban macrogrid that itself is joined to an interconnect; these issues are critical when a microgrid is operated in islanded mode. The Energy Management Systems (EMS) that balance PV output, load, and battery storage require accurate intra-hour irradiance forecasts to solve the control problem by shedding non-critical load when power generated is predicted to drop significantly below the load. An increasingly important problem for utilities is optimal scheduling and dispatch of a microgrid [4–7], both when connected to the macrogrid and when operated as an island. This task is divided into Day-Ahead Scheduling, which finds optimal schedules for the next operating day and focuses on energy markets, and Intra-day Dispatching and Scheduling in which schedules are continuously updated during the current day. Both cases follow these steps: (1) forecast day-ahead load, (2) forecast day-ahead renewable power (solar, wind), (3) Micro-Grid Management System (MGMS) optimizes the day-ahead plan, produces schedules for flows within the microgrid and to the PCC, (4) MGMS transmits schedules to utility control center.

This article describes a four-year research effort to develop hardware and software with an aim to solve the intra-hour solar forecasting problem for electric utilities. It was a collaborative effort between many groups, including national labs and research institutes (NREL and the Texas Sustainable Energy Research Institute TSERI), two universities (The University of Texas at San Antonio and Universidad de La Laguna in the Canary Islands), public and private utilities (CPS Energy, ENDESA, and Duke Energy), and a private company, Siemens-Omnetric. It serves as a case study in managing research in a joint theatre of operations and integrating the efforts of researchers and engineers who came from very different university and industrial cultures. Details of our research and technology development have been presented in journal articles [8,9], conference proceedings [10–13], and technical reports [14]. While this paper gives a detailed overview of that research, our primary goal is to describe how the

UTSA SkyImager was validated at three geographically diverse locations, the pitfalls encountered, the lessons learned, and the outlook for future research efforts.

The SkyImager evolved from a realization that existing all-sky imaging systems were too expensive to be deployed in large numbers, suffered from data-loss issues caused by the shadow band and camera arm, and used proprietary software. The Raspberry Pi single board computer (\$35) and programable high-resolution Pi-Cam (\$20) with a fisheye lens (\$20) formed the heart of the new system. The most expensive component was the all-weather security camera enclosure (\$350). In addition, General Purpose IO (GPIO) pins would allow a variety of external sensors to be connected to the Pi. Low cost and ease of use were essential if the SkyImager were to be deployed in a rural sustainable development microgrid. In contrast to some commercial all-sky imaging systems, only open source software would be used. The Pi accommodates several operating systems (OS) including Raspbian, a Linux-based derivative of Debian. It can be operated with a monitor or in "headless" mode, and once deployed can be accessed remotely with SSH/SFTP. Code for the SkyImager would be written in Python and allow calls to libraries such as Open Computer Vision, Scikit-Learn, SQLite, and Mosquito. In the summer of 2014 it was an open question whether the proposed imager could deliver the functionality of much more expensive systems and be thoroughly tested before its deployment.

As part of the DOE microgrid INTEGRATE program, the first deployment of the SkyImager occurred in Fall 2015 at the ESIF building at NREL. INTEGRATE aggregated sustainable generation and loads into microgrids controlled by an Energy Management System with the OpenFMB protocol. In 2016 a second SkyImager was installed at the CPS Energy microgrid at Joint Base San Antonio. A multi-year collaboration between CPS-UTSA and the Universidad de La Laguna resulted in the deployment of two SkyImagers in the Canary Islands. These utilize stereoscopic images to determine heights of the bases of cumulus clouds. Deployment of SkyImagers in three diverse locations provided not only big data, but operational experience in harsh extremes of climate. This resulted in improvements and additions to our original design: weatherproofing, new environmental sensors, the need for scheduled maintenance, optimal positioning of the camera, communications with OpenFMB publish-subscribe protocols, and using WiFi and cloud computing. The SkyImager will be an integral part of the command and control for microgrids, both as part of the larger SmartGrid in an urban environment or in an islanded mode in a military or rural setting.

Solar forecasting is widely considered a key means of integrating solar power efficiently and reliably into the electric grid. For a utility to meet projected customer demand with electricity from sustainable resources, high-accuracy global horizontal irradiance (GHI) forecasts must be available over widely different time and space scales. A convenient separation of this forecasting problem into two parts is as follows: (1) *intra-hour forecasts* of the ramp events that are caused when cumulus clouds move between the sun and the solar panels, and (2) *day-ahead forecasts* for 12, 24, and perhaps 36 h into the future. There is overlap between the two parts, but this taxonomy is convenient not only because the physics and forecasting techniques are generally different, but also the way in which the utility makes use of the forecasts. A single ramp event on a microgrid powered primarily by PV arrays can result in over/under voltages, as well as frequency deviations and may require secondary spinning reserves to be brought on line. Day-ahead irradiance forecasts are useful in predicting surplus/deficit generation capacity that can then be augmented or sold in the day-ahead electricity market.

#### *1.1. Day-Ahead GHI Forecasting*

For day-ahead GHI forecasting, both numerical weather prediction (NWP) [15] and satellite imagery provide effective tools for forecasting irradiance. The National Center for Environmental Prediction (NCEP), a part of NOAA, runs two versions of the Rapid Refresh (RAP) numerical weather model to predict environmental data. The first version generates weather data on a 13-km (8-mile) resolution horizontal grid and the second, the High-Resolution Rapid Refresh (HRRR), generates data on a 3-km (2-mile) grid. RAP forecasts use multiple data sources: commercial aircraft weather data, balloon data, radar data, surface observations, and satellite data to generate forecasts with hourly resolution in time and forecast lengths of 18 hours. For further details, consult the RAP website [16]. RAP data are available for download through the National Model Archive and Distribution System (NOMADS). Several benefits accrue from using NWP for irradiance forecasting: NOAA incurs much of the computational burden and these models incorporate first-principles physics such as the Navier-Stokes equations, thereby allowing for the dynamic formation of clouds. Satellite technology is advancing rapidly with GOES-16 (Geostationary Operational Environmental Satellite) pictures being updated every 5 min with maximum resolution of 5000 by 3000 pixels. Figure 1 shows such an image cropped to the central Texas region. The temporal sampling of the data is still insufficient to support optical flow predictions 15-min ahead. Continued improvements in GOES-R (geostationary satellite with high spatial and temporal resolution) may well make the satellite approach to minutes-ahead irradiance prediction more attractive in the future [17–20]. Statistical methods based on historical time-series data and climatology are also useful for day-ahead PV forecasting.

**Figure 1.** GOES high-resolution satellite image cropped to show the central Texas region.
