Rockwell Autoamtion

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

Quick Reference

Solar Position Algorithm Connected Components Accelerator


Toolkit
Topic Page
About This Publication 1
Overview of Solar Positioning 3
Solar Position Algorithm Description 4
Validation and Test Results 14
Additional Resources 16

About This Publication This quick reference provides instructions for using the Solar Positioning
Algorithm with Connected Components Workbench software in a solar tracking
application. The algorithm is provided as part of the Connected Components
Accelerator Toolkit (CCAT).

The CCAT is available on the Connected Components Accelerator Toolkit


DVD, publication CC-QR002, or through the Rockwell Automation Software
Download and Registration System (SDRD) at
http://www.rockwellautomation.com/rockwellautomation/products-technologi
es/connected-components/tools/accelerator-toolkit.page.

Before You Begin

Parameters related to geographical and environmental conditions of the observer


were taken from the National Renewable Energy Laboratory (NREL) Solar
Positioning Algorithm Calculator website at
http://www.nrel.gov/midc/solpos/spa.html and used for validation of the
user-defined function block (UDFB).

Investigate parameters for other geographical locations because they are likely to
change.
2 Solar Position Algorithm Connected Components Accelerator Toolkit

What You Need


Because the RA_SOLAR_POSITION_ALGRTHM instruction requires more
than the standard amount of data memory to store temporary variables and
constants, we recommend that you use one of the specified range of controllers:
• Micro830™ programmable controllers, 24-point base catalog numbers
2080-LC30-24xxx and 48-point base catalog numbers 2080-LC30-48xxx
• Micro850™ programmable controllers, 24-point base catalog numbers
2080-LC50-24xxx and 48-point base catalog numbers 2080-LC50-48xxx

IMPORTANT This specified range of controllers is a guideline that is dependent on the


extensiveness of your controller code.

You also need the following:


• Personal computer
• Connected Components Workbench™ software, version 2.0 and later
• Standard USB for Micro830 controller
• Ethernet network connection for Micro850 controller only

CCAT Solar Tracking Folder Contents

The CCAT Solar Tracking Folder in the Sample Code Modules, contains the
following information:
• This Quick Reference document
• The National Renewable Energy Laboratory (NREL) Technical Report
NREL/TP-560-343-2
• RA_SOLAR_POSITION_ALGRTHM UDFB Connected
Components Workbench (CCW) exchange file in 7z format
• An application example showing the possible uses of the
RA_SOLAR_POSITION_ALGRTHM user-defined function block (in
a zipped CCW project folder)

Rockwell Automation Publication CC-QR005A-EN-P - May 2013


Solar Position Algorithm Connected Components Accelerator Toolkit 3

Follow These Steps


Follow these steps to implement the Solar Position Algorithm.
Start

Overview of Solar Positioning,


page 3

Solar Position Algorithm


Description, page 4

Solar Position Algorithm UDFB,


page 6

Use the Solar Position Algorithm,


page 8

Validation and Test Results,


page 14

Overview of Solar Positioning Solar trackers orient photovoltaic panels, reflectors, lenses, or other optical
devices toward the sun. Since the sun’s position in the sky changes with the
seasons and the time of day, trackers align the collection system to maximize
energy production.

Tracker control algorithms typically incorporate a control strategy that is a hybrid


between open-loop and closed-loop control. The open-loop components prevent
the elimination of distortion of feedback signals from clouds that block the sun.
The closed-loop components eliminate errors from variability in installation,
assembly, calibration, and encoder mounting.

Closed-loop systems track the sun with a set of lenses or sensors with a limited
field of view, directed at the sun, and are fully illuminated by sunlight at all times.

As the sun moves, it begins to shade one or more sensors. The system detects this
movement and activates motors or actuators to move the device back into a
position where all sensors are once again equally illuminated.

Rockwell Automation Publication CC-QR005A-EN-P - May 2013


4 Solar Position Algorithm Connected Components Accelerator Toolkit

Open-loop systems typically employ electronic logic, which is based on a


mathematical formula, to control device motors or actuators to follow the sun.

Solar Position Algorithm The National Renewable Energy Laboratory (NREL) Technical Report
NREL/TP-560-34302, revised January 2008, is included with the Solar
Description Positioning Algorithm and sample program. It provides information and code
examples for a Solar Position Algorithm for Solar Radiation Applications. The
accuracy that can be achieved by using this algorithm is equal to ±0.0003° in the
period from year -2000…6000. This report is a step-by-step procedure for
implementing an algorithm to calculate the solar zenith and azimuth angles.

Rockwell Automation used this report to build a standard logic template that can
be implemented by OEMs to develop tracker equipment.

Based on the Micro800™ controller platform, the implementation of the


algorithm provides reduced execution time and more precision due to native
support of 64-bit floating-point trigonometric math instructions.

Data specific to the geographical location must be entered to perform the


mathematical calculations accurately. The values include the time zone (TZ),
longitude, latitude, pressure, elevation, temperature, surface slope, surface
azimuth rotation, and Delta T (difference between earth rotation time and
terrestrial time). Once the local parameters are entered, the program calculates
the azimuth and zenith angles and the time of sunrise, transit, and sunset for the
day of calculation.

Rockwell Automation Publication CC-QR005A-EN-P - May 2013


Solar Position Algorithm Connected Components Accelerator Toolkit 5

Figure 1 - Position of the Sun Relative to the Observer

Zenith
Sun (Straight Up

North

West

East

θ = Zenith Angle
South φ= Azimuth Angle
e= Elevation Angle

The zenith angle is the angle between the direction of the sun (direction of
interest) and the zenith (straight up or directly overhead). The user-defined
function block (UDFB) calculates the zenith angle in degrees and provides the
value by means of the Out_Zenith output. The sun’s elevation, or altitude, is the
angle from the horizontal plane and the sun’s central ray or just the compliment
of the zenith angle (90° - zenith angle).

The azimuth angle is measured clockwise from true north to the point on the
horizon directly below the object. The program calculates the local (from
observer) azimuth angle and displays it according to two notations:
• Out_AzimuthAstro output provides the astronomer’s azimuth angle,
measured westward from south (-180…180°)
• Out_AzimuthNavi output (0…360°) denotes the navigator’s azimuth
angle, measured eastward from north, which is most often used in solar
tracking applications

Rockwell Automation Publication CC-QR005A-EN-P - May 2013


6 Solar Position Algorithm Connected Components Accelerator Toolkit

Solar Position Algorithm UDFB The Solar Positioning Algorithm is a user-defined function block (UDFB),
named RA_SOLAR_POSITION_ALGRTHM, which can be imported and
used in Connected Components Workbench software, version 2.0 or later.

The RA_SOLAR_POSITION_ALGRTHM UDFB is capable of calculating


the position of the sun, relative to the observer, based on a number of
geographical and environmental parameters at a specific moment in time. It also
calculates the times of sunrise, transit, and sunset for the day.

Rockwell Automation Publication CC-QR005A-EN-P - May 2013


Solar Position Algorithm Connected Components Accelerator Toolkit 7

Input and Output Parameters

Table 1 - Input Parameters


Name Data Type Description
Cmd_Calc BOOL Run calculation
Cmd_SunRTS BOOL Calculate the sunrise, transit, and sunset times
In_Year DINT Year of event
In_Month DINT Month of event
In_Day DINT Day of event
In_Hours DINT Hour of event
In_Minutes DINT Minute of event
In_Seconds DINT Second of event
Par_TimeZone LREAL Observer time zone (negative west of Greenwich) [hours]
Par_DeltaT LREAL Terrestrial Time (TT) - Universal Time (UT) difference [seconds]
Par_Longitude LREAL Observer longitude (negative west of Greenwich) [degrees]
Par_Latitude LREAL Observer latitude (negative south of equator) [degrees]
Par_Elevation LREAL Observer elevation [meters]
Par_AtmRefract LREAL Atmospheric refraction at sunrise and sunset [degrees]
Par_PressureAvg LREAL Annual average local pressure [millibars]
Par_TempAvg LREAL Annual average local temperature [degrees Celsius]
Par_Slope(1) LREAL Surface slope (measured from the horizontal plane) [degrees]
Par_AzmRotation(1) LREAL Surface azimuth rotation (measured from south to projection of surface
normal on horizontal plane, negative west) [degrees]
(1) Optional - this parameter is needed to calculate the Out_Incidence output angle.

Table 2 - Output Parameters


Name Data Type Description
Sts_ER BOOL Error occured during execution
Err_Value DINT Execution error,
• 00001 – One or more input parameters out of range
• 00002 – Sun is always above or below the horizon for the day of
calculation
Out_Zenith LREAL Topocentric zenith angle [degrees]
Out_AzimuthNavi LREAL Topocentric navigator's azimuth angle (measured eastward from north)
[0…360°]
Out_AzimuthAstro LREAL Topocentric astronomer's azimuth angle (measured westward from
south) [-180…180°]
Out_Incidence LREAL Incidence angle for a surface oriented in any direction [degrees]
Out_SunRiseTime TIME Time of sunrise
Out_SunTransitTime TIME Time of sun transit
Out_SunSetTime TIME Time of sunset

Rockwell Automation Publication CC-QR005A-EN-P - May 2013


8 Solar Position Algorithm Connected Components Accelerator Toolkit

Execution Time
These are the execution times:
• Approximately 125 ms for calculation of sunrise, transit, and sunset times
• Approximately 35 ms for calculation of sun’s position

The StsER output parameter, when set high, indicates that the instruction
encountered an error.

Use the Solar Position Algorithm The RA_SOLAR_POSITION_ALGRTHM user-defined function block
(UDFB) is provided as a Connected Components Workbench export file in the
7z format (RA_SOLAR_POSITION_ALGRTHM.7z). The file is in the Solar
Tracking folder within the Sample Code Modules. This folder also contains an
application example (SPA_M830_24QBB_ExampleApplication) that
demonstrates the use of the UDFBs.

Rockwell Automation Publication CC-QR005A-EN-P - May 2013


Solar Position Algorithm Connected Components Accelerator Toolkit 9

Import the User-defined Function Block

You must have a least one UDFB or program already defined in your project
before importing a UDFB or program. To import the UDFB, right-click Import
and choose Import Exchange File.

TIP The instruction uses several other internal UDFBs. These are imported automatically
and do not require any action.

The algorithm requires several complex mathematical expressions to be


calculated at the same time. Standard Micro800 controller memory settings
restrict extensive memory allocation for temporary variables required by the
calculations. Building a project with the newly imported UDFB results in an
insufficient memory error.

Rockwell Automation Publication CC-QR005A-EN-P - May 2013


10 Solar Position Algorithm Connected Components Accelerator Toolkit

To eliminate the error, follow these steps to change the settings of the controller.

1. In the Project Organizer, select the controller and press F4.


The Property window appears.
2. Increase the Memory Size parameter to at least 11,000 KB.
The value can change, dependent on the rest of the controller logic.

Execute the UDFB

The instruction requires one scan to execute. Because the position of the sun does
not change quickly, you should execute the instruction only when needed.

The instruction is programmed to perform initialization of constants on the first


scan of the controller. For proper operation, place the instruction in a program or
rung to be executed unconditionally (that is, with no jumps, IF THEN ELSE
statements, and so forth).

For proper initialization, do not condition the EN input when EN/ENO bits are
used. See Figure 2. Disabling EN/ENO bits and conditioning the first input of
the instruction does not prevent proper initialization unless the rung is not be
executed at all (for example, the Jump instruction was used). See Figure 3.

The Cmd_Calc input starts the execution of the instruction and calculation of
sun’s position.

The combination of Cmd_Calc and Cmd_SunRTS inputs implies that only the
times of sunrise, transit, and sunset (RTS) are calculated while the position is not.

Because the time needed to calculate the RTS is approximately 200 ms and is
needed only once per day, execute this calculation before the regular operation of
the solar tracker.

Rockwell Automation Publication CC-QR005A-EN-P - May 2013


Solar Position Algorithm Connected Components Accelerator Toolkit 11

The RA_SOLAR_POSITION_ALGRTHM instruction can also be used in


programming languages other than Ladder Logic. Examples of the UDFB called
in Function Block Diagram and Structured Text are shown in Figure 4 and
Figure 5, respectively.

Figure 2 - Ladder Logic: without Conditioning

Figure 3 - Ladder Logic: with Conditioning

Rockwell Automation Publication CC-QR005A-EN-P - May 2013


12 Solar Position Algorithm Connected Components Accelerator Toolkit

Figure 4 - Function Block Diagram

Figure 5 - Structured Text

Rockwell Automation Publication CC-QR005A-EN-P - May 2013


Solar Position Algorithm Connected Components Accelerator Toolkit 13

Use RTC in Combination with UDFB

One of the possible sources of date and time data for the instruction can be the
real-time clock (RTC). This functionality in Micro830 and Micro850 controllers
is achieved via a plug-in module (catalog number 2080-MEMBAK-RTC).

Always install the module in the first plug-in slot. Configure the module in the
Controller Properties dialog box.

When the module is properly configured and enabled, you can use the
RTC_READ instruction to read data from the RTC. Because of the format of
particular elements of RTC data, the data type is UINT. Convert it to DINT to
match the RA_SOLAR_POSITION_ALGRTHM input data type.

Figure 6 - Using Real-time Clock Functionality

Rockwell Automation Publication CC-QR005A-EN-P - May 2013


14 Solar Position Algorithm Connected Components Accelerator Toolkit

Validation and Test Results The user-defined function block (UDFB) was implemented based on the Solar
Positioning Algorithm (SPA) published in the National Renewable Energy
Laboratory (NREL) Technical Report NREL/TP-560-34302, revised January
2008. NREL refers to the precision of the algorithm as ±0.0003°.

To verify the correctness of the implementation of the SPA, a simulation was


performed for a period of 1 year with a sampling period of 30 minutes. Based on
17,521 samples gathered, the error of calculation versus results obtained by the
NREL Solar Positioning Algorithm Calculator was calculated as follows.

Angle Average Absolute


Error Value
Zenith 3.41872E-05
Azimuth 7.2167E-05
Incidence 5.26098E-05

These are the simulation parameters.

Parameters Values
Start date and time 1/January/2009 00:00:00
End date and time 31/December/2009 23:30:00
Sampling period 30 minutes
Number of samples 17,521
Time zone -7.0 [hours]
ΔT 67.0 [seconds]
Latitude 39.742476 [degrees]
Longitude -105.1786 [degrees]
Elevation 1830.14 [meters]
Average annual pressure 820.0 [millibars]
Average annual temperature 11.0 [degrees Celsius]
Atmospheric refraction 0.5667 [degrees]
Surface slope 30.0 [degrees]
Surface azimuth rotation -10.0 [degrees]

These results justify the statement that the accuracy of the SPA implementation
for Micro800 controllers is much greater than the mechanical accuracy that
standard mechanical systems could provide.

Rockwell Automation Publication CC-QR005A-EN-P - May 2013


Solar Position Algorithm Connected Components Accelerator Toolkit 15

Notes:

Rockwell Automation Publication CC-QR005A-EN-P - May 2013


Additional Resources These documents contain additional information concerning related products
from Rockwell Automation.

Resource Description
Industrial Automation Wiring and Grounding Guidelines, Provides general guidelines for installing a Rockwell
publication 1770-4.1 Automation™ industrial system.
Micro830 and Micro850 Programmable Controllers User Provides a reference guide for Micro800 controller
Manual, publication 2080-UM002 systems, plug-in modules, and accessories. It also contains
procedures on how to install, wire, and troubleshoot your
controller.
Connected Components Accelerator Toolkit Building Block Provides descriptions of the available Connected
Project Descriptions Quick Reference, publication Component Accelerator Toolkit projects.
CC-QR003
Product Certifications website, Provides declarations of conformity, certificates, and other
http://rockwellautomation.com/rockwellautomation/cert certification details.
ification/

You can view or download publications at


http://www.rockwellautomation.com/literature/. To order paper copies of
technical documentation, contact your local Allen-Bradley distributor or
Rockwell Automation sales representative.

Allen-Bradley, Rockwell Software, Connected Components Workbench, Micro800, Micro830, Micro850, and Rockwell
Automation are trademarks of Rockwell Automation, Inc.

Trademarks not belonging to Rockwell Automation are property of their respective companies.

Rockwell Otomasyon Ticaret A.Ş., Kar Plaza İş Merkezi E Blok Kat:6 34752 İçerenköy, İstanbul, Tel: +90 (216) 5698400

Publication CC-QR005A-EN-P - May 2013


Copyright © 2013 Rockwell Automation, Inc. All rights reserved. Printed in the U.S.A.

You might also like