A Consensus Algorithm for Multi-Objective Battery Balancing

Batteries stacks are made of cells in certain series-parallel arrangements. Unfortunately, cell performance degrades over time in terms of capacity, internal resistance, or self-discharge rate. In addition, degradation rates are heterogeneous, leading to cell-to-cell variations. Balancing systems can be used to equalize those differences. Dissipative or non-dissipative systems, so-called passive or active balancing, can be used to equalize either voltage at end-of-charge, or state-of-charge (SOC) at all times. While passive balancing is broadly adopted by industry, active balancing has been mostly studied in academia. Beyond that, an emerging research field is multi-functional balancing, i.e., active balancing systems that pursue additional goals on top of SOC equalization, such as equalization of temperature, power capability, degradation rates, or losses minimization. Regardless of their functionality, balancing circuits are based either on centralized or decentralized control systems. Centralized control entails difficult expandability and single point of failure issues, while decentralized control has severe controllability limitations. As a shift in this paradigm, here we present for the first time a distributed multi-objective control algorithm, based on a multi-agent consensus algorithm. We implement and validate the control in simulations, considering an electro-thermal lithium-ion battery model and an electric vehicle model parameterized with experimental data. Our results show that our novel multi-functional balancing can enhance the performance of batteries with substantial cell-to-cell differences under the most demanding operating conditions, i.e., aggressive driving and DC fast charging (2C). Driving times are extended (>10%), charging times are reduced (>20%), maximum cell temperatures are decreased (>10 °C), temperature differences are lowered (~3 °C rms), and the occurrence of low voltage violations during driving is reduced (>5×), minimizing the need for power derating and enhancing the user experience. The algorithm is effective, scalable, flexible, and requires low implementation and tuning effort, resulting in an ideal candidate for industry adoption.


Introduction
The 2015 Paris agreement has established global guidelines to tackle climate change, including electrification of transportation [1]. Supported by policies, technological improvements, and falling costs, the global fleet of light-duty passenger vehicles (LDPVs) with a higher degree of electrification, such as battery electric vehicles (BEVs) and plug-in hybrid electric vehicles (PHEVs), have expanded from 2014-2019 by an annual average of 60%, reaching about 1% of the global fleet by 2019 [2].
In 2020 the COVID-19 pandemic has brought great uncertainty for the global electric vehicle (EV) market and the auto market. Although, recent studies confirm that the future remains bright for passenger EVs in the following decades, which will gain market share supported by battery cost reductions and technological advances [3].
Virtually all EVs in today's market store electrical energy in batteries, an essential technology to electrify LDPVs in the next 20 years [2,3]. EVs with a higher degree of electrification, i.e., BEVs and PHEVs, are equipped with larger batteries that can be directly recharged from the grid, in addition to regenerative braking, a common feature in EVs with lower degrees of electrification. Nowadays, a BEV or PHEV battery is formed of a combination of hundreds to thousands of lithium-ion cells connected in a certain seriesparallel arrangement.
Lithium-ion battery technology is improving, showing increased energy storage capability, and their cost is falling, mainly thanks to economies of scale. However, there are still some significant technical barriers to overcome for EV adoption [2,3], particularly regarding range anxiety, charging infrastructure, battery supply chain, battery safety [4], and battery management [5].
Regarding the latter, for safety reasons, lithium-ion cell manufacturers limit their operating window by certain voltages, currents, and temperatures. Outside that so-called safety operating window (SOA), the degradation rate accelerates and there is a risk of catastrophic failure [5]. In addition, original equipment manufacturers (OEMs) typically define more restrictive operating windows to increase safety, ensure reduced degradation rates, and/or enhance the user experience. That is implemented in the form of conventional current or power derating algorithms, as reviewed by Barreras et al. [6] and Sun et al. [6]. Derating can be improved through degradation-aware algorithms, as recently shown by Sowe et al. [7] and Schimpe et al. [8,9].
Indeed, battery degradation mechanisms are complex and enhanced by certain operating and storage conditions that are fundamentally related to SOC, temperature, or current levels, as discussed by Schimpe et al. [9] orPellettier et al. [10] or For instance, extreme temperatures are a major concern. On one hand, the degradation rates are accelerated at high temperatures, due to rapid growth of the solid electrolyte interface (SEI) layer, existing even the risk of thermal runaway over certain thresholds (Figure 1). On the other hand, at low temperatures, there is accelerated aging due to lithium-plating and stripping, being more intense at higher C-rates. There is also a risk of internal short due to the formation of dendritic lithium (Figure 1). Even within a moderate temperature range (~10-50 • C), power and energy capability are influenced by battery temperature, since lithium-ions diffusivity in the electrodes increases with temperature. Indeed, the temperature window within which the battery lifetime (calendar and cycle life) and power and energy performance are balanced, is relatively small (~20-40 • C). Regarding SOC, for example, in BEVs and PHEVs the minimum allowable SOC is typically over 5-10%, since the battery power capability, and thus the vehicle acceleration is lower at low SOC levels, and also to avoid the risk of overdischarge. Battery degradation rate is also higher at extreme SOCs, and therefore the maximum SOC window in EV batteries is set typically below 90-95%-although the user may occasionally select operating modes that allow larger SOC windows for extended range operation.
To alleviate those problems, active heating and cooling strategies are implemented in EVs, and the battery power is derated under eventual extreme SOC or temperature conditions [11]. However, the former translates into higher auxiliary loads (i.e., lower efficiency), more complex integration, extra costs, volume, weight, and reliability and maintenance issues, while the latter typically means longer charging times at low temperatures and reduced power capability at high temperatures.
To make everything more complex, the battery pack should also be managed at a cell level, due to the existence of cell-to-cell variations in SOC, temperatures, or power and energy capability ( Figure 2). While cell-to-cell variations may not be substantial at the beginning-of-life (BOL), they increase cumulatively over time due to intrinsic and system-level induced issues, such as uneven power due to parallelization, non-uniform heating/cooling, heterogeneous mechanical stress, uneven presence of heat sources nearby, or battery management issues. For example, in series-connected packs, lower capacity cells charge and/or discharge faster, leading to a reduced battery operating window. In other words, less energy is charged and discharged, since the battery pack performance is limited by the cell(s) with the minimum voltage/SOC during discharge and the maximum voltage/SOC during charge. There are two main approaches to balance these cell-to-cell differences. The first relies on dissipative mechanisms, and it is so-called passive balancing. The idea is to dissipate the energy of the highest-charged cell in a passive element, such as a resistor, during the charging phase [12]. The main advantages of this approach are simplicity and low cost but at the expense of higher energy losses. This dissipative approach also does not fully address the balancing problem during discharge: the effective capacity and power of the battery pack are still defined by the weakest cell(s), i.e., the cell(s) with the highest/lowest SOC, lowest power capability and/or maximum/minimum temperature [13].
The second approach is non-dissipative, a so-called active balancing, which aims to continuously re-distribute the energy within the battery pack using power conversion. In the literature, there is a wide range of power conversion topologies that can be used [5,12,14,15], enabling the transfer of energy from one cell to another, a common energy buffer (e.g., a capacitance of inductance) or from the cell to the pack. This re-distribution of energy brings several advantages. Firstly, it provides higher energy efficiency than pure dissipative approaches and can be much faster. But more importantly, it opens new possibilities from the point of view of the control algorithm beyond the conventional SOC-based, OCV-based, and terminal voltage-based balancing algorithms, which are broadly used both in passive and active balancing, as described by Fleischer et al. in [12].
As shown in pioneering works of Altaf et al. [16,17], Barreras et al. [5,18], Pinto et al. [14,19], and de Castro et al. [20], active balancing opens the way for novel balancing functions, including not only SOC and voltage balancing, but also thermal control, power capability equalization, or distributed hybridization. For instance, it is well known the connection between battery current and temperature, due to self-heating effects, as illustrated in Figure 3. This means that increase in battery temperature can be controlled, up to some extent, through current limitation [5]. All in all, active balancing can enable improved battery performance, prolonged lifetime, and improved or additional features, as already stated by Barreras et al. in 2014 [18]. Regarding battery performance, the usable capacity of the entire pack over its lifetime can be increased, since both the charge and discharge performance of the battery pack can be dictated by the average characteristics of the cells, instead of the weakest cell, as is the case with dissipative approaches [13]. On the other hand, higher costs, complexity, and volume represent the main obstacles for the deployment of this technology in practice, especially in automotive applications [5,12,15].
From a control architecture perspective, battery balancing functions can be performed in the following ways: centralized; de-centralized, or distributed architectures. That can be related to the battery management system (BMS) topology [5], as illustrated in Figure 4.
In centralized networks, control functions are concentrated in a single unit (aka agent), which receives state information from all battery cells and centrally decides the control actions for the balancing hardware. In decentralized networks, each cell (or module) decides the control action locally, so the biggest reliability problem of centralized networks, i.e., single point of failure, is solved. However, the controllability is limited because there is no cell-to-cell communication. In distributed paradigms, the decentralization is only partial, i.e., the cells can communicate variables of interest with their neighboring cells. Therefore, the control intelligence is divided among a full network of control agents with partial information about the state of the battery. In general, centralized and distributed control paradigms have the potential to achieve optimal performance, since they access global state information; however, they are also more complex to solve and implement, especially for large-scale systems with dozens or hundreds of actuators. On the other hand, decentralized architectures execute the control effort only locally, thereby requiring no information exchange and lower computational power. However, since each agent uses local information of the battery pack, it is challenging to achieve optimal control performance.
From an algorithmic perspective, three classes of control methods have been proposed for advanced active battery balancing, either in centralized or de-centralized architectures: • Model-based: they rely on the mathematical model of the battery modules, often based on equivalent electric circuits. Battery models can be just used to estimate the current battery state, such in conventional OCV-and SOC-based balancing methods [12], but also to predict the future behavior of the battery pack, aiming to synthesize a control policy that fulfills the balancing goals, such as minimization of SOC or thermal unbalances, enforcing actuation and safety constraints. Model-predictive control [21], or linear state feedback [22] represent paradigmatic examples of this approach.

•
Machine learning: in this case, the control policy is derived based on interactions with the real battery pack or with a simulation model. It usually decreases modeling efforts and domain knowledge expertise but at the expense of higher data needs and computational effort (especially during training). Reinforcement learning [23] is a good example of this approach, which has been gaining increased attention over the last few years. • Fuzzy logic: in contrast with previous approaches, it relies mainly on expert knowledge to derive control algorithms [24], but this also means that there is no single systematic approach or implementation framework.
Beyond that, a novel method for battery balancing control are consensus algorithms, a distributed architecture based on graph theory in the area of communication. Consensus algorithms only require communication links between adjacent units, i.e., previous and next cells in a series string in our case, featuring advantages of less information requirement, scalability (i.e., modularity), and robustness, while keeping the potential for optimal performance due to global information discovery [25].
So far, only a couple of papers in the literature have implemented consensus algorithms, and for a single function or objective, i.e., either cell voltage [26] or SOC equalization [27]. In contrast, in this study, we propose for the first time in the literature a multi-functional/multi-objective consensus algorithm for distributed battery balancing.
Here we show how this algorithm can simultaneously perform SOC, temperature, and voltage balancing, but it could be easily extended to equalize other variables. For example, the surface concentration of electrode particles, or the rates of degradation, being able to perform derating actions, such as the ones presented in [9], at cell or module level.
The overall framework is presented in Figure 5. The concept is evaluated in simulations in the context of an e-mobility application, considering a cell-to-pack-to-cell balancing system configuration and a series-connected battery pack.

System Modeling and Control Algorithm
A single module of a battery system in an e-mobility application is modeled in this work, including 8-cells connected in series and the cell-to-pack-to-cell (CPC) balancing system. The battery power profiles are generated considering the full-pack and different driving conditions. The battery module electrical equivalent circuit model (EECM) is summarized in Figure 6.

Electro-Thermal Battery Model
A battery module made of 8 large format Li-ion pouch cells (NMC cathode, 53 Ah) connected in series is simulated by means of a multi-cell model. The electro-thermal model of each cell is composed of a simple lumped EECM coupled with a simple lumped thermal equivalent circuit model (TECM), which considers heat transfer between neighboring cells. Apart from that, different sets of parameters are generated to create different scenarios for cell-to-cell variations. Experimental data from single-cell characterization tests are combined with statistical data from screening tests on more than 200 pristine cells from Barreras et al. [28] and data from the literature to parameterize the models.

Electrical Model
Regarding the EECM of each cell j, the circuit implemented consists of a variable DC voltage source, OCV j [V], in series with a constant resistor, R j [Ω] ( Figure 6). The former represents the cell equilibrium voltage, usually referred to in this context as the open-circuit voltage (OCV), while the latter accounts for all the cell internal resistance effects. This is mathematically represented as: is the cell actual capacity, and i j [A] is the cell current.
The average non-linear OCV vs. SOC characteristic is obtained from step-response tests conducted on an automated battery tester on a single cell ( Figure 7). For implementation purposes, the average OCV vs. SOC relationship is linearized between 95% and 5% SOC, as illustrated in Figure 8. That is the typical SOC range of a lithium-ion battery in a full-electric vehicle. For the interest of the reader, the electrical test system setup is shown in Figure 9. This linear model is described as: where a j , b j are constant parameters derived for the model, and equal to 3.406 V and 0.673 V, respectively.

Figure 7.
Step-response test data at 0.5 and 25 • C.  On the other hand, a statistical model of cell-to-cell variations is built to estimate the value of the series resistance and the cell capacity for each cell in the module at different aging states, as described in next Section 2.1.2.

Statistical Model of Cell-to-Cell Variations
Estimation or prediction of cell-to-cell variations over the battery life is particularly challenging. Manufacturing tolerances and uneven temperature distributions are key factors behind imbalances in electrical parameters such as capacity, internal resistance, or self-discharge rate. While there is a myriad of modeling and aging studies at the singlecell level, only a very few focus on the diversion of aging of large groups of lithium-ion cells. Moreover, just two of them present experimental results for large-capacity cells, as summarized in Table 1. In this study, statistical data obtained by Barreras et al. [28] through screening tests conducted on 208 Kokam SLPB 53 Ah cells tested at Beginning-of-Life (BOL) is used to parametrize the statistical model of cell-to-cell variation at BOL. The cell capacities are derived from the discharge capacities measured during a 1C full discharge at constant current and room temperature. The internal resistances are derived from measurements of the so-called direct current resistance (DCR) around room temperature and 50% SOC. The DCR parameterization is interesting in this context because it accounts for pure ohmic plus charge-transfer polarization effects, i.e., the dominant effects in an EV battery pack during driving [44]. The two histograms of the relative frequency of discharge capacity and the DCR resistance at BOL are shown in Figure 10. These histograms are fitted to normal distributions, which are the de facto statistical models of cell-to-cell variations at BOL [28]. On the other hand, in the absence of more statistical data from large format cells at other aging states in the literature, the Middle-of-Life (MOL) and End-of-Life (EOL) parameter distributions are calculated through certain manipulation of the BOL distributions based on insights from the literature, following the same approach of Pinto et al. [14]. Then, as summarized in Figure 11, based on these statistical models of parameter distributions, a mixed aging scenario with substantial cell-to-cell variations is generated for our model. Figure 11. Mixed aging scenario for cell-to-cell variations considered for the 8S module in this study [14]. Table 2 presents the resistance and capacity values derived for each cell of the 8S module under this scenario. The values are presented in vectors of 8 elements and normalized to the mean value of the internal resistance at the BOL (2.09 mΩ), and the nominal cell capacity (53 Ah), respectively. Further information on the methods used to determine these datasets in [14]. The complement of this dataset is assumed for all the fast charging scenarios, i.e., (1 − ϕ).

Thermal Model
With respect to the thermal model, we assumed a lumped-parameter model and considered that: (1) the heat generation is evaluated based on Joule losses; (2) the cell heat capacity is constant; (3) the thermal resistance from cell to ambient is constant and formulated based on heat convection; (4) there is certain conductive heat transfer from one cell to the next/previous. This is represented by means of a simple lumped TECM for each cell with links to neighboring cells, as illustrated in Figure 12, where T j [K] is the actual temperature of cell j, T amb [K] is the ambient temperature, C p [J/K] is the cell heat capacity, R cond [K/W] is the conductive thermal resistance between adjacent cells, and R conv [K/W] is the convective thermal resistance between each cell and the environment. For each cell j, the TECM is coupled with the corresponding EECM through the heat generation term, . Q gen,j [W], which represents Joule losses and is expressed as: Regarding heat capacity, is assumed that C P = 1032 J/K. This value is derived from the cell mass (1.2 kg) and the specific heat capacity (860 J/kgK)) determined by means of flash lamp thermal characterization tests by Barreras et al. [45,46]. The tests are conducted at room conditions on a similar cell (Kokam SLPB 40 Ah pouch cell), following ASTM E1461 standard procedures [47].
From the same references [45,46], the in-plane thermal conductivity is obtained. This value is used in combination with the cell dimensions, the tab dimensions, and the thermal conductivity of the tabs, to estimate the cell-to-cell conductive thermal resistance from the next equations: where R cond,cell [K/W] is the in-plane conductive thermal resistance of a cell, and R cond,tabs [K/W] is the conductive thermal resistance of the cell tabs that physically connect adjacent cells, and are derived as follows: where d = 0.222 m is the height of the cell, k || = 33 W/mK is the in-plane thermal conductivity [45,46], and A || = 0.01908 m 2 is the averaged cross-section of the cell calculated from the datasheet.
R cond,tabs = L/2 k tabs A tabs where L = 0.02 m is the distance assumed between the tabs of adjacent cells, k tabs = 237 W/mK is the thermal conductivity of the tabs, assuming that is equal to the tabulated value of aluminum and neglecting contact resistances between tabs, and A tabs = 32·10 −5 m 2 is the cross-section of two tabs superimposed, calculated from the datasheet. These calculations result in R cond = 6.16 K/W, R cond,cell = 1.76 K/W, and R cond,tabs = 2.64 K/W, suggesting that both the cell thermal resistances and the tab resistance play an important role in cell-to-cell heat transfer through the tabs of adjacent cells. Unfortunately, there is a lack of results in the literature for other cells, for example, Zhu et al. [48] just estimated a value of 1.711 K/W for large format prismatic cells. In any case, R cond,cell is an intrinsic cell property, which suggests that R cond > 3.53 K/W even assuming that R cond,tabs could be minimized by improved thermal design of tab-interconnection.
On the other hand, R conv is derived from: where h [W/m 2 K] is the convective heat transfer coefficient, and A [m 2 ] is the interface surface area of the solid material. In this study, we estimated R conv = 0.813 K/W, assuming h = 15 W/m 2 K and A = 0.082 m 2 . The former is a typical value for low forced air velocities, and the latter is the sum of the areas of the larger front and rear faces of the cell. We considered a battery module with parallel cooling/heating based on forced air. The arrangement is sketched in Figure 13. In comparison with series cooling/heating, a parallel arrangement provides a more even distribution of the temperatures [14].

Balancing System Model
The overall balancing system topology proposed consists of a set of bi-directional DC/DC converters connected in parallel with each cell, which can move energy from/to each cell to/from the 8S battery module. This is the so-called CPC energy transfer configuration. As shown in Figure 6, the balancing system is represented through a simplified EECM, assuming that all the conduction power losses of each DC/DC converter can be lumped together into an equivalent resistive component, assuming R B = 10 mΩ. On the other hand, for the calculation of the overall balancing system losses, switching, magnetic, and drivers' energy losses are assumed to be constant and equal to P B,loss,other = 100 mW for each converter.

Battery Power Profiles Generation
To test the algorithm under realistic demanding conditions, we have generated both fast charging and aggressive driving power profiles considering an exemplary BEV and the battery specifications.

Aggressive Driving Power Profiles
In a BEV, the battery pack supplies power and energy to the vehicle driveline, which is composed of the electric motor(s), inverter, and mechanical transmission. This load power (p out x i (t) = −Lx(t)) is dependent on numerous factors, including the type of driving cycle the vehicle is operating, the energy efficiency of the driveline's components, as well as the inertial, rolling, and aerodynamic resistance forces that affect the vehicle (see [49] for details). Given that our goals consist in the design and test of the balancing control algorithm, in what follows we will assume that the load power p out is a known disturbance. Its value is computed considering the uCar [49] as a reference vehicle. In this paper, we use the US06 (repeated a certain number of times) as the driving cycle, since we focus on more demanding aggressive driving scenarios, but the model framework also implements other standard and non-standard driving cycles. The driving process is finished when the end-of-discharge condition is detected, i.e., when min SOC j ≤ 0.05, a common limit in real BEVs.
With regard to low voltage violations, they take place when one or several cells show a voltage below the lower voltage threshold set by the application. Here we used the minimum cell voltage stated by the manufacturer to define this limit (v j < 2.7 V), but more restrictive windows are common for safety and reliability reasons. In real-life, the BMS would derate the BEV battery power when a low voltage violation is detected [6,11], either temporarily or permanently by forcing a low-power operating mode, sometimes called "limp home" mode. However, here we decided not to implement such a derating algorithm, to enable a fair comparison between different cases by ensuring the same power levels. Instead, we allowed BEV operation until the aforementioned lower SOC threshold and quantified the operation time with low voltage violations as a key performance indicator.

Fast Charging Power Profiles
The DC fast charging profiles are created based on a constant power constant voltage (CP-CV) strategy, which is common in fast charging protocols. The charging process shifts to the CV stage when max v j ≥ 4.2 V. The power level in the CP stage is determined by trial-and-error aiming to charge with the maximum power that does not result in cell overcurrent considering the limits defined in the manufacturer's datasheet, i.e., max i j ≤ 106 A. The power level is determined considering also the maximum balancing currents, which are below 20A for all the cases evaluated. The charging process is finished when the end-of-charge condition is detected, i.e., when max SOC j ≥ 0.8. This is a also common setting in fast charging protocols.

Multi-Agent Consensus Algorithm
The coordination of distributed system with multiple agents is enabled by a protocol known as consensus algorithms, which allows the agents to exchange information via the communication network. In the case of the battery system, consensus algorithms can achieve information sharing and coordination among different cells.
The coordination of distributed system with multiple agents is enabled by a protocol known as consensus algorithms, which allows the agents to exchange information via the communication network. In the case of a battery pack, each cell in a pack represents one agent. An important feature of the consensus algorithm is that information exchange occurs only between the neighboring cells and that the centralized controller does not exist. For this reason, even if some of the communication links fail, the full information exchange capability can be preserved, where the actual level of resiliency depends on the communication network topology, as discussed in [50].
When every given cell knows the average of these variables, it is possible to design local control protocols that can ensure desired behavior of both the battery pack system and each cell totally independently of the centralized pack-level controller. In this context, a single point of failure is avoided, while the performance can be designed per technical requirements without any limitation.
The consensus algorithm is applied to the controller of every given cell by locally implementing a simple difference of variables of interest (in our case cell SOCs, terminal voltages, and temperatures) between each cell and those of other adjacent cells, which can be expressed as [4] .
x j (t) = ∑ k=N j x j (t) − x k (t) (9) where x j (t) and x k (t) are the variables of interest in agent j and k. N j represents the whole set of neighbors of cell j. From the equation above, it can be understood that the variables of interest change interactively according to the values of local measurements and the receiving measurements coming from the neighboring cells. Provided that the communication network is fully connected, all the variable values will eventually converge to an average. Therefore, based on the consensus algorithm that information is shared among units, each cell can compute an exact average value of the variables of interest, i.e., cells SOCs, terminal voltages, and temperatures, as shown in [51].
The multi-agent network of the battery pack is modeled as an undirected and connected graph. And the consensus algorithm can be expressed as follows [5,6]: .
x j (t) = −Lx(t) (10) where L is the graph Laplacian of the network, which formally describes the network's topology. The elements of the matrix are defined as where d j is the number of neighbors of node j, which means the diagonal elements L jj are determined by the number of edges attached to the node. In this application, x(t) includes the average estimated SOC, or temperature, or terminal voltage, but other variables are also possible. Each cell (or agent) j receives the estimated current average value from neighboring agents and updates its information based on the SOC, temperature, and terminal voltage using three consensus balancing algorithms.
The estimation of SOC is updated as where SOC j denotes the agent j's average estimated SOC of all agents, SOC j is the actual SOC of agent j, and σ 1 is the SOC consensus coefficient. Similarly, the agent j's average temperature and terminal voltage of all agents can be obtained based on the next consensus algorithms: where T j represents the estimation of agent j, T j is the actual temperature of agent j, and σ 2 is the temperature consensus coefficient, and where v j represents the estimation of agent j, v j is the actual terminal voltage of agent j, and σ 3 is the voltage consensus coefficient. Then, the reference balancing current for each cell j, i.e., i B,j [A] in Figure 6, is calculated with a correction term obtained from the cooperation between agents, incorporating the SOC balancing (Equation (12)), temperature balancing (Equation (13)), and/or terminal voltage balancing (Equation (14)), based on multi-agent. As a result, the multi-agent consensus algorithm helps each local unit to converge towards the global average of SOC, terminal voltage, and temperature.
Regarding the value of each consensus coefficient, σ 1 , σ 2 , and σ 3 , they could be formally selected taking into account the topology of the communication network defined by graph Laplacian matrix L (Equation (11)) to ensure fast and stable convergence. Indeed, these parameters affect the second smallest eigenvalue of the L, which should be maximized to ensure the fastest possible convergence, as explained in detail in [52]. However, formal stability analysis falls beyond the scope of this paper, and the interested reader is referred to the literature for more details.
In this paper, we have just followed a sub-optimal trial-and-error selection method to determine the starting values of the consensus parameters. The selection is also supported by sensitivity analysis in the more complex cases of multi-function control.
In addition, we took into account the following considerations: (1) the values of the consensus coefficients determine the convergence rate of the algorithm for each variable of interest, being faster for larger values, (2) the control actions, i.e., the balancing currents, are larger for larger values of the coefficients and larger differences in the variables of interest, and (3) the magnitude of the differences might be quite different for each variable of interest, being particularly lower for the SOCs, as they are defined as dimensionless variables with values between 0 and 1. This means that different values are expected for each consensus parameter, being particularly larger for the SOC case.
It is also worth noting that in ordinary control theory, hardware implementation of the controller is often not considered, and therefore in theory too large consensus coefficients that might lead to extremely large control signals are possible. This might result in hardware or stability issues. In practice, this situation is typically avoided by including saturation in the actuator, as discussed in [53]. Here, we included a saturation block to the controller to limit the balancing currents to ±1C (53 A), but other limits could be explored.
Finally, it is worth noting that, within this framework, static or dynamic values for the consensus coefficients can be applied. For instance, in this paper, beyond the static coefficients, we also propose a dynamic voltage consensus coefficient determined in quadratic proportion to the battery current, i out [A]: where k 1 and k 2 [-] are constant coefficients, and typically k 1 k 2 to avoid controller saturation. This dynamic definition of the voltage consensus coefficient virtually eliminates the widely known problem in regular balancing systems [54] of over-balancing voltages during low current periods or under-balancing voltages during high current peaks.

Results
Using our simulation framework, we can easily study a myriad of scenarios with respect to battery states, external conditions, or power demand. In this paper, due to space constraints, we focus only on demonstrating the effectiveness of the algorithm under more demanding scenarios. Hence, we focus on aggressive driving and fast charging conditions (see Section 2.3), in combination with substantial differences in cell-to-cell variations (see Section 2.1.2), and moderate parallel forced air cooling (see Section 2.1.3). Thus, we assumed in all the scenarios analyzed the mixed aging cell-to-cell variations scenario. As qualitatively shown in Figure 12, this is the case with a larger variation in cell internal resistances and capacities, since it combines cells with BOL, MOL, and EOL parameterization.
We compare side-by-side the performance of single-controllers for either SOC, voltage, and temperature balancing, and evaluate the results in comparison with the 'no control' case, which is used as a benchmark. We also evaluate multi-function dual controllers, in particular: (1) simultaneous SOC and voltage balancing, and (2) SOC and temperature balancing.
For a detailed comparison, we present plots in time of key variables, but also provide performance metrics in corresponding tables. In the case of multi-function balancing, we also conduct sensitivity analysis, aiming to provide insights on the performance of the controller depending on the tuning of the consensus gains.
The following results are displayed for the aggressive driving scenarios: • Figure 14 and Table 3: a comparison of single controllers; • Figure 15 and Table 4: a comparison of single and dual controllers, including voltage balancing using the dynamic voltage consensus gain (Equation (15)); • Figure 16 and Table 5: a sensitivity analysis of dual balancing (SOC and temperature); • On the other hand, the next results are presented for the fast charging scenarios: • Figure 17 and Table 6: a comparison of single controllers; • Figure 18 and Table 7: a sensitivity analysis of dual balancing (SOC and voltage); • Figure 19: a comparison of single and dual controllers with different fast charging profiles.  Table 3. Key metrics of single controllers results shown in Figure 14.      All cases using the CP-CV charge profile of the 'no control' case. Table 6. Key metrics of single controllers results shown in Figure 17.

Aggressive Driving Results
From Figure 14 and Table 3, we learn that near-perfect SOC balancing (∆SOC rms < 0.1%) is possible with relatively low currents and can also extend driving range (+10%). In practice, it might be limited by the error in the SOC estimation, which is not considered here. However, conventional SOC balancing cannot solve the problem of low voltage violations, overheating, and thermal unbalance.
On the other hand, temperature and voltage balancing might induce larger SOC to unbalance (7.9 and 3.4%, respectively), which might shorten the driving range (−18% and −1%) but actually minimizes the occurrence of low voltage violations and thus the potential need for derating during driving. In addition, both temperature and voltage balancing can reduce the maximum temperatures (in 12.8 and 7.4 • C) and the cell-to-cell temperature differences. The peak balancing currents are around 20 A, i.e., 50% higher than for SOC balancing, but below 10% of the peak battery current.
The magnitude of these balancing effects is dictated by the values of the consensus gains. To illustrate that, in Figure 15 and Table 4, we analyze the impact of implementing a dynamic voltage consensus coefficient (Equation (15)). In this case, we can see that the balancing action is more pronounced during high power peaks. To keep the balancing power level within reasonable limits, we limited the balancing currents to 53A (or 1C). It is observed that the dynamic gain boosts the performance of the voltage balancing controller, with a minor increase in SOC unbalances and balancing losses. Moreover, when used in combination with SOC balancing in a dual controller fashion, we can get the advantages of both controllers while minimizing their caveats.
As previously stated, the magnitude of the balancing effects is dictated by the values of the consensus gains. To illustrate the importance of appropriate tuning for the consensus gains, in Figure 16 and Table 5 we present a sensitivity analysis for a dual balancing case. We considered SOC and temperature balancing, but similar studies can be conducted for other scenarios. To conduct the parameter sweep we re-defined the values of the SOC and temperature consensus gains as a function of a dimensionless variable α, which takes values from 0 to 1. This is expressed as σ 1 = 2000(1 − α) and σ 2 = 20α. In extreme cases, the dual controller behaves as a single controller, as either σ 1 or σ 2 are equal to zero. As illustrated in Figure 16, different non-linear trends are observed in the metrics, including an irregular pattern for the maximum temperatures. These results highlight the importance of developing selection methods to balance the trade-offs of each controller.

Fast Charging Results
From Figure 17 and Table 6, we learn that the algorithm is also effective during fast charging scenarios. The SOC balancing controller can equalize SOC smoothly, and the voltage balancing controller is able not only to equalize terminal voltages but also to reduce both the maximum temperatures (>8 • C) and the cell-to-cell temperature differences. However, it increases the SOC unbalance.
As pointed out earlier for the aggressive driving scenarios, a balance between the pros and cons of single controllers can be achieved by combining them in a multi-function controller and making an appropriate selection of the consensus gains. This possibility is investigated in the sensitivity analysis presented in Figure 18 and Table 7 for a dual controller that performs SOC and voltage balancing.
For a fair comparison, the results displayed in Figures 17 and 18, and their corresponding Tables 6 and 7, are obtained using in all cases the same fast-charging power profile. The maximum power levels are determined considering the maximum terminal voltages of the 'no control' case (Figure 17a), and the maximum balancing currents of the SOC and voltage balancing cases (Figure 17b,c).
However, as can be observed in Figure 17b,c, and thanks to the balancing actions, it would be possible to charge the battery at higher power levels in those cases without violating the upper voltage limit. That is particularly true for the voltage balancing case (Figure 17c). This is investigated in the cases shown in Figure 19, where the battery is charged using its own CP-CV charge profiles to optimize the charging time. In comparison with the 'no control' case ( Figure 19a), which requires 1811 s to bring the battery up to the end-of-charge condition, the battery with voltage balancing (Figure 19b) and dual balancing (SOC and voltage) (Figure 19c) can be charged up to the same condition in only 1400 s and 1655 s, respectively. This enables a charging time reduction of 22.7% and 8.6%, respectively.

Discussion
Here we discuss other qualitative aspects of this work. Firstly, we would like to acknowledge that both the EECM and the TECM proposed are relatively simple, but they are sufficient to validate the novel balancing control algorithm proposed. This is particularly true when coupled with a rational distribution of cell-to-cell parameter variations. Indeed, an equivalent modeling methodology has already been followed and validated experimentally by de Castro et al. [20].
In addition, this relatively simple electro-thermal model can be formulated with convex functions in a convex set. This means that in future work the control for the balancing system can be evaluated offline using convex optimization, following the pioneering methodology developed by Pinto et al. [14]. This enables the comparison of the sub-optimal online results obtained with the novel consensus algorithm, with the global optimal results provided by convex optimization.
Apart from that, we would like to highlight the flexibility of the algorithm, which can be easily modified to equalize other variables of interest. This can include variables related to battery internal states and degradation mechanisms, such as the surface concentration of electrode particles, or the rates of degradation derived from more or less complex degradation models. Thus, it would be possible to equalize battery lifetime at the cell level with this framework if such variables or states can be monitored, diagnosed, and/or predicted up to some extent, which is doable with the current state-of-the-art.
As a final remark, it is worth noting that the model framework is extremely fastone study case can be run in less than a second. This is very convenient when running sensitivity analysis of key variables of interest, such as the consensus gains, and opens the door to generate large amounts of synthetic data. This large amount of data could be useful, for example, in combination with big data analytics to uncover hidden patterns, correlations, and other valuable insights.

Conclusions
This study presents for the first time a multi-objective distributed control for balancing systems, based on a multi-agent consensus algorithm. In our view, the algorithm's outstanding effectiveness, scalability, flexibility, and ease of implementation and tuning make it an ideal candidate for industry adoption. Beyond its distributed architecture, our new consensus algorithm offers key advantages over current centralized and de-centralized algorithms in the literature, such as (1) model-based, since it does not demand prediction of future variables and does not need a model of the system; (2) machine learning, since it does not demand any data for training and validation, and has extremely low memory and computational requirements; and (3) fuzzy logic, since it offers a systematic implementation approach.
Our results show that our novel multi-functional balancing can boost the performance of batteries with substantial cell-to-cell differences under the most demanding operating conditions, i.e., aggressive driving and DC fast charging (2C). Indeed, it is well known that under high power demand battery performance might be limited by overheating and excessive unbalance in cells SOC, terminal voltages, or temperatures. However, we demonstrate that a well-tuned consensus algorithm can generate balancing current setpoints that virtually eliminate these limitations, achieving a good balance between the pros and cons of single controllers.
In comparison with no control, driving times are increased (>10%), charging times reduced (>22%), maximum cell temperatures decreased (>10 • C), temperature differences lowered (~3 • C rms), and the occurrence of low voltage violations during driving reduced (>5×). This minimizes the need for power derating and enhances the driver experience. In a broader sense, it might also have an impact on the thermal management design, by reducing the demand for intensive and uniform cooling.
The benefits of multi-functional balancing are particularly interesting in the case of (1) EVs oriented to motorsport (e.g., Formula E), (2) any EVs that contemplate aggressive driving operating modes, such as the Tesla ludicrous mode, (3) all EVs that offer supercharging, and (4) batteries with significant cell-to-cell differences. In future work, we would like to evaluate the impact of the control in battery lifetime and to investigate the applicability within battery energy storage applications.

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.