Distributed Intelligent Battery Management System Using a Real-World Cloud Computing System

In this work, a decentralized but synchronized real-world system for smart battery management was designed by using a general controller with cloud computing capability, four charge regulators, and a set of sensorized battery monitors with networking and Bluetooth capabilities. Currently, for real-world applications, battery management systems (BMSs) can be used in the form of distributed control systems where general controllers, charge regulators, and smart monitors and sensors are integrated, such as those proposed in this work, which allow more precise estimations of a large set of important parameters, such as the state of charge (SOC), state of health (SOH), current, voltage, and temperature, seeking the safety and the extension of the useful life of energy storage systems based on battery banks. The system used is a paradigmatic real-world example of the so-called intelligent battery management systems. One of the contributions made in this work is the realization of a distributed design of a BMS, which adds the benefit of increased system security compared to a fully centralized BMS structure. Another research contribution made in this work is the development of a methodical modeling procedure based on Petri Nets, which establishes, in a visible, organized, and precise way, the set of conditions that will determine the operation of the BMS. If this modeling is not carried out, the threshold values and their conditions remain scattered, not very transparent, and difficult to deal with in an aggregate way.


Introduction
At present, a very worrying energy crisis is affecting socio-political, economic, and energy supply stability on a global scale. For this last aspect, it is particularly necessary to intensify the promotion of an energy self-sufficiency policy based on renewable energies.
One of the objectives for further increasing the competitiveness of renewable energies must be based on the improvement of energy storage systems (ESSs). In particular, it is important to improve the operating and maintenance costs of the installations based on the application of advanced methods for the monitoring and predictive diagnosis of failures, aimed at extending the useful life of the batteries. The price of a photovoltaic (PV) system is significantly impacted by the reduced battery life. More than 40% of the costs over the course of a PV system's life cycle are attributable to the battery [1]. System reliability will improve, and operating costs will be significantly reduced as the battery's lifespan increases [2,3]. By avoiding hazardous operating conditions such as deep discharge and overcharging, batteries' lifespans can be increased.
A battery can offer many years of dependable service if it is properly designed, constructed, and maintained. A brand-new battery may not initially operate at full capacity. During the first few years of use, the capacity usually increases, peaks, and then drops until the battery reaches the end of its useful life. A lead-acid battery is generally considered to have reached the end of its useful life when its capacity reaches 80% of its rated capacity. Below 80%, the rate of battery deterioration quickens, making it more susceptible to a mechanical shock or a rapid failure induced by a high discharge rate. It should be noted that a battery will eventually lose its capacity even in perfect circumstances [4].
The storage capacity and useful life of batteries are significantly influenced by the appropriate management of their use, which is necessary to achieve the energy storage system's maximum availability [5]. Batteries can be used differently by condition-monitoring devices to increase their lifespan. Additionally, they can regulate the state of the batteries, allowing the application of predictive maintenance approaches to decide when to replace them [6,7]. They can also estimate the quantity of energy stored in the batteries to plan power usage and charging cycles.

Maintenance Particularities of Each Type of Battery
The useful life of batteries depends on many factors, and it is known that it can be shortened by both overcharging and undercharging and overloading. It can also be highly detrimental if the current discharges are too deep under conditions of high ambient temperatures or due to the confined space of the installation site. This phenomenon is general and affects different types of batteries, either Li-ion type [8] or Valve-Regulated Lead-Acid (VRLA)-type batteries (gel or Absorbent Glass Mat (AGM)), which, due to their comparatively low cost, are still widely used [9].
For VRLA (gel or AGM) batteries, overcharging can cause gassing, which dries out the electrolyte and raises the internal resistance, leading to irreparable damage. When the charging voltage of 12 V batteries approaches 15 V, flat-plate VRLA batteries begin to leak water [1].
It should be noted that Li-ion batteries are particularly expensive and that they are also susceptible to irreversible damage from excessive charging or discharging. When the system is not in use, various components (alarm systems, relays, standby current from specific loads, current drain from battery chargers, etc.) gradually drain the battery. Since Li-ion batteries have a much higher charging efficiency than lead-acid batteries, it is advised to set the charging efficiency factor to 99 percent [10].
LiFePO4 batteries can generally use the factory-programmed "charging parameters" as well. When the current falls below a set threshold, some battery chargers stop charging. This limit must be exceeded by the tail current. LiFePO4 batteries outperform lead-acid batteries at high discharge rates. The Peukert exponent should be set to 1.05 [10] unless the battery manufacturer specifies otherwise.
When the system is not in use, the battery should be isolated in case there is any uncertainty regarding potential residual current consumption by opening its circuit breaker, removing the battery fuse(s), or disconnecting the battery's positive terminal. If the system has been completely discharged and the low-voltage disconnection of the cells has taken place, the residual discharge current is particularly hazardous. A Li-ion battery still has a reserve of about 1 Ah for every 100 Ah of capacity after being disconnected due to the low cell voltage. If the battery's reserve capacity is reduced, the battery will suffer damage. If the system is left in a discharged state for more than 10 days, a residual current of 4 mA, for instance, can destroy a 100 Ah battery (4 mA × 24 h × 10 days = 0.96 Ah). It is especially advised in these circumstances to use devices with low current consumption [10].

BMS Applications
By managing the battery with an intelligent battery management system (BMS), information is received that will allow major degradation problems to be avoided. The amortization of a BMS is quickly realized by contributing to the prolongation of battery life.
It would be desirable if a BMS could have easy access to the innards of commonly used batteries to protect the drive battery's individual cells and to increase the service life as well as the cycle number. This possibility would be very interesting for most types of batteries. However, this is not feasible for practically all commercial batteries, except in the case of laboratory tests. In this final instance, the BMS measures the control parameters: the battery current, temperature, and cell voltage. The nominal voltage of a common cycling aging, which occurs when they undergo cyclic operation [35]. The temperature and the SOC are two primary factors that contribute to aging in the first scenario, in addition to time itself. The Arrhenius equation can be used to explain how the temperature changes exponentially [52], whereas the SOC changes linearly [53,54]. On the other hand, the DOD and the C-rate also play a role in aging brought on by cycling [55]. In contrast to the C-rate, which uses a second-degree polynomial, the first one accomplishes this using a logarithmic relation [56,57].
Both a rise in the battery's internal resistance and a reduction in capacity are the two consequences that these effects have in practice [58]. The RC components are also affected, but these effects only have an immediate impact on how quickly the battery reacts to sudden changes in current. Practically speaking, a relationship can be drawn between the battery's capacity loss and aging, which will continue to happen continuously despite taking place slowly.
The gradual loss of a battery's capacity and its increase in internal resistance are the most obvious effects of battery aging, and these are measured by the state of the battery (SOH) parameter. The SOH can be calculated either using Equation (1) or (2) as the ratio of the battery's current capacity (Cap) to its initial capacity (Cap ini ) or its initial internal resistance Rn ini to increased internal resistance Rinc, respectively. SOH = Cap/Cap ini (1) SOH = Rinc/Rn ini (2) Its operational limit will be established by the SOH. In other words, this is the parameter that determines when a battery in a given application reaches the end of its useful life. The aging of batteries and other relevant parameters have been analyzed through experimental tests performed in laboratories following predetermined protocols [59][60][61][62][63].
When taking into account a battery's actual operating circumstances, sensors may frequently be unable to determine or estimate aging parameters by measuring their internal variables. Mathematical models developed in experimental laboratory conditions do not easily adapt to the random conditions of complex degradation associated with the real-world operating regime that batteries are subjected to in challenging and difficult circumstances because measurements can be very challenging, expensive, or intractable. Batteries gradually degrade under these circumstances as a result of multi-parametric cumulative effects, the relative contributions of which are very difficult to measure. Online trend analysis techniques are more suitable for monitoring the true state of charge (SOH) of batteries when operating under actual conditions [64].

Common Catastrophic Battery Failures
Finding out when batteries' useful lives are up with the potential to move on to adequate maintenance in the appropriate time and form is one of the key components of diagnosis. However, it is also important to take into account the risks related to some common catastrophic failures, whose effects might be felt immediately. According to their technology, batteries are known to fail in a variety of ways [65]. Due to their relative advantages, relatively low cost of installation and maintenance, energy density, and safety, some of the most popular battery types today are the VRLA and gel types. The associated typical failure modes for these types of batteries are those that are listed below [66,67]: Many of the above-mentioned failure modes, particularly dry-out, positive-grid corrosion, and thermal runaway, are strongly influenced by an increase in the internal battery temperature, which in turn depends, under normal circumstances, primarily but not exclusively on the ambient temperature resulting from environmental factors such as weather. The battery installation chamber acts as a "filter" to change the outside temperature to the ambient temperature.
The internal battery temperature has a significant impact on aging, grid corrosion, and the rate of water loss (dry-out) from evaporation or hydrogen evolution at the negative plates (self-discharge), all of which rise with temperature. On the other hand, applications that involve intense cycling may benefit from a (moderate) temperature increase [68].
The phenomenon of dry-out occurs and is accelerated by excessive heat (lack of proper ventilation or, to put it another way, heat accumulation inside the battery as a result of a prior failure from the heat dissipation process), as well as overcharging, which can result in elevated internal temperatures and high ambient (installation chamber) temperatures, and significantly contributes to grid corrosion. Failures can show signs of drying out in between 82 and 85% of cases [67]. It frequently occurs as a side effect of some failure modes and as a unique inducer of others, such as thermal runaway. Negative-strap corrosion, which causes the slow loss of the electrolyte, is the typical failure mode for a VRLA battery under normal operating conditions. The pressure relief valve (PRV) allows the sealed cells to vent when the internal temperature rises. The battery capacity decreases, and the internal impedance rises when enough electrolyte is vented, removing the glass matte from contact with the plates.
When a battery experiences thermal runaway, its temperature rises quickly, causing it to overheat to an extreme degree. As a result, the battery may melt, catch fire, or even explode. Only high ambient temperatures and/or excessive charging voltage can cause thermal runaway in a battery [69,70]. Even though runaway failures are less common, they can still have critical consequences. In these situations, the battery system's automatic control action must be immediate and based on its quick isolation from the loads and disconnection from the generation sources, both of which must be carried out by the BMS system as a whole. In a self-sustaining reaction, thermal runaway happens when a battery's internal parts start to melt. The battery's internal temperature increases as the current is accepted. The battery can accept more current from the charger because the temperature increase lowers the impedance of the battery. The battery gets hotter as a result of the higher current. When the heat removed linearly increases more slowly than the heat produced by the reaction, thermal runaway occurs. As a result of the reaction mass's temperature being raised by the excess heat, the rate of reaction rises. In turn, this quickens the rate at which heat is produced. According to a rough rule of thumb, the reaction rate-and subsequently, the rate of heat generation-doubles with every 10 C increase in temperature, causing the battery temperature to "runaway". The temperature can rise even further to the point of plastic meltdown and potential fire [66] once the electrolyte has boiled away, exceeding the upper limit of 126 • C [67] that will eventually be reached when it begins to boil.
The float voltage and ambient temperature can have varying effects on various batteries. Significant variations in the float voltages between various batteries of various makes and models can result in varying aging times. The chemistry of the battery and its construction, its age, and particularly the chamber conditions where batteries are installed all play a part in the response variation in each battery's behavior [71].
If the battery's internal heat generation process enters an advanced uncontrolled phase, violent boiling and quick gas generation will take place, leading to over-pressurization. If this condition is not caught in time, it can result in catastrophic damage due to emissions of hydrogen, oxygen, hydrogen sulfide gas (an irritant), and atomized electrolyte. The installation chamber may catch fire or explode as a result of this process [72]. Users may be exposed to hazardous gas emissions in this situation, including hot, toxic gases, liquids, and particles, increasing the possibility of catastrophic mishaps.
All batteries are known to be "killed" by high temperatures, though the impact varies depending on the model, manufacturer, and manufacturing technology used. At 95 • F (35 • C), the life of lead-acid is reduced by 50%, whereas the life of nickel-cadmium is Sensors 2023, 23, 3417 6 of 38 reduced by 16-18% [56,62]. The battery life is halved for every 18 • F (10 • C) increase in battery temperature. Positive-grid corrosion occurs more quickly as a result of the elevated temperature, as do other failure modes. A 20-year battery will only last 10 years if it is kept at a temperature of 95 • F (35 • C) as opposed to the intended 77 • F (25 • C), and so on. A 20-year battery will only last 5 years if the temperature is raised by another 18 • F to 113 • F (45 • C). The internal temperature of the batteries is therefore the most crucial parameter to take into account in predictive trend analysis [56].
On the other hand, any battery's internal chemical reactions are slowed down by the low-temperature range. Depending on the technology, the degree of performance reduction varies as well. A VRLA battery might need a 20% capacity compensation, for instance, when the temperature is close to freezing. A capacity increase of twofold is necessary for a lead-calcium cell using 1.215 specific gravity acid, compared to an 18% increase for the Ni-Cd cell.
In a perfect world, the trend analysis of some battery parameters, especially temperature, impedance, capacity, and their relationship with SOH, would be a great tool for determining when it is time to replace the batteries and how the batteries degrade over time. However, as was already mentioned, not all of these parameters can be easily assessed [73][74][75].
However, despite the unquestionable advancements brought about by the introduction of BMSs, there are still some issues that limit the ability to fully utilize the potential for performing estimations with more precise models referring to the internal state parameters of the batteries, such as SOC and SOH. The limitations on computing power and data storage that are currently in place make this problem more difficult. The most recent proposals that have been made in recent years, based on the use of IoT, cloud computing, twin models, big data, and machine learning, aim to eliminate the current difficulties [76][77][78][79].
In this work, as a contribution, a decentralized but synchronized real-world smart battery management system has been designed using a Cerbo GX general controller with networking communication capability and cloud data processing access, four charge regulators, and a sensorized smart battery monitor with networking and Bluetooth capabilities. Currently, BMSs can be utilized as distributed control systems for real-world applications when general controllers, charge regulators, and smart monitors and sensors are integrated, such as those suggested in this work, which enable more accurate estimations of the battery's electrical parameters.
The main feature of the proposed BMS is that it is intelligent, as it provides the ability to supply dynamic parameters from a non-intelligent battery in a similar way to intelligent batteries. It is a real-world BMS system and a comparatively low-cost system.
Another contribution made in this work is the development of a methodical modeling procedure based on Petri Nets, which establishes, in a visible, organized, and precise way, the set of conditions that will determine the operation of the BMS. If this modeling is not carried out, the threshold values and their conditions remain scattered, not very transparent, and difficult to deal with in an aggregate manner.
This document is structured as follows: In Section 2, the smart devices and sensors used to monitor an energy storage system (ESS) are presented. The tests conducted are described in detail, and a decentralized but synchronized real-world system for a smart BMS system is proposed. The suggested management approach is predicated on the articulation of particular parametric conditions based on the type of batteries employed, whose dynamics can be represented as Petri Nets models (PNs). The experiment's results are presented in Section 3. Section 4 discusses the findings as well as some additional suggestions and information gleaned from the experimental trials. Finally, in Section 5, some inferences are made regarding the benefits of the suggested approach to managing batteries.

Materials
This section shows the materials used to configure the BMS system. Figure 1 shows the representative block diagram of the integrated intelligent BMS. Every block is explained in the following paragraphs. ticulation of particular parametric conditions based on the type of batteries employed, whose dynamics can be represented as Petri Nets models (PNs). The experiment's results are presented in Section 3. Section 4 discusses the findings as well as some additional suggestions and information gleaned from the experimental trials. Finally, in Section 5, some inferences are made regarding the benefits of the suggested approach to managing batteries.

Materials
This section shows the materials used to configure the BMS system. Figure 1 shows the representative block diagram of the integrated intelligent BMS. Every block is explained in the following paragraphs.

Batteries
The PlusEnergy TPG200 GEL Battery is a so-called maintenance-free type, as it is a sealed monoblock battery that can be installed in indoor locations with poor ventilation ( Figure 2). It is made of ABM and is highly resistant to acid and demanding external conditions. Although it undergoes deep discharges quickly, it is recommended that its discharges not be greater than 30%, since otherwise, it can significantly shorten its useful life.
The technical data of the battery are as follows: voltage: 12V; model: TPG12-200; dimensions: 483 × 170 × 170 × 240 × 240 MM; weight: 41.5 Kg; brand: PlusEnergy; battery type: GEL; maintenance-free period: more than 3000 cycles according to IEC 61427; capacity: 200Ah in C100 and 150 Ah in C10; 2-year warranty; battery applications: telecommunications, repeaters, solar installations, batteries for use in enclosed areas; fields of application: security system, backup power supply, UPS, new energy storage, medical device, electric toy, communication system, computer system, emergency light, solar system, wind power system.

Batteries
The PlusEnergy TPG200 GEL Battery is a so-called maintenance-free type, as it is a sealed monoblock battery that can be installed in indoor locations with poor ventilation (Figure 2). It is made of ABM and is highly resistant to acid and demanding external conditions. Although it undergoes deep discharges quickly, it is recommended that its discharges not be greater than 30%, since otherwise, it can significantly shorten its useful life.    The technical data of the battery are as follows: voltage: 12 V; model: TPG12-200; dimensions: 483 × 170 × 170 × 240 × 240 MM; weight: 41.5 Kg; brand: PlusEnergy; battery type: GEL; maintenance-free period: more than 3000 cycles according to IEC 61427; capacity: 200 Ah in C100 and 150 Ah in C10; 2-year warranty; battery applications: telecommunications, repeaters, solar installations, batteries for use in enclosed areas; fields of application: security system, backup power supply, UPS, new energy storage, medical device, electric toy, communication system, computer system, emergency light, solar system, wind power system.

Xuncel Inverter
The XJTM XUNZEL Series pure sine wave inverter is an inverter that changes the DC input voltage of a battery to a symmetrical AC output voltage ( Figure 4). The output waveform is a high-quality pure sine wave with total harmonic distortion below 3% (THD < 3%).

Xuncel Inverter
The XJTM XUNZEL Series pure sine wave inverter is an inverter that changes the DC input voltage of a battery to a symmetrical AC output voltage ( Figure 4). The output waveform is a high-quality pure sine wave with total harmonic distortion below 3% (THD < 3%).

BlueSolar MPPT Regulator
One of the primary purposes of charge regulators is to continuously monitor the battery's condition and control the intensity of the charge in order to increase the amount of electrical energy that can be generated from energy sources. Depending on the battery charge level, if it is lower than 95 percent, it will allow all of the energy produced by the solar panels to pass through so that they can be charged as quickly as possible. The energy flow will be extremely controlled to allow for maximum charging if the batteries are between 95% and 99% charged (the float state). The power supply will be cut off if the batteries are fully charged, protecting them from overheating and overloading. As a result, the initial battery bank's SOC will determine the amount of charge that the solar regulators must distribute. The battery will always be safeguarded against overloads thanks to the solar charge controller (SCC), and the charge is executed whenever it is most practical ( Figure 5). Figure 6 shows the connection and disconnection relay module.

BlueSolar MPPT Regulator
One of the primary purposes of charge regulators is to continuously monitor the battery's condition and control the intensity of the charge in order to increase the amount of electrical energy that can be generated from energy sources. Depending on the battery charge level, if it is lower than 95 percent, it will allow all of the energy produced by the solar panels to pass through so that they can be charged as quickly as possible. The energy flow will be extremely controlled to allow for maximum charging if the batteries are between 95% and 99% charged (the float state). The power supply will be cut off if the batteries are fully charged, protecting them from overheating and overloading. As a result, the initial battery bank's SOC will determine the amount of charge that the solar regulators must distribute. The battery will always be safeguarded against overloads thanks to the solar charge controller (SCC), and the charge is executed whenever it is most practical ( Figure 5). Figure 6 shows the connection and disconnection relay module. charge level, if it is lower than 95 percent, it will allow all of the energy produced by the solar panels to pass through so that they can be charged as quickly as possible. The energy flow will be extremely controlled to allow for maximum charging if the batteries are between 95% and 99% charged (the float state). The power supply will be cut off if the batteries are fully charged, protecting them from overheating and overloading. As a result, the initial battery bank's SOC will determine the amount of charge that the solar regulators must distribute. The battery will always be safeguarded against overloads thanks to the solar charge controller (SCC), and the charge is executed whenever it is most practical ( Figure 5). Figure 6 shows the connection and disconnection relay module.   charge level, if it is lower than 95 percent, it will allow all of the energy produced by the solar panels to pass through so that they can be charged as quickly as possible. The energy flow will be extremely controlled to allow for maximum charging if the batteries are between 95% and 99% charged (the float state). The power supply will be cut off if the batteries are fully charged, protecting them from overheating and overloading. As a result, the initial battery bank's SOC will determine the amount of charge that the solar regulators must distribute. The battery will always be safeguarded against overloads thanks to the solar charge controller (SCC), and the charge is executed whenever it is most practical ( Figure 5). Figure 6 shows the connection and disconnection relay module.  The three charging phases used by the solar charger are as follows ( Figure 7): • Initial charge (bulk): The solar charger uses its maximum charge current during the initial charge phase to quickly charge the batteries. The battery voltage will gradually • Initial charge (bulk): The solar charger uses its maximum charge current during the initial charge phase to quickly charge the batteries. The battery voltage will gradually rise during this stage. The initial charging phase of the battery ends when the voltage reaches the predetermined absorption voltage, and the absorption phase then starts. • Absorption: The solar charger is now operating in constant voltage mode as it enters the absorption phase. The battery's current will gradually drop. The absorption phase ends and the float phase starts when the current drops below 1 A (tail current). The absorption time is brief when there are only surface discharges. This stops the battery from being overcharged. The absorption time is automatically extended to ensure that the battery is fully charged following a deep discharge. rise during this stage. The initial charging phase of the battery ends when the voltage reaches the predetermined absorption voltage, and the absorption phase then starts.
• Absorption: The solar charger is now operating in constant voltage mode as it enters the absorption phase. The battery's current will gradually drop. The absorption phase ends and the float phase starts when the current drops below 1 A (tail current). The absorption time is brief when there are only surface discharges. This stops the battery from being overcharged. The absorption time is automatically extended to ensure that the battery is fully charged following a deep discharge.
• Float: The batteries are fully charged during the float phase when the voltage is decreased. The VictronConnect app allows one to select from eight preset charging algorithms. It is also possible to fully program the charging algorithm. It is possible to adjust the charging voltages, the length of the phases, and the charging current. The VictronConnect app allows one to select from eight preset charging algorithms. It is also possible to fully program the charging algorithm. It is possible to adjust the charging voltages, the length of the phases, and the charging current.
Periodic charging for equalization is necessary for some lead-acid battery types. The charging voltage will increase during equalization to balance the cells above standard charging voltages. Applications such as VictronConnect can enable equalization charging if it is necessary.
Because the battery temperature affects the absorption and float charge voltages, a specific temperature sensor is necessary. The settings for the solar charger allow one to enable or disable temperature compensation. By using the compensation coefficient (mV/ • C), the compensation amount can be changed.
When greater accuracy is needed, using an external battery temperature sensor should be taken into consideration. The temperature compensation range is 6 • C to 40 • C (39 • F to 104 • F). The internal temperature sensor of the solar controller is also used to determine whether the solar charger has overheated. In order to improve the charging efficiency and lengthen the life of lead-acid batteries, it is ideal to take into account a wireless battery voltage, current, and temperature sensor that can be used in conjunction with the solar charger. Additionally, it compensates for any voltage drops across the battery cables that may occur when charging with a high current by increasing the charging voltage.

BMV-712 Smart Battery Monitor
The smart device used in this work is the BMV-712 (Battery Monitoring Victron) Smart Battery Monitor (Figure 8), which can be connected to the general Cerbo GX controller via a VE.Direct port ( Figure 9). It can also be connected with the VE.Direct interface via USB and wirelessly, so it can work synchronously with the solar charger. Thus, it is able to send it the temperature and voltage values of the battery to perform the best possible charge compensation. In addition to local monitoring and control with the Cerbo GX, the information is also sent to the free remote monitoring website: The Victron Remote Monitoring (VRM) Online Portal. The main function of the BMV-712 is to monitor and indicate the state of charge of the battery by monitoring the current flow into or out of the battery, preventing an out-ofcontrol total discharge from happening. A simple way to calculate the charge would be by integrating this current over time (which, if the current is a fixed number of amps, reduces to multiplying the current by the time). This operation will give us the net amount of Ah charged or discharged. Unfortunately, however, the calculation of the effective capacity of a battery is particularly complex since its dependence is multifactorial, since (a) the discharge process is conditioned by the speed at which it is produced and (b) also depends on the temperature at which the discharge is carried out, and (c) another factor that increases the complexity is produced during the battery charging process due to the occurrence of the phenomenon known as gassing [3]. Due to this phenomenon, there is a loss of efficiency in the charging process, since the total Ah supplied for charging experiences a decrease in the final amount of Ah stored in the battery.

External Temperature Sensor
In order for the BMV-712 Smart Battery Monitor to incorporate more accurate temperature measurement values, it must incorporate a compatible temperature sensor, such The main function of the BMV-712 is to monitor and indicate the state of charge of the battery by monitoring the current flow into or out of the battery, preventing an out-ofcontrol total discharge from happening. A simple way to calculate the charge would be by integrating this current over time (which, if the current is a fixed number of amps, reduces to multiplying the current by the time). This operation will give us the net amount of Ah charged or discharged. Unfortunately, however, the calculation of the effective capacity of a battery is particularly complex since its dependence is multifactorial, since (a) the discharge process is conditioned by the speed at which it is produced and (b) also depends on the temperature at which the discharge is carried out, and (c) another factor that increases the complexity is produced during the battery charging process due to the occurrence of the phenomenon known as gassing [3]. Due to this phenomenon, there is a loss of efficiency in the charging process, since the total Ah supplied for charging experiences a decrease in the final amount of Ah stored in the battery.

External Temperature Sensor
In order for the BMV-712 Smart Battery Monitor to incorporate more accurate temperature measurement values, it must incorporate a compatible temperature sensor, such  The main function of the BMV-712 is to monitor and indicate the state of charge of the battery by monitoring the current flow into or out of the battery, preventing an out-ofcontrol total discharge from happening. A simple way to calculate the charge would be by integrating this current over time (which, if the current is a fixed number of amps, reduces to multiplying the current by the time). This operation will give us the net amount of Ah charged or discharged. Unfortunately, however, the calculation of the effective capacity of a battery is particularly complex since its dependence is multifactorial, since (a) the discharge process is conditioned by the speed at which it is produced and (b) also depends on the temperature at which the discharge is carried out, and (c) another factor that increases the complexity is produced during the battery charging process due to the occurrence of the phenomenon known as gassing [3]. Due to this phenomenon, there is a loss of efficiency in the charging process, since the total Ah supplied for charging experiences a decrease in the final amount of Ah stored in the battery.

External Temperature Sensor
In order for the BMV-712 Smart Battery Monitor to incorporate more accurate temperature measurement values, it must incorporate a compatible temperature sensor, such as ASS000100000. The temperature sensor should be connected between the shunt connectors and the positive terminal of the battery bank, as shown in Figure 10, where one of the two wires of the sensor functions as a power cable. The temperature can be displayed in • C/ • F, and its measurement can be used to adjust the battery capacity to the temperature. Battery charging with temperature compensation is very convenient, especially when charging batteries in environments subjected to hot or cold climates. This compensation can be enabled or disabled during the configuration phase of the solar charger and in the BMV-712 device. With this setting, the amount of compensation can be adjusted by assigning a compensation coefficient (mV/°C).

Cerbo GX General Control Device
In the context of the configuration of a decentralized intelligent battery management system, the Cerbo GX device will be used as an overall system controller with the ability to communicate with the other devices both wirelessly and directly through VE.Direct ports ( Figure 11). Both ways ensure communication with the solar chargers, BMS, and inverters. Remaining autonomy (h); - Battery charging with temperature compensation is very convenient, especially when charging batteries in environments subjected to hot or cold climates. This compensation can be enabled or disabled during the configuration phase of the solar charger and in the BMV-712 device. With this setting, the amount of compensation can be adjusted by assigning a compensation coefficient (mV/ • C).

Cerbo GX General Control Device
In the context of the configuration of a decentralized intelligent battery management system, the Cerbo GX device will be used as an overall system controller with the ability to communicate with the other devices both wirelessly and directly through VE.Direct ports ( Figure 11). Both ways ensure communication with the solar chargers, BMS, and inverters.

Cerbo GX General Control Device
In the context of the configuration of a decentralized intelligent battery management system, the Cerbo GX device will be used as an overall system controller with the ability to communicate with the other devices both wirelessly and directly through VE.Direct ports ( Figure 11). Both ways ensure communication with the solar chargers, BMS, and inverters. The Cerbo GX, which ensures the coordinated operation of the entire installation, is connected to the other parts of the system, including the solar regulators, inverters/chargers, surveillance and monitoring devices, and batteries.

Victron Connect-Remote App
Victron Connect-Remote allows remote access through the online VRM portal by communicating with a general controller, such as the Cerbo GX, which enables a wide variety of Victron devices with a VE.Direct interface. This powerful option allows The Cerbo GX, which ensures the coordinated operation of the entire installation, is connected to the other parts of the system, including the solar regulators, inverters/chargers, surveillance and monitoring devices, and batteries.

Victron Connect-Remote App
Victron Connect-Remote allows remote access through the online VRM portal by communicating with a general controller, such as the Cerbo GX, which enables a wide variety of Victron devices with a VE.Direct interface. This powerful option allows monitoring, operation, and configuration with complete system monitoring from virtually anywhere in the world. With this user interface, the perception can be experienced as if the BMS system were connected locally via Bluetooth or wired to VE.Direct via the USB interface. Monitored online data such as power, voltage, current, temperature, and other information are constantly transferred to a big data platform based on cloud technology with massive data storage and processing potential ( Figure 12). monitoring, operation, and configuration with complete system monitoring from virtually anywhere in the world. With this user interface, the perception can be experienced as if the BMS system were connected locally via Bluetooth or wired to VE.Direct via the USB interface. Monitored online data such as power, voltage, current, temperature, and other information are constantly transferred to a big data platform based on cloud technology with massive data storage and processing potential ( Figure 12). The multiple models will increase adaptation to uncertain environments and different aging levels, so a more accurate and reliable estimation of SOC can be achieved under complicated operating conditions.

Cerbo GX General Control Device with Temperature Sensors
The Cerbo GX controller also has 2 additional relays ( Figure 13) with the ability to act on the system not only to bring the battery to a safe state but also to perform control actions leading to the start/stop of generators and inverters. These parameters, such as the SOC parameter, voltage, current, and especially temperature, can be obtained more accurately from the BMV-712 intelligent device in order to extend the life of the batteries by keeping them at adequate safety values.
With this in mind, the Cerbo GX can be connected to a set of up to 4 Ruuvi wireless The multiple models will increase adaptation to uncertain environments and different aging levels, so a more accurate and reliable estimation of SOC can be achieved under complicated operating conditions. The Cerbo GX controller also has 2 additional relays ( Figure 13) with the ability to act on the system not only to bring the battery to a safe state but also to perform control actions leading to the start/stop of generators and inverters. These parameters, such as the SOC parameter, voltage, current, and especially temperature, can be obtained more accurately from the BMV-712 intelligent device in order to extend the life of the batteries by keeping them at adequate safety values.

Methods
The designed method of battery parameter status management is based on the use of a distributed battery management system. The precise measurement of the SOC, V, I, and T parameters of the battery are performed specifically by the BMV-712 intelligent device, as well as alarm processing. The actuation response of the safeguard system can be split between the BMV-712 itself, which has an integrated relay, and the general controller of the Cerbo GX system, which, as shown above, has two additional integrated relays.
The advantages of the decentralization or distribution of control tasks began to be recognized as early as the 1970s when control systems were centralized by a single computer due to their high costs. The failure of a single centralized computer meant the shutdown of the entire controlled system. Currently, the implementation models of automated systems are based on the use of distributed (decentralized) control systems so that a failure of a decentralized controller will only locally affect a specific part of the process. In the designed distributed system, four MPPT charge controllers are used. Should one of them fail, the power supply will not be interrupted since the others will be able to supply the necessary charge, protecting the batteries and preventing them from experiencing a significant level of discharge. However, the solar chargers used, although they are independent, must operate synchronously when it comes to developing the bulk, absorption, and flotation charging phases.
The synchronization of the chargers is carried out through a type of master-slave system algorithm used by the Cerbo GX general controller. The algorithm chooses a master among the set of connected solar chargers in the system, and that master will be the one that dictates the charging algorithm; however, all the solar chargers that belong to the same network must be configured for the same type of batteries by the programmer. Then, the master will make sure that all chargers are in the same state of charge and at the same voltage setpoint. At the start of the day, the master will measure the battery voltage before any of the other chargers in the network start charging (to find the idle voltage of the battery). This information is used to decide what the total absorption time should be for some types of batteries. The idle voltage of the battery, as well as the total absorption time and the time spent in the current state of charge, is shared with the other chargers. That information is important so that chargers can resume the charging algorithm if, for some reason, the master stops charging (i.e., the Sun went down or solar energy hitting its panels decreased, the charger went out, the charger lost contact with the grid, etc.).
To ensure the synchronization of the charge controllers, a Cerbo GX controller is used in conjunction with four identically configured SmartSolar charge controllers. One possible configuration is to use a VE.Smart network to charge the battery banks, fulfilling the same mission as a single higher-power regulator. The decentralized solar chargers will be synchronized using the same charging algorithm between them, without the need for additional hardware, performing the bulk, absorption, and float charge state changes syn- With this in mind, the Cerbo GX can be connected to a set of up to 4 Ruuvi wireless temperature sensors or ASS00001000 wired temperature sensors. These sensors can be used to control the start/stop actions of generators and inverters, ensuring battery safety in cases of dangerous temperature rises in other devices such as inverters, battery installation chambers, and cold rooms.

Methods
The designed method of battery parameter status management is based on the use of a distributed battery management system. The precise measurement of the SOC, V, I, and T parameters of the battery are performed specifically by the BMV-712 intelligent device, as well as alarm processing. The actuation response of the safeguard system can be split between the BMV-712 itself, which has an integrated relay, and the general controller of the Cerbo GX system, which, as shown above, has two additional integrated relays.
The advantages of the decentralization or distribution of control tasks began to be recognized as early as the 1970s when control systems were centralized by a single computer due to their high costs. The failure of a single centralized computer meant the shutdown of the entire controlled system. Currently, the implementation models of automated systems are based on the use of distributed (decentralized) control systems so that a failure of a decentralized controller will only locally affect a specific part of the process. In the designed distributed system, four MPPT charge controllers are used. Should one of them fail, the power supply will not be interrupted since the others will be able to supply the necessary charge, protecting the batteries and preventing them from experiencing a significant level of discharge. However, the solar chargers used, although they are independent, must operate synchronously when it comes to developing the bulk, absorption, and flotation charging phases.
The synchronization of the chargers is carried out through a type of master-slave system algorithm used by the Cerbo GX general controller. The algorithm chooses a master among the set of connected solar chargers in the system, and that master will be the one that dictates the charging algorithm; however, all the solar chargers that belong to the same network must be configured for the same type of batteries by the programmer. Then, the master will make sure that all chargers are in the same state of charge and at the same voltage setpoint. At the start of the day, the master will measure the battery voltage before any of the other chargers in the network start charging (to find the idle voltage of the battery). This information is used to decide what the total absorption time should be for some types of batteries. The idle voltage of the battery, as well as the total absorption time and the time spent in the current state of charge, is shared with the other chargers. That information is important so that chargers can resume the charging algorithm if, for some reason, the master stops charging (i.e., the Sun went down or solar energy hitting its panels decreased, the charger went out, the charger lost contact with the grid, etc.).
To ensure the synchronization of the charge controllers, a Cerbo GX controller is used in conjunction with four identically configured SmartSolar charge controllers. One possible configuration is to use a VE.Smart network to charge the battery banks, fulfilling the same mission as a single higher-power regulator. The decentralized solar chargers will be synchronized using the same charging algorithm between them, without the need for additional hardware, performing the bulk, absorption, and float charge state changes synchronously. Each charge regulator has the ability to manage its own output current, which will depend mainly on the output of each photovoltaic solar panel, the resistance of the cable, and the maximum output current configured in the charger, but sometimes it is convenient to configure the maximum load current of the entire network. In case this function is needed, the distributed current and voltage control functions (DVCC) must be used; for this objective, in this work, a Cerbo GX device was used.
Gel batteries were used in this work, since their use is frequent in many solar installations due to their comparatively low cost compared to lithium batteries. In gel batteries, it is advisable to confine the SOC to 80-100% to ensure the best possible lifetime. The battery management system's measurement of the SOC to reduce extended periods of SOC decline is one of its primary goals. Because of the seasonal decrease in solar radiation during the winter, the battery may experience a low SOC for protracted periods of time. This will result in an increase in the sulfation phenomenon and significantly shorten the battery's lifespan. Because battery self-discharge starts to play a significant role in long-term energy storage, the battery is unable to offer enough storage capacity for the worst season of decreased solar radiation [11]. In this regard, the use of controllers with maximum power point tracking (MPPT) is advisable, as it adapts the operating voltage in the PV system to provide the maximum power, managing to increase the solar panel voltage and increasing the solar production by up to 30%. Otherwise, the battery life may be shortened by overcharging due to the use of an inaccurate charge regulation system. To prevent overloads in a precise way, it is necessary to ensure the synchronized operation of the set of devices that are part of the generation system, as well as its charge regulation system. Therefore, to ensure the confinement of SOC values in a given operation range, the synchronized operation of the set of solar charge regulators that are part of the intelligent battery management system via distributed voltage and current control (DVCC) functions has been used.

Distributed Voltage and Current Control (DVCC) Functions
The bulk, absorption, and float charge state changes will be carried out concurrently by the decentralized solar chargers using the same charging algorithm. Each charge regulator has the ability to control its own output current, which is determined by the output of each solar panel, the cable's resistance, and the maximum output current set by the charger regulator's maximum charge-current-limiting function for the network as a whole. In this case, this function is associated with the distributed voltage and current control (DVCC) functions [80] of a Cerbo GX software device ( Figure 14). function is needed, the distributed current and voltage control functions (DVCC) must be used; for this objective, in this work, a Cerbo GX device was used. Gel batteries were used in this work, since their use is frequent in many solar installations due to their comparatively low cost compared to lithium batteries. In gel batteries, it is advisable to confine the SOC to 80-100% to ensure the best possible lifetime. The battery management system's measurement of the SOC to reduce extended periods of SOC decline is one of its primary goals. Because of the seasonal decrease in solar radiation during the winter, the battery may experience a low SOC for protracted periods of time. This will result in an increase in the sulfation phenomenon and significantly shorten the battery's lifespan. Because battery self-discharge starts to play a significant role in long-term energy storage, the battery is unable to offer enough storage capacity for the worst season of decreased solar radiation [11]. In this regard, the use of controllers with maximum power point tracking (MPPT) is advisable, as it adapts the operating voltage in the PV system to provide the maximum power, managing to increase the solar panel voltage and increasing the solar production by up to 30%. Otherwise, the battery life may be shortened by overcharging due to the use of an inaccurate charge regulation system. To prevent overloads in a precise way, it is necessary to ensure the synchronized operation of the set of devices that are part of the generation system, as well as its charge regulation system. Therefore, to ensure the confinement of SOC values in a given operation range, the synchronized operation of the set of solar charge regulators that are part of the intelligent battery management system via distributed voltage and current control (DVCC) functions has been used.

Distributed Voltage and Current Control (DVCC) Functions
The bulk, absorption, and float charge state changes will be carried out concurrently by the decentralized solar chargers using the same charging algorithm. Each charge regulator has the ability to control its own output current, which is determined by the output of each solar panel, the cable's resistance, and the maximum output current set by the charger regulator's maximum charge-current-limiting function for the network as a whole. In this case, this function is associated with the distributed voltage and current control (DVCC) functions [80] of a Cerbo GX software device ( Figure 14). In systems with lead-acid, AGM, and GEL batteries, but also Li-ion and LiFePO4 batteries, the DVCC functions allow configurable charging current limits to be set for the entire system, where the Cerbo GX device actively limits the inverter/charger in case the solar chargers are already charging at full power. Additionally, it allows the provision of  In systems with lead-acid, AGM, and GEL batteries, but also Li-ion and LiFePO4 batteries, the DVCC functions allow configurable charging current limits to be set for the entire system, where the Cerbo GX device actively limits the inverter/charger in case the solar chargers are already charging at full power. Additionally, it allows the provision of more accurate values, such as those provided by the shared temperature sensor (STS), current sensor (SCS), and voltage sensor (SVS), which can be obtained from the BVM-712 smart device connected to a VE.Direct port of the Cerbo GX controller [80]. These functions are described in more detail below: - The SVS is enabled when DVCC is enabled. It works with solar chargers connected to a VE.Direct port. The system automatically selects the best available voltage measurement obtained from the BMV-712 battery monitor. To make up for the voltage loss in the battery wires, the battery voltage data are used. This prevents a lower voltage from charging the battery than the exact voltage set on the charger owing to wiring resistance. - The STS will use the BMV-712 to obtain the battery temperature value for the Cerbo GX controller device to send the obtained temperature measurement to the inverter/charger system and all connected solar chargers. The battery temperature data are used to adjust the charging voltages. At low temperatures, a lead-acid battery generally needs a higher charging voltage, and conversely, a lower charging voltage is required at high temperatures. When using lithium batteries, the charging voltages are the same at all temperatures, except at low temperatures. Below 5 • C, they should not be charged to prevent damage and degradation; therefore, they should be disconnected from the generation source. - The SCS sends the battery current, measured by the BMV-712 battery monitor connected to the GX device, to all connected solar chargers. The battery current data are used to enable more precise usage of the tail current setting because it helps the solar charger determine when the absorption phase should end and transition to the equalization/float phase. However, it should be noted that gel batteries such as those used in this work are generally not suitable for the equalization phase.

Alarm, Acoustic Signals, and Relay Management
For most of the readings of the BMV-712 smart device, an alarm can be configured that will be triggered when a preset threshold value is reached. When the alarm is triggered, a beep will sound, the backlight will flash, and the alarm icon will appear on the display along with the current value. When an alarm occurs, an associated relay built into the body of the monitor can be optionally triggered as a reactive actuation on the system in response to the alarm activation. The alarm is canceled by pressing a button. However, the alarm icon will continue to be displayed as long as the alarm conditions remain in effect.
The BMV-712 relay is installed in the battery monitoring device itself and will be activated/deactivated when the threshold values of the parameters listed in the left column of Table 1, all battery-specific parametric values [11], are reached. In the right column of Table 1 are the BMV-712 parameters that are activated/deactivated in alarm management and processing but do not give rise to any relay trips.

Dynamic Model of System Operation
A dynamic system controlled by discrete events was used to model the management of the safe operation of the ESS of a battery bank, which is specifically based on a Petri Net (PN) model, which, due to its dynamic characteristics, allows the intuitive representation of the set of precise actions to be performed on the system depending on the realization of a series of threshold values of characteristic parameters taken from the specific characteristics of both the batteries and the inverter. See Supplementary File.
The design, configuration, and implementation of the algorithm to be programmed based on conditions will allow the establishment of the set of triggering conditions of PN transitions, and the corresponding actions to be performed on the system will be assigned to the corresponding output location. Figure 15 shows the PNs corresponding to the treatment of the parameters temperature, voltage, current, and SOC. The design, configuration, and implementation of the algorithm to be programmed based on conditions will allow the establishment of the set of triggering conditions of PN transitions, and the corresponding actions to be performed on the system will be assigned to the corresponding output location. Figure 15 shows the PNs corresponding to the treatment of the parameters temperature, voltage, current, and SOC.

Results
These results describe the application of the set of BMS functions used in dedicated tests for the start/stop of the photovoltaic generation system conditioned by the following parameters: -Battery voltage; -Battery SOC; -Battery current; -Battery and inverter temperature.

Results
These results describe the application of the set of BMS functions used in dedicated tests for the start/stop of the photovoltaic generation system conditioned by the following parameters: -Battery voltage; -Battery SOC; -Battery current; -Battery and inverter temperature.
For the specific case of the work developed in our study, the following configurations were arranged based on the conditions of the system used.

Battery Charging
In the configuration shown in Figure 16, the conditions based on battery voltage thresholds are established, performing charging from the voltage drop to 12.5 V, allowing the batteries to be charged following the bulk, absorption, and flotation phases. The BMV is reset to "fully charged" in the case of a 12 V battery when the following "charging parameters" are satisfied: the voltage exceeds 13.2 V while the charging (tail) current is less than 4.0 percent of the entire battery capacity (i.e., 8 A in a 200 Ah battery) for three minutes.

ors 2023, 23, x FOR PEER REVIEW
For the specific case of the work developed in our study, the were arranged based on the conditions of the system used.

Battery Charging
In the configuration shown in Figure 16, the conditions b thresholds are established, performing charging from the voltage the batteries to be charged following the bulk, absorption, and fl is reset to "fully charged" in the case of a 12 V battery when the rameters" are satisfied: the voltage exceeds 13.2 V while the cha than 4.0 percent of the entire battery capacity (i.e., 8 A in a 2 minutes.

Supplementary Charge Conditioned by Current Consumption
This condition is used outside the normal charging phase reaching the 100% SOC level. Once this condition is reached, th

Supplementary Charge Conditioned by Current Consumption
This condition is used outside the normal charging phase sequence that results in reaching the 100% SOC level. Once this condition is reached, the generator will be automatically disconnected. However, if, in this generation system shutdown phase, an increase in battery current consumption occurs, such as the one set in the following window, it will allow the automatic restart of the generation system to prevent the premature discharge of the battery. In the configuration shown in Figure 17, any consumption above 6 A will trigger the restart of the generation system, which will be suspended when the load consumption drops below 3 A.

Supplementary Charge Conditioned by Current Consumption
This condition is used outside the normal charging phase sequ reaching the 100% SOC level. Once this condition is reached, the ge matically disconnected. However, if, in this generation system shu crease in battery current consumption occurs, such as the one set in th it will allow the automatic restart of the generation system to preven charge of the battery. In the configuration shown in Figure 17, any c A will trigger the restart of the generation system, which will be suspe consumption drops below 3 A. Finally, reaching 100% SOC will cause the generation system charging operation is required due to consumption that results in a dr ure 18). Finally, reaching 100% SOC will cause the generation system to stop until a new charging operation is required due to consumption that results in a drop to 75% SOC ( Figure 18).   Tables 2 and 3 show data obtained from the cloud server corresp cation of the generator start/stop control based on the condition of and SOC parameters. Table 2 shows data corresponding to the begin when the BMS triggers a low-voltage alarm due to the energy con during the night. The columns with the states of the four relay module used for the start/stop control of the four solar controllers are shown reason column shows the currently active condition, as well as the a voltage alarm status. In this situation, Relay 1 (NO) must be activate the start of the solar generation system. Relay 2 remains inactivated, figured in a normally closed (NC) situation.  Tables 2 and 3 show data obtained from the cloud server corresponding to the application of the generator start/stop control based on the condition of the voltage, current, and SOC parameters. Table 2 shows data corresponding to the beginning of the morning, when the BMS triggers a low-voltage alarm due to the energy consumption occurring during the night. The columns with the states of the four relay modules connected in series used for the start/stop control of the four solar controllers are shown. The Generator run reason column shows the currently active condition, as well as the activation of the low-voltage alarm status. In this situation, Relay 1 (NO) must be activated (closed), allowing the start of the solar generation system. Relay 2 remains inactivated, but it has been configured in a normally closed (NC) situation.    In Table 3, a wider variety of conditions are shown, such as stopping the solar generation system due to high voltage values, as well as additional current charge supplies when peak load consumption occurs to prevent the battery from discharging prematurely. These conditions are automatically established during data processing in the cloud. In column D of Tables 2 and 3, they are defined as the Generator run reason; that is, the conditions of the electrical parameters that cause the alarms are established.
The option of using charge management based on the configuration based on the conditions of the electrical parameters V, I, and SOC is appropriate in the case of generic charge generators. However, in the case that the generation is carried out with solar chargers, it is more appropriate that the charging algorithm is directly managed by the advanced charging algorithms of the MPPT type, such as those used in this work. The three charging phases used in this case by the solar charger are:

•
Initial charge: In the first (bulk) phase of charging, all available current from the solar charger is used to charge the battery to the absorption voltage of 14.4 V. In this phase, a gel battery is charged to about 85%.
• Absorption: During this phase, an absorption voltage of 14.4 V is maintained for a variable time that is set by the solar charger algorithm, taking into account the information supplied by the BMS-712 device regarding the initial state of charge of the battery, and can be up to 5 times longer than the duration of the bulk phase. The charging current is gradually reduced until the float current is reached. • Float: Once the absorption phase is finished, after a time that will depend on the battery charging algorithm selected in the MPPT solar charge controller, the flotation phase is reached. At this moment, the battery is considered 100% charged. In the case of a 12 V battery, the BMV resets to "fully charged" when the following "charging parameters" are met: the voltage exceeds 13.2 V, and simultaneously, the charging (tail) current is lowered to 4.0% of the full battery capacity. In the case of the type of 200 Ah battery used in this work, it is 8 A for 3 min. Once this state of charge is reached, the VictronConnect application executes automatic synchronization, reaching 100% SOC. Synchronization can also be optionally executed by the user using the configuration sequence shown in Figure 19. Once the first synchronization is completed (automatically or manually), the BMV keeps a record of the automatic synchronizations that occur ( Figure 19). battery, and can be up to 5 times longer than the duration of the bulk phase. The charging current is gradually reduced until the float current is reached.
• Float: Once the absorption phase is finished, after a time that will depend on the battery charging algorithm selected in the MPPT solar charge controller, the flotation phase is reached. At this moment, the battery is considered 100% charged. In the case of a 12 V battery, the BMV resets to "fully charged" when the following "charging parameters" are met: the voltage exceeds 13.2 V, and simultaneously, the charging (tail) current is lowered to 4.0% of the full battery capacity. In the case of the type of 200 Ah battery used in this work, it is 8 A for 3 min. Once this state of charge is reached, the VictronConnect application executes automatic synchronization, reaching 100% SOC. Synchronization can also be optionally executed by the user using the configuration sequence shown in Figure 19. Once the first synchronization is completed (automatically or manually), the BMV keeps a record of the automatic synchronizations that occur ( Figure 19). Figure 19. Optional user synchronization to 100% SOC.

Test Management on High/Low-Temperature Alarm Threshold Values
To carry out the safe management of high/low-temperature threshold value alarms that may eventually affect batteries or inverters, the generator must be stopped/started. For this purpose, the configuration sequence that must be used is shown in Figure 20. In our tests, we used two temperature sensors, 24 and 25, acting on the same Relay 2 to manage the start/stop of the generator, since Relay 1 is dedicated by default to the start/stop management of the generation system due to the V, I, and SOC parameters.

Test Management on High/Low-Temperature Alarm Threshold Values
To carry out the safe management of high/low-temperature threshold value alarms that may eventually affect batteries or inverters, the generator must be stopped/started. For this purpose, the configuration sequence that must be used is shown in Figure 20. In our tests, we used two temperature sensors, 24 and 25, acting on the same Relay 2 to manage the start/stop of the generator, since Relay 1 is dedicated by default to the start/stop management of the generation system due to the V, I, and SOC parameters.
In order to carry out these tests, destructive testing was avoided, taking into account the dangerous nature of the tests. Thus, an inductive method was used to introduce threshold temperature limit values through the application of high and low temperatures by applying a Peltier cell TEC1-12706 12 V on battery and inverter terminals, where Temperature Sensors 24 and 25 of the Cerbo GX and the temperature sensor of the BMV-712 are installed, respectively. In order to carry out these tests, destructive testing was avoided, taking into account the dangerous nature of the tests. Thus, an inductive method was used to introduce threshold temperature limit values through the application of high and low temperatures by applying a Peltier cell TEC1-12706 12 V on battery and inverter terminals, where Temperature Sensors 24 and 25 of the Cerbo GX and the temperature sensor of the BMV-712 are installed, respectively.
For the disconnection and isolation of the battery, especially in case of overheating and to prevent runaway phenomena, the temperature sensor ASS000100000 and a relay integrated into the BMV-712 monitor have been used to act on the two identical and synchronized KH180-type power relays. These connections and locations are shown in Figure  21. Test data are shown in Table 4. For the disconnection and isolation of the battery, especially in case of overheating and to prevent runaway phenomena, the temperature sensor ASS000100000 and a relay integrated into the BMV-712 monitor have been used to act on the two identical and synchronized KH180-type power relays. These connections and locations are shown in Figure 21. Test data are shown in Table 4.   Temperature Sensor 24 (type ASS00001000) and Relay 2 (Cerbo GX) have been used to perform the generator disconnections caused by a high-temperature alarm in the battery (Table 5).
Additionally, in the case of the inverter, if a high-temperature alarm takes place on the inverter, Temperature Sensor 25 (type ASS00001000) and Relay 2 will cause the disconnection of the generator system. Test data are shown in Table 6. Tables 7 and 8 show data from tests based on low-temperature alarms in the battery using Temperature Sensors 24 and 25, acting on Relay 2. Figure 22 shows that as a result of the configuration used to establish the triggering conditions of the decentralized intelligent battery management system, the operating cycle of the SOC is well within the percentage threshold values recommended for the type of batteries used in photovoltaic generation systems.          For this type of system, it is advisable to use deep-cycle batteries, but although they can withstand deep discharges occasionally, it is not advisable that this happens frequently. What is more, the manufacturers advise that the daily discharge cycles not fall below 80%.
As regards the temperature parameter, the tests carried out have also been adjusted to the safeguard threshold values of the type of gel batteries that, on the other hand, would be similar to those of lithium batteries. In [81], it is specified that the float charge voltage of gel batteries can be kept constant at temperatures up to 50 • C without any danger of thermal runaway, whereas in the case of lithium batteries, the critical value for the start of the reaction leading to thermal runaway is 60 • C. As regards the temperature parameter, the tests carried out have also been adju to the safeguard threshold values of the type of gel batteries that, on the other hand, w be similar to those of lithium batteries. In [81], it is specified that the float charge vo of gel batteries can be kept constant at temperatures up to 50 °C without any dang thermal runaway, whereas in the case of lithium batteries, the critical value for the st

Discussion
For real-world applications, the decentralized integrated BMS system developed in this study, from both practical hardware and software points of view, represents a significant advance.
Likewise, it can be observed that the voltage value for the start-up initiation set in the configuration window of the battery voltage function agrees with the corresponding value checked in Table 2 obtained from the downloaded data.
Likewise, in Table 3, the sporadic recharges that occur according to the conditions set in the battery current window can be checked.
The results obtained show the good performance of the decentralized BMS system with regard to its confinement to threshold values obtained in the SOC graphs in suitable conditions, preventing both an overload and a drop to levels below 80%, as can be seen in Figure 22.
The BMS used in this work presents a capacity for the adequate resolution of the thermal treatment of the batteries, as can be verified in Tables 4-6, both for the stop operations of the generation system and for the isolation of the battery under dangerous temperature conditions.

Discussion
For real-world applications, the decentralized integrated BMS system developed in this study, from both practical hardware and software points of view, represents a significant advance.
Likewise, it can be observed that the voltage value for the start-up initiation set in the configuration window of the battery voltage function agrees with the corresponding value checked in Table 2 obtained from the downloaded data.
Likewise, in Table 3, the sporadic recharges that occur according to the conditions set in the battery current window can be checked.
The results obtained show the good performance of the decentralized BMS system with regard to its confinement to threshold values obtained in the SOC graphs in suitable conditions, preventing both an overload and a drop to levels below 80%, as can be seen in Figure 22.
The BMS used in this work presents a capacity for the adequate resolution of the thermal treatment of the batteries, as can be verified in Tables 4-6, both for the stop operations of the generation system and for the isolation of the battery under dangerous temperature conditions. All the BMS system data were downloaded from both Amazon AWS and Influx Cloud services, which were used to store and process the VRM data.
However, there are still outstanding objectives to be solved that have to do with accurate measurements, especially the SOH, which will allow a more accurate process in terms of predictive diagnostics for the calculation of the RUL of the batteries.
The capacity for data storage and processing in the cloud has experienced a very significant advance that could lead to the application of more complex algorithms for obtaining data with greater precision. However, in order to achieve a better analysis of the true states of batteries, battery manufacturers would need to enable easy access to certain internal battery parameters, such as internal resistance. It is known that the aging of the battery will result in the degradation of the battery capacity and an increase in the internal resistance of the battery. Therefore, the SOH of the battery can be estimated by the internal resistance as a predictor symptom. The purpose of this is to apply complex analytical techniques for SOH estimation, since with the aged capacity C aged or higher internal resistance R inc , the SOH of the battery can be more accurately defined in order to estimate its RUL [82].

Conclusions
The designed decentralized BMS allows the increased security, supervision, monitoring, management, and optimization of any ESS system, including the ability to detect potential problems early. It provides a great capacity for handling alerts and alarms remotely, from anywhere in the world, with an immediate response on the system. Specifically, it allows the monitoring and management of the battery state of charge, energy consumption, and energy harvesting from solar panels, generators, and grids using characteristic electrical parameters such as the voltage, current, SOC, and battery temperature. It allows the automatic start/stop of generators and disconnections remotely and in real time while providing history graphs and detailed analytical reports. This enables the predictive diagnosis of future problems and prevents ultimate system failures.
With the ever-changing real-world circumstances of off-grid installations, observations and measurements based on real-time measured parameters are crucial for optimal system performance and utilization. With VRM, intelligent rules can be easily established so that the system can cope with real problems in real time. Thanks to the information provided by the data, users of off-grid systems can adapt their energy use to better balance it with the energy captured, for example, by using the most energy-intensive devices only when there is sufficient solar irradiance. Author Contributions: Conceptualization, E.G.; methodology, E.G., A.C. and E.Q.; software, E.G. and A.C.; validation, E.G. and E.Q.; formal analysis, E.G. and E.Q.; investigation, E.G., E.Q. and A.C.; resources, E.G., E.Q. and A.C.; data curation, E.G.; writing-original draft preparation, E.G.; writing-review and editing, E.G., E.Q. and A.C.; visualization, E.Q. and A.C.; supervision, E.G., E.Q. and A.C.; project administration, E.G., E.Q. and A.C.; funding acquisition, E.G. and E.Q. All authors have read and agreed to the published version of the manuscript.
Funding: This research received no external funding.

Institutional Review Board Statement: Not applicable.
Informed Consent Statement: Not applicable.

Data Availability Statement:
The data presented in this study are available on request from the corresponding author.

Conflicts of Interest:
The authors declare no conflict of interest.