Developing Smart Self Orienting Solar Tracker for Mobile PV Power Generation Systems

Photovoltaic (PV) devices are one of the most renewable energy sources in demand globally. To harvest the maximum possible energy output from PV panels, it is necessary to orient them in a position where the sunray can fall on them perpendicularly. In this paper, an autonomous dual-axis smart solar tracking system is designed and implemented for positioning PV panels in a way that would make them generate the highest achievable energy output automatically anywhere in the world. The designed tracking system is built based on a mathematical model which is integrated with a microcontroller (µC), a Global Positioning System (GPS), a digital compass, and a gyro orientation sensor. The designed system provides a smart solution to accurately track the sun at a minimum power budget to increase the overall efficiency of PV panels. The suggested model is implemented and tested using 50 W PV panels, and it is empirically tested in the Middle East region of Baghdad, IRAQ. For further evaluation, it is also tested using simulated tracking data collected from three different regions Berlin, Singapore, and Sydney. This was done by selecting a city above the Tropic of Cancer, a city below the Tropic of Capricorn, and a city within the tropical region near the Equator. The obtained results confirmed that the developed system can track the sun in any region around the world, optimizing power consumption by operating the tracker within specific intervals that enables mustering maximum possible power of PV panels while ensuring minimum power consumption by the tracking system. The developed tracking system expended a mere 0.62% to 0.68% of the energy gain made.


I. INTRODUCTION
In recent years, climate change and global warming have created the research impetus to improve renewable energy outcomes. Renewable energy needs to be implemented in various areas and applications to reduce the dependency on fossil fuels [1]. The photovoltaic (PV) panel is one of the most popular renewable energy sources that directly convert sunlight to electrical energy. However, optimal PV panel installation necessitates more critical attention regarding, for example, how to choose the angle of incidence between PV and sunrays to collect maximum energy. To solve this issue, a solar tracker can be employed to maintain an angle of incidence between the sunray and PV panel within certain values that help collect the maximum possible energy [2]. Based on the literature, there are two types of solar trackers: single-axis and dual-axis. The single-axis solar tracker uses one axis, horizontal, tilt, or vertical, to orient the PV panel. It is simple to implement [3][4], however, it is only applicable for static applications, and it draws the maximum efficiency at a certain time of the year only [5]. The dual-axis tracker uses two axes to orient the PV panel: elevation and azimuth. This type delivers the highest possible energy at any time throughout the year, and it can be used in mobile applications [6]. The major problem with this type of tracker is complexity. There are two types of dual axis trackers: the open loop systems and the close loop systems [3][4][5][6][7]. The close loop system is usually based on optical sensors, such as light dependent resistors (LDRs), which in conjunction with a drive system reorients PV panel position to be always perpendicular to the sunray. This type of tracking system has problems mainly in the installation and is sensitive to environmental issues such as dust. Open loop systems are based on estimating the sun's position from pre-calculated data of the trajectory of the sun depending on a geographical location, date, and time. The data are stored in the control device memory unit and the controller tracks the sun using current solar time against pre-calculated sun position. PV panel based mobile power generation with an autonomous tracking system finds very practical applications in recreational vehicles and camping equipment . Several solar tracking systems have been proposed previously to monitor the position of PV panels. For example, Das et al., [8] presented a solar tracking system based on µC with four light-dependent resistors (LDRs) to reorient the PV panel's position to maintain a perpendicular sunray on the panel surface. However, in that study, the LDRs were considered the key control element. Those LDRs are vulnerable to environmental issues like dirt, dust, moisture condensation, or bad weather which can have negative effects on sensing functionality, resulting in an erratic sunray tracking as well as additional power being consumed by the tracking system. Chong et al. [9] introduced a solar tracking method based on-axis the general sun-tracking formula. The system used Windows-based software. Two stepper motors were employed with optical encoders for each one as a feedback signal. Although their results were promising, the mathematical model was more complex and required high computational power. Hassan Fathabadi [10] suggested a highly efficient sensorless solar tracker used in an open loop approach to orient PV panels perpendicularly to the sunray. On assessing this work, it has been determined that the equations are incomplete due to neglecting other factors that can impact calculating the actual position of the sun. Moreover there are no reference indicators for the two elevation and azimuth angles and the elevation needs sea level reference while the azimuth needs north pole reference. Shufat et al,. [11] designed a dual axis solar tracker system combined with a GPS. It worked on the open loop approach. The tracking system estimated sun trajectory forms astronomical algorithms. The results were stored as constant data for current location with respect to GPS obtained data. An issue associated with that work was that it required huge pre-calculated data for the position of the sun to get an accurate tracking system. Hence, the required pre-calculated data for the position of the sun will be huge, even for fixed position applications. Therefore, it would be more prudent to use the mathematical formulae to locate the current position of the sun and then calculate the required corrections to PV panel position. The purpose of this study, therefore, was to design a selforienting solar tracking system for mobile applications and camping equipment that can be deployed anywhere on the planet based on a dual-axis solar tracker. The tracking system contained a GPS module that provides the necessary data required to find the local position of the sun by the solar time, a mathematical model, and two orientation sensors. A micro electromechanical system (MEMS) gyroscope and compass provide the reference orientation on which the tracking elevation and azimuth angles are calculated. These sensors are mated with an 8-bit micro power µC and a smart control program allowing for very efficient system operation resulting in a reduced power budget of the tracking system and automated PV panel-based power generation system installation. The results demonstrated the robustness of the proposed model.

II. METHODOLOGY
In this paper, a smart self-orienting solar tracking system is proposed. The proposed system consists of two parts: a mechanical part and an electronic part. Figure 1 shows the proposed model for the solar tracking system.

A. Description of mechanical structure of the smart solar tracker
The mechanical section consists of a structure, that holds the PV panel, with two degrees of freedom, and prime movers. The prime movers are required to change panel orientation regarding elevation and azimuth angles. The structure of the prototype is made of Lexan and wood as shown in Figure 2. DC electrical motors are selected as prime movers. These prime movers need to deliver the torque required to adjust position of the solar panel. The following formula is used to find drive requirements of the solar tracking system: The required torque (T) of the elevation motor is found by Where is the applied force which is found to be around 40.4 N for the "Newpowa" 50Watt / 12 Volt monocrystalline Solar Panel, and is the length of lever which equals 0.03 m, θ is the angle between total forces acting on structure and lever arm. This figure would also include PV panel and mechanical structure weight plus wind force using recorded wind speed rates at the measurement site and is found to be around 16.2 N. The angle is assigned a hypothetical value of 90 degrees as the value at which wind will generate the maximum force on structure. For the azimuth motor, motion analysis is performed using SolidWorks CAD software using SolidWorks motions tool with the speed set at 5 rpm as shown in Figure 3. The required torque has been found equaling 1.698 N.m for the elevation drive and 0.864 N.m for azimuth drive. The speed of both actuators is chosen to be between 2 rpm to 5 rpm. The ZGY370 miniature worm geared 12 V DC 3 rpm motor from Zhongxin Electric Motor Co. was selected. Low speed operation is fairly suitable to the selected task as it reduces stresses on the mechanical parts, simplifies control, and eliminates overshoots when the reorientation task is executed. The worm geared motor is selected for its high torque and self-locking feature. The electronic circuit consists of a control unit, GPS receiver, two MEMS: the compass and the gyro sensors, voltage regulators providing supply to different circuit elements and motor drive circuit. The control unit is based on a µC that reads the GPS module, calculates the position of the sun, reads the orientation sensors, and then drives the motor to the position of the sun. A micro power 8-bit µC (ATMEGA328P) is chosen for its suitability and popularity. A MAX232 IC converts signals from RS-232 levels to TTL logic and it is used to interface the Haicom HI-204III DB9 Serial GPS receiver module signal to the UART serial port of the µC. The orientation sensors measure the actual angles of the PV panel, the elevation angle and the azimuth angle. The MEMS gyro sensor MPU-6050 IC is used as gyroscope to provide sea level reference in measuring elevation angle of the PV panel. It is the angle between the horizontal plane and the oblique line from the PV panel to the sun .The HMC5883L MEMS device is used as a compass to measure azimuth angle which is the direction from which the sunlight is coming (with respect to the north pole) [13]. The motor drive device is the L298N IC that contains two H-Bridge drivers that drive the two motors implemented in the solar tracker design. The motors are operated discontinuously for reduced drive energy requirements. The EG78L05 and the AMS1117-3.3 provide the necessary voltages to operate system electronics. The complete system circuit diagram is shown in Figure 4. Table 1 shows the bill of main materials (BOM). It should be noted that the HMC5883L is a digital compass that relies on earth's magnetic field in its operation, thus it will be affected by any nearby artificially generated magnetic fields. Therefore, adequate magnetic shielding around the axes drive motors must be provided to reduce the effect of their stray magnetic field on compass operation.

III. The Mathematical Model of Sun Motion
The mathematical model used in the design of the smart solar tracker relied on the mathematical formulae given in the work of C.B. Honsberg and S.G. Bowden [12]. This describes a simplified mathematical modeling based on a local solar time to find the current position of the sun in the sky. These formulae were applied and verified to be accurate and capable of delivering appropriate solar tracking functionality anywhere in the world. The next paragraphs provide a description of the formulae used in estimating the tracking system variables and parameters:

Fig. 2. Smart solar tracker
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and content may change prior to final publication.

IV. Description of Smart Solar Tracker Software
The software consists of a main program in which several sub programs are combined together to furnish the functions required to operate the solar tracking system. The main program and its associated sub programs run on ATmega328P, which is an 8-bit micro power µC. This µC delivers all the functions needed. It reads the GPS system data and calculates current sun position using the solar time equations. Then it reads orientation sensors data and uses them to align PV panel angles with the calculated angles of sun's position. After that, if necessary, the µC generates the required parameters to drive the motor toward the new position to reorient PV position to be perpendicular to sunray. The control technique selected for driving the motors is the on-off control due to low-speed operation that generate negligible very small overshoot. The following sub sections will describe the solar tracker software elements in detail. A. Reading the GPS The GPS system sends data to receiving end using serial protocol called NMEA massage forms [14]. There are different massages sent by the GPS receiver. For this work, only the GPRMC massage is used. This message contains the time, date, latitude, and longitude information. The data in the GPRMC message presents as: $GPRMC,161229.487, A,3723.2475, N,12158.3416, W,0.13, 309.62, 120598, *10. The GPS sends the data continuously via serial communication protocol. The data is received by the µC via UART (after the MAX232 converts its level to that compatible with TTL) as an array of characters. The GPS module used in this work requires a maximum of 3 minutes period to get valid GPS data, therefore at the start of the system operation, a wait timer is set for 5 minutes and then the program verifies received data validity using the validation indicator symbol embedded within the GPRMC massage. If valid data are received, the split function is called to extract the required data from the GPRMC massage. Four variables are required: time, date, latitude, and longitude. The values of these parameters are sent to main program to provide the tracking function. But if waiting time elapses without receiving the "Data Valid" symbol, then the program sends a message to the LCD display informing user of the tracking system status to indicate that the GPS system is not working properly. Figure 5 presents the flowchart of the GPS reading sub program.

B. Calculating Current Position of the Sun
The function of this subprogram is to change parameter formats to be suitable for the implemented mathematical equations, as explained in section III. There are some considerations to be taken in organizing the data needed to calculate current position of the sun as will be clarified in the coming paragraphs. The time and date numerical presentation obtained from the GPS system need to be rearranged to suite the format adapted in the equations used to calculate current sun position. First, time must be presented in hours, minutes are presented as fraction of an hour, thus the time format will be: The day of the year is acquired using an array of 12 variables, each has a value of the number of the days of the year from Jan the 1st to the 1st day of current month, then the number of days passed of that month is added to the day value of the date. If the latitude is calculated for a position located in the northern hemisphere, then the value is positive, and if location at which the latitude needed to be calculated is at the southern hemisphere, then the value is negative. The outcome value of the two angles is stored under these two variable names: Az_Angle is the calculated azimuth angle, and El_Angle is the calculated elevation angle.

C. Reading orientation sensors
The smart solar tracker operation requires measuring the actual azimuth and elevation angles of the PV panel to orient it to the desired angles at which it would always be perpendicular to sunray. The required calculations are shown in section 3.2. The elevation angle is measured using the MPU-6050 MEMS gyro device while the azimuth angle is measured using HMC5883L MEMS compass. These two devices are interfaced with the µC via the I2C interface using (TWI) protocol. These two devices are configured in the initialization section of the main program. To read these devices using the I2C bus, the bus master (the µC) selects one of the devices on the bus by transmitting a write command with the address of that device. Then, the bus transmits a read command to read the data register of the selected device. The two angles that are measured by the sensors are sent to the main program as two variables: elevation angle as Gyro_Data, and the azimuth angle as Compass_Data as explained in the flowchart shown in Figure 6.
This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and content may change prior to final publication.

D. Solar Tracker Main Program
The main program of the solar tracker system starts by initializing µC components namely the timers, the UART for the GPS module, and the I2C for the MPU-6050, the HMC5883L, and the LCD display. After that, the program calls the GPS sub program. The program goes into a wait state pending GPS_Status. If the GPS_Status indicates that GPS data are valid, then the program moves the 4 variables, time, date, latitude, and longitude, to selected locations in µC memory. Subsequently, the program starts calculating elevation and azimuth angles, and stores them as El_Angle for elevation angle, and Az_Angle for azimuth angle. If elevation angle is positive, then the tracking process is started by comparing the new calculated angles with the actual angles of the PV panel that are measured by the data received via orientation sensors. If the difference between the new calculated angles and the actual angles of the PV panel is more than the Step_Angle, then the program drives the actuating motors to the new angles using gyroscope readout as a reference for elevation angle and compass readout as a reference for azimuth angle. If the difference is less than Step_Angle, the system goes into a 1 minute wait state then recalculates the angles with the new time and verifies whether the elevation angle is positive or negative. If it is positive, then the tracking process is repeated. Conversely, if the elevation angle is negative then the sunrise time of the next day is calculated, and the system will wait to reach that time and start the tracking process again. If the GPS data is not validated, a message will be displayed on system LCD indicating GPS data validation failure and shut down the tracking system. The main program flowchart is shown in Figure 7.

V. Results and Discussion
Due to the flexibility of the smart solar tracker, the tracking system is optimized to gain more power by reducing the system power budget which is consumed by the tracking system. An actual test was done in Baghdad, Iraq with simulation to optimize the tracking system. The National Renewable Energy Laboratory [15][16] tools and data were relied upon in studying and experimenting with the implemented smart tracker system. To find the power gain made through utilizing the smart tracker for the PV panel, the power generation of a 50 W PV panel was monitored and measured for a selected number of days throughout a year. The details for December the 23rd, March the 21st, and June the 21st are shown in Table 2. The graphical representation for the table is shown in Figure 8 from which the power gain of the two axis solar tracker was found to be 67.65% for December the 23 rd , 50.6% for March the 21 st , and 55.8% for June the 21 st . The tracking system consumption power was calculated. The system consumes power by the µC, the sensors, and motor drivers. For the µC and the sensors, their consumption at maximum was 150mA, and at the wait state less than 1mA. The motor driving circuit power consumption depended on the operation of the motors. The tracking system needed 10 seconds at maximum to initialize the first angle, and 3 seconds at maximum to move the PV panel to the new angle. The power consumption of the motor was found as = × The average current of the motor was found by the experiment shown in Figure 9. A dummy load was attached to the motor and a constant current was supplied to the dummy load (to simulate the load of the PV panel). In average, the power consumption of 10 seconds operation was 120.88 Joule, and the power consumption of 3 seconds operation is 36.88 Joule. The effect of the sunlight angle of incident was measured in Figure 10 where the actual test was done. The data shows the decline in the output power as shown in table 3. From this data, the optimal angle between two consecutive alignment processes was selected to be 5 degree step for most of the day, and 10 degree step when the elevation of the Sun was between 0 and 10 degree to efficiently harvest solar energy. Each step needs on average 20 minutes for the elevation and azimuth all day except 11-13 LST needs on average 10 minutes between each step, shown in Figures 11, 12, and 13. These time slots between tracking steps determine the number of steps for each day. In table 4, the energy consumption of the tracking system was calculated and displayed in table 4 for the three selected days in a year. The percentage of energy expended by the smart solar tracker over gained energy is shown in table 5 for the three selected days.    This article has been accepted for publication in IEEE Access. This is the author's version which has not been fully edited and content may change prior to final publication.

VI. CONCLUSIONS
In this paper, a fully automated dual axis solar tracker was designed, and a working prototype based on a specially developed embedded system was implemented. Extensive experimentation on this prototype was conducted to evaluate and approve its functionality anywhere in the world. The designed system demonstrated a suitable tracking accuracy that can efficiently muster the highest possible energy out of PV panels anywhere around the globe. The adaptive tracking steps scheme, the careful selection of system components, and management technique resulted in very low power requirement. The developed tracking system operating energy requirement amounted to only 0.62% to 0.68% of the energy gain made. The system is scalable and capable of being adapted to serve larger PV panel arrays with very little modifications required which involves changing the panel actuators and motor drive elements.
Agriculture, (01) Mathematical Sciences and (08) Information and Computing Sciences. Designing expert systems to his research interests, including deep learning, convolutional neural and long-short-term memory network. Dr Abdullas leadership was recognized by many awards. Dr Abdulla served on several committees he was a chair of IEEE conference. Dr Abdulla collaborates with researchers in Middle East, US, Japan, Europe, China, and Canada, delivered over 30 seminars. In last 3 years Dr Abdullas papers were cited more than 200 times. With more than 25 publications (largely in Q1 journals), Dr Abdulla leads the Advanced Data Analytics Modelling Research Simulation Group, as Principal and Associate Supervisor of more than 10 PhD/Masters HDR students. Dr Abdulla has supervised more than 5 PhD/Masters Thesis/Dissertations, and examined a number of Thesis locally and overseas. Expression of interests from potential higher degree applicants to study in Dr Abdullas Group are particularly welcome. FIFTH E. AUTHOR, Dr.Mohammed Diykh: Holds BSc Degree in Computer Science, MSc Degree in Information Technology, and PhD in Biomedical engineering. His research interests include biomedical signal analysis, data mining, and graph theory. Mohammed Has more than 20 publications (largely in Q1 journals). Dr Mohammed has supervised more than 4 PhD/Masters Thesis/Dissertations, and examined a number of Thesis locally and overseas.