DESIGN AND CONSTRUCTION OF A FUZZY LOGIC SOLAR TRACKER PROTOTYPE FOR THE OPTIMIZATION OF A PHOTOVOLTAIC SYSTEM

In this article, a fuzzy logic solar tracker was designed and implemented to increase the efficiency of a photovoltaic system by updating the position of the panel throughout the day for optimal use of solar radiation. In the design and implementation of the solar tracker, different control strategies were analyzed, concluding that the fuzzy control satisfies all the requirements of the photovoltaic system with a solar tracker, the developed prototype underwent different tests in a determined period of time to validate the performance of the solar tracker. system compared to one with a fixed position, achieving an increase of 40% compared to fixed solar systems.


I. INTRODUCTION
At present, the predominant energy medium is from fossil fuels, which is being diminished due to industrial growth, means of transportation and population, increasing demand for it, to meet this increase in demand.demand the most viable alternative is renewable energy.Within these renewable energies, solar energy is the most viable because it is a resource that occurs anywhere, it does not depend on its geographical location, unlike other alternative energies [1].
Photovoltaic solar energy is that which is obtained through the direct transformation of the sun's energy into electrical energy through solar cells [2].
Solar energy is one of the most viable alternative sources since it is present throughout the planet, the energy from the sun is inexhaustible and contributes to reducing current environmental problems that have been a consequence of the irrational use of fuels.fossils [3].
The energy produced by solar panels depends directly on the position of the sun with respect to said panel.The constant change of position of the sun considerably limits the efficiency of a panel in a fixed state, therefore, through the use of solar trackers, it is sought to make the most of the irradiation of the sun's rays, increasing the power level.electricity generated in the photovoltaic system compared to fixed systems [4].
The photoelectric cells transform solar energy into electricity in the form of direct current and this is transformed into alternating current by means of an inverter to guarantee the parameters of the electrical network in interconnected systems, so that the converter works in the zone of maximum efficiency solar trackers are used [5].
In photovoltaic systems connected to the electrical grid, the inverter is the central core and must have certain protections in situations that may occur in the electrical grid, such as voltage out of range, grid outage, grid phase shift.[6].
Solar trackers, depending on the type of movement, can be one-axis or two-axis [7].
In single-axis solar trackers, the solar panels remain approximately perpendicular to the sun's rays, following the sun from east to west, with a minimum degree of complexity and lower cost compared to other types of trackers.The limitation of this type of tracker is that it cannot fully track the sun, since it can only track the azimuth or the solar inclination, but not both [8].
Two axis solar trackers have two degrees of freedom and are capable of fully tracking the sun, both in inclination and azimuth, although the performance of the installation may be superior compared to single-axis ones, their cost is much higher [9].
The tracker described in this article belongs to the classification of trackers of an azimuthal axis whereby the panels remain approximately perpendicular to the sun's rays, following the sun from sunrise to sunset.

II. METHODOLOGY
The objective of this article was to design and implement a control system that allows the photovoltaic system to follow the path of the sun to improve the efficiency in the generation of electrical energy compared to fixed systems.
Fuzzy logic has played a vital role in advancing practical solutions for a wide variety of applications in automatic control engineering, digital signal processing, communications, expert systems, medicine, etc.However, the most significant applications of fuzzy systems have been concentrated specifically in the area of automatic control.
Different studies applied to fuzzy control theory have shown that fuzzy learning and/or fuzzy control algorithms are one of the most active and fruitful areas of research in recent years within the field of fuzzy logic [10].

II.1 ESTRUCTURA DE LOS SISTEMAS DIFUSOS
The Different studies applied to fuzzy control theory have shown that fuzzy learning and/or fuzzy control algorithms are one of the most active and fruitful areas of research in recent years within the field of fuzzy logic.
From the conceptual point of view, the design of fuzzy systems from input-output pairs have been classified into two types.The first type of classification suggests that the rules are generated through the input-output pairs and the structure of the fuzzy system is built from these rules, from the fuzzy inference mechanism of the fuzzifier and the defuzzifier.In the second classification, the structure of the fuzzy system is specified first so that some parameters in the fuzzy structure are free to change and these are determined according to the input-output pairs.Although regularly some applications of fuzzy control to industrial processes have produced results superior to their equivalents obtained by classical control, the domain of these applications has experienced a serious limitation when expanding it to more complex systems, due to the fact that There is not yet a complete theory to determine the performance of the systems from the change in its parameters or variables.
Fuzzy inference systems have currently found several successful applications within a wide variety of areas such as automatic control, data classification, decision analysis, expert systems, time series prediction, etc. robotics and pattern recognition.Because of their multidisciplinary nature, fuzzy inference systems are known as expert systems, fuzzy models, fuzzy logic controllers, or just fuzzy systems.Essentially a fuzzy system, it is a structure based on knowledge defined through a set of fuzzy rules, which contain a fuzzy logical quantification of the expert's linguistic description of how to perform adequate control.Figure 1 illustrates the block diagram and the basic components of a fuzzy system where the classical sets Ui and Yi are called the universe of discourse for ui and yi respectively.In particular, ui ∈ Ui with i = 1, 2, 3, ... ,n and yi ∈ Yi with i = 1, 2, ... , m, where ui and yi correspond to the inputs and outputs of the fuzzy system.Source: [12].
In figure 1, it can be seen that the fuzzy system uses fuzzy sets, defined by the fuzzy rule base, to quantify the information in the rule base and that the inference mechanism operates on these fuzzy sets to produce new sets.Therefore, it is necessary to specify how the system will convert the numerical inputs ui ∈ Ui into fuzzy sets, a process called "fuzzification", such that they can be used by the fuzzy system.Similarly, the process called defuzzification describes the mapping of a space of fuzzy control actions into nonfuzzy control actions.Defuzzification therefore generates a nonfuzzy control action which we generally denote by yqcrips and is the best representation of an inferred fuzzy output.
The fuzzification process consists of a transformation of a datum from a classical set to its corresponding fuzzy set, therefore, we denote by Ui*, the set of all possible fuzzy sets that can be defined by Ui and given ui ∈ Ui, let us denote the fuzzy transformation of ui to a fuzzy set by Aifuz, which is defined in the universe of discourse Ui.The transformation from a classical set to a fuzzy set is produced by using the fuzzification operator F, [11], defined by F: Ui → Ui * , where F(ui) = Aifuz.Regularly the use of the singlenton type fuzzifier is the most widely used for applications in the area of automatic control and this is defined as a fuzzy set Aifuz ∈ U' * i with membership function.
The first step for the control design is the transformation of the domain so that the values delivered by the sensors are transformed to fuzzy inputs.For each input and output it is required to have an adequate number of labels that adequately describe their behavior.A universe of discourse with more labels is more accurate than one with few labels, however, it will also require more processing time.Also, an excessive number of labels can lead to an unstable fuzzy system.

II.2 FUZZY INFERENCE MECHANISM
The fuzzy inference mechanism is the core of any fuzzy controller.Its behavior is generally characterized by a set of fuzzy rules of the form: Where A and B are linguistic values defined by a fuzzy set in a universe X and Y respectively.The If clause, an antecedent, is a control action given to the process under control.With a set of fuzzy rules, the fuzzy inference mechanism is capable of deriving a control action for a set of input values, determining a control action for the observed inputs, which represent the state of the process to be controlled.-side by using control rules.The expression "If x is A then y is B," which is regularly abbreviated A → B, is essentially a binary relation R of the variables x and y on the product space X × Y.There are several fuzzy inference methods that can be formulated through the t-norm and s-norm operators to calculate the fuzzy relation R = A → B.

II.3 FUZZY INFERENCE MECHANISM
Defuzzification is defined as a mapping from a fuzzy set B' in V ⊂ R (which is the output of fuzzy inference) to an element of a classical set yq crisp = y * ∈ V.
Conceptually, the task of defuzzifying is to specify a point, an element of V, that reflects the best representation of the fuzzy set B'.To date there is no optimal algorithm for defuzzification, however, there are different defuzzification techniques that are easy to implement.
There are different fuzzy controllers, the most widely used are Mamdani and Sugeno, which have been used successfully in a wide variety of applications in the fuzzy control community.Although, the objective of the Mamdani fuzzy controller is to represent a successful human operator, the Sugeno-type fuzzy controller is suggested to be more efficient in computational and learning methods.

III. SOLAR TRACKER CONTROL PLATFORM DESIGN
For the design of the control platform, two degrees of freedom were used, considering an azimuthal axis and a polar axis, allowing the photovoltaic cell system to position itself parallel to the sun's rays, achieving its highest efficiency.regardless of your geographical position or time of day.For the implementation of the controller, an Arduino card was used through which the movement of the two motors is controlled, positioning the platform in its different axes.
The support structure was designed considering the type of movement desired for the solar tracker, the size of the solar panels and the available space.
The control system uses optical sensors, which monitor the variations in light levels emitted by the sun in order to know the position in which it is located.In this way, analog signals are obtained that will later be converted to digital signals and implemented as variables in a program in charge of feeding the motors to move the structure and position it parallel to the incidence of the sun's rays.
The built mechanical structure is made up of various parts: In the figure 3 shows the parts of the mechanical structure.In the figure 4 shows the parts of the azimuthal axis.In the figure 5 shows the parts of the polar axis.In the figure 6 shows the solar panel used.In order to monitor the solar movement throughout the day and during the seasons of the year, a circuit was implemented to compare the reading of a pair of photoresistive components (LDR), located parallel to each other on the surface and separated by a perpendicular plate that provides a shadow that makes the readings of said devices vary, generating an inequality unless they are located parallel to the sun, this inequality in the readings of said elements is used to locate the panel in the optimal position.The circuit was located in a translucent container conditioned to avoid the interference of solar rays with incidents not necessary for its application.The circuit shown in figure 5 has an arrangement of L298N, which can handle a voltage of up to 46 Volts, through the two output terminals the direction of rotation of the motor is controlled, the supply voltage for this motor is 17 volts which are obtained from an external source, the control system has three terminals for the direction and speed control signals of the motor to be controlled.If both inputs are low, the motor will be off and there is no power consumption, the speed being controlled by PWM (Pulse Width Modulation).Applying the PWM signal to one of the control inputs of the bridge.
To control the system, an Arduino card supported on a free Hardware platform was used, based on a board with a microcontroller, which is programmed using its own language and a free integrated development environment (IDE).As it is a free Hardware development platform, both its design and its implementation are free without the need to previously acquire a license.
The developed platform used an Arduino UNO with an ATMmega328 microcontroller (data-sheet).It has 14 digital input/output pins (of which 6 of them were used as PWM outputs), 6 analog inputs, a 16MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button.The microcontroller connects to a computer via USB, is powered by an AC/DC adapter, or a battery.The Arduino Uno Board differs from its predecessor in that it does not require the use of the FTDI USBto-serial driver chip.Instead, it has the Atmega8U2 programmed as a USB-to-serial converter.ONE.
Atmega328 has 32 KB of flash memory for code storage (of which 0.5 KB is used for the bootloader); it also has 2 KB of SRAM and 1 KB of EEPROM (which can be read and written with the EEPROM library).
Each of the 14 digital pins on the Arduino UNO board can be used as input or output, using the pinMode (), digitalWrite (), and digitalRead () functions.They all operate at 5 volts, each pin can supply or receive a maximum of 40 mA and have an internal pull-up resistor (disconnected by default) of 20-50 KΩ.In addition, some pins have specialized functions.The configuration of the Arduino UNO used is shown in figure 7. Source: [10].
The Hardware of the card used consists of a board with an Atmel AVR microcontroller and input/output ports.

IV. PROGRAMMING OF THE MEMBER UNIONS OF THE SOLAR TRACKER
For the elaboration of the control program of the solar tracker, knowing the behavior of the different devices that will make possible the control of the system, the member functions that are used in the programming will be elaborated, to corroborate the correct operation, the Fuzzy Logic Controller Design package from the LabView program, this was only used for the simulation of the control algorithms since Arduino does not have a simulation environment.For each of the input and output variables, the universe of discourse is defined in which the member functions of each of the variables will be contained.
For the fuzzy control, a natural language was used through which the functions of each variable are expressed with a name to distinguish them and use them later.In the table 2 shows the output variables.In the table 3 shows the member functions of Photo l.Obtaining the graph shown in figure 8 for the member functions of Photo l.Source: Authors, (2022).
In the table 4 shows the member functions of Photo r.Obtaining the graph shown in figure 9 for the member functions of Photo r.Source: Authors, (2022).
In the table 5 shows the member functions of potentiometer A. Obtaining the graph shown in figure 10 for the member functions of potentiometer A. Source: Authors, (2022).
In the table 6 shows the member functions of potentiometer G. Obtaining the graph shown in figure 11 for the member functions of potentiometer G.In the table 7 shows the member functions of the Polar motion motor.Obtaining the graph shown in figure 12 for the member functions of the Polar movement motor.Source: Authors, (2022).
In the table 8 shows the member functions of the Polar motion motor.Obtaining the graph shown in figure 13 for the member functions of the Polar movement motor.In the table 9 shows the member functions of the Azimuthal movement motor.Obtaining the graph shown in figure 14 for the member functions of the Azimuthal movement motor.In the table 10 shows the member functions of the Azimuthal movement motor.Obtaining the graph shown in figure 15 for the member functions of the Azimuthal movement motor.

V. RESULTS AND DISCUSSIONS
From the analysis of the data, the hypothesis on the increase in the level of electrical power generated in the photovoltaic system using solar trackers, unlike fixed systems, is corroborated.
In the present research work, a functional fuzzy control system was designed and implemented in a mechanical structure; to which different tests were carried out with satisfactory results.The results were obtained by means of the Arduino card, sensing the photoresistive elements between the values of 0 to 1023, varying the readings in a range of 0 to 600 depending on the incidence of solar rays.
In order to verify the correct operation of the control system of the solar tracker, calibration tests were carried out making a greater amount of light fall on one of the photosensitive elements and checking that the motor rotates in that direction.
To corroborate the objective set out in the investigation "A control system was designed to improve the efficiency for the generation of electrical energy with a solar tracker".Measurements were made to compare the energy generated by a fixed panel and the automated system with the implemented fuzzy control, for which I connect a load made up of five 60-watt spotlights placed in series.
Data acquisition was carried out over three days during the month of November 2020, obtaining a total of 113 samples for each day; using for this purpose four multimeters connected to the load: two of them used for voltage readings and the other two for current readings in both cases, both in the fixed state and in the mobile state.
A test was carried out with a moving solar panel taking into account only the polar movement of the structure from an initial position of 15o inclination on said axis and facing east for sunrise.The control system designed maintained the orthogonality between the panel and the incidence of the sun's rays in order to obtain the greatest possible efficiency throughout the course of the day, controlling the position through the use of a card.Arduino through the values delivered by the photoresistors moving it as appropriate.
Voltage and current measurements were carried out between 8:40 a.m. and 5:00 p.m. and 6:00 p.m. and with these readings the power and energy generated by the solar panel were determined.
In the table 11 shows the measurements of the first day between 8:40 a.m. and 5:00 p.m. and 6:00 p.m. Obtaining the graph of power generated for the first day with a fixed panel shown in figure 16.Obtaining the graph of power generated for the first day with a mobile panel shown in figure 17.With the measurements of the second day, the graph of power generated with a fixed panel is obtained, shown in figure 18.With the measurements of the second day, the graph of power generated with the mobile panel is obtained, which is shown in figure 19.With the measurements of the third day, the graph of power generated with a fixed panel is obtained, which is shown in figure 20.

Figure 12 :
Figure 12: Graph of member functions of the Polar motion motor.Source: Authors, (2022).

Figure 13 :
Figure 13: Graph of member functions of the Polar motion motor.Source: Authors, (2022).

Table 3 :
Photo member functions l.

Table 4 :
Photo member functions r.

Table 5 :
Member functions of potentiometer A.

Table 6 :
Member functions of potentiometer G.

Table 7 :
Functions member of the Polar motion motor.

Table 8 :
Functions member of the Polar motion engine.

Table 9 :
Functions member of the Polar motion motor.

Table 10 :
Azimuthal moving engine member functions.

Table 11 :
Comparative measurements of the first day.