Cloud shadow speed sensor

Changing cloud cover is a major source of solar radiation variability and poses challenges for the integration of solar energy. A compact and economical system is presented that measures cloud shadow motion vectors to estimate power plant ramp rates and provide short-term solar irradiance forecasts. The cloud shadow speed sensor (CSS) is constructed using an array of luminance sensors and a high-speed data acquisition system to resolve the progression of cloud passages across the sensor footprint. An embedded microcontroller acquires the sensor data and uses a crosscorrelation algorithm to determine cloud shadow motion vectors. The CSS was validated against an artificial shading test apparatus, an alternative method of cloud motion detection from ground-measured irradiance (linear cloud edge, LCE), and a UC San Diego sky imager (USI). The CSS detected artificial shadow directions and speeds to within 15 ◦ and 6 % accuracy, respectively. The CSS detected (real) cloud shadow directions and speeds with average weighted rootmean-square difference of 22 ◦ and 1.9 m s −1 when compared to USI and 33 and 1.5 m s −1 when compared to LCE results.


Introduction
Given the impact of fossil fuel consumption on the environment, it is imperative that renewable energy sources provide a greater fraction of world energy demand.On average, the Earth receives 8000 times more solar energy than the energy consumed globally, making solar energy a strong candidate for supplying future world energy needs.However, difficulties in integrating variable generators into the electric grid have impacted the rate of large-scale adoption of solar power.The variability of the solar resource could be better accommodated by grid operators if fluctuations in irradiance caused by cloud cover could be predicted.
Understanding cloud motion is critical for ramp rate estimation and short-term forecasting (Arias-Castro et al., 2013;Coimbra et al., 2013;Lave et al., 2012Lave et al., , 2013)), because cloud motion causes a sudden shortage or oversupply in solar power and must be compensated for with an opposing ramp of energy storage or conventional generation.Previous studies have used satellite imagery for estimating cloud motion (Leese et al., 1971;Hammer et al., 1999;Lorenz et al., 2004;Perez et al., 2010).However, due to satellite navigation, resolution, and parallax uncertainties, such cloud motion estimates are of limited use in very short-term, intra-hour forecasting.
Other methods are based on ground measurements that can be used to yield cloud shadow speed.Cloud shadow motion vectors are typically equivalent to cloud motion vectors as measured from satellites or simulated through numerical weather prediction (since Sun-Earth distance cloud-Earth distance), but large solar zenith angles or large cloud vertical development relative to horizontal translation can introduce differences.While cloud shadow speed may not be as useful as horizontal cloud speed for meteorological models, cloud shadow motion vectors are more relevant for groundbased solar forecasting applications.For the remainder of the paper we will refer to "cloud speed" or "cloud motion vector" measurements for conciseness, although strictly cloud shadow motion vectors are measured.Examples of cloud speed detection from ground sensors are given in Hinkelman et al. (2011), who determined cloud speeds by analyzing the time lag in maximum cross correlation between two sensors aligned with the cloud direction, but the method cannot be automated since cloud direction has to be known a priori.Weigl et al. (2012) also derived velocity vectors from spatial irradiation data by considering rectangular clouds and tracking the movement of irradiation minima across the sensor array.Recently, two different approaches to determine cloud motion vectors were developed and validated by Bosch et The first approach (further developed in Bosch and Kleissl, 2013) considers the kinematic equations of a linear cloud edge (LCE) passing through a sensor triplet and will be used in this paper for validation.The second method is based on the most correlated pair (MCP) of sensors arranged in 12 m diameter semi-circular array and lays the foundation of the cloud shadow speed sensor (CSS) described here.However, the limited sampling frequency requires sensor spacings of tens of meters and does not permit detecting cloud speeds with enough resolution to cover the full range of naturally occurring cloud speeds.Also, the system is not self-contained and cannot perform on-board post-processing.A semicircle system that is smaller, self-contained, and sampling at high frequency is required for commercial use, and is described in this paper.
Section 2 describes the theoretical concept for the cloud motion vector (CMV) measurement.Sections 3.1 and 3.2 desribes the phototransistor characteristics, optical assembly, and layout.In Sect.3.3 the data acquisition and postprocessing system is presented and quality control is discussed.Performance parameters and limitations of the CSS are explained in Sect.3.4.Validation procedures for the algorithm and cloud motion results against artificial shadows and (real) clouds are described in Sects.3.5 and 3.6, and results of the validation are shown in Sect. 4.

Theory: most correlated pair method (MCP)
Variability of solar irradiance at the Earth's surface is mainly due to cloud shadows with varying light intensity.We present here a system to obtain CMVs using an array of groundbased sensors to measure the spatiotemporal variation of Assuming sensors S a and S b are the pair with largest R ab , the detected solar irradiance time series will be most similar but delayed by a time lag, t = t ab , as seen in Fig. 1.
Determining the time lag via cross correlation, the cloud speed can be found by where D is the distance separating the sensors.

Cloud shadow speed sensor (CSS)
The CSS (Fig. 2) design objectives are compactness, fast data acquisition rates, robustness, and onboard processing.
The implementation includes a high-performance microcontroller platform with built-in data acquisition and storage capability, and an array of phototransistors.The following subsections describe the system in more detail.

Luminance sensors
Solar radiation sensors consist of an array of nine phototransistors (TEPT4400, Vishay Intertechnology Inc., USA).The sensors have a spectral response ranging from approximately 350 to 1000 nm with a peak response at 570 nm.The manufacturer has characterized the sensors over an operating temperature range of −40 to +85 • C. Response time was determined experimentally in our laboratory and found to be 21 µs rise time (10-90 % response).Excitation voltage for the sensors was 3.3 VDC supplied from a voltage regulator (LM2937-3.3,Texas Instruments Inc., USA) and applied to the phototransistor collector (Fig. 3).A 2 k load resistor was connected from the sensor emitter to system ground.The sensor outputs were taken at the emitter-load-resistor junction and fed to the analog input channels on the microcontroller.

Luminance sensor array
CMVs were determined with the phototransistors configured as an array of eight sensors positioned around a central sensor on a circle of radius 0.297 m, covering 0-105 • in 15 • increments (Figs. 2 and 4).Cross-correlation coefficients were computed for each pair of sensors (central sensor and a sensor on the circle) to determine cloud speed and direction based on Eqs. ( 1)-( 2).Each sensor was placed at the base of and inside a black opaque tube with a diameter of 6.35 mm and height of 14.3 mm with a translucent acrylic light diffuser/collector at the top.The tube height was chosen such that the diffuser positioned above the sensor fully occupies the TEPT4400 field of view (FOV) as shown in Fig. 5. Full exposure of the TEPT4400 sensor FOV to the overhead light field dictates a vertical separation of h < 5.51 mm, but h = 2.78 mm was chosen in the design such that a tilt error of up to 18.8 • would still allow the TEPT4400 FOV to remain within the diffuser area.This sensor optical assembly (TEPT4400, tube, Figure 5. Cross-sectional view of luminance sensor optical assembly (TEPT4400, opaque tube, and light collector/diffuser) for a vertical spacing h that matches the TEPT4400 field of view (FOV) to the diffuser diameter.To reduce the effect of TEPT4400 sensor tilt errors, h = 2.98 mm was chosen instead.diffuser) ensures that the CSS has a near-cosine response over the full −90 to 90 • exposure to radiation from the fullsky hemisphere.When tested under halogen lights the diffuser was determined to have no effect on the incident light spectrum within the spectral response range of the sensor.

Data acquisition and post-processing
The microcontroller-based data acquisition system and sensors are powered by a small rechargeable 12 VDC sealed lead-acid battery.Regulated voltages (5 VDC for the microcontroller, 3.3 VDC for the sensors) are derived from the battery using integrated circuit voltage regulators (Fig. 3).The data acquisition system was configured using a A compromise had to be made between measurement precision and detectable irradiance range due to the limited 10 bit analog-to-digital converter (ADC) of the microprocessor.Hence, the TEPT4400 sensor circuit was deliberately designed to report voltages that exceed the measurement range of the microcontroller near solar noon on clear days.In particular, the detected solar irradiance saturates at 880 W m −2 but higher irradiance can be neglected since clear-sky periods rejected for post-processing due to small variance.Irradiance measurements under 880 W m −2 representing cloudy conditions are therefore better resolved and are more appropriate for CSS applications.
The 6000 × 9 data array can be transferred to an off-board microSD card in 14 s, for archiving and further analysis.Alternatively, onboard post-processing is available and the results can then be relayed to a central computer via ethernet or wireless communication.The cloud speed and direction are computed using an algorithm based on Eqs. ( 1)-( 2).Computing the cross-correlation for every time step (i.e., m = 1 to 5600 in 400 steps) would require 18 min.Optimization reduced the processing time to approximately 2 min.First, assuming a monotonous "smooth" signal, the cross-correlation time shift is performed in increments of 5 time steps instead of the standard 1 time step.Then, the temporary maximum R ab is located and the surrounding 10 R ab are computed in time steps of 1 to determine the exact t ab the maximum R ab .Second, Lb and Lb of each R ab are updated based on the previous Lb and Lb .Through extensive post-processing analysis this algorithm has proven to be robust in finding t ab .
Quality control (QC) during post-analysis is required to increase the robustness of the algorithm (Bosch et al., 2013).Most importantly, periods of small variability in the signal (for example during clear conditions) or small correlation coefficients are excluded.In specific, the range in a set of measurements must exceed 7 % of the full-scale 10 bit reading and the largest R ab computed must be greater than 0.95.Both threshold values were determined empirically, and they ensure that data are only processed if a cloud passage occurred that results in a large signal-to-noise ratio and is more likely to produce correct CMVs.Measurements with several identical maximum R ab across different sensor pairs or unphysical cloud speeds (greater than 50 m s −1 is very unlikely) are also discarded.Lastly, a moving median filter is computed at every CMV timestamp to determine the central tendency of QC results within the past 30 min.While there is a potential to delay the detection of a change in cloud motion, CMVs generally change over longer timescales.
In addition to CMV detection, variability in solar irradiance can be measured by the CSS and could be used by grid operators to inform control schemes for energy storage or rampable generation throughout the day.

Performance parameters and limitations
Based on typical cloud speeds obtained over the US (Bosch and Kleissl, 2013;Lave and Kleissl, 2013), the CSS was designed to detect cloud speeds of up to 15 m s −1 with at least 1 m s −1 resolution.The resolution of detectable cloud speeds is determined by the radius of the semicircle (D = 0.297 m, Eq. 2) and the sampling time step ( t = 0.0015 s).For the CSS design, the resolvable cloud speeds are given by D N t , where N = 1, . . ., k and k defines the maximum number of time shifts used in the cross-correlation computations.In this case we select the minimum cloud speed as 1 m s −1 , which yields k = 200.Cloud speeds of less than 1 m s −1 are unusual and have little relevance to solar power as the resulting ramp rates would be slow and approach the cloud lifetime (Jiang et al., 2006).With 6000 samples from each sensor, the central 5600 data points are shifted in the cross correlation procedure, leaving k = 200 bidirectional time shifts to determine t ab .The direction of the shift that produces the maximum R ab indicates whether the clouds are moving in one direction or the opposite.The largest and smallest resolvable cloud speeds are therefore D t = 0.297 m 0.0015 s = 198.1 m s −1 and D k t = 0.297 m 200•0.0015s = 0.99 m s −1 , respectively.The cloud speed resolution scales with 1 N such that very large cloud speeds are obtained at poor resolution (for example the second largest speed is 0.297 m 2•0.0005 s = 99.1 m s −1 ), while smaller cloud speeds can be detected at higher resolution.

Validation using artificial shadows
Prior to measuring complex ground radiation patterns caused by clouds, a performance test with a simple shadow of known relative velocity was used to validate the CSS.Under clear conditions at solar noon, an irregular stationary shadow was created from a suspended object.The CSS was mounted on a mobile platform that was pulled at a constant speed by a torque motor.Relative velocity vectors between the shadow and sensor can be determined by the motor rotational speed and orientation of the sensor.The magnitude of the irradiance reduction (i.e., the signal for Eq. 1) in the shadow decreases with increasing height of the object because of increased diffuse irradiance.Consequently, the CSS was first tested with a dark shadow from an object positioned 0.23 m above the CSS.The CSS was moved at a known CSS speed of 0.51 m s −1 with different directions (60 and 90 • ).Since the known CSS speed did not fall within the range of detectable cloud speeds (see Sect. 3.4), k = 600 was used to reduce the smallest resolvable cloud speed to 0.33 m s −1 for this experiment.The procedure was repeated with the object raised to 1.35 m above the CSS to observe how the influence of increased diffuse irradiance affects the measurements, post-processing, and CMVs.For all conditions, the detected directions were correctly identified and the detected shadow speed fell within 6 % of the true speed (Table 1), which is acceptable for CSS application.The only direction error occurred in experiment 2, but the maximum R ab values for the 90 and 105 • directions were essentially indistinguishable with a difference of 0.0006.These results validate the basic concept, realization, and algorithm of the CSS to measure (real) cloud speed and direction.

Deployment and validation against two cloud motion sensors
The CSS was deployed on 9 days over a period of 6 months from March to August 2013 at the UC San Diego solar energy test bed in La Jolla, CA (Table 2).For validation, a sky imager was deployed adjacent to the CSS and a consistent coordinate system was established.The UCSD sky imager (USI - Chow et al., 2011;Urquhart et al., 2013;Yang et al., 2014) captures images using an upward-facing charge-coupled device (CCD) image sensor that senses RGB channels at 12 bit precision and 1748 × 1748 pixel resolution.A 4.5 mm circular fisheye lens allows for imaging of the entire sky hemisphere.Utilizing composite high dynamic range (HDR) imaging, the USI outputs images at 16 bit with a dynamic range of 84 dB.The images used in this analysis were taken by a rooftop-mounted USI located at 32.8722 • N, 117.2410 • W, and 129 m m.s.l.capturing images every 30 s.A cross-correlation method is applied to derive a representative cloud vector for the image (Yang et al., 2013).USI cloud directions are expected to be accurate, but cloud speeds scale linearly with cloud height, which is difficult to determine.Therefore the LCE approach (see Introduction and Bosch et al., 2013;Bosch and Kleissl, 2013) was applied to three photodiode pyranometers (Li-200SZ, Licor Inc.).The pyranometers were colocated on the USI rooftop and setup in an orthogonal coordinate system with average separation of 7 m and logged to a single CR1000 (Campbell Scientific Inc.) data logger with an acquisition frequency of 20 Hz.

Results and discussion
The predominant cloud conditions in coastal southern California are overcast stratocumulus and few to scattered cumulus clouds.Table 2 shows the average cloud directions and speeds on the nine deployment days.Table 3 presents the corresponding root-mean-square difference (RMSD) and mean bias (MB).
The 23 July and 8 August deployments are selected for discussion in greater detail.The KNKX METAR station 9 km to the east reported the following conditions: the air temperature during the 23 July and 8 August deployments was 22-26 • C and 24-25 • C, respectively.Surface winds were 260 to 310 • at 4.1 to 5.7 m s −1 on 23 July and 250 to 280 • at 3.6 to 4.6 m s −1 on 8 August.There were few clouds at 400 m below scattered clouds at 900 to 1200 m a.g.l. on 23 July and few clouds at 460 m a.g.l. on 8 August.
The solar irradiance and resultant CMVs for 23 July and 8 August are shown in Figs. 6 and 7.For 23 July, 20 % of the 1611 raw results satisfy the QC criteria described in Sect.3.3; most results are excluded since the variability did not exceed 7 % of 10 bit full-scale reading, as observed after 14:00 PST.Sky imagery reveals that CMV results occurred in scattered stratocumulus cloud cover during 12:00-14:00 PST that became overcast after 14:00 PST (differences to the METAR cloud observations can be explained by large spatial heterogeneity of cloud cover in this coastal  area).Overcast conditions cause insufficient solar variability to pass the QC criteria, but the 30 min median filter causes CMV to persist into the overcast period, like during 14:00-14:30 PST.The CSS QC directions indicate cloud movement from the west-northwest (WNW, 300 • ) direction, consistent with surface winds and visual inspection of sky imagery.USI and LCE results show an average cloud motion direction of 286 and 275 • with RMSDs of 14 and 35 • , respectively.The CSS cloud speed ranges from 3.0 to 6.0 m s −1 .USI and LCE yield an average cloud speed of 3.9 and 5.3 m s −1 , with RMSD of 1.2 and 1.2 m s −1 compared to CSS results, respectively.
On 8 August, visual inspection from sky imagery shows thin, scattered stratocumulus clouds during 10:30-14:45 PST from WNW that became more widespread during 14:45-16:30 PST.Overcast conditions occurred after 16:30 PST, which causes low solar irradiance variability and again produces no CMV results.The CSS detects average cloud movement from the WNW (299 • ) direction, while USI and LCE detect average cloud directions of 286 and 283 • , respectively.RMSD values for comparing CSS to USI and LCE direction results are 26 and 33 • , respectively.The CSS cloud speed increases from 2.0 to 6.8 m s −1 throughout the deployment and is consistent with the ranges and trends observed by USI and LCE with RMSD of 0.9 and 1.3 m s −1 , respectively.It is worth noting that all speed results are similar during periods of high solar variability (14:45-16:00 PST), which indicates more robustness during favorable cloud conditions.Although the three methods slightly differ in both detected direction and speed, the results lie within the range of CSS, USI, and LCE method uncertainty.True cloud speeds are not available and it is therefore unclear which sensor is more accurate.
The post-analysis conducted on days presented in Tables 2 and 3 assumes a single layer of cloud movement.In the presence of multilayer clouds, several regions with high density of CMVs can be found at different cloud velocities.By using a histogram peak-finding technique on CMV results, the CSS can determine multilayer cloud movement.This method was based on prior research on CMV determination from ground irradiance data and requires further analysis, but should be feasible to implement in the CSS algorithm for identifying multilayer CMVs.Cloud motion experiencing wind shear can have a vertical speed component that is undetectable by the CSS.However, the CSS will detect 2-D cloud shadow motion (x-y plane) in scenarios with 3-D cloud movement.While this measurement may not be as useful for meteorological models, the cloud shadow speed is more relevant to provide for solar variability and forecasting applications.
The analysis presented in Tables 2 and 3 also shows comparable results between CSS, USI, and LCE results for a wide range of cloud directions (southeasterly to northwesterly).The range of cloud speeds is more limited due to the low cloud heights and benign weather conditions in coastal southern California, but results are again consistent with the other methods.Overall speed and direction biases are essentially zero and typical RMSDs are 2 m s −1 and 30 • .

Conclusions
Nine phototransistors arranged in a semicircular formation were used to obtain cloud shadow motion vectors by finding the maximum signal cross correlation between the different pairs of sensors.Fast sampling rates by the microprocessor allowed the system to be compact yet able to detect the full range of typical cloud speeds from 1 to 15 m s −1 (with 1 m s −1 precision) and up to 24 m s −1 with 2 m s −1 precision.The CSS was validated using an artificial shading test apparatus and was found to detect cloud directions and speeds to within 15 • and 6 % accuracy, respectively.Nine deployments on partly cloudy days resulted in cloud directions and speeds consistent with those observed from a sky imager and computed from the LCE method.
Unlike the prior proof of feasibility in Bosch et al. (2013), the present CSS system is self-contained and more economical while still producing accurate cloud motion vectors.With the present QC criteria, the CSS does not provide CMV results under uniform overcast conditions, but the small solar irradiance variability in overcast conditions does not present a major issue for solar power integration.Further optimization of the algorithm will refine QC procedures to retain as many CMVs as possible while ensuring robustness of the results.

Figure 1 .
Figure 1.Idealized sketch showing the most correlated pair of signals shifted by t ab (adapted from Bosch et al., 2013).

Figure 2 .
Figure 2. cloud shadow speed sensor (CSS).The entire system is contained inside a weather-proof enclosure.On the top of the enclosure is an array of nine phototransistors used to measure the variation in solar radiation as clouds passed overhead.

Figure 3 .
Figure 3. Simplified schematic showing excitation voltage applied to the phototransistor collector, the 2 k load resistor, and the sensor output as applied to an analog input channel on the microcontroller.

Figure 4 .
Figure 4. Sensor arrangement.Each circle represents a sensor arranged in a circular pattern with 15 • radial spacing about the central sensor.Additional angles from 120 to 165 • are obtained through equilateral triangles constructed from existing sensor positions.For example, for triangle abc the line from b to c results in an angle of 120 • .

Figure 6 .
Figure 6.Solar irradiance and CMVs from CSS, USI, and LCE for 23 July.Luminance measurements of the central TEPT4400 sensor were calibrated against a colocated pyranometer to obtain W m −2 of solar irradiance.

Figure 7 .
Figure 7. Solar irradiance and CMVs detected during the CSS deployment on 8 August 2013.

www.atmos-meas-tech.net/7/1693/2014/ V. Fung et al.: Cloud shadow speed sensor high
-performance 32 MIPS, 32 bit microcontroller platform (chipKIT Max32, Digilent Inc., USA) running at 80 MHz.The onboard static memory allows fast storage of up to 6000 10 bit data points per sensor.With our sampling rate of 667 samples s −1 , 6000 data points can be acquired and stored in approximately 9 s.

Table 1 .
CSS performance for the artificial cloud shadow experiment.

Table 2 .
Deployment dates and average direction and speed for each cloud motion sensor.USI CMVs are unavailable for 14 March and 10 May due to incorrect cloud heights.LCE results are removed on 23 April due to an insufficient amount of results that passed QC.

Table 3 .
RMSD and MB of CSS results compared to LCE and USI.Due to incorrect cloud height observed, no cloud motion results were detected from USI on 14 March and 10 May.LCE results are excluded for 23 April due to a shortage of results that pass QC.