Solar Tracker

Group member: Ci Chen(A), Jiayi Li(B), Ziran Ling(A)

Introduction

Global warming has increased the demand for green energy produced by renewable sources such as solar power. A solar tracking system can increase the power generation efficiency greatly by always orienting the solar panel towards the sun. Our solar tracker use a very small scale dual-axis tacking system and a solar board as a simulation of real-life senario to show how a DIY Mbed based solar tracker will work.

Feature

  • Update weather from the internet daily and pause the tracking routine if it is not sunny
  • The sun position is calculated according to the "PSA" solar positioning algorithm, based on longitude, latitude, and time zone
  • The system automatically stop tracking during night
  • LCD display clearly showing the real time, weather, and panel angle
  • Dual-axis simulation tracking in order to maximize the power generation efficiency

800 800 /media/uploads/conantina/print.jpg

Hardware

Mbed LPC1768
Dynamixel AX-12A Robot Actuator
uLCD-144-G2 128 by 128 smart color LCD
Ethernet Magjack and Breakout Board

Wiring and coding examples

Actuator

Vertival Ax-12AMbedPower Supply
Datap27,p28
Vdd9V
GndGnd
Horizontal Ax-12AMbedPower Supply
Datap13,p14
Vdd9V
GndGnd

1000
To control the actuators (digital servos), the team uses Plataforma Solar de Almería ("PSA") solar positioning algorithm to calculate the sun position, based on longitude, latitude, and time zone. Then Mbed chip controls the actuators to rotate. The PSA algorithm can be found here: http://www.pveducation.org/pvcdrom/properties-of-sunlight/sun-position-high-accuracy The two digital servos rotate according to the Zenith and Azimuth angles. The servos need external power supply to support them.

example code to calculate zenith and azimuth angles

dElapsedJulianDays=(double)(iDay+liAux3+liAux4+liAux5+59)+
		                    -0.5+dDecimalHours/24.0;
dOmega=2.1429-0.0010394594*dElapsedJulianDays;
		dMeanLongitude = 4.8950630+ 0.017202791698*dElapsedJulianDays; // Radians
		dMeanAnomaly = 6.2400600+ 0.0172019699*dElapsedJulianDays;
		dEclipticLongitude = dMeanLongitude + 0.03341607*sin( dMeanAnomaly ) 
			+ 0.00034894*sin( 2*dMeanAnomaly )-0.0001134
			-0.0000203*sin(dOmega);
		dEclipticObliquity = 0.4090928 - 6.2140e-9*dElapsedJulianDays
			+0.0000396*cos(dOmega);
	}

	// Calculate celestial coordinates ( right ascension and declination ) in radians 
	// but without limiting the angle to be less than 2*Pi (i.e., the result may be 
	// greater than 2*Pi)
	{
		
		dSin_EclipticLongitude= sin( dEclipticLongitude );
		double dY1 = cos( dEclipticObliquity ) * dSin_EclipticLongitude;
		double dX1 = cos( dEclipticLongitude );
		dRightAscension = atan2( dY1,dX1 );
		if( dRightAscension < 0.0 ) dRightAscension = dRightAscension + twopi;
		dDeclination = asin( sin( dEclipticObliquity )*dSin_EclipticLongitude );
	}

	// Calculate local coordinates ( azimuth and zenith angle ) in degrees
	{
		
		dGreenwichMeanSiderealTime = 6.6974243242 + 
			0.0657098283*dElapsedJulianDays 
			+ dDecimalHours;
						
		dLocalMeanSiderealTime = (dGreenwichMeanSiderealTime*15 
			+ dLongitude)*rad;
		dHourAngle = dLocalMeanSiderealTime - dRightAscension;
		dLatitudeInRadians = dLatitude*rad;
		dCos_Latitude = cos( dLatitudeInRadians );
		dSin_Latitude = sin( dLatitudeInRadians );
		dCos_HourAngle= cos( dHourAngle );
		dZenithAngle = (acos( dCos_Latitude*dCos_HourAngle
		*cos(dDeclination) + sin( dDeclination )*dSin_Latitude));
		double dY = -sin( dHourAngle );
		double dX = tan( dDeclination )*dCos_Latitude - dSin_Latitude*dCos_HourAngle;
		dAzimuth=atan2( dY, dX );
		if ( dAzimuth < 0.0 ) 
			dAzimuth = dAzimuth + twopi;
		dAzimuth = dAzimuth/rad;		
		// Parallax Correction		
		dParallax=(dEarthMeanRadius/dAstronomicalUnit)
			*sin(dZenithAngle);
		dZenithAngle=(dZenithAngle 
			+ dParallax)/rad;
		dElevation=90-dZenithAngle;
	}	
}

uLCD

mbeduLCD HeaderuLCD cable
5V=VU5V5V
GndGndGnd
TX=P9RXTX
RX=P10TXRX
P11ResetReset

Ethernet

MbedSparkfun RJ45 Ethernet MagJack Breakout
TD+P1
TD-P2
RD+P7
RD-P8

Since the school internet limitation, the team sets a bridge in the laptop to provide Ethernet connection to the mbed. Detailed method can be found here https://developer.mbed.org/users/4180_1/notebook/setting-up-a-network-bridge-connection-for-mbed-on/.

To pull the data from the internet, the team intended to use the https://developer.mbed.org/users/lballiet91/notebook/nokia-lcd-weather-application/ yahoo weather API. However, later the team realized that Yahoo API provided more data than we actually need. To make the program more efficient and also to provide another innovative option to get data from the Ethernet. The team decided to try some other approaches. The team used this website http://openweathermap.org/data/2.1/find/city?lat=33.75&lon=-84.39&cnt=1&type=XML to get the data in the XML format. Since the data is not too long, it could be directly placed in a buffer. Then the team converts the buffer into a string. Through the string.h header the data can be parsed and information can be selected to control the actuator and also to display on the uLCD.

Ethernet example

         HTTPResult r = http.get("http://openweathermap.org/data/2.1/find/city?lat=33.75&lon=-84.39&cnt=1&type=XML", &stream, request_callback); //Load a very large page, such as the hackaday RSS feed
        BigBuf[stream.readLen()] = 0; //Transform this buffer in a zero-terminated char* string
         parser.append( BigBuf, strlen(BigBuf)); // stream current buffer data to the XML parser
         sprintf(buffer,"%s",BigBuf);
        n = sizeof(buffer);
        string ret(buffer, n);
        place = ret.substr(ret.find("name"),ret.length());
        place = place.substr(place.find(delimiter3),place.find(delimiter2)-4);
        weather = ret.substr(ret.find(delimiter), ret.length());
        weather.erase(0,weather.find(delimiter3)+1);
        condition = weather.substr(weather.find("main"),weather.length());
        condition = condition.substr(condition.find(delimiter3),place.find(delimiter2)-2);

Demo Video

Import programDIY Mbed Dual Axis Soler Tracker

This program uses the "PSA" solar positioning algorithm calculating the sun position, based on longitude, latitude, and time zone. Then Mbed chip controls the two digital servos to rotate the solar panel to the correct azimuth and zenith angle.


Please log in to post comments.