A New Optimization Approach for a Solar Tracker Based on an Inertial Measurement Unit

Improvements and applications of Inertial Measurement Unit (IMU) sensors have increased in several areas. They are generally used in equipment that measures orientation, gravitational force, and speed. Therefore, in this paper, we worked on improving the performance of IMU in an application on solar trackers of the Kalman filter. This work illustrates the design of an autonomous device with astronomical control of a photovoltaic (PV) panel, allowing the optimization of the orientation/energy gain ratio. The device is based on two concepts at the same time, the modeling of the solar trajectory adopted by an algorithm which calculates continuously the solar angles (elevation and azimuth) and the approval of these by the IMU in order to sweep away any climatic fluctuations and thus allow an almost perfect adjustment relative to the perpendicular axis of the rays. The tracking system is based on two joints controlled by an Arduino control board. Experiments have shown a better performance of the two-axis device: the net energy gains can be around 34% with an additional 1.1% when the Kalman filter is applied. Keywords-astronomical control; orientation; energy gain; optimization; inertial measurement unit


INTRODUCTION
Solar trackers are devices that allow the orientation of daylight reflectors regardless of their nature (photovoltaic (PV) solar panels, concentrated solar reflectors, or a lens focused towards the sun). The position of the sun in the sky varies with the seasons (elevation) and the time of day as the sun moves across the sky [1]. Most solar powered pieces of equipment serve us best when pointed at the sun [2,3]. In the literature, we find many works focused on the knowledge of several astronomical and atmospheric quantities, whereas the use of these in algorithms makes the parameters difficult to implement when it comes to simple solar tracking systems [4]. A solar tracker can increase the efficiency of such equipment at any fixed position at the cost of additional system complexity [5][6][7]. There are many types of solar trackers of varying cost, sophistication, and performance [8,9]. The accuracy of the solar tracker depends on the application [10][11][12][13][14][15][16]. Usually, PV systems do not work properly without monitoring, therefore at least one-axis tracking is mandatory [17].
In our work, we tried to structure a new two-axis tracking approach in which we aimed to orient the panel in real time towards the sun, in order to be placed in optimal position in relation to the incidence of solar radiation (perpendicular radiation if possible) because, throughout the day and depending on the season, the position of the sun varies constantly and in a different way, depending on latitude and longitude. First, we modeled the position of the sun by calculating each location on the earth at any time of day and determined the periods of daily sunshine as a function of time and place in order to get maximum benefit from the solar energy. Sunrise and sunset are defined as the instants when the upper limb of the sun's disk has just touched the horizon. This corresponds to an altitude of about zero degrees for the sun. The calculation of the position of the sun in our algorithm uses a certain coordinate system where time and location are given as input while the coordinates of the reference ground are given as output and this using a GPS sensor responsible for geolocation and timing. Real-time adaptation has the effect of substantially increasing the amount of reception and energy output of the PV panel as a second goal in our work by focusing on the layout, use, and angular correction of panel deflection due to the displacement of the sun by special Inertial Measurement Unit (IMU) sensors that empower the reading and inform us of all the surface angles of a solar panel in relation to the horizontal and vertical axes of the platform in a 3D aspect. For additional precision, correction by Kalman filter was carried out correcting the internal angular error. The correction was made with two actuators which are excited and driven by a driver through an Arduino card. The experiments have shown better performance of the two-axis device by using IMU, especially through the Kalman filter, the net energy gains of which prove the efficiency of the proposed system.

II. MODELING THE PATH OF THE SUN
The position of any celestial object is described in two angles, the azimuth angle and the elevation angle. The elevation angle is the angle of the object above the horizon from the point of observation while the azimuth angle has diverse definitions. Figure 1 shows the concept of azimuth (γ) and elevation angles (α). Overview of tracking angles.
The calculation of the position of the sun in terms of azimuth and elevation angles and the sunshine duration requires the calculation of certain parameters such as Local Solar Time (LST) and Local Time (LT). The 12:00 hours LST is defined as the highest position of the sun in the sky. LT usually varies from LST due to the eccentricity of Earth's orbit and due to human adjustments such as time zones and daylight saving time.

A. Local Standard Time Meridian
The Local Standard Time Meridian (LSTM) is a reference meridian used for a particular time zone and is similar to the Prime Meridian which is used for Greenwich Mean Time (GMT) which can be calculated by the following equation:

B. The Equation of Time
The hour lines are the traces of the hourly plane which is perpendicular to the equator on the surface of the dial. The solar time measured and established by a dial is counted on the equator by the daily displacement of the hourly plane of the sun. One hour has passed when the direction of the sun's hourly plane has changed by 15°. The sundial does not take into account the declination of the sun, therefore, whatever the date of the year, the position of the time plane one hour after noon will be the same. Thus, 1 pm the time line will be identical for every day of the year. This is the principle of the polar style dials in which the duration of a solar hour is not constant throughout the year. Although the variation is minimal, on the order of a few seconds, the essential consequence is that these variations accumulate to form a larger gap. And during the year, the moment of the passage of the sun to the meridian (solar noon) slowly shifts day after day compared to noon which will be indicated by a perfect and regular clock. Our clock shows the average time. The annual variation in the difference between solar noon and mean noon is called the equation of time. By definition: Equation (2) is periodic from year to year. It has a maximum of more than 14 minutes at the beginning of February and a minimum of -16 minutes at the beginning of November. It also has an intermediate maximum and minimum. It becomes zero 4 times a year: around April 15, June 15, September 1 and December 24. The exact value of the equation of time can be calculated at any moment with all the precision required by formulas presented in various works of astronomy. There are also simplified formulas and tables sufficient for the needs of gnomonics [18] but with the current power of PCs, it is better to use formulas as exact and complete as possible. It takes a little longer, but at least the calculated values are accurate within a few seconds. The equation of time (in minutes) is an empirical equation that corrects the eccentricity of the earth's orbit and the axial tilt of the earth is: , where d is the day of the year (i.e. d = 1 for January 1st, d = 32 for February 1st, etc.).
The precise Time Correction (TC) factor (in minutes) explains the variation in LST in a given time zone due to variations in the longitude of the location in the time zone and also incorporates the EoT as in (4). Number 4 in the equation shows the number of minutes the earth takes to rotate by one degree.
The LST can be calculated using (4) and LT as follows: C. The Angles of Solar Corrections 1) The Hour Angle (HRA) As the first correction angle, the HRA presents the conversion of LST to the degrees with which the sun moves across the sky. By definition, the HRA is 0° at solar noon. Each hour from solar noon corresponds to an angular movement of the sun by 15°. This step of 15° presents the rotation of the earth during one hour. In the morning, the hour angle is negative.

2) Declination Angle (δ)
The declination is the angle that the sun makes at the maximum of its course (solar noon) in relation to the equatorial plane. It varies between -23.45° on December 21 and +23. to the plane of the PV module. The declination angle can be calculated by [7]:

3) Elevation Angle (α)
The elevation angle varies throughout the day. It also depends on latitude and date. The maximum elevation angle is an important parameter in the design of PV systems. This angle is measured at solar noon and depends on the angle of latitude and declination. The formula for the maximum elevation angle is: When (8) gives a number greater than 90°, the result is subtracted from 180°. This means that the sun at solar noon is coming from the south, as is typical of the northern hemisphere. ߶ is the latitude of the location of interest (with a positive sign for the northern hemisphere and negative for the southern hemisphere) and δ is the declination angle.

D. Sunrise and Sunset
In order to calculate the sunrise and sunset for a given location, altitude zeroing must be applied and the altitude equations are reformulated to give: 60 cos cos sin sin cos 15 60 cos cos sin sin cos 15 All the calculations mentioned above were developed in the LabVIEW environment by the use of command blocks and micro programs. Figure 2 shows the overall code for modeling the path of the sun in the form of command frames designated as outputs from an Arduino board. This map takes over from correcting the angular deviation (elevation and azimuth) caused by the daily and seasonal variation of the position of the sun.
The selected IMU is a HMC5883L magnetic field sensor (gyroscope). This module encompasses in a single circuit all the functions necessary for the realization of a complete IMU. It integrates three axes for the two elements, the accelerometer and the magnetometer. It simultaneously measures the tracked movement and combines it with perfect synchronization with the clock. With the collaboration of the sensors, it performs an almost absolute position tracking without giving in to external transmission or emission elements. However, the majority of IMUs are exposed to negative distortion from external magnetic fields which affect the accuracy regardless of their nature. We therefore applied a correction by a Kalman filter in order to make the IMU more exact. III. DESCRIPTION OF THE TRACKING SYSTEM The tracking system corrects the angular deviation (elevation and azimuth) due to the apparent movement of the sun. It controls the movement of a PV module on two axes. The first has a 360° rotation capability, it is considered the main support of the whole mechanism. The second has a 90° rotation capability and is responsible for the rotation of the PV.
To keep the solar radiation perpendicular to the active surface of the PV module, the automation of the trajectory of the sun is defined thanks to the equations of time translated into programs in LabVIEW with the cooperation of the Arduino board. The control system is shown schematically in Figure 3. It consists of two parts: the operative part and the control part. The operative part has two joints actuated by two jacks.

A. The Operative Part
The design of tracking systems is usually designed by one axis or by two axes. To amplify the energy gain of the PV module, two-axis trackers are the ideal solution. The choice of motors is essential, so we chose motors that have axial encoders in order to know at any time the exact angle of the motors after each movement. A powerful motor rotates 360° and presents the overall support of the module. It is responsible for correcting the azimuth deviation. The weight of the joint does not present any movement constraint on the motor because it is mounted axially on the latter using a bearing. The second motor allows the angular correction of the elevation. These motors are commonly used in the home automation field.

B. The Order Part
The control device is essentially based on multisensory technology in order to collect at any time any information that enters directly or indirectly into the calculations of the path of the sun and the angles of deviation which correct the deviation through the equations of time. The electronic IMU devices measure and report the specific strength of a body. The angular rate and sometimes the magnetic field surrounding the body and the use of a combination of accelerometers and gyroscopes or magnetometers as criteria of choice led us to use them to optimize the energy gain by orientation of the PV module. For a near-perfect PV initialization, a gyroscope is used.

IV. MAGNETOMETRIC SENSOR MODEL
Magnetic field measurement is subjected to two types of distortion: hard iron distortion and soft iron distortion. To obtain precise measurements, a mathematical correction of the scale factor, misalignment, and bias errors by a Kalman filter is applied to the model matrix. This process involves finding a transformation and bias matrix in order to obtain corrected measurements of the magnetic field. In this algorithm, a bias is applied to the vector of initial magnetometric data (X, Y, Z coordinates) which is then multiplied by the resulting vector. We then subtract the bias vector from the result as shown in (11). This was done by the intervention of an Arduino card in the LabVIEW environment.
We used intrinsic active rotations of the magnetometer module around the (X, Y, Z) axes in a three-dimensional plane. We created 3 angles which present respectively pitch, roll, and yaw. We thus obtained 12 probabilities as indicated in Figure 4. Axial probabilities of the IMU on the three-dimensional plane.
In its initial position, the magnetometer module coordinate system and the panel coordinate system are aligned with each other. If we want to rotate the axis of the panel, we would perform the three elementary rotations as follows: • Rotation by the roll angle around the X axis: • Rotation by the pitch angle around the Y axis: • Rotation by the yaw angle around the Z axis: The numbering 0 on the X, Y, and Z coordinates presents the starting point. The numberings 1, 2 and 3 respectively present 3 elementary rotations (the first, the second, and the third). It is possible to return to Euler angles [19] from a rotation matrix. The equation varies in correspondence with the order of execution of the elementary rotations of Euler angles and the Euler angles of Tait-Bryan [20] which correspond to the order yaw-pitch-roll with corrections by a Kalman filter. We integrate (11) to obtain the angles as follows: These were deduced using the fact that the magnetometer module rotates back to front and the local field vectors move inward. Using this information along with knowing the orientation of the IMU allows the formation of a direction cosine matrix which is used to convert the measurements from the IMU coordinate frame to the panel coordinate frame. We can present the order of transformations as follows: • Turn the angle α +90° around the X axis to align the Z axis of the IMU with the Z axis of the panel support.
• -Rotate β +90° around the Z axis to align the coordinate frames of the IMU and the panel support.
Thus, the complete transformation of the IMU into coordinates of the panel support is given by the multiplication of the equation: ܶ ൌ െ sin ߚ sin ߙ . cos ߚ cos ߙ . cos ߚ cos ߚ sin ߙ . sin ߚ cos ߙ . sin ߚ 0 cos ߙ െ sin ߙ ൩ (20) The similarity of movement of the angles of our problematic which is the movement of a PV panel around its axes at the first two angles (yaw and pitch) led us to make a correspondence of the azimuth and elevation angles with the latter. Center of circle before calibration and filtering separately, (a) on the Χ axis, (b) on the Υ axis, (c) on the Ζ axis, (d) and (e) on the XYZ kernel. Figure 5 shows that the center of the circle after hard iron distortions is now at Y=100 and X=200. There is therefore a polarization of hard iron on the X axis of 200mG and a polarization of iron hard on the Y axis of 100mG. These distortions move the center of the circle away from its original position but preserve its original shape.
Soft iron distortions on their part distort existing magnetic fields. Soft iron distortions are easy to identify in a magnetic output graph because they distort the circular output. The soft iron distortions distort the circle and give it an elliptical shape. An illustration of the magnetometer output with the two distortions on the X and Y axes in order can be seen in Figure 6. A circle which does not undergo any distortion must be centered on X=0, Y=0 and its radius must be equal to the magnitude of the magnetic field. Figure 7 shows the application of the Kalman filter with block-chained logic under the LabVIEW environment.

V. GENERAL STRUCTURE OF THE DEVICE
The produced system is an autonomous, automatic, and preprogrammed solar tracker based in its design on an Arduino Mega embedded system which is capable of astronomically resetting the local parameters of a PV installation by geolocation and instantly correcting with a new approach of the IMU the angular fluctuations (azimuth and elevation) caused by the displacement of the sun using a preprogrammed algorithm and pulse control in order to minimize the power consumed by the actuators and to increase the luminous flux on the active surface of the panel.
Usually, IMUs are used in the field of aeronautics, especially drones. They allow the collaboration with a GPS receiver when the GPS signals are absent as is the case in tunnels. In order to collect as much information as possible to geolocate a photovoltaic installation, we have chosen the GY-NEO6M type GPS compatible with the master Arduino Mega card. It can be synchronized with an RTC of our system or operate autonomously. The modeling of the above mentioned path of the sun requires knowledge of a few parameters in order to determine the angles of azimuth and elevation.   An internal clock updates the GPS in order to detect the local coordinates as well as the date and the time required in this calculation. The IMU works by sensing linear acceleration using the internal accelerometer and the rotation rate using the HMC5883L at each angular correction (azimuth or elevation). So, it is updated with the next angles and the current angles. These data are stored in the Arduino in an EEPROM to be compared to the angles of the motor encoders to confirm their values and to be used as correction steps through power stages that reposition the equipment. To access the internal parameters that are introduced into the initialization and configuration of the tracking system or the modeling of the trajectory, a touch screen can be used which does this through several actions. Figure 8 summarizes the general design of the produced device.

A. GPS Communication
Modeling the path of the sun requires the intervention of a few quantities. The GY-NEO6M uses geolocation by the World Geodetic System (WGS 84) which is used in mapping and navigation including satellite navigation systems. The geographic coordinates of the PV system are quantities (latitude, longitude, and time) which define its position on the installation surface. Latitude values collected by the system and longitude values are the considered entrances. Through two pins of the Arduino board (TXD 1 and RXD 1 ) the GPS communicates at a speed of 9600bps. More parameters are shown in Table I.

B. Tactile Communication
In order to simplify the communication between the user and the Arduino and to minimize the use of electronic components (push buttons), a touch screen type (320×240 TFT LCD) was used in the constitution of our device. Its role is also to display any action applied on the Arduino. A multi-screen menu has been created to organize the control and display of the various parameters which can be the measured quantities or different input and output data. The main purpose of this tactile communication is to access the internal parameters of the quantities recorded previously such as the initial variables stored on the Arduino EEPROM and change them according to our needs. This adjustment is considered as a manual mode (all the quantities are inserted manually without the use of the VI. EXPERIMENTAL TEST In order to demonstrate the effectiveness of this new approach, we first carried out a comparison of the results obtained on a fixed module with respect to another module oriented by two axes based on the new approach while correcting the variation related to elevation and azimuth. These two angles are directly linked to the day, night, and seasonal variation under the same operating conditions. A further comparison was made between the results obtained by the technique without and with the Kalman filter. These experiments were carried out in a day where the illumination was relatively good with some disturbances in the afternoon in the eastern Algeria (Ain Beida) defined by 35.796 N altitude and 7.393 E longitude with a varied temperature. For a daily correction, a series of successive orders to the equipment at equal intervals during the period of sunshine carries the angular correction of deviation which varies from 1.5 to 2 degrees. The command information is extracted from the database which is calculated by the Arduino and stored in the EEPROM of its microcontroller. Voltage and current measurements were conducted at equal time intervals. The Copernicus equation gives us an initial declination of the PV module of 14.81°. The LabVIEW environment provides us with graphical interfaces to display the different quantities collected experimentally by the card (current, voltage, and power). The results are shown in Figures 9-13. In Figures 9-11, we obtained from the LabVIEW the responses represented in blue for the measured quantities of a tracking system without Kalman filter and in red for those of a fixed system.
In Figure 9, we see that the oriented system generates a current intensity that exceeds three times the current obtained by the fixed system at the start of the day because the panel has already been initialized in a perpendicular position with respect to the solar rays, so this system stabilizes at a maximum current value. We also notice disturbances caused at the end of the day by a cloud passage. During this time, the fixed system starts with a low current which gradually increases towards the optimal period of sunshine then decreases (knowing that the panel is fixed at a tilt angle of 32°). The current generated by the stationary panel always remains lower than that generated by the oriented panel. This validates the significant influence of irradiation on the current and more precisely that of the angles formed by the rays and the panels. It is always favorable to keep an angle of 90° with the panels for a total absorption of the rays without losses and without refractions which leads us to choose the most precise oriented systems.
In Figure 10, we see that the voltage supplied by the oriented module at the start of the day is high but decreases regularly due to the influence of the temperature on the voltage of the panel caused by the fact that the active surface of the panel remains perpendicular to solar radiation while the voltage supplied by the fixed module at the start of the day is low and remains constant with some variations and disturbances and exceeds the oriented module a few times. Figure 11 shows the power obtained during this day by the two panels which represent the product of the voltage and the current. We notice the effect of the orientation technique on the efficiency which is a gain of 34% in comparison with the fixed system. Fig. 9.
Current-time curves for a fixed and an oriented module.  In Figure 9, we can see the gain obtained by the tracking system, manifested by the difference between the two schemes. This gain was obtained thanks to the angle detection precision of the IMU. This reflects the influence of this technique on the efficiency of a PV panel. To remedy the errors caused by the external magnetic effects on the IMU sensors, a Kalman filter is applied. In order to show the effect of the latter on the yield, two comparative experimental tests were carried out on a filtered and an unfiltered system during two different days to generalize the results. We plot the curves of the measured quantities (I and V) using LabVIEW. Figures 12 and 13 show the power plot obtained by the tracking system with (blue) and without (red) the Kalman filter. The difference between the plots in the same chart in Figures 12 and 13  In [13], a comparative study between a fixed system and another two-axis oriented system using a 120W PV panel showed an average daily energy gain of 112.5Wh. According to the energy aspect and over the same period, we arrived to obtain an average daily energy gain of 403.2Wh (since the PV panel used in [13] is 12 times greater than the one opted in the current work). So, the developed new optimization approach for a solar tracker based on an IMU is most suitable for twoaxis tracking systems.  VII. CONCLUSION Due to the poor performance of fixed panels resulting from the movement of the sun and energy losses, the main goal of the researchers in this field is to track the variant trajectory of the sun and to optimize the techniques used while taking into account the materials. Various methods have been employed to remedy this. In the current work, a preprogrammed technique using different equations of time was adopted which includes the use of IMU modules. These new components are characterized by their precision of positioning identification along three axes. This helps us to collect more accurate data on the position of the panels and thus to better control them to follow the sun. However, these components operate using magnetic fields and are highly sensitive. They are therefore often influenced by neighboring magnetic fields and end up showing calculation errors, which cause energy losses. To solve this problem, we used an additional corrector, which is the Kalman filter. It corrects deviations caused by magnetic fields. According to the obtained results, a tracking technique supported by IMU is much more advantageous than a fixed PV system and the addition of a Kalman filter gives us more stable results and a higher efficiency than the filterless system (about