19
Dual Axis Solar Tracking Panel Control System Senior Design Project by: Ryan Courtney Advisor: Dr. Junkun Ma Class: ET 493_01 Fall 2011 Professor: Dr. Cris Koutsougeras

csit.selu.educsit.selu.edu/...w0378793_Phase1_Ryan_Courtney.docx  · Web viewThe purpose of this project is to design a dual axis solar tracking real-time feedback control system

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: csit.selu.educsit.selu.edu/...w0378793_Phase1_Ryan_Courtney.docx  · Web viewThe purpose of this project is to design a dual axis solar tracking real-time feedback control system

Dual Axis Solar Tracking Panel Control System

Senior Design Project by: Ryan CourtneyAdvisor: Dr. Junkun Ma

Class: ET 493_01 Fall 2011Professor: Dr. Cris Koutsougeras

Page 2: csit.selu.educsit.selu.edu/...w0378793_Phase1_Ryan_Courtney.docx  · Web viewThe purpose of this project is to design a dual axis solar tracking real-time feedback control system

Table of Contents

Abstract………………………………………………………………………..Page 3

Introduction…………………………………………………………………...Page 4

Proposed Research……………………………………………………………Page 4

Approach……………………………………………………………………...Page 4

Overall Value of Project’s Research………………………………………...Page 4

Budget Justification…………………………………………………………..Page 5

Diagram of Overall System…………………………………………………..Page 5

Phase I…………………………………………………………………………Page 6

Introduction…………………………………………………………...Page 6

Light Sensor…………………………………………………………...Page 6

Microcontroller………………………………………………………..Page 7

Algorithm/Code………………………………………………………..Page 10

Conclusion……………………………………………………………...Page 13

Timeline Phase I………………………………………………………………..Page 13

References………………………………………………………………………Page 13

Parts……………………………………………………………………………..Page 13

Page 3: csit.selu.educsit.selu.edu/...w0378793_Phase1_Ryan_Courtney.docx  · Web viewThe purpose of this project is to design a dual axis solar tracking real-time feedback control system

Dual Axis Solar Tracking System

Team Members: Ryan CourtneyFaculty Advisor: Junkun MaDepartment of Computer Science & Industrial TechnologySLU10847Southeastern Louisiana UniversityHammond, LA 70402

Abstract

The purpose of this project is to design a dual axis solar tracking real-time feedback control system for a single solar panel as shown in Diagram 1. This will then be mounted on to a trailer and used to charge banks of batteries that will in turn give power to an electric motor. The control system will be constructed using a light intensity sensor that will provide sun orientation and location information to a microcontroller. The microcontroller will then interpret the signal from the sensor and activate a rotary motor and linear actuator to adjust the positioning and orientation of a solar panel so as to optimize the amount of light that is hitting the panel. The information obtained from the system such as sensor readouts, voltage output, motor control, etc. will be transmitted to a wireless device for monitoring and record keeping. This project will allow me to become familiar with the design and implementation of a feedback control system. It will also allow me to expand my knowledge of integrating different components into one system. This in turn will grow my knowledge of building interfaces to work with the hardware I have in place in the system. As solar energy is a fast growing technology in today’s world, this will give me the hands-on experience I need to compete in today’s engineering field.

Diagram 1

Page 4: csit.selu.educsit.selu.edu/...w0378793_Phase1_Ryan_Courtney.docx  · Web viewThe purpose of this project is to design a dual axis solar tracking real-time feedback control system

Introduction

This project will prepare me for the use of my knowledge beyond the walls of Southeastern. It will allow me to put into reality the theory that is taught in the classroom. I will be able to implement the control methods presented to me. Drawing from my classes about microprocessors and computer architecture, I will be able to integrate a microcontroller as the brain of my control system. I will be able to put into practice the reading in of data to the controller, processing the data, and using it to produce useable output to either another system or for readout purposes. While working on this project will be able to see clearly the overlapping of hardware and software and how I can use them together to accomplish the tasks that the work field will put before me. I plan to meet twice a week with my advisor to update on the progress of the project as well as get any guidance or knowledge needed for obstacles that arise. I will be working with my advisor to integrate this control system into a larger project in which he has other students designing different parts. Overall, the project will be designed to be generic in that it can be fitted to any type of system that requires the use of solar energy.

Proposed Research

The proposed research is to first locate a sensor that is cable of detecting light intensity. This will either be purchased or constructed using photo-resistors. This will include methods to obtain as well as to use signal from the sensor. I will then need to gather information about how to implement the sensor as part of the overall system. This will require research into determining the correct microcontroller for the task along with reading into how it is capable of sending signal to other components in the system such as the motors, actuator, and wireless device. Depending on the selection of the microcontroller, a digital to analog converter may be needed to establish communication between the microcontroller and other components in the system. This will be an excellent project that will allow a Computer Engineering Technology student gain extensive knowledge on integrating a software and hardware driven feedback control system.

Approach

Research is the number one concern of this project. I will have to gather extensive information to be able to accurately implement the components of this system. I will be studying similar systems and projects to determine how best to approach my design. From the understanding I gain in this research, I will be able to complete a competent and functional system. My goal is to design a system that will track light orientation to allow the system to physically adjust the position of a solar panel so as to max light intensity intake can be achieved. The data such as solar panel position, obtained from the system will then be transferred via a wireless device and then displayed for monitoring purpose.

Overall Value of Project’s Research

Learning the design and implementation of a feedback control system will be extremely valuable in bringing into reality the theory that has been presented to me in the classroom. I will be able to put my hands on the hardware and grow my knowledge of implanting it into a functional system. I will be able to learn the bounds and limits of the hardware first-hand as they cannot always be

Page 5: csit.selu.educsit.selu.edu/...w0378793_Phase1_Ryan_Courtney.docx  · Web viewThe purpose of this project is to design a dual axis solar tracking real-time feedback control system

clearly expressed on paper. This project will give me a better understanding of the design and implementation of a feedback control system.

Budget Justification

Budget Category Funds Requested

Reason for Request

Photoconductive Sensor $155 To purchase or construct light sensorMicrocontroller $395 To obtain microcontroller for system controlWireless Device $175 To obtain wireless device for transmitting dataElectric Meter $250 To obtain electric output of solar panelTotal $975

The funds requested for this project amount to $975.00. This includes the components necessary to accomplish the project. The components are: photoconductive sensor ($155) to purchase or design a sensor to monitor light intensity, a microcontroller ($395) to act as the central brain of the system to interpret all signals and control other devices in the system, and a wireless device ($175) to be used to transmit data to a computer. The electric meter ($250) will be used to monitor the electric output of the solar panel.

Diagram of Overall System

Figure 1

As can be seen in Figure 1, the light sensor is integral to the design of this system. Without it, the system cannot function. The construction/acquisition of this light sensor is the first task of this project and will be completed by the end of the semester, December 2011.

Page 6: csit.selu.educsit.selu.edu/...w0378793_Phase1_Ryan_Courtney.docx  · Web viewThe purpose of this project is to design a dual axis solar tracking real-time feedback control system

Phase I

Introduction

Phase 1 of the project will be to either obtain or construct the light sensor and get a working algorithm for tracking the light position.

Light Sensor

I began my research first in hopes of obtaining a commercially available light sensor that could track light incidence angle based on a simple coordinate system and output signals from this. My search proved to be in vain as the only light sensors I could locate that were readily available were sensors that either detected light presence or were already integrated into another system and useless to me.

This is when I decided it would be best to design and construct my own light sensor. I decided to use photo-resistors for the design. Photoresistors are unique resistors that have a variable resistance based on the amount of light they received. Theoretically, a photoresistor exposed to little to no light should have a very high to infinite resistance. By taking advantage of this very property, it is possible construct a light sensor consists of a grid of four photo-resistors as shown below in Figure 2 to track the orientation of a light incidence.

Figure 2

As can be seen, the four photo-resistors were given the designations A0 – A3 for easier reference both in this document and in the algorithm that would be controlling the system. Using the layout in Figure 2, the position of light can be tracked by simply comparing the voltage drops across the various photo-resistors. For example, to track the vertical light position, resistors A0 and A1 are compared. If the voltage drop across A0 is greater than A1, the most intense light is at A1. According to the properties of photo-resistors, the more light that is present at a resistor, the lower the resistance will be. Holding true to Ohm’s law which says:

V= I*R

where V is the voltage drop across a resistor, I is the current flowing through the resistor, and R is the resistance value of the resistor, it can be seen that lower resistance results in a lower voltage drop. This means that the most intense light is at the position of the lowest voltage drop so long as current is held constant. Therefore, the most intense light is at A1.

Page 7: csit.selu.educsit.selu.edu/...w0378793_Phase1_Ryan_Courtney.docx  · Web viewThe purpose of this project is to design a dual axis solar tracking real-time feedback control system

Using the same process, the vertical light position can be obtained as well. This logic can then be translated into an algorithm that can implemented by a microcontroller.

Microcontroller

The final part of Phase 1 would be to select a microcontroller. Two popular microcontrollers on the market are the Arduino and mBed microcontrollers. I chose the Arduino board for two reasons. It has multiple models that all can run the same code. It also has the most support via an online forum. Using this forum, one can ask questions and read sample projects submitted by users from all over the world. The particular model of Arduino I chose to use was the Arduino Uno due to its small size.

The Arduino Uno can be purchased at any online store that sells electronics such as Amazon.com. For support and documentation on this project, one can visit:

http://www.arduino.cc/en/Main/arduinoBoardUno

Following this link will give all of the technical specifications on this item as well as links to purchase it.

With the microcontroller selected and purchased, I began to research how to implement my light sensor design using the microcontroller. I found that the Arduino Uno contained six pins that could read in an analog signal. The pin would pass a small current over the device connected to the pin using a 5 volt supply from the board and then produce a value from 0 to 1023 based on the voltage drop across the device. By using a voltage divider circuit, the photo-resistors could each be connected to the microcontroller as shown in Figure 3 below:

Page 8: csit.selu.educsit.selu.edu/...w0378793_Phase1_Ryan_Courtney.docx  · Web viewThe purpose of this project is to design a dual axis solar tracking real-time feedback control system

Figure 3

The value of resistor R was 10 KΩ. The value can be increased or decreased for more or less sensitivity in the circuit respectively. For this purpose, the value chosen gives enough sensitivity. The A0 pin is the name of the first analog pin on the microcontroller. There are five other pins available for the other resistors or any other analog component.

Using this circuit repeated three more times for resistors A1 through A3, the light sensor was successfully connected to the Arduino Uno microcontroller. Figure 4 shows the prototype of the photo-resistors on a bread board. This prototype was used to build and test the algorithm that drives the light sensor.

Figure 4For all testing done, the Arduino was powered by the included USB cable connected to a standard USB 2.0 port on a desktop computer. The board also contains another port and pin for using external power supplies.

Page 9: csit.selu.educsit.selu.edu/...w0378793_Phase1_Ryan_Courtney.docx  · Web viewThe purpose of this project is to design a dual axis solar tracking real-time feedback control system

After the light sensor was successfully connected to the board and found to be producing values into the console application designed for this board. The software and drivers along with documentation on how to setup a computer for use with the Arduino boards can be located at:

http://arduino.cc/en/Main/Software (driver and console application)

http://arduino.cc/en/Guide/Windows (installation instructions for Windows)

Once fully installed, the application for creating code to run on the board will look like this:

Using this application, I began to create the algorithm that would perform the logic described earlier for the light sensor. This algorithm will also be adapted later to use this logic to control the motors that will physically point the system toward the light.

Page 10: csit.selu.educsit.selu.edu/...w0378793_Phase1_Ryan_Courtney.docx  · Web viewThe purpose of this project is to design a dual axis solar tracking real-time feedback control system

Algorithm/Code

The algorithm that will be used to control the system will follow the logic diagram in Figure 4:

Figure 5

As can be seen, the algorithm first checks to see if the all of the resistors are equal within a certain tolerance. The tolerance is defined in the coding as 5 for testing purposes. A more precise number will be obtained when the system enters into the final rounds of testing when it is assembled. This is done because if all of the resistors are equal within a certain tolerance, then there is no reason to move the system. The panel is pointed at the most intense light. The algorithm calls a HOLD function that tells the system to wait for a specified amount of time before checking again.

If the resistors are not equal, the algorithm then compares each resistor to its complementary resistor to see which is greater. For example, resistor A0 has a complementary resistor of A1 as it is the resistor below A0 and is used to determine the vertical direction of light (refer to Figure 2). Using logic described earlier in this document (see Light Sensor), the algorithm determines the direction for the system to move based on the result of the comparison of the two resistors.

Figure 5 (shown below) shows the implementation of the logic diagram in Figure 5 using a series of loops and IF statements. The code in Figure 6 is based on C++ and is written in the compiler that can be found on the Arduino website (see Microcontroller).

int tol_v = 5; // tolerance level for vertical resistorsint tol_h = 5; // tolerance for horizontal resistors

int left = 76; // as the H-bridge in use operates on a range of 0-5V with 2.5V being stop, 76 yields a 60% capability in reverse/left directionint right = 204; // as the H-bridge in use operates on a range of 0-5V with 2.5V being stop, 204 yields a 60% capability in forward/right directionint up = 153;

Page 11: csit.selu.educsit.selu.edu/...w0378793_Phase1_Ryan_Courtney.docx  · Web viewThe purpose of this project is to design a dual axis solar tracking real-time feedback control system

int down = 153;/* H-bridge for horizontal motion still needs to be tested. Low pass filter is working and converting the PWM signal to analog for the bridge to receive, but as of yet to use a confirmed working H-bridge. Pending receipt of new bridge. H-bridge for vertical motion is in route and will be tested when received. As it operates differently than the horizontal bridge, more pins will be needed to enable the motor and control direction. This will be defined in the next version once part is received. */

int pwm = 9; // sets PWM pin to pin 9 on board

int wait = 5000; // delay time between checks

void setup() Serial.begin(9600); pinMode(pwm, OUTPUT); // sets pin 9 to output

void loop() init_check(); Serial.println(); //delay(2000);void init_check() if(abs(avg_sensor(A0) - avg_sensor(A1)) <= tol_v && abs(avg_sensor(A2) - avg_sensor(A3)) <= tol_h) hold(); else ctrl_horiz(A2, A3); ctrl_vert(A0, A1); Serial.println("STOP!!!"); hold();

int avg_sensor(char s) //averages resistor readings for more stable value. int count = 0; int sum = 0; for(int i = 0; i < 3; i++) count++; sum += analogRead(s); return sum/count;

void ctrl_vert(char s1, char s2) //logic for determining which direction to move in verical plane while (abs(avg_sensor(s1) - avg_sensor(s2)) > tol_v) if(avg_sensor(A0) < avg_sensor(A1)) Serial.println("Move UP!"); delay(1500); else Serial.println("Move DOWN!");

Page 12: csit.selu.educsit.selu.edu/...w0378793_Phase1_Ryan_Courtney.docx  · Web viewThe purpose of this project is to design a dual axis solar tracking real-time feedback control system

delay(1500); Serial.println("STOP!!!"); //init_check();

void ctrl_horiz(char s1, char s2) //logic for determining which direction to move in horizontal plane while (abs(avg_sensor(s1) - avg_sensor(s2)) > tol_h) if(avg_sensor(A2) < avg_sensor(A3)) Serial.println("Move LEFT!"); hmotor_ctrl(left); // signal motor to turn left until resistors are balanced delay(1500); else Serial.println("Move RIGHT!"); hmotor_ctrl(right); // signal motor to turn right until resistors are balanced delay(1500);

void hmotor_ctrl(int val) analogWrite(pwm, val);

void vmotor_ctrl(int val) //to be filled

void hold() //Delay function used when resistors are balanced Serial.println("HOLD"); delay(wait);

Figure 6

As can be seen in Figure 6, the algorithm first calls a function known as “init_check.” This is the function that performs the first portion of the logic diagram in Figure 4. Then based on the results of the check, it moves to either the “hold” function or “ctrl_horiz” and “ctrl_vert” functions. The “ctrl” functions act as the second part of the logic diagram. They each call a function known as “avg_sensor.” This function simply reads the voltage drop from the resistor at the designated pin three times and then takes the average of the readings. This allows for a more reliable, stable number from the resistor. Then following the logic referenced in the Light Sensor section, the code will then print out the direction to move to the console so that it can be checked to see that the algorithm is functioning.

There are also functions and variables in the algorithm that will be used to control the motors for the system. As of now, they are mostly skeleton functions and will be added to in future revisions of the algorithm upon start of Phase II of the project which is scheduled to be complete in the Spring 2012 semester.

Page 13: csit.selu.educsit.selu.edu/...w0378793_Phase1_Ryan_Courtney.docx  · Web viewThe purpose of this project is to design a dual axis solar tracking real-time feedback control system

Conclusion

Phase I is complete with a working light sensor capable of tracking orientation of a light incidence. Taking advantage of the properties of photo-resistors, I was able to successfully construct a light sensor prototype that has successfully tracked the position of the most intense light. With this being complete, I have fulfilled the deliverables promised in Phase I of this project.

In Phase II, I will begin to test the various H-bridges I have obtained to determine which will be best to use to control the two motors in this system. The control functions in the algorithm that send the necessary signals to the motors will be completed and the final system will be assembled with wireless reporting capability.

Timeline Phase I

Date (Week of) Task9/12/2011 Draft of Proposal9/26/2011 Research Light Sensor and Final Proposal

10/10/2011 Research Microcontroller and other electronics10/17/2011 Gather Components10/24/2011 Draft Final Report and Begin testing of microcontroller11/7/2011 Test components for sensor with microcontroller

11/14/2011 Research motor and actuator control with microcontroller

11/21/2011 Begin construction of light sensor using results of tests11/28/2011 Final Report and finalize algorithm for light sensor

Spring 2012 Implement motor and actuator control along with wireless communication (Phase II)

References

1. http://www.arduino.cc/playground/Learning/PhotoResistor 2. http://arduino.cc/en/Reference/HomePage 3. http://www.bizoner.com/arduino-ambient-light-density-cds-photoresistor-sensor-p-

230.html?zenid=qqasomd7cq6ekgr3pbr0kas7u0

Parts

Item Link Quantity Price TotalSingle H-Bridge http://www.pololu.com/catalog/product/1212 1 $22.95 $22.95Jumper Wire

http://www.amazon.com/Elenco-Piece-Pre-formed-Jumper-Wire/dp/B0002H7AIG 1 $9.93 $9.93

Page 14: csit.selu.educsit.selu.edu/...w0378793_Phase1_Ryan_Courtney.docx  · Web viewThe purpose of this project is to design a dual axis solar tracking real-time feedback control system

Sabertooth http://www.dimensionengineering.com/Sabertooth2X25.htm 1 $124.99 $124.99

Arduino http://www.amazon.com/gp/product/tags-on-product/B001VK18HC 2 $24.95 $49.90

mBed http://www.pololu.com/catalog/product/2150 1 $59.00 $59.00Solder less Header http://www.sparkfun.com/products/10527 10 $1.35 $13.50xBee Explorer http://www.sparkfun.com/products/9132 4 $9.95 $39.80xBee Antenna http://www.sparkfun.com/products/8665 4 $22.95 $91.80xBee USB/Serial http://www.sparkfun.com/products/8687 2 $24.95 $49.90Photo-resistor PCB

http://www.bizoner.com/arduino-ambient-light-density-cds-photoresistor-sensor-p-230.html?zenid=qqasomd7cq6ekgr3pbr0kas7u0 4 $4.50 $18.00

Photo-resistor

http://www.radioshack.com/product/index.jsp?productId=2062590&CAWELAID=107594592 1 $4.00 $4.00

$483.77

**Note that the mBed microcontroller was ordered. This is in preparation for Phase II. If more advanced motor control is needed, the mBed microcontroller will be needed.