Robust Digital Control Strategy Based on Fuzzy Logic for a Solar Charger of VRLA Batteries

This paper presents the design and implementation of a digital control strategy for a Buck converter, used as a solar charger of valve-regulated lead acid (VRLA) batteries. The control system consists of two fuzzy logic controllers (FLCs), which adjust the appropriate increment of the converter duty cycle based on battery state of charge according to a three-stage charging scheme. One FLC works as a maximum power point tracker (FLC-MPPT), while the other regulates the battery voltage (FLC-VR). This approach of using two different set of membership functions overcomes the limitations of the battery chargers with a single control function, where the voltage supplied to the battery is either not constant due to the operation of the MPPT algorithm (possibly damaging the battery) or is constant due to the operation of the voltage control (hence, MPP cannot be achieved). In this way, the proposed control approach has the advantage of extracting the maximum energy of the PV panel, preventing battery damage caused by variable MPPT voltage, thereby extending the battery’s lifetime. Moreover, it allows overcoming of the drawbacks of the conventional solar chargers, which become slow or inaccurate during abrupt changes in weather conditions. The strategy is developed to be implemented in a low-cost AT91SAM3X8E Arduino Due microcontroller. Simulations by MATLAB/Simulink and experimental results from hardware implementation are provided and discussed, which validate the reliability and robustness of the control strategy.


Introduction
In photovoltaic (PV) generation systems, the energy produced is limited by the efficiency of solar panels, which is generally between 18 and 23% [1]. The low conversion efficiency of a PV panel is due to the physical characteristic of PV conversion, and the dependence of its maximum power point (MPP) with atmospheric conditions [2]. Thus, the use of a maximum power point tracking (MPPT) technique to optimize the energy produced becomes essential [3,4]. The implementation of an MPPT algorithm needs a DC-DC power converter, which acts as an impedance adapter between the PV panel and the load, adapting the apparent impedance of the PV module to make it match the impedance in the MPP [5].
Over the years, many MPPT techniques have been developed [6][7][8][9][10]. Among the most popular conventional MPPT methods are: Fractional open circuit voltage (FOCV), Fractional short circuit current (FSCC), Hill Climbing (HC), Perturb and observe (P&O), and Incremental conductance (IncCond). FOCV and FSCC are the simplest and cheapest ones to implement, although they achieve less accurate results [11,12]. HC and P&O are widely used techniques due to their simplicity and ease of implementation [13][14][15]. Both algorithms present the problem of oscillations around the MPP, and fail under rapid atmospheric changes [16,17]. IncCond theoretically overcomes the problem of oscillations; however, in practice, this rarely happens due to the resolution of the digital implementation The FLCs are developed to be programmed in an Arduino Due board. To evaluate th control system under different weather and load conditions, simulations via MATLAB/Sim ulink are performed. The performance of the designed FLCs is compared with conventiona methods commonly used and reported in the literature: P&O, IncCond, and the Propor tional-Integral-Derivative (PID) controller. In addition, a prototype hardware setup is im plemented. Experimental and simulated results are discussed to prove the reliability an validity of the proposed control strategy.
The paper is organized as follows: Section 2 presents the description of the batter charger system, including the modeling of the PV module, the dc-dc power converte and the charging strategy. Section 3 provides a detailed explanation of the design meth odology used for each FLC. Section 4 discusses the simulated results. Section 5 provide the experimental results and verifies the effectiveness of the proposed control strategy while Section 6 summarizes the conclusions of the paper.

Description of the Battery Charger System
A schematic diagram of the solar battery charger is shown in Figure 1. A PV panel i used as a power source, which feeds a VRLA battery. To determine the power of the PV panel and the SoC of the battery, the current (IPV) and the voltage (VPV) of the panel an the current (IBAT) and the voltage (VBAT) of the battery are measured. With this information the control algorithm determines the appropriate charging mode.

Modeling of PV Module
A PV cell can be modeled by an equivalent electrical circuit composed of a curren source in parallel with a diode and a resistor network, as shown in Figure 2 [55], wher Iph represents the current generated by the incident radiation and Id the current at the PN junction according to the Shockley equation. The parallel RP resistance represents the los where a small leakage current flows through the parallel path and RS represents the losse which are loss of metal grid, contacts, and current collecting bus.

Modeling of PV Module
A PV cell can be modeled by an equivalent electrical circuit composed of a current source in parallel with a diode and a resistor network, as shown in Figure 2 [55], where I ph represents the current generated by the incident radiation and I d the current at the PN junction according to the Shockley equation. The parallel R P resistance represents the loss where a small leakage current flows through the parallel path and R S represents the losses, which are loss of metal grid, contacts, and current collecting bus. A PV cell can be modeled by an equivalent electrical circuit composed of a source in parallel with a diode and a resistor network, as shown in Figure 2 [55] Iph represents the current generated by the incident radiation and Id the current at junction according to the Shockley equation. The parallel RP resistance represents where a small leakage current flows through the parallel path and RS represents th which are loss of metal grid, contacts, and current collecting bus. Equations (1)-(3) [56] describe the PV cell model, where: I r is the reverse saturation current, T is the reference cell operating temperature, β the ideality factor at the junction, q is the charge of the electron (1.602176 × 10 −21 C), I SC is the short circuit current of the cell, K is the Boltzmann constant (1.38065 × 10 −3 J/ • K), α is the temperature coefficient of the short circuit current of the cell, T r is the temperature in standard test conditions, I rr is the reverse saturation current at T r temperature, E G is the energy of the Silicon band-gap (1.1 eV), and P sun is the incident radiation. Parameters α and I SC are usually given by the manufacturer of the solar cell. Parameters β, I rr , R S , and R P can be estimated.
In order to obtain more realistic conditions for the simulations to be made in Section 4, a model for the commercial module used has been developed. The parameters which are not provided by the manufacturer have been estimated using the procedure described in [56]. Table 1 presents a summary of the parameters adjusted for the commercial module. Figure 3 shows the curves obtained for the PV panel at different levels of radiation and temperature. Table 1. Electrical characteristics of the commercial PV panel [57].

Parameters Values
Nominal voltage (V n ) 12 V Maximum power current (I MPP ) 3.02 A Maximum power voltage (V MPP ) 18.21 V Maximum power (P MPP ) 55 W Short circuit current (I sc ) 3.28 A Open circuit voltage (V oc ) 22.34 V Short circuit temperature coefficient (α) +0.04/%/ • C Diode ideality factor (β) 1.2 Serie resistance (R S ) 11.6 mΩ Parallel resistance (R P ) 30 Ω Reverse saturation current (I rr ) 5.9594 × 10 −9 (A) eV), and Psun is the incident radiation. Parameters α and ISC are usually given by the manufacturer of the solar cell. Parameters β, Irr, RS, and RP can be estimated. In order to obtain more realistic conditions for the simulations to be made in Section 4, a model for the commercial module used has been developed. The parameters which are not provided by the manufacturer have been estimated using the procedure described in [56]. Table 1 presents a summary of the parameters adjusted for the commercial module. Figure 3 shows the curves obtained for the PV panel at different levels of radiation and temperature.

Power Converter
A Buck power converter has been chosen as the interface between the PV generator and the battery. In a Buck converter, the input voltage is greater than the output voltage. The topology of a Buck converter is shown in Figure 4. The control of the power flow from the PV module to the battery is performed by adjusting the duty cycle of the electronic switch of the converter, using a PWM (Pulse Width Modulation) technique. The Buck converter was chosen in this work for its low cost, simplicity, and high efficiency in PV applications [58]. In addition, the load control operation remains uninterrupted even when the PV panel provides a low output current in low radiation conditions. In this case, the Buck converter is able to increase the required charging current level [59]. As the Buck converter can provide a low voltage level from a higher voltage PV array and can operate efficiently at any radiation level, the use of this type of converter in PV applications that contain low voltage batteries is highly recommended [60]. The average output voltage is given by Equation (4) [61].
where T S is the switching period, t on is the conduction time of the switch, and D is the duty cycle. voltage batteries is highly recommended [60]. The average output voltage is given by Equation (4) [61].
where TS is the switching period, ton is the conduction time of the switch, and D is the duty cycle.

Battery Charging Strategy
Most VRLA battery manufacturers recommend dividing the charging process into three phases, namely: bulk, absorption, and float [62], as shown in Figure 5. When the

Battery Charging Strategy
Most VRLA battery manufacturers recommend dividing the charging process into three phases, namely: bulk, absorption, and float [62], as shown in Figure 5. When the battery is used in photovoltaic systems, its charging system requires an elaborate control strategy, in which the battery should be charged within its allowed current and voltage limits, as quickly as possible, given that the daily energy generation period is limited and dependent on weather conditions. In order to reach these goals, a control strategy has been designed. The flowchart of the proposed control strategy is shown in Figure 6. In the condition of a discharged battery, an efficient FLC-MPPT must act to extract the highest power from the panels in order to speed up the charging process. In this bulk phase, I BAT is limited to the maximum allowed charging current (I CH(max) ) to avoid excessive heating and premature battery wear. At this phase, the battery capacity is usually recovered between 80 and 90% [49]. When V BAT reaches the absorption voltage (V ABS ), an accurate voltage controller FLC-VR must act in order to continue the charging process at constant voltage, thus avoiding overvoltage. In this absorption phase, the charging voltage is fixed in V ABS . This set point is maintained until I BAT drops to the full charge value (I OCT ). At this point, the voltage regulator updates the set point to the float voltage (V FLT ). In this float phase, a very small charging current is generated, responsible for compensating for self-discharge and ensuring full charge. battery is used in photovoltaic systems, its charging system requires an elaborate control strategy, in which the battery should be charged within its allowed current and voltage limits, as quickly as possible, given that the daily energy generation period is limited and dependent on weather conditions. In order to reach these goals, a control strategy has been designed. The flowchart of the proposed control strategy is shown in Figure 6. In the condition of a discharged battery, an efficient FLC-MPPT must act to extract the highest power from the panels in order to speed up the charging process. In this bulk phase, IBAT is limited to the maximum allowed charging current (ICH(max)) to avoid excessive heating and premature battery wear. At this phase, the battery capacity is usually recovered between 80 and 90% [49]. When VBAT reaches the absorption voltage (VABS), an accurate voltage controller FLC-VR must act in order to continue the charging process at constant voltage, thus avoiding overvoltage. In this absorption phase, the charging voltage is fixed in VABS. This set point is maintained until IBAT drops to the full charge value (IOCT). At this point, the voltage regulator updates the set point to the float voltage (VFLT). In this float phase, a very small charging current is generated, responsible for compensating for selfdischarge and ensuring full charge.

Design of the Fuzzy Logic Controllers
FLC is one of the AI techniques that provides a convenient method for the design of non-linear controllers based on heuristic information [63]. This method does not require an accurate mathematical model of the system to determine the parameters of the controller. The information needed is obtained by the knowledge of an expert on the system. FLC provides a simple methodology to represent and implement the human experience, al-

Design of the Fuzzy Logic Controllers
FLC is one of the AI techniques that provides a convenient method for the design of non-linear controllers based on heuristic information [63]. This method does not require an accurate mathematical model of the system to determine the parameters of the controller. The information needed is obtained by the knowledge of an expert on the system. FLC provides a simple methodology to represent and implement the human experience, allowing reasoning, not in numerical variables, but in linguistic variables, which are qualitative [64]. As shown in Figure 7, an FLC includes three steps: fuzzification, the fuzzy inference engine, and defuzzification. In the fuzzification, the numerical input variables are converted into linguistic variables, based on input membership functions. The inference engine is responsible for making control decisions considering the knowledge base (rule base) using a linguistic description in terms of If-Then rules. The most commonly used inference methods are Mandami and Takagi-Sugeno. In the defuzzification, the linguistic based data are converted back to numeric data. Center of gravity (CoG) and Mean of Maxima (MoM) are two methods normally used for defuzzification. lowing reasoning, not in numerical variables, but in linguistic variables, which are qualitative [64]. As shown in Figure 7, an FLC includes three steps: fuzzification, the fuzzy inference engine, and defuzzification. In the fuzzification, the numerical input variables are converted into linguistic variables, based on input membership functions. The inference engine is responsible for making control decisions considering the knowledge base (rule base) using a linguistic description in terms of If-Then rules. The most commonly used inference methods are Mandami and Takagi-Sugeno. In the defuzzification, the linguistic based data are converted back to numeric data. Center of gravity (CoG) and Mean of Maxima (MoM) are two methods normally used for defuzzification. For the design of the FLCs, the following definitions have been adopted. The control of the power converter is carried out by adjusting the duty cycle value of the electronic switch in each switching period. For any pair of discrete input data [x1(n), x2(n)], a set of triangular membership functions, defined specifically for each FLC, transforms the numeric data into a fuzzy dataset for each input µ1[x1(n)] and µ2[x2(n)], assigning a certain degree of belonging to each linguistic variable. Triangular membership functions have been chosen because they are simple to implement and can reduce the computational cost, being more suitable for low-cost microcontrollers. Using the Mandami method of fuzzy minima implication, the inference engine applies the control rules to the fuzzified inputs, generating a single set of fuzzy outputs (µΔD) for each rule. Finally, the numerical value of the output variable, which corresponds to the size of the duty cycle variations (ΔD), is obtained using the CoG defuzzification method, shown in Equation (5).
where n is the time at which values are sampled, wi = min {µ1[x1(n)],u2[x2(n)]} is the weight factor, and ΔDi is the value which corresponds to the membership function of ΔD(n). The output of the FLC is converted to the duty cycle according to Equation (6).

Fuzzy Inputs
Design considerations and the effectiveness of a fuzzy MPPT algorithm depends on the proper selection of the system's input variables. According to the characteristics of a PV cell, several types of input variables could be used. In this work, the slope (S) of the P-V curve and the power variation (ΔPPV) have been chosen, as shown in Figure 8. This approach has the advantage of easily determining whether the operating point (OP) is on the right or left of the MPP, facilitating the increase or decrease in the converter's duty cycle. In addition, for low radiation levels, ΔPPV can be used to detect changes in radiation and facilitate the tracking speed [65]. ΔPPV and S can be described by Equations (7) and For the design of the FLCs, the following definitions have been adopted. The control of the power converter is carried out by adjusting the duty cycle value of the electronic switch in each switching period. For any pair of discrete input data [x 1 (n), x 2 (n)], a set of triangular membership functions, defined specifically for each FLC, transforms the numeric data into a fuzzy dataset for each input µ 1 [x 1 (n)] and µ 2 [x 2 (n)], assigning a certain degree of belonging to each linguistic variable. Triangular membership functions have been chosen because they are simple to implement and can reduce the computational cost, being more suitable for low-cost microcontrollers. Using the Mandami method of fuzzy minima implication, the inference engine applies the control rules to the fuzzified inputs, generating a single set of fuzzy outputs (µ ∆D ) for each rule. Finally, the numerical value of the output variable, which corresponds to the size of the duty cycle variations (∆D), is obtained using the CoG defuzzification method, shown in Equation (5).
where n is the time at which values are sampled, w i = min {µ 1 [x 1 (n)],u 2 [x 2 (n)]} is the weight factor, and ∆D i is the value which corresponds to the membership function of ∆D(n). The output of the FLC is converted to the duty cycle according to Equation (6).

Fuzzy Inputs
Design considerations and the effectiveness of a fuzzy MPPT algorithm depends on the proper selection of the system's input variables. According to the characteristics of a PV cell, several types of input variables could be used. In this work, the slope (S) of the P-V curve and the power variation (∆P PV ) have been chosen, as shown in Figure 8. This approach has the advantage of easily determining whether the operating point (OP) is on the right or left of the MPP, facilitating the increase or decrease in the converter's duty cycle. In addition, for low radiation levels, ∆P PV can be used to detect changes in radiation and facilitate the tracking speed [65]. ∆P PV and S can be described by Equations (7) and (8), respectively.
. Inputs S and ΔPPV on the P-V curve of a PV panel.

Asymmetrical Membership Functions
In order to optimize the efficiency of the MPPT, asymmetrical triangular membershi functions were used. FLC-MPPT algorithms based on asymmetrical functions have show to have better behavior to extract maximum power than those based on conventional sym metric functions [25,30]. For both inputs and outputs, the membership functions were de fined in terms of the following linguistic variables: negative big (NB), negative small (NS zero (ZO), positive big (PB), and positive small (PS). The ranges for S, ΔPPV, and ΔD wer

Asymmetrical Membership Functions
In order to optimize the efficiency of the MPPT, asymmetrical triangular membership functions were used. FLC-MPPT algorithms based on asymmetrical functions have shown to have better behavior to extract maximum power than those based on conventional symmetric functions [25,30]. For both inputs and outputs, the membership functions were defined in terms of the following linguistic variables: negative big (NB), negative small (NS), zero (ZO), positive big (PB), and positive small (PS). The ranges for S, ∆P PV , and ∆D were adjusted to (−55 to 10), (−1 to 1), and (−0.02 to 0.02), respectively. Since there is no definite systematic method to select gains for an FLC, the membership values have been determined by trial and error by using the MATLAB Fuzzy Inference System. Figure 9 shows the membership functions for the inputs and output of the controller.

Fuzzy Rules
A DC-DC converter has the characteristic of reflecting in its input the impedance of th connected load (ZL). This impedance is reflected as a function of the duty cycle of the con verter. Thus, by varying the duty cycle, it is possible to adjust the current and voltage in th PV panel, i.e., its OP. In the case of the Buck converter, the reflected input impedance (Zi) i given by Equation (9) [66]. If the duty cycle of the Buck converter increases, the input im pedance decreases, producing an increase in the current in the PV panel and displacing th OP of the panel to the left. In the case where the duty cycle decreases, the opposite effect i produced and the OP of the panel is moved to the right, as shown in Figure 10.

Fuzzy Rules
A DC-DC converter has the characteristic of reflecting in its input the impedance of the connected load (Z L ). This impedance is reflected as a function of the duty cycle of the converter. Thus, by varying the duty cycle, it is possible to adjust the current and voltage in the PV panel, i.e., its OP. In the case of the Buck converter, the reflected input impedance (Z i ) is given by Equation (9) [66]. If the duty cycle of the Buck converter increases, the input impedance decreases, producing an increase in the current in the PV panel and displacing the OP of the panel to the left. In the case where the duty cycle decreases, the opposite effect is produced and the OP of the panel is moved to the right, as shown in Figure 10. (1) If S is positive and ΔPPV is positive, it means that the OP is on the left side of the MPP and approaching it; then, ΔD must be negative to continue in the same direction. (2) If S is positive and ΔPPV is negative, it means that the OP is on the left side of the MPP and the OP is moving away from it; then, ΔD must be negative to change direction. (3) If S is negative and ΔPPV is positive, it means that the OP is on the right side of the MPP and approaching it; then, ΔD must be positive to continue in the same direction. (4) If S is negative and ΔPPV is negative, it means that the OP is on the right side of the MPP and moving away from it; then, ΔD must be positive to change direction. (5) If ΔPPV is zero, it means that the OP could be very close to the MPP. Here, two situations could happen: In the case of S being negative, it means that the OP is on the right side of the MPP; then, ΔD must be positive to move the OP to the left. In the case of S being positive, it means that the OP is on the left side of the MPP; then, ΔD must be negative to move the OP to the right. (6) If S is zero, it means that the MPP has been reached; then, ΔD must be zero. Table 2 shows the summary of the proposed rules for the FLC-MPPT. The control surface is shown in Figure 11.  (1) If S is positive and ∆P PV is positive, it means that the OP is on the left side of the MPP and approaching it; then, ∆D must be negative to continue in the same direction. (2) If S is positive and ∆P PV is negative, it means that the OP is on the left side of the MPP and the OP is moving away from it; then, ∆D must be negative to change direction. (3) If S is negative and ∆P PV is positive, it means that the OP is on the right side of the MPP and approaching it; then, ∆D must be positive to continue in the same direction. (4) If S is negative and ∆P PV is negative, it means that the OP is on the right side of the MPP and moving away from it; then, ∆D must be positive to change direction. (5) If ∆P PV is zero, it means that the OP could be very close to the MPP. Here, two situations could happen: In the case of S being negative, it means that the OP is on the right side of the MPP; then, ∆D must be positive to move the OP to the left. In the case of S being positive, it means that the OP is on the left side of the MPP; then, ∆D must be negative to move the OP to the right. (6) If S is zero, it means that the MPP has been reached; then, ∆D must be zero. Table 2 shows the summary of the proposed rules for the FLC-MPPT. The control surface is shown in Figure 11.

Fuzzy Inputs
To design the voltage controller, two input variables have been chosen: the error (E) and the error change (ΔE); the sampled values of these variables are described in Equations (10) and (11), respectively.
where VREF corresponds to the desired charging voltage.

Symmetrical Membership Functions
For the fuzzification process, symmetric triangular membership functions were used. For the entries, the following linguistic variables were defined: negative big (NB), negative mean (NM), zero (ZO), positive big (PB), and positive mean (PM). The range for E and ΔE were adjusted to (−15 to 15) and (−0.025 to 0.025), respectively. In order to improve the accuracy of the controller, two more linguistic variables for the ΔD output function can be added: positive small (PS) and negative small (NS) [67]. The range of ΔD was adjusted to (−0.05 to 0.05). Figure 12 shows the membership functions for the inputs and output of the controller.

Fuzzy Inputs
To design the voltage controller, two input variables have been chosen: the error (E) and the error change (∆E); the sampled values of these variables are described in Equations (10) and (11), respectively.
where V REF corresponds to the desired charging voltage.

Symmetrical Membership Functions
For the fuzzification process, symmetric triangular membership functions were used. For the entries, the following linguistic variables were defined: negative big (NB), negative mean (NM), zero (ZO), positive big (PB), and positive mean (PM). The range for E and ∆E were adjusted to (−15 to 15) and (−0.025 to 0.025), respectively. In order to improve the accuracy of the controller, two more linguistic variables for the ∆D output function can be added: positive small (PS) and negative small (NS) [67]. The range of ∆D was adjusted to (−0.05 to 0.05). Figure 12 shows the membership functions for the inputs and output of the controller.

Fuzzy Rules
The derivation of the control rules has been based on six criteria [68]: (1) If E is large (positive or negative), then ΔD change must be large in order to bring VBAT quickly to VREF. (2) If E is decreasing, then a small change in ΔD is necessary.
(3) If E is zero and ΔE is not zero (VBAT keeps changing), then a small change in ΔD is necessary to prevent the VBAT from moving away from VREF. (4) If E is zero and ΔE is zero, then ΔD must remain unchanged. (5) If E is positive, then the sign of the ΔD change must be negative. (6) If E is negative, then the sign of the ΔD must be positive. Table 3 shows the summary of the proposed control rules. Figure 13 shows the control surface of the FLC-VR.

Fuzzy Rules
The derivation of the control rules has been based on six criteria [68]: (1) If E is large (positive or negative), then ∆D change must be large in order to bring V BAT quickly to V REF .
(2) If E is decreasing, then a small change in ∆D is necessary.
(3) If E is zero and ∆E is not zero (V BAT keeps changing), then a small change in ∆D is necessary to prevent the V BAT from moving away from V REF . (4) If E is zero and ∆E is zero, then ∆D must remain unchanged. (5) If E is positive, then the sign of the ∆D change must be negative. (6) If E is negative, then the sign of the ∆D must be positive. Table 3 shows the summary of the proposed control rules. Figure 13 shows the control surface of the FLC-VR.

Simulations
In this section, the results of the simulations assembled in Simulink are presented. The fuzzy algorithms were implemented using the Toolbox Fuzzy Logic Designer. The model developed for the commercial module presented in Section 2.1 is represented by the Solar Panel function block. The battery behavior has been represented by the generic model for lead-acid batteries available on Power System Toolbox. The values for the power converter are those used in the experimental prototype. Figure 14 shows the scheme implemented to analyze the performance of the FLC-MPPT algorithm. A radiation profile with abrupt changes and constant temperature was applied as the input of the PV panel, as shown in Figure 15. The transient behavior and the steady-state tracking efficiency of the MPPT were determined, and their results compared with two popular conventional MPPT techniques: P&O and IncCond. Details of these techniques can be found in [6]. The calculation of efficiency (η) in Equation (12) and the convergence time (τ), determined as the time in which the system reaches 95% of the MPP, as recommended in [69], were calculated. Figure 16 shows the behavior of the MPPT algorithms for each radiation level; the results for the obtained efficiencies are summarized in Table 4. It can be observed that, compared to P&O and IncCond, the FLC-MPPT presented the highest average efficiency and the smallest steady-state ripple of power, for all radiation levels tested. Table 5 shows the convergence times for each MPPT method, where the FLC-MPPT presented the fastest transient response.

Simulations
In this section, the results of the simulations assembled in Simulink are presented. The fuzzy algorithms were implemented using the Toolbox Fuzzy Logic Designer. The model developed for the commercial module presented in Section 2.1 is represented by the Solar Panel function block. The battery behavior has been represented by the generic model for lead-acid batteries available on Power System Toolbox. The values for the power converter are those used in the experimental prototype. Figure 14 shows the scheme implemented to analyze the performance of the FLC-MPPT algorithm. A radiation profile with abrupt changes and constant temperature was applied as the input of the PV panel, as shown in Figure 15. The transient behavior and the steady-state tracking efficiency of the MPPT were determined, and their results compared with two popular conventional MPPT techniques: P&O and IncCond. Details of these techniques can be found in [6]. The calculation of efficiency (η) in Equation (12) and the convergence time (τ), determined as the time in which the system reaches 95% of the MPP, as recommended in [69], were calculated. Figure 16 shows the behavior of the MPPT algorithms for each radiation level; the results for the obtained efficiencies are summarized in Table 4. It can be observed that, compared to P&O and IncCond, the FLC-MPPT presented the highest average efficiency and the smallest steady-state ripple of power, for all radiation levels tested. Table 5 shows the convergence times for each MPPT method, where the FLC-MPPT presented the fastest transient response.

FLC-VR
To evaluate the performance of the FLC-VR, the scheme of Figure 17 was implemented. Two typical tests to analyze the functioning of a feedback control were carried out. The results obtained for the FLC-VR have been compared with the behavior of a classic PID controller, which has been tuned by the Ziegler-Nichols method [70]. The adjusted parameters of the PID controller are shown in Table 6. First, a step in the reference voltage from 13.5 to 14.4 V was applied at t = 0.02 s. Then, a step in the load current from 4 to 6.7 A was applied at t = 0.04 s. Figure 18 shows the system response for each controller. The performance parameters-settling time and overshoot-were summarized in Table 7. It can be seen that the FLC-VR presented a better behavior than the PID controller, with a shorter settling time to reach the new set point and correct the battery voltage in the event of load disturbances, in addition to the considerable decrease in overshoot.

FLC-VR
To evaluate the performance of the FLC-VR, the scheme of Figure 17 was implemented. Two typical tests to analyze the functioning of a feedback control were carried out. The results obtained for the FLC-VR have been compared with the behavior of a classic PID controller, which has been tuned by the Ziegler-Nichols method [70]. The adjusted parameters of the PID controller are shown in Table 6. First, a step in the reference voltage from 13.5 to 14.4 V was applied at t = 0.02 s. Then, a step in the load current from 4 to 6.7 A was applied at t = 0.04 s. Figure 18 shows the system response for each controller. The performance parameters-settling time and overshoot-were summarized in Table 7. It can be seen that the FLC-VR presented a better behavior than the PID controller, with a shorter settling time to reach the new set point and correct the battery voltage in the event of load disturbances, in addition to the considerable decrease in overshoot.    Figure 19 shows the experimental setup implemented to validate the performance of the control strategy. The system consists of monocrystalline WANT-M55W PV panels, a NIMAC VRLA 12 V/10 Ah battery, and the prototype of the charge controller, which contains three main circuits: the Buck converter, a signal measurement and conditioning board, and the Arduino Due board where the developed C code was implemented. The high performance, low power, flexibility, the simplicity of its hardware and software, and low cost of the Arduino Due microcontroller has motivated its use in this work. Data collection was performed using the DAQ USB 6009 system from National Instruments and the Tektronic TDS2012B digital oscilloscope. Table 8 presents the main components used      Figure 19 shows the experimental setup implemented to validate the performance of the control strategy. The system consists of monocrystalline WANT-M55W PV panels, a NIMAC VRLA 12 V/10 Ah battery, and the prototype of the charge controller, which contains three main circuits: the Buck converter, a signal measurement and conditioning board, and the Arduino Due board where the developed C code was implemented. The high performance, low power, flexibility, the simplicity of its hardware and software, and low cost of the Arduino Due microcontroller has motivated its use in this work. Data col-   Figure 19 shows the experimental setup implemented to validate the performance of the control strategy. The system consists of monocrystalline WANT-M55W PV panels, a NIMAC VRLA 12 V/10 Ah battery, and the prototype of the charge controller, which contains three main circuits: the Buck converter, a signal measurement and conditioning board, and the Arduino Due board where the developed C code was implemented. The high performance, low power, flexibility, the simplicity of its hardware and software, and low cost of the Arduino Due microcontroller has motivated its use in this work. Data collection was performed using the DAQ USB 6009 system from National Instruments and the Tektronic TDS2012B digital oscilloscope. Table 8 presents the main components used to build the Buck converter. Table 9 presents the main technical data of the Arduino Due microcontroller. All experimental tests have been carried out on the premises of Arturo Prat University in Iquique, Chile. microcontroller. All experimental tests have been carried out on the premises of Arturo Prat University in Iquique, Chile.  Figure 19. The experimental hardware setup.

MPPT-FLC Performance
To analyze the dynamic response of the FLC-MPPT, a test was conceived. With the control operating in the Bulk region, and under approximately constant conditions of radiation and temperature, a situation that can be verified during a time interval of a few seconds on a clear day. A step in the charging current of the battery of 10% was applied.

MPPT-FLC Performance
To analyze the dynamic response of the FLC-MPPT, a test was conceived. With the control operating in the Bulk region, and under approximately constant conditions of radiation and temperature, a situation that can be verified during a time interval of a few seconds on a clear day. A step in the charging current of the battery of 10% was applied. This was performed connecting a resistor in parallel to the battery. Figure 20 shows that the power on the PV panel initially has a reduction of 18% (46 to 38 W) due to the current change. Then, the control algorithm quickly acts to reduce the voltage of the PV module in order to compensate for the current increase and takes the operating point around the MPP again, reaching a convergence time of 1.93 s. On the same day, aiming to determine the average steady-state efficiency of the FLC-MPPT, three other tests were carried out. They were performed at different times in order to achieve very different radiation levels. The FLC-MPPT presented an excellent performance, reaching efficiencies greater than 97.87% in all cases analyzed, as shown in Figure 21. The results obtained are summarized in Table 10.
Energies 2021, 14, x This was performed connecting a resistor in parallel to the battery. Figure 20 sh the power on the PV panel initially has a reduction of 18% (46 to 38 W) due to th change. Then, the control algorithm quickly acts to reduce the voltage of the PV in order to compensate for the current increase and takes the operating point ar MPP again, reaching a convergence time of 1.93 s. On the same day, aiming to d the average steady-state efficiency of the FLC-MPPT, three other tests were car They were performed at different times in order to achieve very different radiatio The FLC-MPPT presented an excellent performance, reaching efficiencies grea 97.87% in all cases analyzed, as shown in Figure 21. The results obtained are sum in Table 10.     In order to test the behavior of the FLC-MPPT in complete cycles of daily radiation, four tests were performed. In all of them, the battery was replaced by a resistor. The value of the resistive load has been carefully chosen. If the maximum power voltage (VMPP) and  In order to test the behavior of the FLC-MPPT in complete cycles of daily radiation, four tests were performed. In all of them, the battery was replaced by a resistor. The value of the resistive load has been carefully chosen. If the maximum power voltage (V MPP ) and maximum power current (I MPP ) values of the commercial PV panel are considered for an incident radiation of 1000 W/m 2 and temperature of 25 • C, weather conditions known as standard test conditions (STC) ( Table 1), then the theoretical value of the resistor that guarantees MPP in this climatic condition can be determined as R MPP = V MPP /I MPP = 18.21 V/3.02 A = 6 Ω. On the other hand, according to Equation (9), note that the Buck converter has an inability to reflect impedances less than the load on its input. Therefore, the impedance connected to the output of the power converter must be less than R MPP . In order to achieve the widest possible range for adjusting the duty cycle, a load resistor RL = 1 Ω was chosen. Therefore, for example, for the STC, the duty cycle according to (9) should be D = (1/R MPP ) (1/2) = 0.4, which is almost at the center of the allowable range for D (0 to 1).
In each test, power data on the panel with 10-second intervals were collected, starting from 8:00 a.m. to 8:00 p.m., local time. As a comparison, the power data of another PV panel with identical characteristics operating without the MPPT algorithm and with different R L values were also collected simultaneously. Figure 22 shows how the daily energy production of the PV panel was effectively maximized by FLC-MPPT. Table 11 summarizes the obtained results. Figure 23 shows the duty cycle in PWM form, generated at certain times during the test on January 31, and obtained directly from the drain source voltage in the Buck converter's Mosfet.

FLC-VR Performance
To analyze the performance of the voltage control, a test was carried out, consisting of adjusting the controller set point to 14.4 V, using a resistor as a load. With the control in progress, steps in the load current were applied, alternating the load resistor between 15 and 7.5 Ω. When the disturbances were applied, both the current in the load and the power supplied by the PV panel reached new levels, while the controller quickly adjusted the duty cycle of the converter to bring the output voltage to the reference. In the case of current increase, the voltage stabilization time was 1.24 s and in the case of current reduction, the voltage stabilization time was 0.93 s, as shown in Figure 24. The results obtained demonstrate the robustness of the FLC-VR to regulate the load voltage in the presence of abrupt current variations, which normally occurs in situations of abrupt changes in inci-

FLC-VR Performance
To analyze the performance of the voltage control, a test was carried out, consisting of adjusting the controller set point to 14.4 V, using a resistor as a load. With the control in progress, steps in the load current were applied, alternating the load resistor between 15 and 7.5 Ω. When the disturbances were applied, both the current in the load and the power supplied by the PV panel reached new levels, while the controller quickly adjusted the duty cycle of the converter to bring the output voltage to the reference. In the case of current increase, the voltage stabilization time was 1.24 s and in the case of current reduction, the voltage stabilization time was 0.93 s, as shown in Figure 24. The results obtained demonstrate the robustness of the FLC-VR to regulate the load voltage in the presence of abrupt current variations, which normally occurs in situations of abrupt changes in incident radiation.

FLC-VR Performance
To analyze the performance of the voltage control, a test was carried out, consisting of adjusting the controller set point to 14.4 V, using a resistor as a load. With the control in progress, steps in the load current were applied, alternating the load resistor between 15 and 7.5 Ω. When the disturbances were applied, both the current in the load and the power supplied by the PV panel reached new levels, while the controller quickly adjusted the duty cycle of the converter to bring the output voltage to the reference. In the case of current increase, the voltage stabilization time was 1.24 s and in the case of current reduction, the voltage stabilization time was 0.93 s, as shown in Figure 24. The results obtained demonstrate the robustness of the FLC-VR to regulate the load voltage in the presence of abrupt current variations, which normally occurs in situations of abrupt changes in incident radiation.

Performance of the Three-Stage Charging Process
In order to validate the battery charger control's global strategy, a final test was carried out. Experimental data were collected every 10 seconds between 12:00 and 19:45 h. The control flowchart parameters of Figure 5 were fixed as: V ABS = 14.4 V, V FLT = 13.5 V, I CH(max) = 3A, and I OCT = 0.3 A, agreeing with the parameters suggested by the manufacturer of the commercial battery [71]. When starting the test, the battery was sufficiently discharged with a voltage of 13.1 V. Figure 25 shows the results obtained for the charging process. It is observed that between 12:00 h and 13:27 h, in the condition of discharged battery, the FLC-MPPT acts to maximize the power provided by the PV panel. The power increases while the available radiation grows as time advances. In this Bulk charging phase, the current in the battery remains constant around I BAT = 2.6 A and V BAT increases gradually until reaching the absorption value V ABS = 14.4 V. At this threshold, the FLC-MPPT is switched off and the FLC-VR starts to adjust the absorption voltage. At this stage, I BAT begins to decrease, and consequently, also the current and power on the panel; the charger operates in this absorption phase between 13:24 h and 18:14 h. When I BAT reaches the full charge value I OCT = 0.3 A, the FLC-VR changes its reference, and the charge continues at the float voltage V FLT = 13.5 V, until the end of the test. In this final charging phase, only a small current is generated to avoid self-discharge and ensure 100% charge. gradually until reaching the absorption value VABS = 14.4 V. At this threshold, the FLC-MPPT is switched off and the FLC-VR starts to adjust the absorption voltage. At this stage, IBAT begins to decrease, and consequently, also the current and power on the panel; the charger operates in this absorption phase between 13:24 h and 18:14 h. When IBAT reaches the full charge value IOCT = 0.3 A, the FLC-VR changes its reference, and the charge continues at the float voltage VFLT = 13.5 V, until the end of the test. In this final charging phase, only a small current is generated to avoid self-discharge and ensure 100% charge.

Conclusions
This work has presented and tested the design of a new digital control strategy implemented in the Arduino Due microcontroller for a Buck power converter used as a solar

Conclusions
This work has presented and tested the design of a new digital control strategy implemented in the Arduino Due microcontroller for a Buck power converter used as a solar charger of VRLA batteries. The strategy combines both MPPT and output voltage regulation by using two precise fuzzy logic controllers (FLC-MPPT and FLC-VR), which operate adjusting the optimal increment of the converter duty cycle according to a smart three-stage charging algorithm. To evaluate the performance of the designed FLCs, simulations by MATLAB/Simulink were carried out. The results have shown that the FLC-MPPT operating under abrupt changes in incident radiation achieves higher MPPT efficiency, smaller steady-state ripple, and shorter convergence time compared to conventional MPPT techniques commonly reported in the literature: P&O and IncCond (Tables 4 and 5). Furthermore, the FLC-VR presents smaller transitory voltage overshoot and faster transient response compared to a standard PID controller (Table 6). In addition, a prototype hardware setup was implemented. The experimental tests have proved that in the Bulk charging region, the energy produced by the PV panel is maximized in different weather conditions, with efficiency of the FLC-MPPT being between 97.87 and 98.22% with a convergence time of 1.93 s. Moreover, in the absorption and float charging regions, the FLC-VR is able to stabilize the voltage against abrupt variations in the charging current, with setting times between 0.93 and 1.24 s.
The simulated and experimental results validate the robustness and reliability of the control strategy. The charging system delivers maximum power from the PV source to the battery and avoids overcharging, thereby ensuring an efficient, fast, and safe charging process. Moreover, it overcomes the drawbacks of the conventional PV charges, is feasible to implement in low-cost microcontrollers, and does not require any mathematical model. Funding: This work has been supported by Arturo Prat University.

Conflicts of Interest:
The authors declare no conflict of interest.  The Ith discrete input data µ i Fuzzy data set for the Ith discrete input data W i Weight factor for CoG defuzzification method n Sample n n-1 Sample n-1 S Slope of the P-V curve