A Dual-Axis Solar Tracker Using the Basic Stamp Microcontroller

fiercebunElectronics - Devices

Nov 2, 2013 (4 years and 7 days ago)

62 views





A
n Ephemeris Based

Dual
-
Axis Solar Tracker Using the

Basic Stamp
®

Microcontroller



Shawn Lamb*



Department of Applied Physics

Appalachian State University, Boone, NC









Copyrighted to Shawn Lamb 2005

All Rights Reserved


1.

Introduction



A m
icrocontroller based dual
-
axis tracking device was constructed as part of a
"proof of concept" project for the Renewable Electricity class TEC 5608 at Appalachian
State. The concept was to guide a solar panel to follow the Sun using only a
microcontroller
. The initial
idea involved a real time calculation of the altitude and
azimuth given the local time, latitude, and longitude. Upon learning that the
microcontro
ller chosen, the Basic Stamp (BS2P
) from Parallax Inc.
[1]
, could not work
with IEEE floating
point numbers the idea had to be adjusted to that of lookup tables.
The small amount of memory space in the EEPROM on the microcontroller limited the
number of data points to be included in the lookup table. Only seven points were chosen
al
lowing for sev
en tracking positions

covering the period from 9am to 3pm (hour 15 in
military time). The Jet Propulsion Lab's online ephemeris
[2]

was used to generate the
altitude and azimuth
(see
appendix A
)
for these times on the date
4/25/05.



2. The Tracker

Devic
e



The tracker was constructed out of wood having a turntable style azimuth axis and
fork mount style altitude axis. A lazy susan ball bearing was used to hold two concentric
wooden discs together giving the low friction motion needed to track in azimuth
. For the
fork mount a thick cardboard cylinder was shaped to hold a metal bar running through the
forks (see
cover
).
Three wooden
(maple)
le
gs were constructed by Jeremy E
h
re
t for
stability. A faux solar panel was used for demonstrative purposes. A we
b camera with a
solar filter, mounted parallel to the plane of the panel, would image the sun in order to
test accuracy.



3. The Motors



Two Airpax A82478
-

5 V / 3.5 W unipolar
[3]

stepper motors drove the two axes.
After an attempt at gearing the mo
tors to the axes a more "appropriate" solution was
appreciated, namely duct tape. The friction of the duct tape interface between the surface
of the turntable and the motor did cause some slipping in angle. A thin strip of sand
paper was added to the sur
face in order to increase the friction and there was no more
slipping (see fig
1
). After much experimenting, a duct tape belt system was used to t
urn
the altitude axis (see fig 2
). Each motor was then tested to determine the angular
resolution of each st
ep. This constant was used in the software as a conversion factor
from the needed angle and the number of steps sent to the motors. Two
Allegro
[4]

8052
stepper drivers
were used to control the stepping signals. The only input needed to drive
a motor was

a direction pulse (0V = clockwise and 5V = ccw)

and a step pulse (active
low). The operating parameters of both the motor and the driver chip are given in
appendix B. As a note the motors did get hot to the touch when left powered for more
than twenty m
inutes or so but this neither affected their performance or
presented any
danger of fire
.






Fig 1
-

Azimuth Motor w/ sandpaper



Fig 2
-

Altitude Motor w / belt



3. The Microcontroller



The Parallax Basic Stamp (B
S
2
P
) was used to control the mo
tors in
correspondence with the ephemeris.

The stamp used an embedded form of the BASIC
language created by Parallax called PBASIC. This language uses commands that are
different than BASIC and as was discussed earlier only allows for integer numbers.
The
2K EEPROM memory holds up to 4000 lines of code and the PBASIC language but has
little room for data. This stamp can be expanded by including 8k EEPROMs just to hold
the table values. The stamp processes 4k instructions / sec and has a 20 Mhz clock t
hat
can be used for timing (see appendix C)
.


Two push buttons were added to the stamp for manual alt
itude

/ azimuth
adjustments and debugging. Ultimately four output lines were sent to the driver chips
(located under the tracker) for step and direction

bits (see fig 3

and 4
).
The stamp was
powered separately by a 9V battery. It was found to last about 6 hours of constant use.






Fig 3
-

The Basic Stamp Microcontroller



Fig 4
-

8052 Stepper Motor Drivers





4. The Lookup Table



The ephemeris
is loaded into the code directly as both a lookdown table of hours
and separate lookup tables for altitude and azimuth.
A prompt at the start of the program,
before motion control, asks the user which hour (EST) it is currently closest to. This is
then u
sed in a look
down

table of hours which then returns the element number that hour
was found at into a variable HOUR (see appendix D

for the complete program
)
. This
index is then used in another look
up

table of the same length to get the altitude and
azimut
h (in degrees). This concept can be extended to n points by importing the
ephemeris data (.txt format) into MS Excel and separating the columns into hour, alt, and
azimuth. The only limitation is the amount of memory space available in the EEPROM.
It ha
s been calculated that by adding two serially connected, 8k EEPROMs that a full
year's worth of points at 5 minute intervals could be stored. This would afford accurate,
long
-
term tracking
that would only have to be updated every

year or so. The EEPROMs
are "loaded" with both data and code via a US232B parallel bus line from a PC (in this
case a PII / W98 laptop). An peripheral clock chip could be purchased as well to keep
accurate date and time. At the end of a day's tracking the panels are brought bac
k to their
home position of azimuth = 90˚ (E) and altitude = 24˚ (near visible horizon) in
anticipation of the next day's sunrise. The microcontroller can then be put into a low
power mode until the next morning.


5. Conclusions

and Future
Implications



This project showed that a Basic Stamp could be used to track the sun using an
ephemeris but didn't show how well it does so. Accuracy could be improved with more
points from the ephemeris. Using the webcam one could "watch" how the panels move
in res
ponse to the sun

(see fig.5
a and 5b
)
. An astronomical autoguiding program could
be used to determine the average drift in alt / az
imuth

over time
(see fig.6
a and 6b
)
.

Ultimately this offset could be looped back into the microcontroller to make fine
adjust
ments in an autonomous closed loop system.

One application of this would be in









Fig.5
a

-

Webcam image
without solar filter



Fig.5b
-

Webcam image with solar filter







Fig.6a
-

Offset tracking by alt / azimuth



Fig.6b
-

Astroart® autoguiding software for the webcam


High Concentrating Photovoltaic (HCPV) systems used in industrial applications that
need a tracking accuracy of less than 0.1 degrees (1/5 the Sun's angular size). Stirling
Engines also need to concentrate i
ncident sunlight directly onto the thermo
-
electric
element. The portability and relatively low cost of this type of tracking system also
invites small scale PV tracking with a high level of accuracy. Several smaller panels
could be tracked instead of mou
nting many on a single tracker. Also, the microcontroller
is autonomous for 1 year periods (or more) and no computer is needed to control the
tracking. These are ideas that will be pursued in dept
h over the next couple years. For
now this model tracker
shows the possibilities of accurate, autonomous tracking using the
BASIC STAMP microcontroller.



Acknowledgements



I would like to thank Dr. Tom Rokoske for his very helpful insight to the tracker
problem as well as Dr. Raichle. Special thanks to Jeremy

Ehret for his excellent wood
craftsmanship and to Dr. Clements for his advise on microcontrollers. Thanks also to
ASU Dept. of Physics and Astronomy as well as Appropriate Technology Dept for
equipment and facilities.

References

[1] Parallax Inc., Rockl
in, CA
-

TEL: (888) 512
-
1024
-

www.parallax.com

[2] Ephemeris by Jet Propulsion Lab, Pasadena, CA
-

http://ssd.jpl.nasa.gov/cgi
-
bin/eph

[3] Airpax
-

www.allegromicro.com/techpub2/airpax/airpax.htm

[4]
Allegro

MicroSystems,

Inc., 115

Northeast

Cutoff, Wor
cester,

MA

01606

USA,
TEL:

1.508.853.5000
-

www.allegromicro.com

Appendix A : Ephemeris Report

Ephemeris Settings


Target Body:
Sun [Sol]

Observer Location:
Boone, NC


Coordinates:
81°39'27.7''W, 36°11'55.0''N



From:
A.D. 2005
-
04
-
25 09:00 UT
-
5 (
EST/CDT)


To:
A.D. 2005
-
04
-
25 15:00


Step:
1 hour

Format:
Calendar Date and Time


Output Quantities:
4


Ref. Frame, RA/Dec Format:
J2000, Degrees

Apparent Coordinates Model:
Refracted


HORIZONS Generated Ephemeris

Start time : A.D.

2005
-
Apr
-
25 09:00:00.0000 UT
-
05:00

Stop time : A.D. 2005
-
Apr
-
25 15:00:00.0000 UT
-
05:00

Step
-
size : 60 minutes

***********************************************************************
Target primary : Sun {source: DE4
05}

Atmos refraction: YES (Earth refraction model)

RA format : DEG

Time format : CAL

Time zone : UT
-
05:00

***********************************************************************


Date_(ZONE)_HR:MN Azi_(r
-
appr)_Elev

********************
********************


2005
-
Apr
-
25 09:00 * 102.9589 38.9920


2005
-
Apr
-
25 10:00 * 115.8244 50.4133


2005
-
Apr
-
25 11:00 * 134.8823 60.3342


2005
-
Apr
-
25 12:00 * 164.8743 66.5352


2005
-
Apr
-
25 13:00 * 201.5035 65.8538


2005
-
Apr
-
25 14:00 * 229.332
5 58.7453


2005
-
Apr
-
25 15:00 * 246.9373 48.4478


Azi_(r
-
appr)_Elev =


Refracted apparent azimuth and elevation of target. Corrected for
light
-
time,the gravitational deflection of light, stellar aberration,
precession, nutation

and approximate atmosphe
ric refraction. Azimuth
measured North(0)
-
> East(90)
-
>

South(180)
-
> West(270), elevation with
respect to plane perpendicular to local

zenith direction. TOPOCENTRIC
ONLY. Units: DEGREES


Computations by ...


Solar System Dynamics Group, Horizons On
-
Line Ephemeris System


4800 Oak Grove Drive, Jet Propulsion Laboratory


Pasadena, CA 91109 USA


Information: http://ssd.jpl.nasa.gov/


Connect : telnet://ssd.jpl.nasa.gov:6775 (via browser)


telnet ssd.jpl.nasa.gov 6
775 (via command
-
line)


Author : Jon.Giorgini@jpl.nasa.gov