원시데이터 수집 시스템
선정목록으로

Toward Composing Efficient FPGA-Based Hardware Accelerators for Physics-Based Model Predictive Control Smart Sensor for HEV Battery Cell Management

관련 수소연료전지 · (5) 연료전지용 수분제어장치(가습기)

기본 정보

저자
  1. Anne K. Madsen — Electrical and Computer Engineering Department, University of Colorado Colorado Springs, Colorado Springs, CO, USA
  2. Darshika G. Perera — Electrical and Computer Engineering Department, University of Colorado Colorado Springs, Colorado Springs, CO, USA
DOI
10.1109/access.2023.3319288
저널
IEEE Access
발행년도
2023
발행기관
Institute of Electrical and Electronics Engineers
피인용수
1
라이선스
cc-by-nc-nd
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1109/access.2023.3319288
토픽
Fuel Cells and Related Materials
OpenAlex ID
W4387010472

평가 내용

관련도
관련
사업분야
수소연료전지 · (5) 연료전지용 수분제어장치(가습기)
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '수소연료전지 > 연료전지용 수분제어장치(가습기)' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

In the era of climate change, and with the rapid depletion of fossil resources, efficient and sustainable transportation systems, such as hybrid electric vehicles (HEVs), are becoming imperative. The cornerstone of HEVs is the efficient battery technology, in order to extend the useful life of the battery and to provide improved performance to fossil fuel technology. Model predictive control (MPC) is an effective technique for battery management systems (BMS), which enables cell-level monitoring and controlling of the battery pack, reducing the safety margin of operation, while maintaining the safety requirements. Furthermore, utilizing the physics-based model (PBM) of the battery allows the control system to operate on the chemical and physical process of the battery that are the root cause of battery degradation. The non-linear extended Kalman filter (EKF) serves as the state observer to monitor the physical and chemical properties/processes of each battery cell, since these are internal processes of the battery, making them physically unobservable. The amalgamation of the aforementioned techniques, i.e., MPC, PBM, and EKF, can extend the useful life of the battery cell/pack, especially for lithium-ion batteries. In real-world scenarios, HEVs and smart applications often require portable BMS, compelling BMS to be executed on highly constrained embedded devices. Also, the inherent adaptive control process of physics-based (PB) MPC is uniquely suited for smart systems/applications. However, the high computational complexity of PB-MPC, comprising PB-EKF, prevents it from being realized on resource-constrained embedded devices, making it infeasible for portable BMS. In this research work, we introduce novel, unique, and efficient FPGA-based embedded hardware accelerator for PB-MPC smart sensor (comprising PB-EKF) for BMS, specifically on embedded devices, by addressing the computational complexity of PBM. Our proposed embedded PB-MPC hardware accelerator achieved 58 times speedup compared to its embedded software counterpart, while maintain a small footprint required for portable systems. This speedup enables us to manage more battery cells utilizing a single chip compared to that of embedded processor-based solutions.

본문 133,261자

본문 펼치기
Date of publication xxxx 00, 0000, date of current version xxxx 00, 0000. _Digital Object Identifier 10.1109/ACCESS.2022.Doi Number_ # Towards Composing Efficient FPGA-Based Hardware Accelerators for Physics-Based Model Predictive Control Smart Sensor for HEV Battery Cell Management Anne K. Madsen, and Darshika G. Perera, Senior Member, IEEE Electrical and Computer Engineering Department, University of Colorado Colorado Springs, Colorado Springs, CO 80918 USA Corresponding author: Darshika G. Perera (e-mail: <u>[darshika.perera@uccs.edu).](mailto:darshika.perera@uccs.edu)</u> ABSTRACT In the era of climate change, and with the rapid depletion of fossil resources, efficient and sustainable transportation systems, such as hybrid electric vehicles (HEVs), are becoming imperative. The cornerstone of HEVs is the efficient battery technology, in order to extend the useful life of the battery and to provide improved performance to fossil fuel technology. Model predictive control (MPC) is an effective technique for battery management systems (BMS), which enables cell-level monitoring and controlling of the battery pack, reducing the safety margin of operation, while maintaining the safety requirements. Furthermore, utilizing the physics-based model (PBM) of the battery allows the control system to operate on the chemical and physical process of the battery that are the root cause of battery degradation. The non-linear extended Kalman filter (EKF) serves as the state observer to monitor the physical and chemical properties/processes of each battery cell, since these are internal processes of the battery, making them physically unobservable. The amalgamation of the aforementioned techniques, i.e., MPC, PBM, and EKF, can extend the useful life of the battery cell/pack, especially for lithium-ion batteries. In real-world scenarios, HEVs and smart applications often require portable BMS, compelling BMS to be executed on highly constrained embedded devices. Also, the inherent adaptive control process of physics-based (PB) MPC is uniquely suited for smart systems/applications. However, the high computational complexity of PB-MPC, comprising PB-EKF, prevents it from being realized on resource-constrained embedded devices, making it infeasible for portable BMS. In this research work, we introduce novel, unique, and efficient FPGA-based embedded hardware accelerator for PB-MPC smart sensor (comprising PB-EKF) for BMS, specifically on embedded devices, by addressing the computational complexity of PBM. Our proposed embedded PB-MPC hardware accelerator achieved 58 times speedup compared to its embedded software counterpart, while maintain a small footprint required for portable systems. This speedup enables us to manage more battery cells utilizing a single chip compared to that of embedded processor-based solutions. INDEX TERMS FPGAs; embedded hardware architectures; model predictive control, physics-based model; smart sensors; battery cell management. I. INTRODUCTION In the era of climate change and global warming, and with the rapid depletion of fossil resources, efficient and sustainable transportation systems are becoming imperative [1],[2]. This has led to novel automobile technologies such as hybrid electric vehicles (HEVs) and electric vehicles (EVs) [2]. As stated in [3], HEVs achieve better fuel efficiency compared to analogous conventional vehicles. For instance, “the estimated fuel consumption, for 2021 Toyota Corolla Hybrid at a combined city-andhighway, is about 52 miles per gallon (MPG), whereas for conventional 2021 Corolla (four cylinder, automatic), fuel consumption is estimated to be 34 MPG” [3]. As a result, HEVs are becoming ubiquitous in today’s environment. In order to compete with the performance and ease of the fossil-fuel vehicles, the batteries of the HEVs must be capable of providing the required power, longevity, and fast recharge times. This has led to research in techniques for battery management systems (BMS), including techniques to optimize the control of the battery cells using Model Predictive Control (MPC) to enhance performance, while extending the useful life of the battery cells as well as providing safe operating environment [4],[5],[6]. MPC is one of the most effective techniques for cell-level monitoring and controlling of the battery packs [7],[8], since it inherently incorporates constraints and refines the safety margins, thus enabling the battery cells to be fully utilized. However, MPC is computationally intensive and typically used for industrial control. This research demonstrates the feasibility of MPC on portable and embedded devices. A modular BMS with MPC was proposed in [7],[9] that reduces the computational load on the battery cell controller, while retaining the ability to protect the battery from degradation. This proposed BMS comprising MPC enables the control burden to be split among the energy management sub-systems, effectively reducing the computational load for the battery cell controller [7],[9]. This idea is similar to the edge computing concept, where the subsystems handle as much of the computation as possible, and only provide the minimum necessary information to the overarching system. To achieve this endeavor, the modular BMS utilizes a smart sensor based on MPC that will regulate the cell current proposed by the higher-level management system for safe and reliable performance of individual battery cells, while a DCDC converter subsystem handles the state of charge (SOC) balancing of the battery cells and the bus voltage regulation for powering auxiliary systems [9]. The measurement cycle for a battery cell for our proposed architecture is 1 second, which is based on the rate of change of the internal state of the battery [20]. The MPC based smart sensor will utilize MPC’s “lookahead” strategy to predict the impact of the requested control signal would have on the battery cell, and accordingly optimize the signal based on the model and the constraints to prevent degradation [8]. The optimization step will only occur if the requested control signal violates the constraints being monitored by the smart sensor. In this approach, the control signal is an externally provided input, which simplifies the computation of the unconstrained solution for predictive control. Consequently, the smart sensor focuses on monitoring the requested control input, and the sensor executes the MPC optimization only if the control input violates the constraints. The MPC optimization then calculates a correction factor for the requested control signal that will keep the battery cell operating at peak performance and prevent the conditions that cause degradation. If the constraints are not violated, the smart sensor optimization does not engage, and the sensor acts as a pass-through. The effectiveness of the MPC algorithm depends on the accuracy of the mathematical model of the battery cell. Two main mathematical models of the battery cell are the equivalent circuit model (ECM) [10],[11],[12],[13] and the electro-chemical physics-based model (PBM) [4],[7]. The ECM model comprises simplified algorithms and provides solid performance. However, the ECM is an empirical model derived from battery performance and is not able to incorporate the different chemical and physical reactions that occur internally in the battery. These reactions are the basis for battery degradation and reduced performance [4],[14],[15]. Conversely, the PBM model incorporates these electrochemical reactions, providing an adaptive capability but is extremely non-linear and not as easily described by a discrete state space representation [4],[14]. However, the PBM has the distinct advantage of modeling the internal dynamics of the battery cell, enabling the MPC algorithm to consider aging, which in turn would extend the useful life of the battery cells as well as enhance the performance [12]. Since the PBM is based on the internal dynamics of the battery cell, measurements of the control values must be estimated. Direct measurements of internal chemical processes cannot be done without invasive techniques [14]. The Kalman filter (KF) is one of the most widely used state estimator/observers known for robust and effective state estimation for linear systems [14]. The Extended Kalman Filter (EKF) is one of many non-linear adaptations of KF [16], selected due to its adaptability to MPC [7]. Thus far, the computation complexity of the PBM model has prevented this model as a viable option for portable BMS. The authors in [14] envision that with powerful embedded microcontrollers (consisting of substantial on-chip memory), it is possible to support and utilize the physics-based (PB) EKF and physicsbased (PB) MPC, in order to obtain the maximum performance and lifetime from the batteries. Recent work [4],[7] described a reduced-order state-space physics-based battery model that approaches the simplicity of the ECM. Even with the adaptation made in [4],[5],[7] the PB-EKF and the PB-MPC would require powerful embedded microcontroller or microprocessors. An alternative is to utilize Field Programmable Gate Arrays (FPGAs) to create and map the increasingly complex PBM model for BMS. Our former analysis [17] illustrated that FieldProgrammable Gate Arrays (FPGAs) are one of the best avenues to create hardware architectures on resourceconstrained embedded devices, especially suitable for portable BMS. We have been introducing many FPGA-based hardware architectures to support and accelerate several compute and data intensive applications, including data analytics, control systems [8],[18],[19],[37], machine learning, and cybersecurity, specifically on highly constrained embedded devices. The customized and optimized FPGA-based hardware architectures/techniques will further improve the speed-performance of the PB-MPC smart sensor (comprising PB-EKF), while addressing the stringent requirements of embedded devices, which in turn would lead to more areaefficient, low power, and high-performance designs. From our investigation on related work (presented in Section V.C), we could not find any FPGA-based embedded hardware architectures, specifically for PB-MPC. Our investigation further revealed that most of the existing works [10],[11],[12],[13] on EKF for batteries, were based on the ECM approach for estimating the state of charge (SOC) and state of health (SOH) of the batteries, and not much research has been done on physics-based (PB) EKF. Existing works in the published literature for PB-MPC designs, such as [7],[9],[15] were focused mainly on using Matlab software models to verify and improve the physics-based (PB) approaches. To facilitate our endeavor of creating embedded architectures for PB-MPC for portable BMS, we initially introduced an efficient embedded software architecture for PB-MPC smart sensor (comprising PB-EKF) that functioned effectively on a 32-bit embedded microprocessor (running at 100MHz) with 128KB of on-chip memory [19]. In this case, multiple embedded microprocessors would be needed to successfully manage a full battery pack. For instance, battery packs can consist of tens, hundreds, or thousands of battery cells depending on the type of cell used, thus requiring 5, 100, or even more embedded microprocessors to support a single battery pack. We also introduced an embedded hardware architecture for EKF that functioned on Virtex-6 FPGA running at 50MHz [18]. In this research work, our main objective is to create a novel, unique, and efficient FPGA-based embedded hardware accelerator for the PB-MPC smart sensor, comprising the PBEKF observer for predicting the state of the battery cell, which can support multiple battery packs with a single chip/FPGA. Our proposed embedded hardware accelerator for PB-MPC (running at 100MHz) would ultimately be utilized in the overarching BMS. With our proposed embedded hardware accelerators, we strive to retain the accuracy and the insight provided by the PBM model, while reducing the associated design/computational complexity. In this paper, our contributions are as follows: - We introduce a novel, unique, and efficient FPGAbased embedded hardware architecture for PB-MPC smart sensor, (comprising PB-EKF), for lithium-ion battery cell control. - Our proposed embedded hardware architecture realized on a single chip/FPGA can be utilized to control multiple battery cells/packs individually, in a timemultiplexed fashion, thus significantly reducing the hardware resources required for BMS, which is ideal for resourceconstrained embedded devices. - We perform experiments to evaluate the feasibility and efficiency of our proposed embedded hardware architectures, which demonstrate that our hardware design for PB-MPC smart sensor is indeed a viable approach for battery cell management. - We demonstrate the feasibility of deploying/realizing computationally intensive methods, such as PB-MPC comprising PB-EKF, normally reserved for industrial control, on resource-constrained portable and embedded systems. The organization of the paper is as follows: In Section II, we present the background of our work, summarizing the PB-MPC algorithm utilized for this research work, including the physics-based model (PBM), extended Kalman filter (EKF), optimization, and model predictive control (MPC). Our design approach and development platform, including our system-level architecture are presented in Section III. In Section IV, we present the internal architectures of our proposed FPGA-based embedded hardware architecture for PB-MPC (comprising PB-EKF). In Section V, we report our experimental results and analyses for our embedded hardware architectures, including the functional verifications with baseline Matlab model, performance analysis, etc. Our analysis on existing works on embedded hardware designs for PB-MPC (in the published literature) is also discussed and presented in Section V. In Section VI, we summarize our work, conclude, and discuss future directions. II. BACKGROUND In order to compose our FPGA-based hardware accelerator for the overall PB-MPC smart sensor, we modify and utilize four main algorithms/techniques, including the physics-based model (PBM) of a battery, the Extended Kalman Filter (EKF) observer, the Hildreth’s Quadratic Programming (HQP) technique to optimize the cost function in MPC, and the Model Predictive Control (MPC) algorithm itself. In this section, we discuss and present a brief overview of each of these algorithms/techniques. _A._ _PHYSICS-BASED MODEL (PBM)_ There are two main mathematical models of the battery cell: equivalent circuit model (ECM) and the electro-chemical physics-based model (PBM) [7],[9],[20]. The ECM models are empirical models widely used in the industry due to their simplicity. The ECM typically focuses on the measurable aspects of the battery such as current, voltage, and resistance. The PBM of the battery provides insight into the factors that impact the performance, the State of Charge (SOC), and the life of the battery; whereas the ECM cannot provide insight into the internal electro-chemical processes of the battery that directly impact the performance and aging [7]. In this case, insight into these processes enable the safety margins of the batteries to be reduced, thus increasing the usable capacity of the battery, while ensuring that the physical processes, which cause aging are respected, which in turn will preserve the life of the battery [7]. The PBM incorporates the theory of the electro-chemical processes to predict performance. The PBM models are highly non-linear and more computationally complex than ECMs. However, the PBM models are inherently adaptive to the dynamic/changing environment without the need for extensive data gathering typically required by the ECM models. Due to the aforementioned traits, the PBMs are always considered to be overly complex to use in resource-constrained computing environments, such as embedded devices. To address some of the complexities associated with the PBMs, authors in [14] introduced a reduced-order state-space physics-based battery model that approximates the simplicity of the ECM models. In this research work, the PBM utilized in our approach is a first order model introduced in [10], which reduces the model to 5 basic reactions: (1) charge conservation in the solid, (2) mass conservation in the solid, (3) mass conservation in the electrolyte, (4) charge conservation in the electrolyte, and (5) lithium flux. We focus on this approach, since it was stated [10] that this reduced order model (ROM) was deemed suitable for embedded applications/devices, based on the first order principles. In this case, the Discrete Realization Algorithm (DRA) (in [14]) is used to transform the first order partial differential equations into a discrete state-space representation suitable for a Kalman Filter and MPC approach. This state-space representation is completely linear and composed of debiased variables; thus, as in [11],[14] a series of non-linear corrections are added back to the debiased variables to accommodate the non-linear nature of the model. In this case, the lithium flux is the only reaction that does not require a non-linear correction. In order to create a more optimized state-space model, the battery cell is split into three regions [11] as illustrated in Fig. 1. FIGURE 1. Cell schematic illustrating three regions and the associated variables [11]. As illustrated in Fig. 1, the internal variables of the battery are described by position as related to _x_ or _z_ . The variables (in Fig. 1) are as follows: ϕ represents the electric potential, which is used to calculate the charge conservation; ? represents the concentration of lithium, which is used in mass conservation calculations; ? represents the flux and ? is the reaction overpotential tied to the open circuit voltage (OCV) of the battery (????), both of which (i.e., ; ? and ?), are used to calculate the fifth reaction, lithium flux. The subscripts _s_ and _e_ indicate solid and electrolyte, respectively, whereas the subscript _s,e_ together indicates the surface of the solid. One limitation of the linearized PBM is that the prediction errors will increase as the cell state moves away from the set points of temperature and the state of charge (SOC) utilized to perform linearization [14]. To address this limitation and then to create accurate models over a wide range of temperatures and SOC, in [14], the authors developed the concept of a blended model created from the adjacent single temperature SOC models. This technique also reduces the number of models, the data, and the calculations required for accurate prediction. The state space model is a single-input, multiple-output model. In this case, the outputs are defined by the variables being modeled. As illustrated in Fig. 1, each of the six variables (??, ??, ??, ??, ??, ?) has at least four special locations. By solving the 6 variables for all the locations, it would generate 28 outputs for the state-space model [7]. A detailed description of this specific technique can be found in [14]. _B._ _EXTENDED KALMAN FILTER (EKF)_ FIGURE 2. Extended Kalman Filter Process. An observer mechanism is required to monitor the internal non-measurable, non-linear electro-chemical processes of the battery. Therefore, for this research work, an Extended Kalman Filter (EKF) is selected to serve as the observer, due to the non-linearity of the PBM. As illustrated in Fig. 2, the EKF utilized in our research is a non-linear adaptation of the Kalman filter, which linearizes the PBM model around the current state developed in [10],[12],[13]. Our proposed smart sensor is created in such a way to reduce the aging effects caused by lithium plating; and the EKF is created to monitor the model states and the side reaction overpotential (??−?), where the latter is a major factor in battery aging and performance degradation [13],[14]. In this case, the state values of the model are based on the five reactions in the PBM: (1) the electric potential in solid (??) for conservation of charge in the solid, (2) the lithium solid surface concentration (??) for conservation of mass in the solid, (3) the electric potential in electrolyte (??) for conservation of charge in the electrolyte, (4) the lithium concentration in electrolyte (??) for conservation of mass in the electrolyte and (5) the reaction in flux (?? and ?). The input value for the EKF is the current, and the output value is the voltage. The main process of an EKF is similar to the Kalman Filter with the modified steps as shown in Fig. 2. This process and the associated steps are detailed in Section IV.B. The Kalman Filter uses the linear state equations (1) and (2). ??+1 = ???? + ???? (1) ?? = ???? + ???? (2) Where ??+1 represents the predicted state, ?? is the current state, ?? is the current input state (e.g., Igref), and _A_ and _B_ are the state matrices. The standard output equation is used to generate different outputs for the Kalman filter created in equations (5)-(7). The ?? is the current output, and _C_ and _D_ are the output matrices. Typically, the EKF uses the following equations (3) and (4) to express a nonlinear set of equations: ??+1 = ?(??, ??) + ?? (3) ?? = ℎ(??, ??) + ?? (4) Where ?? and ?? represent the state and the output noise, respectively, and ?and ℎ are vector-valued nonlinear functions [7]. Instead of using the nonlinear equations, in this research work, our approach utilizes the linear expressions in equations (1) and (2) with matrices A, C, and D, created from the nonlinear look up tables (LUTs) based on the blended models. A set of non-linear corrections (using equation (5)) are applied to _C_ and _D_ matrices to ensure that the electrochemical processes are accounted for, and then the _C_ and _D_ matrices are linearized again, which are represented by ?̂ and ?̂. This approach adds an additional step 3.5 non-linear corrections to the process in Fig. 2. A detailed description of this approach can be found in [6]. The output voltage in equation (6), ?????,?, is a function of the chemical processes in the battery and the open circuit voltage (OCV). The equation (7) is output SOC, which dependents on the current state, the surface potential, and a Doyle cell parameter, ?. These output equations are further detailed in Section IV. ????,? = ??(??, ??) (5) ?????,? = ??(?, ??, ?, ???) (6) ????,? = ℎ?(??,??, ?) (7) In order to reduce the amount of memory required to run the smart sensor, we limit the parameters to temperatures ranging between _0°C_ and _25°C_ and SOC steps of 5% (from 0 to 100%). Considering that the EKF itself is an estimation, selecting a single blended model with the above temperature range produces results that are within the accepted tolerance for state estimation [7] of battery performance. _C._ _OPTIMIZATION_ A key component of model predictive control (MPC) is optimizing the cost function. We use two techniques to reduce the complexity of the problem (i.e., solving the cost function), and then numerically solve the optimization using the Hildreth Quadratic programming (HQP) technique. The first simplification technique is to utilize only the active constraints that are active during the solution interval, and to ignore the inactive constraints; this in turn has the potential to reduce the number of calculations required for a solution. The second technique is the primal-dual approach. This technique simultaneously identifies the active constraints and reduces the optimization to a single min-max problem enabling the use of the HQP. Detailed description of the aforementioned techniques can be found in [4],[14]. We briefly explain these two techniques below. In this case, we start with an augmented cost function, ?, developed by MPC algorithm in the next subsection (i.e., Section II.D) that incorporates the Lagrange multiplier (λ), and the constraints from the MPC relationship; then we would have an augmented cost function that enables the exclusion of the inactive constraints. As presented below, the cost function (in equation (9)) is augmented with the equality constraint (in equation (8)), and multiplied by the Lagrange multiplier (λ). ??≤? (8) ?= <u>12</u> <sup>????+ ???+ ??(??−?)</sup> (9) Where E and F are standard objective or cost function matrices, which are further developed in equations (38) and (39), respectively; and M is the matrix reflecting the constraints. In this case, using partial derivatives with respect to _x_ and λ, and setting them to zero allows us to explicitly solve _x_ in terms of λ. This primal dual approach allows us to reduce the optimization problem to equation (10) below. <u>12</u> <sup>???−1?)</sup> (10) ????≥0 <sup>(−</sup> <u>1</u> <u>12</u> <sup>????−???−</sup> <u>12</u> where, ?= ?? <sup>−1</sup> ? <sup>?</sup> (11) ?= ?+ ?? <sup>−1</sup> ? (12) If we further denote the active constraints as Mact and λact, then the explicit solution for _x_ is (equation (13)): ?= −? <sup>−1</sup> ?−? <sup>−1</sup> ????? ???? (13) Typically, in MPC, −? <sup>−1</sup> ? represents the unconstrained solution denoted by ∆?°. The correction factor needed for the constrained solutions is ? <sup>−1</sup> ????? ???? . Hildreth’s Quadratic Programming (HQP) is a numerical solver for this correction factor. The HQP is an iterative approach that always produces an executable solution which prevents the hardware and software from crashing or entering into an unrecoverable state that hangs the system. Additionally, the HQP does not require matrix conversion, and is executed using basic math functions readily available in hardware. The HQP initially calculates the unconstrained solution (∆?°), and then compares it to the constraints. If none of the constraints are violated, ∆?° will be the solution, and the algorithm exits. If a constraint is violated, the HQP then invokes an iterative process to calculate the correction factor. It does this by iteratively applying _P_ and _K_ to the previous vector of Lagrange variables using the following two equations (14) and (15): ??+1? = ???(0, ??) (14) where, ?−1?=1 ??????+1 + ∑??=?+1 ??????] (15) ??+1 + ∑??=?+1 ????? Δ??,? = x?,? −??,?−1 (18) Δ?? = ?? −??−1 (19) Then we get the following: Δ??,?+1 = ??Δx?,? + ??Δ?? (20) ??+1 −?? = ??Δ??,?+1 = ????Δ??,? + ????Δ?? (21) In order to put MPC equations back into a standard form, we define a new augmented state vector as ?? which are defined as follows: ?? = − <u>1</u> <u>1</u> ?−1?=1 ????? ??? <sup>[??</sup> <sup>+ ∑</sup> (22) ? <sup>?,?+1</sup> ?+1 <sup>]</sup> Where P and K are defined in equations (11) and (12), respectively. The HQP converges when ? <sup>?+1</sup> ≅? <sup>?</sup>, or when the maximum number of iterations (a set threshold value) is reached. Once this occurs, the HQP uses the final λ to create the correction factor and applies it to ∆?° to calculate the constrained solution. This process is further detailed with our proposed FPGA-based hardware architecture in Section IV. _D._ _MODEL PREDICTIVE CONTROL_ MPC is an adaptive control theory that attempts to adjust the control signal that results in the target response. MPC uses a model of the system under control to predict the system’s response and optimization theory to iteratively adjust the control signal until the target response is achieved. We use the receding horizon principle to determine the prediction horizon (Np), which is known as the optimization window; and the receding horizon results in a moving control window (Nc). There are two advantages to this approach: (1) the vectors remain manageable in size and, (2) once the control vector is determined, only the most recent control is applied to the system. In this research, our proposed FPGA-based hardware architecture uses a standard MPC flow; however, since we are using this as a smart sensor, the cost function is tailored specifically to produce the desired smart sensor behavior. Also, for the MPC approach in our proposed hardware architecture, we use the augmented state space equations. We briefly describe the MPC approach utilized for our research work, as follows. In the equations below, _k_ is the current time interval; _k-1_ is the previous time interval; _k+1_ is the predicted or future time interval; _x_ is vector describing the state of the system; _y_ is a vector of measured outputs; and _u_ is the control or input vector. The augmentation is used to eliminate the steady state error, which is achieved by applying the difference operations to both sides of the standard state space model of a plant. Therefore, following the development in [26], if we start with the standard state space equations: ??,?+1 = ????,? + ???? (16) ?? = ????,? (17) And we subtract the previous values from the current values: ?? = [ <sup>Δ?</sup> ? <sup>?,?</sup> ? ? <sup>?,?</sup> ? <sup>] and ??+1</sup> <sup>= [Δ?</sup> ? <sup>?,?+1</sup> ?+1 Then the plant equations become: ? <sup>?,?</sup> ? <sup>] + [</sup> ?? <sup>??</sup> ? ?? <sup>??</sup> ?? <sup>] Δ??</sup> (23) ?? <sup>?</sup> ? <sup>?</sup> ? 0??? <sup>] [Δ?</sup> ? <sup>?,?</sup> ? ??+1 = [ Δ??,?+1 ? ??,?+1?+1 <sup>~~]~~</sup> <sup>= [</sup> ?? <sup>?</sup> ? <sup>?</sup> ? 0?? ?? = [0? ?] [ <sup>∆?</sup> ? <sup>?,?</sup> ? <sup>]</sup> (24) Which simplifies down to: ??+1 = ??? + ?Δ?? (25) ?? = ??? (26) Once we have the plant equations, we can calculate the predicted plant output, given the control signal (∆??), which we calculate using our optimization approach. The state vector (??) describes the current state of the plant. Since we are working with the internal electrochemical processes of the battery, ?? cannot be directly measured. To determine the current state, we use the PB-EKF observer detailed in Section II.B. The prediction horizon (Np) determines the number of future state variables calculated (i.e., ??+1), whereas the control horizon (Nc) determines the number of control values as shown below in equation (27). ∆?= [∆??, ∆??+1, ⋯, ∆??+??−1]? (27) The state variables are calculated sequentially and the predicted output variables (??+1) are calculated by multiplying the state variable by _C_ as follows: ??+1|? = ???? + ??Δ?? ??+2|? = ?? <sup>2</sup> ?? + ???Δ?? + ??Δ??+1 ⋮ ??+??|? = ?? <sup>??</sup> ?? + ?? <sup>??−1</sup> ?Δ?? + ?? <sup>??−2</sup> ?Δ??+1 + ⋯+ ?? <sup>??−??</sup> ?∆??+??−1. (28) These predictions are expressed in terms of the current state (??), and the input or future control signal (Δ??+?), where j = 0, 1, 2, …, (Nc-1). Then the output vector is expressed as: ? ?= [??+1|?, ??+2|?, ⋯, ??+??|?] (29) The output equation can be written in a more compact form as: ?= Φ??? + GΔ? (30) Where, Φ = ? ?? ?? <sup>2</sup> ⋮ [?? <sup>??−1]</sup> and (31) 0 0 0 ⋮ ?? <sup>??−??</sup> ? <sup>]</sup> (32) 0 0 ?? ⋮ ?? <sup>??−3</sup> ? ⋯ ⋯ 0 ⋱ ⋯ ?= ?? ??? ?? <sup>2</sup> ? ⋮ [?? <sup>??−1</sup> ? 0 ?? ??? ⋮ ?? <sup>??−2</sup> ? After developing the prediction matrix, the next step is to determine the cost or optimization function. In order to use the MPC as a smart sensor, the optimization function has to be tailored to support that behavior. Hence, if we organize ∆? in the same fashion as ? we get the following: ∆?? ∆??+1 ⋮ ∆??+??−1 the battery current to protect the battery cells from aging and degradation. This significantly simplifies the design and development of our MPC architecture; thus, reducing the computational complexity of calculating the unconstrained global optimal control signal (∆?°). In Fig. 4, ∆?° is represented by ?????. The electrochemical process of side reaction overpotential (??−?) is the primary factor in battery life and performance degradation, and also the main constraint used in our MPC architecture. Further adaptations of MPC for our proposed FPGA-based hardware architecture are discussed in Sections III and IV. A detailed description of the PB-MPC theory can be found in [14]. III. DESIGN APPROACH AND DEVELOPMENT PLATFORM In this research work, we introduce our novel and unique FPGA-based hardware architecture for the PB-MPC smart sensor (comprising PB-EKF) to support the battery management system (BMS) using the MPC for physics-based electro-chemical battery model. Previously, in [19], we introduced embedded software architecture for PB-MPC smart sensor for BMS, which is executed on an embedded processor. In this work, we use our PB-MPC embedded software architecture to evaluate our proposed embedded FPGA-based hardware architecture. Prior to creating our PBMPC embedded software architecture, we created the software for PB-MPC smart sensor in C and execute on the desktop computer. The desktop C program is also utilized to verify the results and correct functionality of both our embedded hardware and embedded software architectures. Furthermore, we compare our embedded FPGA-based hardware architecture with the baseline model for the PB-MPC smart sensor written in Matlab [7], in order to evaluate and validate the correctness and functionalities of our proposed design. Our desktop results are also compared and verified with the baseline Matlab results. During the design and development, both our embedded hardware and software versions of various computations/modules are implemented using a hierarchical platform-based design approach to facilitate component reuse at different levels of abstraction. Our proposed architecture comprises different levels of abstractions, where higher-level functions utilize lower-level sub-functions and operators. In this case, the PB-MPC is at the highest level, whereas the fundamental operators such as add, subtract, multiply, divide, etc. are at the lowest level. _A._ _EXPERIMENTAL PLATFORM_ All our embedded hardware and software experiments are carried on the Xilinx VC707 development board, which utilizes a Virtex-7 XC7VX485TFFG1761-2 FPGA [21]. This VC707 FPGA development board includes large on-chip logic resources (75,900 slices), MicroBlaze soft processors, and 37MB on-chip BRAM (Block Random Access Memory) to store data/results. This development board also consists of numerous peripherals that could be utilized to support a [ ?? ??+1 ⋮ ??+??−1 ] = [ 1 0 0 ⋯ 1 1 0 ⋮ ⋱ ⋮ 1 1 ⋯ 1 ] [ ] + [ 1 1 ⋮ 0 ] ?0 (33) Which can be expressed as ?= Σ∆?+ ?0. For the smart sensor, the control vector is expressed as _Ig_ as follows: ?? = Σ∆?+ ?0 (34) To develop our optimization, the basic cost function becomes: ?= (?? −??)?(?? −??) (35) Substituting for _Ig_ and rearranging the terms to match the standard optimization format below: ?= <u>12</u> <sup>????+ ???</sup> (36) Results in: ?= <u>12</u> <sup>∆??2???∆?+ ∆??(−2??(??</sup> <sup>−?0))</sup> (37) Where, ?= 2? <sup>?</sup> ?∆? (38) ?= −2? <sup>?</sup> (?? −?0) (39) The aforementioned equations and the corresponding functions are used by our HPQ optimization approach to determine the optimal control signal. The overall battery management system/architecture, described in Section III and illustrated in Fig. 4), is a distributed management system, where separate subsystems handle the voltage regulation and SOC balancing. This in turn enables the smart sensor to focus solely on monitoring physical test of the embedded FPGA-based hardware accelerator for BMS. It should be noted that we utilized VC707 with Virtex-7 FPGA as a prototyping platform to design, develop, test, and verify our proposed architectures. However, in a real-world scenario, our intention is to execute our PB-MPC (comprising PB-EKF) hardware design on lowcost small-footprint FPGAs. All our embedded hardware modules are designed in Verilog. They are executed on the Virtex-7 FPGA (running at 100MHz) to verify their correctness and performance. Xilinx Vivado 2020.1 design tools are used to create our embedded hardware designs. Xilinx Vivado design suite environment has an integrated simulator, which we utilize to verify the functionality of the design at the bit and signal level prior to downloading and reconfiguring the FPGA. Our previously proposed embedded software modules for PB-MPC [19] were written in C and executed on the 32-bit RISC MicroBlaze soft processor (running at 100 MHz) on the same Virtex-7 FPGA. For our proposed embedded hardware architecture, the MicroBlaze soft processor is incorporated to execute some high-level control functions, which are also written in C. The hardware modules for the fundamental operators are designed using single precision floating-point units [22] from the Xilinx IP core library. The MicroBlaze processor was also configured to use single precision floating-point units for the embedded software modules in [19]. Conversely, the baseline Matlab model [7] was designed using double-precision floating-point operators. Our experiments are performed using an Urban Dynamometer Driving Schedule (UDDS) [23] current profile for the input ( _uk_ ) and the measured output ( _vk_ ), similar to our previously proposed PB-EKF in [18]. This driving schedule (i.e., UDDS) reflects the typical driving pattern of city or urban drivers with many starts and stops and speed changes, all of which exercise battery cell management. Our proposed hardware architecture for PB-MPC comprising modified PBEKF is initialized using a SOC (state of charge) of 0.6 and an initial state covariance of diagonal matrix [1E5, 1E5, 1E7, 1E7, 5E9], similar to the baseline model in [7]. Our proposed FPGA-based PB-MPC smart sensor is created in such a way to support the normal driving of HEVs with the charging and discharging based on the UDDS driving profile [7]. _B._ _SYSTEM-LEVEL ARCHITECTURE_ We create system-level architectures for our FPGA-based embedded hardware design for PB-MPC. For our proposed embedded hardware architecture, we integrate on-chip BRAMs to store the input data needed to process the PB-MPC algorithm and to store the final and intermediate results from the PB-MPC algorithm. Our system-level architecture is depicted in Fig. 3. As illustrated in Fig. 3, the AXI (Advanced Extensible Interface) bus acts as the glue logic for the system. The AXI bus [24] provides improved design mobility through the use of industry standards and interface protocol standardization, which is compatible with the modern Xilinx IP cores. Although the AXI bus protocol supports the burst transfers and streaming, we decide to use the AXI4-lite bus, due to its small logic footprint and support of single memory mapped transactions suitable for use with the control and status registers, which is ideal for our proposed embedded hardware architecture for PB-MPC. FIGURE 3. System-level architecture for our PB-MPC smart sensor. For our system-level architecture, we incorporate the MicroBlaze processor to perform some high-level control functions, as well as to support testing and verification of our embedded FPGA-based hardware architectures. In this case, MicroBlaze processor is configured to have 128KB of local on-chip memory. As depicted in Fig. 3, our proposed userdesigned hardware module communicates with the MicroBlaze and with the other peripherals via AXI bus [24], through the AXI Intellectual Property Interface (IPIF) module, using a set of ports called the Intellectual Property Interconnect (IPIC). MicroBlaze processor is employed: to send a flag to our user-designed hardware IP to initiate the whole PB-MPC process including the PB-EKF, start the AXI Timer to measure the execution time, receive a flag from our user-designed hardware IP, once the process is completed. The execution times for our proposed hardware are obtained using the AXI Timer [25] running at 100MHz. _C._ _TOP-LEVEL ARCHITECTURE FOR PB-MPC SMART_ _SENSOR_ In this sub-section, we briefly describe the overall top-level architecture of a battery management systems (BMS) with the PB-MPC smart sensor, (comprising PB-EKF), whereas detailed description can be found in [7],[19]. This overall toplevel block diagram is demonstrated in Fig. 4 [19]. As illustrated, the color blocks, Cell, EKF, and MPC are the elements in the PB-MPC smart sensor. The unique design for a distributed control system, proposed in [7] and shown in Fig. 1, has the subsystems effectively handling voltage regulation and SOC balancing, leaving the smart sensor to handle the battery current and protect the battery cell from aging and degradation. This in turn greatly simplifies the overall PBMPC, (comprising PB-EKF), created in such a way that the computation for the unconstrained global optimal control is greatly reduced; and when using a control horizon of 1 and a prediction horizon of 2, this computation is almost eliminated. In this case, in order to act as a pass through, if the proposed control signal ????? elicits no constraint violations, ????? must then be the PB-MPC’s unconstrained global solution (∆?). FIGURE 4. Block diagram of the BMS with a PB-MPC smart sensor [19]. In Fig. 4, the block diagram describes the inputs to the PBMPC, (comprising PB-EKF), and the outputs necessary for proper operation of the PB-MPC. In this case, the PB-MPC is a single-input and single-output approach that evaluates the cell current control requested by the higher level BMS. For instance, if the requested cell current is within acceptable operating conditions, then the PB-MPC simply acts as a pass through. Conversely, if the requested cell current would cause lithium plating (a known aging mechanism), then the PB-MPC intervenes to take appropriate action and computes an acceptable cell current. For this PB-MPC, the primary constraint is based on the side reaction overpotential (??−?), which is a major factor in the reduction of battery life and degradation in performance. This type of PB-MPC is detailed in [7]. As depicted in Fig. 4, the inputs to the PB-EKF are the cell current and voltage, whereas the outputs of the PB-EKF, including the current-state of the battery, state of ??−?, state and output matrices (A, B, ?̂,?̂), are the inputs to the PB-MPC. In this case, the cell current is a combination of string current (???????) and control current (??). The PB-EKF operates on the current-state while the PB-MPC operates on the change-in state from the current-state to the next-state, and computes the change-in current. In order to function correctly, the changein current is added to the control current to produce a changein state for the PB-MPC with the aid of PB-EKF. Then, the PB-MPC outputs an updated control signal (?????∗ ) that meets the current and ??−? constraints to prevent aging and battery degradation, while satisfying the required performance of the BMS. The PB-MPC smart sensor algorithm is similar to the standard MPC algorithm; however, instead of focusing the cost function on the amplitude of the control increment (∆??), which is the norm for the standard MPC [8]; with PB-MPC, the cost function will target the amplitude of the current signal (??). This is further explored and detailed with Module 8 in Section IV.C.1. As mentioned in Section III.A, in this research work, our proposed FPGA-based embedded hardware architecture/accelerator for PB-MPC comprising the PB-EKF, is designed and developed on the VC707 development board with the Virtex-7 FPGA using the Xilinx Vivado design tools. We previously introduced an embedded hardware architecture for PB-EKF [18], which was designed and developed on the ML605 development board with Virtex-6 FPGA using the Xilinx ISE design tools. We realized that these FPGA development boards were not fully backwards compatible. Hence, we modify our previous PB-EKF hardware version, which includes redesigning and upgrading all the interfaces to the Advanced eXtensible Interface (AXI) protocol, as well as certain internal architectures. We further modify our previous PB-EKF version, in order to incorporate the PB-MPC portion of the smart sensor architecture. These upgrades and redesigns, on the new VC707 development platform, enable us to increase the clock frequency of our proposed PB-MPC architecture (comprising the modified PB-EKF) to 100MHz, as opposed to our previous PB-EKF version running at 50MHz. IV. OUR PROPOSED EMBEDDED HARDWARE ARCHITECTURE FOR PB-MPC SMART SENSOR In this section, we discuss and present our novel, unique, customized, and optimized embedded hardware architectures for the PB-MPC smart sensor (comprising PB-EKF). We initially investigate the functional flow of the PB-MPC [7],[9],[18],[19] in order to gain insight, and subsequently to decompose this complex and computationally intensive algorithm into several sub-tasks. This enables us to dramatically simplify the design process, without compromising the integrity and the performance of the baseline PB-MPC algorithm. The hardware functional flow of our PB-MPC smart sensor is illustrated in Fig. 5. As shown, we decompose the PB-MPC algorithm into four stages, which are built with 13 modules. As shown in Fig. 5, Stage 2 (in purple) and the corresponding modules (i.e., modules 2 to 7) are utilized to create the EKF portion of the smart sensor architecture; Stage 3 (in pink) and the corresponding modules (i.e., modules 8 to 12) are utilized to create the MPC portion of the smart sensor architecture; and Stage 4 (in green) and module 13 are utilized to enable the operating temperature updates and the external memory access as needed. In this research work, we modify our previously proposed PB-EKF [18], in order to incorporate the PB-MPC portion of the smart sensor architecture. For instance, Module 7 from [18] is modified and expanded to include the linearized output matrices. Next, subsequent stages and modules are added to create the MPC algorithm utilized for our smart sensor. As detailed in Section II, our PB-EKF architecture is inspired by the reduced order physics-based model introduced in [4],[14],[15],[26]. As detailed in Section III.C, FIGURE 5. Block diagram of the hardware flow for our PB-MPC smart sensor. our proposed PB-MPC hardware architecture (comprising PB-EKF) is designed and developed on VC707 development board with the Virtex-7 FPGA using the Xilinx Vivado design tools; whereas our previously proposed PB-EKF [18] was designed and developed on the ML605 development board with Virtex-6 FPGA, and using the Xilinx ISE design tools. Since these FPGA development boards were not fully compatible, we further modify our previous PB-EKF version, including redesigning and upgrading interfaces and internal architectures, in order to make it compatible with the newest VC707 development board, as well as to cater to the PB-MPC portion of our proposed hardware architecture. The internal architectures of the hardware modules (i.e., all 13 modules in Fig. 5) are detailed below. _A._ _STAGE 1: INITIALIZATION_ 1) MODULE 1 In Stage 1, Module 1 consists of a finite state machine (FSM) that retrieves relevant constants from the read only memories (ROMs) and then writes these into the designated memory locations in the random access memories (RAMs). In this case, ROMs are preloaded with a text file comprising the constants, while downloading and programming the chip/FPGA. Utilizing a text file enables the FPGA/chip designers to easily modify the constants and lookup tables (LUTs) used throughout the design, without changing the underlying Verilog hardware codes/architecture in the XILINX IDE. The constants include the initial state vector ( _xk_ ), SOC, and the error covariance matrix (??). This module is executed only once during the initialization. After the initialization process, , _xk_, SOC, and ?? are updated continuously by the PB-EKF in Stage 2, and the control signal is updated by the PB-MPC in Stage 3 as illustrated in Fig. 5. _B._ _STAGE 2: PB-EKF COMPUTATION_ 1) MODULE 2 In Stage 2, Module 2 executes the first step in the PB-EKF (i.e., equation (40)), in order to compute the state matrix ( _A_ ), followed by the state time update ( _xk_ ). The high-level architecture of the Module 2 is illustrated in Fig. 6. ??+1 = ???? + ????−1 (40) FIGURE 6. Top-level architecture for Module 2. The “state time update” (i.e., step 1 of Fig. 2) uses the apriori information; thus, the subscripts indicate previous state ( _k-1_ ) and the current state ( _k_ ). The state matrix ( _A_ ) is built using look-up-tables (LUTs) and two dimensional (2D)-interpolation. The LUTs are created using two temperature values (0°C and 25°C), and 20 different SOC values ranging from 0% to 100%. The LUTs require integer values as inputs or indices; however, the temperature and SOC are floating point values. The index finder module is designed to create the correct integer index values from the floating point (FP) SOC value. For our proposed architecture, the temperature indices are always 0 and 1. The SOC indices are determined by casting a FP value to an integer to strip off the decimal value, which is similar to always rounding a number down. The integer value is then used to create the indices and to determine the scaling factors (α0, α1, β0, β1) used in the 2-D linear interpretation to create the state matrix ( _A_ ). Fig. 7 illustrates the internal architecture of the index finder, which determines the high and low SOC indices for this module and high and low indices for the change in the open circuit potential (∆????) in Module 4. The LUTs for ∆???? have 201 entries; index finder is equipped with a flag to change the multiplier from 20 for SOC to 200 for ∆????. The ∆???? computation takes place in the reuse of Module 3, post Module 5. The generic approach to producing the scaling factors and indices is presented in equations (41) and (42). In this case, if _Z_ represents the array of 20 SOC values, and _T_ represents the array of 2 temperatures, _α0_ and _β0_ are computed with these two equations (41) and (42). <u>??−?[0]</u> ?[1]−?[0] <sup>=</sup> <u>??25−0</u> <sup>= 0.04(??) (41)</sup> component rounds to the nearest integer instead of always rounding down. This Check module determines whether β0 is negative by examining the most significant bit (MSB). In the case, where β0 is negative, it considers High=(int)soc_val and Low=High-1; otherwise, where β0 is positive, it considers Low = (int)soc_val and High = Low+1. In our hardware design, the computation of “soc_val” is followed by two parallel operations: (1) one that performs FPI, in order to find “Low”, and then converting “Low” back to floating point using the int2flt component; (2) another one that computes “soc_val+1”. For both parallel operations, only one adder is utilized, due to careful timing of the computations. We also design a separate “Check_T” module (Fig 8) to compute α values based on the temperature input. This Check_T module is also used to determine the case value input to the user-designed _e_ <sup>_x_</sup> module utilized in Module 4. The Check_T module uses a multiplier and an adder to create α1 and α0; and uses a comparator to determine the case value for the user-designed _e_ <sup>_x_</sup> module. The internal architecture of the Check_T module is illustrated in Fig. 8. FIGURE 8. Internal architecture for Check_T module. The aforementioned “case value” is stored in the on-chip BRAMs for subsequent analysis. The resulting α and β are used in the 2-dimensional linear interpretation, to create the state matrix ( _A_ ) as presented in equation (43), where [i] represents the states. ?[?] = ?1?1(????0[???][?]) + ?0?1(????1[???][?]) + ?1?0(????0[???ℎ][?]) + ?0?0(????1[???ℎ][?] (43) The original LUT for _A_ matrix ( _BigA_ ) was a 3D matrix, composed of temperature, state of charge (SOC), and system state values, which led to a 2X20X5 matrix. For our proposed architecture, we split the LUT into two 20X5 matrices ( _BigA0_ and _BigA1_ ), in order to utilize the dual-port BRAMs as well as to reduce the associated overhead. As in equation (43), _A_ [i] represents the diagonal of the 5X5 state matrix. Since _A_ is a diagonal matrix, _A_ is stored as a vector in our hardware module, with the implied zeros. Furthermore, the state _xk_ is also a vector; hence, the operation ???−1 no longer requires addition. Also, since _B_ is a set of ones, the operation ???−1 = ??−1. As a result, the state time update (i.e., ?0 = ??,℃−?[???]℃ ?[???ℎ]℃−?[???]℃ <sup>=</sup> <u>????−?[???]</u> .05 = 20(???? −?[???]) (42) ?0 = <u>????−?[???]</u> ?[???ℎ]−?[???] <sup>=</sup> FIGURE 7. Internal architecture for Index Finder. Our hardware architecture for the index finder (Fig. 7) is designed in such a way to find the SOC indices, and the β values. This requires integrating a check condition (i.e., β <0) to the result to ensure that “Low” represents the lower bounding integer, since the FPI (floating-point-to-integer) FIGURE 9. Internal architecture for A Matrix computation. equation (40)) is reduced to the equation (44) below. This in turn enables the state time updated to be executed using a single FP multiplier and a single FP adder. ??[?] = ?[?]??−1[?] + ??−1 (44) The internal hardware architecture to compute the _A_ matrix (equations (41), (42), and (43)) is shown in Fig. 9. As illustrated, the first two parallel multipliers compute the four terms in equation (43), i.e., ?1?1 ∗(????0[???][?]) for each state _i_ . In this case, Mult1 and Mult2 perform multiplications on the BigA0 and BigA1 data, respectively. Next, the addition operation (using Add1) is performed to add the first two terms and the last two terms together. The result of the Add1 is forwarded to Add2 to obtain the final _A[i]_ matrix. Add2 result is written to the BRAM, while simultaneously this result is also multiplied with _xk-1[i]_ using Mult3. Next, Mult3 result is added to _uk-1_, and the final addition result (using Add3) is also stored in the BRAM. Our overall Module 2 is designed using only two multipliers and two adders shared by the sub modules. In this case, each multiplier and adder comprise an output_ready signal to indicate that the output is valid, and an input_valid signal to trigger multiply/addition operations. Using the output_ready signal as the input_valid signal reduces the overhead of the FSM. In the standard Kalmann Filter (KF) process, the next step is to compute the error covariance time update. However, in our hardware architecture, this computation is delayed and done in Module 5 with the Covariance Matrix computation. 2) MODULE 3 Module 3 is used for the error covariance time update (i.e., step 2 of Fig. 2) that occurs after Module 2, and again for the error negative electrode, ??,?????? using ??, and the cell model parameters that are held constant for this range of temperatures. covariance measurement update (i.e., step 6 of Fig. 2) that occurs after Module 6. In both instances, Module 3 updates the SOC, creates the observation matrices ( _C, D_ ), and computes the output function ( _yvar,k_ ). In both updates, the output function contains de-biased variables, which have meaning only when the nonlinear corrections are applied [7]. FIGURE 10. Top-level architecture for Module 3. The top-level architecture of Module 3 is illustrated in Fig. 10. As shown, in the beginning, Module 3 computes the SOC based on the time update ( _xk_ ), and the lithium concentration in the solid surface at the negative electrode (?????). For our in the solid surface at the negative electrode (?????). For our proposed hardware architecture, we use the cell model parameters from the Doyle cell parameters in [7]. These paramters are held constant for the temperature range used for our hardware architecture. The SOC computation is obtained using the following steps: 1. Calculate the average solid surface concentration in the negative electrode, ??,?????? using ??, and the cell model ?,?????? = ??,??????? ?,?????? ?????? = ??????[4] + ???? (45) otherwise SOC_store writes the adder output ??,?????? to memory. The SOC values are also stored in the memory. The updates of the SOC drive the updates to the SOC indices as well as the α and β terms discussed previously, thus reusing the two sub-modules (i.e., Index Finder and Alpha Beta) from Module 2. As illustrated in Fig. 10, the _C_ and _D_ matrices are created using the following 2D interpolation, where _i_ represents the 5 states and _j_ represents the 19 outputs in this Model 3. ?[?][?] = ?1?1(????0[???][?][?]) + ?1?0(????0[???ℎ][?][?]) + ?0?1(????1[???][?][?]) + ?0?0(????1[???ℎ][?][?] (48) ?[?] = ?1?1(????0[???][?]) + ?1?0(????0[???ℎ][?]) + ?0?1(????1[???][?]) + ?0?0(????1[???ℎ][?]) (49) The _C_ and _D_ matrices (in Fig. 10) are created by adapting the _A_ Matrix module (in Fig. 9). For the _D_ matrix module, 19 iterations are used instead of 5 iterations as in _A_ matrix. For the _C_ matrix module, an outer loop is added to the _A_ matrix module to create an additional dimension. After computing the _C_ and _D_ matrices, the PB-EKF output equation (50) is computed using Y_out module (in Fig. 10), and represents step 3 of Fig 2. ????,? = ???? + ???? (50) In order to compute _Ckxk_, in equation (50), we create an optimized linear multiply accumulate (MAC) module, which consists of one FP multiplier and 3 FP adders (as shown in Fig. 12). Our primary goal of designing this efficient MAC module is to reduce the area, and the secondary goal is to optimize the speedup. In this case, the parallel computation of the 19X5 _Ck_ matrix by our proposed MAC module would optimize the execution time. While the MAC module performs _Ckxk_, the Index Finder module simultaneously computes the open circuit index values and the β terms for the LUTs for analysis in Module 4. These index values are stored in the RAM in a dedicated address space for subsequent analysis. Not shown in Fig. 12 is the parallel addressing logic that updates the address as the MAC provides an output. Unlike our previously introduced MAC ??,?????? ?,??????? ??[4] + ??,?????? 2. Calculate the ratio of the average to the maximum solid surface concentration in the negative electrode. ?,?????? ⁄??,??? = ??,?????? ???? = ??,?????? ⁄??,??? = ??,?????? ??,???−1 (46) ?,?????? ??,???−1 3. Calculate the SOC using ????and precalculated _m_ and _b_ constants. ???= ?????100−?−?00 <sup>= ????????</sup> <sup>+ ????</sup> (47) FIGURE 11. Internal architecture for SOC computation. By combining the cell model constants and rearranging the terms of the SOC computations from [7], we manage to use the standard equation ( _y=mx+b_ ) to compute the values of the SOC in steps 1 and 3. By using this approach, we reduce the number of variables stored in the ROM, and replace the division with multiplication. The AXI-IP division function takes 20 clock cycles in hardware, while multiplication takes only 5 clock cycles. The internal architecture of the SOC module is depicted in Fig. 11. In this case, in loop 2 (L2), the necessary data are sent to the adders and multipliers from the on-chip memory. In loop 1 (L1), the SOC module checks the ??,?????? value to insure, whether this SOC module checks the ??,?????? value to insure, whether this value falls in bounds before it is written to memory. If ??,?????? < ??,???, SOC_store stores the minimum, else if ??,?????? < ??,???, SOC_store stores the minimum, else if ??,?????? - ??,???, SOC_store stores the maximum value; ?,?????? - ??,???, SOC_store stores the maximum value; FIGURE 12. Internal architecture for MAC computation. modules [8], the proposed MAC module in this paper does not use input buffers at each stage. Instead, as shown in Fig. 12, the “ready signals” from the preceding multiplier/adder sub-modules are used to drive the subsequent sub-modules. For the MAC module (in Fig. 12), the input _C_ matrix is partitioned into 19 vectors, and fed into the MAC module one vector at a time. The result of the MAC module is added to the corresponding _Dkuk_ term, in order to compute the output function _yk_ . Once ?? is calculated, the non-linear corrections (represented by ????,? = ??(??, ??)) can be calculated. In Table I, we list the important debiased variables from ?? used in the non-linear corrections. TABLE I <u>IMPORTANT DEBIASED VARIABLES</u> <u>Elements of</u> <u>????,?</u> <u>Description</u> ??[0]??? ??[3] Negative and positive Electrolyte <u>concentration variables</u> <u>??[6]</u> <u>Negative Potential in the electrolyte variable</u> ??[7]??? ??[9] Negative and positive Solid surface <u>concentration variables</u> <u>??[15]??? ??[17]</u> <u>Negative and positive Flux variables</u> 3) MODULE 4 FIGURE 13. Top level architecture for Module 4. Module 4 is used after Module 3, and is the starting point for Module 7. In both cases, Module 4 computes the non-linear corrections and the output voltage ( _yvolt,k_ ), which is step 3 and step 3.5 of Fig 2. As illustrated in Fig. 13, Module 4 is created with five sub-modules and various FP IPs. In this case, the non-linear corrections computation is iterative, thus is not a good candidate for parallelism. The first correction is the concentration in the electrolyte (??), at both ends of the terminal, which is represented by equations (51) and (52). ??,0 = ??[0] + 1 (51) ??,? = ??[3] + 1 (52) The aforementioned corrections comprise simple memory calls and additions (by a FP adder). The concentrations in the electrolyte results are inverted to calculate _1/ Ce,0_ and _1/ Ce,L_, and stored in the memory for subsequent analysis. Our FP divider takes 20 clock cycles to generate the first division result, thus other computations are performed during the division operation. Next, the solid surface concentration corrections are computed using equations (53) and (54). ??,0 = ??[7] + ??,??? (53) ??,? = ??[7] + ??,??? (54) Where ??,??? and ??,??? are functions of the maximum negative and positive SOC and maximum negative and positive ??, respectively. These are implemented using a Xilinx FP adder. However, all these variables are constant for this temperature range, hence are pre-calculated and placed in the ROM. The next two corrections, which are potential in the electrolyte and flux computations, are interleaved to avoid waiting for any long-lead time operations such as square root, division and natural logarithmic. The equation (55) below presents the computation of the total potential in the electrolyte (?̃?). In this case, _Tk_ is the current temperature, and ?????? is a precalculated value based on the Doyle parameters. We use Xilinx FP natural logarithmic IP to compute ?̃?. In this case, the ??,???, ??,???, ??,???, and ??,??? are precomputed constants stored in the ROM, and 1⁄?? is computed by the Check_T module (Fig. 8) in Module 2 and stored in the RAM. The internal architecture of the flux computation is shown in Fig. 15. Since there are different values for ??,???, ??,???, ??,???, and ??,???, we implement two different Taylor series to generate accurate _e_ <sup>_x_</sup> results. Both Taylor series are 6 <sup>th</sup> order, however, their coefficients differ. Both are executed in parallel to reduce the execution time. We also split the temperature range into six sections to further reduce the errors from the numerical approximation of _e_ <sup>_x_</sup> . After selecting the focal point, the constants of the Taylor series become the multiples of the base values. These base values (for the six temperature regions) are stored in the ?̃? = ??[6] + ???????? ln <u>???,??,0</u> (55) The internal architecture for the ?̃? computation is illustrated in Fig. 14. FIGURE 14. Internal architecture for ?̃? . The negative and positive flux values are used in the overpotential correction as follows: ?0,??? = √((??,???,??? −??,0)??,0∙??,0) ∙? ?0,??? = √((??,???,??? −??,?)??,?∙??,?) ∙? (−??,??? ~~∙~~ <sup><u>1</u></sup> ?? <sup>~~+~~</sup> <sup>??,???)</sup> (56) (−??,???∙ <sup><u>1</u></sup> ?? <sup>~~+~~</sup> <sup>??,???)</sup> (57) memory. Next, each of the expansion terms are computed using a selected base value. FIGURE 15. Internal architecture for Flux computation. In the flux computation (Fig. 15), the square-root, ?????, and ????? are computed in parallel to reduce the overall In the flux computation (Fig. 15), the square-root, ????? and ????? are computed in parallel to reduce the overall execution time. These results are sent through an inverter to generate inverse of _j0,pos_ and, _j0,neg_ and are stored in the memory for subsequent analysis. The over-potential correction (∆?) is obtained using the following equation (58) where 2?/? is stored as a constant in ROM. <u>?[17]</u> ?0,??? <sup>) − asinh</sup> <sup>~~(~~</sup> <u>??[15]</u> <u>??[15]</u> ?0,??? <sup>~~)~~</sup> <sup>)</sup> ∆?= ?? −?0 = <u>??2?</u> <u>2?</u> <u>??[17]</u> ∙(asinh ~~(~~ ? ?0,??? (58) The internal architecture for ∆? is illustrated in Fig. 16. FIGURE 16. Internal architecture for ∆? . To create the equation (58), we design our own IP for hyperbolic arcsine (asinh) utilizing the Chebyshev Approximation, since Xilinx IP is not available for this operation on the Virtex 7 series FPGA. As stated in [27], the Chebyshev Approximation spreads the error over the interval, allowing a single equation to be used for the entire temperature region. Furthermore, no division is required, resulting in more efficient design. We use the following 8 <sup>th</sup> order Chebyshev equation from [27] to approximate asinh: asinh(?) = −0.017123? <sup>7</sup> + 0.0629397944? <sup>5</sup> 0.16460894? <sup>3</sup> + 0.9999157047? (59) The 8 <sup>th</sup> order function results in a 0.00957% error versus the 0.19% error of the 6 <sup>th</sup> order function; and use only 3 more multiplications and one addition to compute the asinh function. This is deemed an acceptable tradeoff. The internal architecture for the Asinh is demonstrated in Fig. 17. FIGURE 17. Internal architecture for Asinh computation. The open circuit voltage (OCV) or open circuit potential (OCP) is the final linear-correction needed to compute _yvolt,k_ . The OCV and its derivative are non-linear functions, which are represented by two LUTs. The index computations are performed in Module 3 and stored in the memory. The ∆???? is computed using the interpolation presented in equation (60). This interpolation is organized in such a way to reduce the addressing needed for the memory calls, as well as to minimize the number of adders and multipliers used. ∆????= ?1(??????????[???] −??????????[???]) + ?0(??????????[???ℎ] −??????????[???ℎ]) (60) The same equation (60) with different LUTs is utilized to compute the derivative (∆?????), in order to determine the _C_ ~ in Module 5. Hence, the ∆???? module (Fig. 18) is reused to generate ∆???? and ∆????? in sequence. The internal architecture for the ∆???? module, which is reused for ∆?????, is illustrated in Fig. 18. FIGURE 18. Internal architecture for ∆???? and ∆????? . The second execution (i.e., ∆?????) is performed in parallel with the computation of _yvolt,k_ . Once the linearcorrection results are available, the output voltage ( _yvolt,k_ ) is computed using the equation (61), as follows: ?????,? = ?[17]??????,??? −?[15]??????,??? + ?̃? + ∆?− ??????????? + ∆???? (61) In this case, the parameters for resistance in the film and the terminal, ??????,???, ??????,???, and ?????????, are precomputed constants, stored in the ROM. In Module 4, the final step is to compute the error between the computed and measured voltage, known as the voltage residual, i.e., ???? = ?????,? −??, where ?? is the measured voltage. 4) MODULE 5 Module 5 computes the Kalman gain, the state measurement updates and the error covariance time/measurement updates, which are steps 4, 5 and 6 of Fig 2. The top-level architecture of Module 5 is illustrated in Fig. 19. FIGURE 19. Top level architecture for Module 5. The first step (in Module 5) is to create linearized matrices ?̂, and ?̂. We will also be using these linearized matrices for other modules in PB-MPC architecture, which dramatically reduce the number of computations in the PB-MPC algorithm. Since the state equation (i.e., ?̂ = ?, ?̂ = 1) is linear, the authors in [6], linearized the _C_ and _D_ matrices based on _yvolt,k_ values. ?̂ = ?̂1 + ?̂2 + ?̂3 + ?̂4 (62) ?̂ = ?̂1 + ?̂2 + ?̂3 + ?̂4 (63) In equations (62) and (63), for each part [?] represents the states 0 through 4. For instance, Part 1 is based on the film resistance, as follows: ?̂1[?] = ?[17][?]??????,??? −?[15][?]??????,??? (64) ?̂1 = ?[17]??????,??? −?[15]??????,??? (65) Part 2 is based on the potential in electrolyte (??), as follows: <u>1</u> ?̂2[?] = ?[6][?] + ???????? (?[3][?] ??,? <sup>−?[0][?]</sup> ??,01 <sup>~~)~~</sup> <sup>(66)</sup> Where the constants ????[?], ??⁄, ??????, ??????,???, and ??????,??? are all stored in ROM. As illustrated in Fig. 19, the Chat_Dhat module serves as the input module for Module 5. The internal architecture of the Chat_Dhat module is demonstrated in Fig. 20. FIGURE 20. Internal architecture for Chat_Dhat module. During the execution of Chat_Dhat module, all the associated memory ports are utilized. As a result, the SigmaX_time module (in Module 5), which computes the time update to the error covariance matrix, has to be executed directly after the execution of Chat_Dhat module. As in [28], multi-ported memories could be utilized to execute the Chat_Dhat and the SigmaX_time modules in parallel. The SigmaX_time module is designed to execute the following equation (72). ??,? = ???,?−1? <sup>?</sup> + ?? (72) The internal architecture of the SigmaX_time module is shown in Fig. 21. In this case, ?? is the uncertainty of the current sensor, and is a constant _5X5_ matrix stored in the ROM. Since the A matrix is a 5x5 diagonal matrix, each term in the ???,?−1? <sup>?</sup> is ?[?]??,?−1[?]? <sup>?</sup> [?], which can be rewritten as ?[?]?[?]??,?−1[?]. The zeros in the A matrix eliminates the accumulation portion of the matrix multiplication. Firstly, the most efficient computation (?[?]?[?]) is performed. In this case, the output_valid signal of the first multiplier (MULT1) is registered to provide a one clock cycle delay before forwarding it as the input_valid signal of the second multiplier (MULT2). The other input to the second multiplier (MULT2) is ??,?−1. Similarly, the output_ready signal of the second multiplier (MULT2) is registered and forwarded as the input_valid signal of the adder (ADD1). The output of the MULT2 and ??,?−1 are the inputs to the adder (ADD1). The results of the adder (ADD1) are stored in the memory for subsequent computations of Module 5. Next step is to compute the Kalman gain utilizing the Update_SigmaX module (in Module 5). The Kalman Gain matrix ( _L_ ) is computed using the following equation (73). <u>1</u> ?̂2 = ?[6] + ???????? (?[3] ??,? <sup>−?[0]</sup> ??,01 <sup>~~)~~</sup> (67) Part 3 is based on the overpotential, as follows: <u>1</u> ?0,??? <sup>−?[15][?]</sup> ?0,???1 <sup>)</sup> (68) ?̂3[?] = ?? <u>?</u> ? <sup>∙(?[17][?]</sup> <u>1</u> ?0,??? <sup>−?[15]</sup> ?0,???1 <sup>)</sup> (69) ?̂3 = ?? <u>?</u> ? <sup>∙(?[17]</sup> Part 4 is based on the derivative of the OCV, as follows: ?̂4[?] = ????[?] ∙∆????? (70) ?̂4 = 0 (71) ?= ??,??̂ <sup>?</sup> ?? (73) FIGURE 21. Internal architecture for SigmaX_time computation. Where ?? is the voltage error covariance, computed using equation (74). ?? = ?̂??,??̂ <sup>?</sup> + ?̂???̂ <sup>?</sup> (74) From equations (74), ?? is the error in voltage measurement. Since ?̂ is a vector, ??,??̂ <sup>?</sup> is computed first, stored in the memory, and then reused for ?, ??, and ??,?+1. Since ?? is a scalar, we can simplify the computation for the error covariance measurement update (??,?+1). The MAC module (in Module 5) is used to compute the ?̂??,?, and then the MAC result is loaded into a local register array (ChatSigX). Simultaneously, the MAC result is multiplied with an appropriate term from the Chat, and the result is forwarded to an adder to perform the final accumulation ?̂??,??̂ <sup>?</sup> . The internal architecture for voltage error covariance (??) is illustrated in Fig. 22. FIGURE 22. Internal architecture for voltage error covariance ( ?? ). Once the voltage error covariance (??) is computed, a FP divider is employed to compute the final division of the Kalman Gain (L), in equation (73), and the division result is forwarded to the Update_Xhat module with a ready signal. The final step of the Update_SigmaX module is to compute the measurement update of the error covariance matrix (??,?+1) as in equation (75). ??,?+1 = ??,? + ???? <sup>?</sup> (75) Considering that ?? is a scalar, and the ?= ??,??̂ <sup>?</sup> ⁄?? and ???? <sup>?</sup> reduces to (??,??̂ <sup>?</sup> )? <sup>?</sup> or ChatSigX∙? <sup>?</sup>, which in turn leads to a 5X5 matrix that requires only a single multiplier. The multiplier result is added to the ??,?, term by term, to get ??,?+1. The result of the adder is written to the on-chip memory, thus replacing the current ??,?−1 for the next iteration. The internal architecture for Update_SigmaX is demonstrated in Fig. 23. FIGURE 23. Internal architecture for Update_SigmaX. In Module 5, the state update (i.e., equation (76)) is obtained by the Update_Xhat module executed in parallel with the Update_SigmaX module. ??+1[?] = ??[?] + ?[?]???? (76) In this case, the Update_Xhat receives a start signal from Update_SigmaX once the divider inputs are valid. Next, Update_Xhat loads ???? into one input of the multiplier and then waits for the ready signal from Update_SigmaX to load ?[?] into the other input of the multiplier. The output of the multiplier is fed to an adder to add ??[?]. The adder result is sent to Store5 (in Fig. 23) to be written to memory. This FIGURE 24. Overall FSM for our five modules of PB-MPC. completes all the computations in Module 5. 5) MODULE 6 AND 7 For our proposed architecture, Module 6 is a reuse of Module 3, where the input is the measurement update of the state vector, and the output is an updated SOC and the updated output. Similarly, Module 7 is a reuse of Module 4, where the inputs are the outputs of Module 3 (i.e., Module 6 above), and the output is the final output voltage ( _yvolt,k_ ) and updated non-linear corrections. These final computations of Modules 6 and 7, completes the PB-EKF Stage 2. _C._ _STAGE 3: PB-MPC COMPUTATION_ In Stage 3, we execute the steps of the PB-MPC algorithm as follows: <u>Algorithm 1: Steps of Physics-Based MPC</u> 1. Compute the next state for the state vector, ????,?+1, based on the predicted state from PB EKF, ??+1. 2. Compute the augmented state vector for MPC, Δ?? 3. Build the output matrices, ?̂??? and ?̂???. 4. Build the gain matrices, ???? and Φ??? from equation (32). 5. Build the constraint matrices, M and ?. 6. Compute E and F from the cost optimization equations (38) and (39). 7. Compute the unconstrained solution, ∆? <sup>°</sup> . 8. Check the solution against the constraints ( M (∆u°) ≤ γ ). 9. → If the check passes, ∆Uk = ∆u°, then, jump to step 11. 10. → If the check fails, execute Hildreth QP to provide a constrained solution increment, ∆??. <u>11.</u> <u>Update the control signal, i∗gref</u> <u>= igref + ∆Uk[0].</u> For Stage 3, in order to execute the aforementioned PBMPC algorithm, we create an additional five hardware modules. In the following sub-sections, we briefly describe the PB-MPC algorithm with our corresponding modules, whereas a detailed description of the PB-MPC algorithm can be found in [7]. In order to facilitate this process, we also create an overarching FSM to control the flow of the data, as well as to provide unified access to the RAMs and ROMs of our design. As illustrated in Fig. 24, our FSM comprises 11 states to execute the final PB-MPC operations for the smart sensor. 1) MODULE 8 For our proposed architecture, Module 8 comprises three user-designed submodules (IPs): StartPhi_se, Xekf_state, and Phi_se_Store. These three submodules are designed in such a way to be executed in parallel. In this case, Module 8 composed of these three submodules executes the initial PBMPC setup steps 1 to 4 (in Algorithm 1). The top-level architecture of Module 8 is illustrated in Fig. 25. FIGURE 25. Top level architecture for Module 8. During the PHISE state (as in Fig. 24), in Module 8, the StartPhi_se submodule controls the read port A addresses of RAM1, RAM0 and ROM1, a FP adder (ADD1), and a FP multiplier (MULT1), as shown in Fig. 25. The Xekf_state submodule controls the port address of ROM1, ADD2, and MULT2. Finally, the Phi_se_Store submodule controls the port B read/write addresses of RAM1 and RAM0 and a read port A address of ROM0. Considering the on-chip RAMs are true dual port memories, for our proposed architecture, only the Phi_se_Store module has the “write access”, in order to reduce the possibilities of race conditions and/or contention issues. As mentioned in Section II.D, our PB-MPC approach incorporates integral action by using the augmented state vector from equation (22). In this research work, our specific creation of equation (22) is presented below (in equation (77)) using ?? to differentiate the MPC state variable from the EKF state variable, and replacing the generic ?? with the side-reaction overpotential (??−?). Δ?? = [ <sup>Δ????,?</sup> (77) ??−? <sup>]</sup> In order to calculate Δ?? (i.e., equation (77)), our system uses the current state provided by the PB-EKF and the _A_ matrix from the PB-EKF to calculate the next state as shown in equation (78). In this case, ∆?? is the difference between the current state and the next state (i.e., equation (79)) for all but the last element in the vector, which is ??−? . ????,?+1 = ?[?]??+1 + ?? (78) ∆????,?[?] = ????,?+1[?] −??+1[?] (79) In Module 8, the Xekf_state submodule is responsible for computing ∆? (i.e., equations (78) and (79)), Φ??? (equations (83) and (84)) and part of ? (equation (87)) The StartPhi_se submodule is responsible for computing ????,?+1, ??−?, ?̂???, ?̂???, ????, _M_ and the rest of ?. The Phi_se_Store submodule is responsible for writing critical outputs to memory. The block-level views of the StartPhi_se, Xekf_state, and Phi_se_Store submodules are illustrated in Fig. 25. To reduce the complexity of the multiplexers in Module 8, FIGURE 26. Internal architecture for computing ∆?? . and also to reduce the number of state switches due to memory port availability, Phi_se_Store submodule controls the memory reads for Xekf_state submodule. For instance, to compute step 1 and step 2 of the PB-MPC (in Algorithm 1), the StartPhi_se and Xekf_state submodules execute the state equation (80) using the state and state matrices provided by the PB-EKF. Fig. 26 illustrates the internal architecture for computing ∆??, i.e., for equations (78) and (79). ??+1 = ??? + ?Δ?? (80) For our hardware architecture, the computation in equation (80) reduces to a simple vector multiplication, (i.e., ????? ∗??), with ∆?? added to each result (where, _B_ is a vector of 1’s), as shown in equation (78). In this case, as illustrated in Fig. 26, the StartPhi_se submodule gets _A_ from RAM0 and _x_ from RAM1. Also, the RAM outputs are accessible to all three submodules; thus, the Xekf_state submodule can seamlessly forward the _A_ and _x_ values to MULT1, and then to ADD1. In our design (in Fig. 26), the addition (in ADD1 and ADD2) is automated by coupling the add_valid signal of the ADD1 to the mult_rdy signal of the MULT1, as well as the add_valid signal of ADD2 to the add_rdy signal of ADD1. In this case, the automated denotes that the addition is set independently of the current state in StartPhi_se or Xekf_state, which is done using a separate block in Verilog. For our design, a single clock cycle delay is added to the mult_rdy signal to enable the result of the multiplier (MULT1) to be loaded into the input register of the adder (ADD1). For our design, certain control mechanisms/signals are added, so that the coupled signals (e.g., add_valid and mult_rdy signals) and one-cycle delay signal are only active during the operations, such as calculating ∆??,and are grounded otherwise. Without these control mechanisms/signals in place, the one-cycle delay signal would be active throughout the whole system’s operation, due to the parallel nature of the hardware architectures. Also, since the one-cycle delay signal (denoted by 1 in green circle in Fig. 26) is physically attached to ADD1, whenever ADD1 is accessed by any of the submodules, this one-cycle delay signal would also be unnecessarily active, incurring a dynamic power penalty for each change in state between 1 and 0. Admittedly, this individual signal alone has a minute impact on the dynamic power; however, this setup is prevalent throughout the design, thus, the cumulative effect, unchecked, could become significant. It is indeed good design practice to ensure that signals are grounded when not in use [36]. In our design, adding the control mechanisms suppresses the switching action, which in turn connects the one-cycle delay signal to the ground, thus, could reduce the active/dynamic power requirement. In order to compute ∆?? (i.e., equation (77)), StartPhi_se submodule calls ?? from RAM1, and time it appropriately, in such a way that ?? is available when the output of ADD1 is ready, with add_rdy signal, as shown in Fig. 26. In this case, the output of ADD1 and the -?? (created by placing a 1 in the most significant digit) are fed to the input of the ADD2 to achieve the ∆?? terms for ∆??, in equation (77). The last term of ∆?? is ??−?, which is computed in parallel by the StartPhi_se submodule. The Phi_se_Store places the ??−? value in the memory address that corresponds to the last term of ∆??, which completes this computation. Since the PB-MPC system uses a control horizon of 1 and a prediction horizon of 2 [7], the computations for the Module 8 are fairly straight forward. For step 3 (in Algorithm 1), the StartPhi_se submodule computes the ?̂??? and ?̂??? as below. ?̂??? = ?[12][?] + ( <sup>????−</sup> ⁄?????− ) ?[8][????] (81) FIGURE 27. Parallel computation of ????∆? for ? . ?̂??? = ?[12] + ( <sup>????−</sup> ⁄?????− ) ?[8] (82) The gain matrices, Φ??? and ???? are computed using the following approach: Φ???[0] = ?̂??? (83) Φ???[1] = [?̂???|?̂???][ ?|1] <sup>?</sup> (84) Since _B_ is a vector of 1’s, this becomes the accumulated portion of the multiply-accumulate action. The ???? uses an augmented ?̂??? matrix, [?̂???| 1] as follows: ????,??? 0 = [?̂???| 1] (85) ????,??? 1 = [?̂???(????? + 1) <sup>?</sup> | 1] (86) The first row of ???? (i.e., equation (85)) is another accumulate function, while the order of operations for the second row of ???? (i.e., equation (86)) is to add 1 to each element of ????? and then multiply-accumulate (MAC) ?̂??? and the result together. The final terms of 1 in each row (i.e., in both equations (85) and (86)) are simply stored in the memory. Once ???? and Φ??? are computed, Module 8 can compute the constraint matrices, M and ?. From equation (87), only the first and last two terms of γ are computed. The last two terms of M are simply the two terms in the ϕ??? gain matrix. The remaining terms of M are constants determined by the operating conditions of the battery. For M, Σ = I = 1, which is stored in the ROM and can be changed in future designs. −Σ ???? −????,? −???? + ????,? ∆???? −∆???? [ ????∆?−0.14 ] (87) 2) MODULE 9 For our proposed PB-MPC architecture, Module 9 comprises two submodules: DNP submodule and P_inverse submodule. The top-level architecture for Module 9 is illustrated in Fig. 28. FIGURE 28. Top level architecture for Module 9. The DNP submodule is responsible for computing the ∆? <sup>°</sup> = −??⁄, which simplifies to the difference between the current and previous control signal amplitudes as in equation (88). ∆?= ∆????,?+1 = ?????,?+1 −?????,? (88) The DNP submodule computes _K_ and _P_ as shown below using equation (89). For our design, these _K_ and _P_ are utilized in the Hildreth Quadratic Programming (HQP) function as needed. ?= ?? <sup>−1</sup> ? <sup>?</sup> ??? ?= ?+ ?? <sup>−1</sup> ? (89) M = <sup>Σ</sup> −Σ Ι −Ι [ϕ Ι −Ι ϕ???] and ?= The first two terms of ? (in equation (87)) are simple addition/subtraction operations, whereas the final term is a MAC of ???? to ∆?. Working within the limitation of memory ports, the two terms of ????∆? are computed in parallel using the three submodules (StartPhi_se, Xekf_state, and Phi_se_Store). In this case, StartPhi_se submodule extracts/reads the ∆? terms and the first row of ????, equation (85) from the memory, while the Phi_se_Store submodule extracts/reads the second row of ????, equation (86) from the memory. Next, as illustrated in Fig. 27, the StartPhi_se submodule executes the MAC of row 0, ????[0]∆?[0], and the Xekf_state submodule executes the MAC of row 1, ????[1]∆?[1]. Our MAC module for this architecture (i.e., Module 8) is very similar to the MAC module in Fig. 12; however, Module 8 uses a counter with the length of ∆?, and in this case, the control mechanisms/signals to load the adder are based on the least significant bit (LSB) of the count value: 0 for even, 1 for odd. Similar to our other modules, the control signals/mechanisms are generated independently of the FSMs in Xekf_state and StartPhi_se, lowering the number of FSM states. The shortness of the vector length and the latency of the adder enable building the MAC using a single multiplier and single adder. We use handshaking protocol to ensure that three submodules operate in parallel. The next step is to compute the unconstrained solution. FIGURE 29. Computation of K, P and P <sup>-1</sup> . . Where M is from Module 8 and equation (87); and ?= 2?, and ?= −2?∆????,?+1 from [19]. In this case, a control horizon of Nc = 1 results in a scalar for E. The _P_ matrix (in equation (89)) becomes a set of simple multiplications that are continuously executed for the length of the vector. As shown in equation (89), the term ?? <sup>−1</sup> is computed first and stored in the memory. Then _P_ and _K_ can be executed in parallel (as shown in Fig. 29), since there are no dependencies between the two computations _P_ and _K_ . In this case, the inverse of _E_ is stored in memory, so that a floating-point (FP) multiplier can be used to compute the term ?? <sup>−1</sup>, instead of utilizing a FP divider, since the latter IP is more expensive both in terms of execution time and chip area. The _F_ simplifies to 2∆? when Nc=1. For our design, the HQP algorithm (i.e., Algorithm 2) uses the inverse of the terms on the diagonal of the _P_ matrix. The P_inverse submodule (in Fig. 29) executes in parallel with DNP submodule to compute the inverse of the diagonal elements as these elements are being generated. During this time, a FP divider takes 20 clock cycles to complete executing the inversion. The design executes the inverse, even though it may not be required, which in turn reduces the stall time of the HQP, should it be invoked. In this case, the P_inverse submodule sets up the division action, the Phi_se_Store submodule saves the first 4 values to the memory, while the HP_store, (which is part of the HQP shown in Fig.31) manages the final two values. The final two values are only stored, if HQP is activated. This would save the 20 clock cycles that would take to wait for the results of the divider, before moving to the next state. 3) MODULE 10 The compare function (?∆? <sup>°</sup> ≤?), is performed by Module 10. If we rearrange and substitute terms as shown in equation (90), it is evident that we can use the K computation to determine if the constraints meet the condition, ?∆? <sup>°</sup> ≤?. The architecture is based on the fact that if a K term is negative, the constraints fail and HQP is activated. ?∆? <sup>°</sup> ≤? ?(−? <sup>−1</sup> ?) ≤? 0 ≤?−?(−? <sup>−1</sup> ?) 0 ≤?+ ?(? <sup>−1</sup> ?) 0 ≤? (90) The top-level architecture for Module 10 is illustrated in Fig. 30. In this design, the address signals are registered at the abstraction-level of the overall FSM (in Fig. 24), and are not registered at the higher-level of abstraction. Registering the address signals at the abstraction-level of the overall FSM (in Fig. 24) results in a 2-cycle latency when reading data from the memory, if called from overall FSM and a three-cycle latency when called from a user IP such as DNP submodule. As a result, as in Fig. 24 and Fig. 30, the SET_D state sets the correct address; the CALL_D state waits a single clock cycle for the result to be on the RAM output; the LOAD_D state registers the RAM output into a temporary register; and the CHECK_D state uses the most significant bit (MSB) of the temporary register to determine if a constraint is violated. This in turn takes advantage of the hardware convention that 1 = true and 0 = false, and the IEEE floating point standards, where the MSB is used to indicate the sign of the value. In this case, if the MSB =1, the corresponding value is negative. FIGURE 30. Top level architecture for Module 10. The compare module (i.e., Module 10) processes all 6 terms of _K_ (i.e., equation (89)). Once the first negative value appears, the FSM transitions to Module 11 to execute the HQP. If there are no negative values, upon completion, the FSM transitions to Module 12 to perform the NEW_UK (as in Fig. 24). 4) MODULE 11 For our previous work on equivalent circuit model (ECM) based MPC, we introduced embedded hardware architecture for Hildreth’s Quadratic Programming (HQP) algorithm [8]. However, for this research work, we modify our previously proposed HQP [8] for ECM-based MPC, in order to cater to the PB-MPC smart sensor architecture, due to two main reasons. (1) Our previously introduced HQP for ECM-based MPC was designed and developed on the ML605 development board with Virtex-6 FPGA, and using the Xilinx ISE design tools. In this research work, our proposed hardware architectures, including the HQP for PB-MPC, are designed and developed on the VC707 development board with the Virtex-7 FPGA using the Xilinx Vivado design tools. As detailed in Section III.C, these FPGA development boards are not fully backward compatible, which in turn required modifications, including redesigning and upgrading all the interfaces to the AXI protocol. (2) Furthermore, the differences in memory structures between the HQP hardware design for ECM-based MPC and the HQP hardware design for PB-MPC made reusing the same HQP design impractical. Also, the HQP hardware design in the ECM-based MPC was designed to handle a much larger _P_ matrix, thus, would be more powerful than necessary for our current PB-MPC algorithm. For instance, in the ECM-based MPC hardware design [8] the _P_ matrix had 1024 terms, stored on its own RAM; whereas in our current PB-MPC hardware design the _P_ matrix has 36 terms and can fit in the available RAM. A summary of the HQP algorithm utilized for this research work is as follows [19]. Algorithm 2: Hildreth’s Quadratic Programming <u>Technique (HQP algorithm)</u> for loop = 0 to value Calculate λ ????????? ←? ?? = − <u>1</u> ?1?? <sup>∑</sup> ??=0???? (?? −????? + ∑??=0???? ????? ) ?? = max {0, ??} end Check convergence (calculate the Euclidean length of ????????? and ?) ?= −????−1 (92) As illustrated in Fig. 31, the HP_Store submodule stores the result of equation (92) in a temporary register. The temporary register exists at the abstraction level of the overall FSM (in Fig. 24). In this case, the overall FSM (Fig. 24) sends a control signal called “lambda_choice”, which is set as the MSB of this temporary register. Similar to the Compare module (i.e., Module 10 in Section IV.C.3), the HP_Store submodule uses the lambda_choice signal to determine if the element (??) is 0 or the result of equation (92), accordingly stores the appropriate value in memory, and then informs the Lambda_final submodule that the correct value is available. The Lambda_final submodule sets up the multiplier to square ??, and then waits for the next element. This continues until all the elements of ? are computed. FIGURE 32. Internal architecture for computation of w and lambda_choice. if ‖?‖⁄‖?????????‖ < reference then calculate ∆????? else repeat Calculate λ. Calculate ∆????? and update ∆??+1 ∆????? = ∑??=0????(∆????? + ?????) ∆??+1 = ∆?° −∆?????/? <u>end loop</u> ∆????? = ∑??=0????(∆????? + ?? The top-level architecture for Module 11 for HQP algorithm is illustrated in Fig. 31. FIGURE 31. Top-level architecture of Module 11 - HQP. Upon entering the HP state (as shown in Fig. 24), the Module 11 starts the HQP submodules. Our proposed HQP hardware architecture has four associated main submodules that are executed in parallel. The HP_Store submodule manages all the memory writes for the HQP Module 11. The HP_Lambda submodule (in Fig. 32) manages the computation of the ? elements from the HQP algorithm (i.e., Algorithm 2). In this case, _P_ is a diagonal matrix and the second term (i.e., ∑??=0???? ????? ) is 0 resulting in following equation (91). ?= ?? −????? (91) The third submodule, Lambda_final (in Fig. 32), operates in parallel with HP_Lambda and executes the rest of the ? element computations using equation (92). The fourth submodule, HP_Length (in Fig. 33), is responsible for computing the Euclidean Norm of λ for the current state, by summing the squares from the Lambda_Final submodule, and then taking the square root of the result. The Lambda_Final submodule is also responsible for inverting the norm from the previous state, so that the ratio of ‖?????????‖?‖ ‖ <sup>can be assessed for convergence. For our</sup> proposed architecture, the convergence occurs when the following criteria is satisfied: 0.9999 ≤ ‖?????????‖?‖ ‖ <sup>≤1.0001</sup> (93) As in equation (93), the divisor is the norm of the previous λ, which is 0 for the first iteration; hence, in our hardware architecture, a control logic is in place to indicate when the first loop occurs, in order to avoid any division by zero operations. Alternatively, the ratio (in equation (93)) could be reversed, which in turn would also prevent division by zero operations. However, the latter option would not save any iteration cycles, since the ratio will be zero for the first iteration, thus would not meet the criteria in equation (93). In this case, the HP_length submodule (as shown in Fig. 34) sets the “converged” signal high if the ratio meets the criteria in equation (93). This “converged” signal is forwarded to all the four main HQP submodules (i.e., HP_Store, HP_Lambda, Lambda_final, and HP_Length) to stop the operation and clear the necessary states, as well as to the overall FSM (Fig. 24). While the HP_length submodule is summing the ?2? terms for the norm, this submodule also computes the correction ‖?‖ ‖?????????‖?‖ ‖ <sup>can be assessed for convergence. For our</sup> FIGURE 33. Internal architecture for computation of convergence ratio and ∆????? . factor for updating the control signal. Similar to the HQP hardware design for ECM-based MPC, for PB-MPC also, this value is computed in each iteration, and discarded if the iteration does not converge. Upon completion of the HP_length computation (‖?‖), the state changes from HP state to HP_LOOP state at the abstraction-level of the overall FSM, as illustrated in Fig. 24. At HP_LOOP state (in Fig. 24), the overall FSM evaluates if the “converged” signal is high or if the maximum number of iterations has been reached. If neither of these conditions are satisfied, (i.e., not true), the counter is incremented, and the overall FSM transitions back to the HP state. If any one of these conditions are satisfied (i.e., true), the overall FSM transitions to NEW_UK and sets a “New_DU” signal high to indicate that the correction factor is necessary. FIGURE 34. Determining Convergence. 5) MODULE 12 For our proposed architecture, Module 12 (as depicted in Fig. 35) is the final computing module for the PB-MPC. As illustrated in Fig. 3 (in Section III.C), the cell current is composed of ??????? + ??. In this case, the ??????? is controlled by the higher-level energy management system, and is not subject to the smart sensor, leaving limiting ??via ????? as the only signal option available to the MPC. Then, Module 12 is responsible for updating the control signal (??), where ?? represents ?????. If the control on the current, (i.e., ?????), developed by the smart sensor is insufficient to prevent the degradation of the battery cells, then the system takes action to reduce ?? to zero, so that ????? is limited to ???????. As in Fig. 35, Module 12 evaluates the control signal “New_DU” to determine if the FSM executes the states that add the correction factor to ∆?° or if those states are bypassed. Moduel 12 then adds ∆?° to ??−1 to update the control signal, New_DU. If New_DU = 0, the new control signal is equal to the original input (?????); else, the new control signal is equal to ????? plus the correction factor. A final set of comparisons is made to ensure the new control signal is sufficiently limited based on the minimum and maximum allowed ???????. The control signal prior to this last compare is the one stored in memory to act as ??−1, while the output of the comparisons becomes ??∗???. Upon completion of Module 12, the control signal is sent to the top module (i.e., the highest abstractionlevel of our architecture) of our proposed architecture, indicating that the overall FSM (Fig. 24) is completed. The top-level architecture for Module 12 for Control Update is illustrated in Fig. 35. FIGURE 35. Top level architecture for Module 12. _D._ _STAGE 4: TEMPERATURE UPDATE_ 1) MODULE 13 Stage 4 comprising Module 13 consists of a short FSM that loads the measured temperature of the battery into RAM to be utilized in the next iteration. Theoretically, the embedded microprocessor, in our case, MicroBlaze soft processor, that interfaces with our proposed hardware accelerator, would measure the temperature and provide the value via the AXILite protocol. Module 13 also allows the MicroBlaze processor to access the four memories as needed. When creating our proposed hardware architectures, these memory access would be set to the control signal ??∗???, and the SOC. However, for evaluation and troubleshooting purposes, it is useful to be able to access the intermediate values stored by the hardware architectures. When the MicroBlaze processor completes accessing the memory, the processor asserts the “end_test” signal, i.e., sets this signal high. When that occurs, Stage 4 (comprising Module 13) transitions to the idle state in the top module (i.e., the highest abstraction-level of our architecture) of our proposed architecture, and waits for the next start signal for Stage 2, indicating another control interval has begun. V. EXPERIMENTAL RESULTS AND ANALYSIS We perform experiments to evaluate the feasibility and efficiency of our proposed FPGA-based embedded hardware architecture/accelerator for the PB-MPC (comprising PBEKF) smart sensor to support the battery management system using the model predictive control (MPC) for physics-based electro-chemical battery model. We also compare our proposed FPGA-based embedded hardware architecture with the baseline Matlab model [7] for the PB-MPC in order to evaluate and validate the correctness and functionalities of our proposed design. Furthermore, we utilize our previously introduced embedded software architecture for PB-MPC [19] to evaluate our embedded hardware architecture proposed in this research work. It should be noted that the evaluation setups for our embedded hardware and embedded software architectures are based on real implementations, whereas the evaluation setup for the baseline Matlab model is based on simulation. Our embedded hardware and embedded software results are obtained in real-time, while these designs are actually running on the Virtex-7 FPGA; whereas the baseline Matlab results are obtained through simulation on a desktop computer. Prior to our embedded hardware and embedded software architectures, we also create software designs for PBMPC (comprising PB-EKF) in C, which is executed on desktop computers. These desktop C results are also compared and verified with the baseline Matlab results as well as with our embedded hardware and embedded software results. As detailed in Section III.A, our experiments are performed using an Urban Dynamometer Driving Schedule (UDDS) [23] current profile for the input ( _uk_ ) and the measured output ( _vk_ ). Our proposed hardware architecture for PB-MPC (comprising PB-EKF) is initialized using a state of charge (SOC) of 0.6 and an initial state covariance of diagonal matrix [1E5, 1E5, 1E7, 1E7, 5E9], similar to the baseline model in [7]. The time-step or measurement interval for our experiments is 1 second, which is based on the slow dynamics of the lithium diffusion process in the battery cells [20]. Our proposed PB-MPC smart sensor is created in such a way to support the normal driving of HEVs with the charging and discharging based on the UDDS driving profile [7]. _A._ _FUNCTIONAL VERIFICATION COMPARISON: OUR_ _EMBEDDED HARDWARE VS. BASELINE MATLAB_ It is important to ensure that our proposed embedded hardware architecture for PB-MPC, comprising PB-EKF, operates correctly. To facilitate this endeavor, we compare our embedded architectures with the baseline Matlab model, considering the baseline Matlab model as “truth”. FIGURE 36. Comparison for control current igref*: our embedded hardware vs. baseline Matlab. FIGURE 37. Control current difference/error: our proposed embedded hardware vs. baseline Matlab. Firstly, we examine the performance of our embedded hardware (emHW) smart sensor for the ??∗??? control signal. hardware (emHW) smart sensor for the ??∗??? control signal. Fig. 36 demonstrates the comparison for the control current (??∗???) for our proposed embedded hardware versus the (??∗???) for our proposed embedded hardware versus the baseline Matlab, which at a glance looks overlapping with each other. In Fig. 37, we present the ??∗??? error as the each other. In Fig. 37, we present the ??∗??? error as the difference between the Matlab performance and the embedded hardware performance. As illustrated in Fig. 37, the maximum error occurs in the first 16 cycles and is 1.25mA, resulting in a maximum percentage of error 0.018%, which is negligible. In this case, the mean error is 2.62μA, and the standard deviation is 59.1μA. Secondly, we examine the performance of our embedded hardware (emHW) for the state of charge (SOC). Fig. 38 depicts the comparison for the SOC for our proposed embedded hardware versus the baseline Matlab, while Fig. 39 shows the SOC error difference between Matlab and embedded hardware performance. As in Fig. 38, our embedded hardware predicts the SOC values almost as well as the Matlab model. In this case, the maximum error is 2.24E-7 with a mean error of 4.12E-9 and standard deviation of 6.67E-8, which are very minute values, thus negligible. FIGURE 38. Comparison for SOC output: our embedded hardware vs. baseline Matlab. FIGURE 39. Our embedded hardware architecture error for SOC. Thirdly, we compare the side-reaction overpotential ( _φs-e_ ), the key variable to prevent aging and performance degradation. Fig. 40 demonstrates the performance comparison for the side-reaction overpotential ( _φs-e_ ) for our embedded hardware versus the the baseline Matlab, again at a glance looks overlap with each other. Fig. 41 illustrates the _φs-e_ error difference between Matlab and embedded hardware performance. As illustrated in Fig. 41, the error seems fairly consistent across the test interval and is most likely due to the use of single-precision FPUs in embedded hardware versus double-precision FPUs in baseline Matlab. Our results support this with a mean error of -6.53E-9 and a standard deviation of 3.35E-8, which again are very minute values, thus negligible. FIGURE 40. Comparison for side-reaction overpotential: our embedded hardware vs. baseline Matlab. FIGURE 41. our embedded hardware architecture error for _φs-e_ . In summary, from the aforementioned results and analysis, we can conclude that our proposed embedded hardware architecture for PB-MPC (comprising PB-EKF) shows similar behaviors and functionalities as that of the baseline Matlab model, thus verifying the correctness and functionality of our proposed embedded hardware designs. These analyses show that the error difference values for all three functionalities are very minute, thus negligible. _B._ _PERFORMANCE ANALYSIS: EXECUTION TIME,_ _SPEEDUP, AND RESOURCE UTILIZATION_ We perform experiments to evaluate the feasibility and efficiency of our proposed embedded hardware architectures in terms of speed-performance and resource utilization on the chip. 1) EXECUTION TIME AND SPEEDUP: EMBEDDED HARDWARE VS. EMBEDDED SOFTWARE, BASELINE MATLAB To evaluate the execution time and speedup of PB-MPC smart sensor, we compare the execution time of our proposed embedded hardware architecture with our embedded software design in [19], as well as the baseline Matlab mode. However, unlike the average execution time comparison in [19], in this research work, we compare the worst-case execution time as presented in Table II. In this case, similar to our previously proposed ECM-based MPC designs [8], the total worst-case time to execute an iteration of the PB-MPC smart sensor (comprising PB-EKF) occurs when the HQP algorithm is activated, as the initial process fails to converge. The HQP algorithm, which solves the optimization of the cost function, is currently the largest bottleneck of our proposed design. This is mainly because HQP is a purely serial process that iterates until the conditions are met for an optimal solution or 500 iterations for a suboptimal solution. While we could use fewer iterations, it results in HQP being called more often. It is indeed a tradeoff that will be examined as future work. For our experiments, the worstcase execution time is mainly used to ensure there are enough resources to compute any situation. The worst-case time is also crucial to determine how many individual battery cells can safely be monitored and controlled by our proposed design on a single chip/FPGA. The total worst-case execution times for our proposed embedded PB-MPC hardware architecture as well as for our previously proposed embedded PB-MPC software architecture [19] are presented in Table II. The total worstcase execution times for the baseline Matlab model is also presented in Table II. The execution time for each design is measured 10 times and the average is presented. In this case, our embedded hardware is executed on the Virtex-7 FPGA running at 100MHz, whereas our embedded software is executed on the MicroBlaze soft processor running at 100MHz on the same FPGA, for fair comparison purpose. Also, Matlab software model is executed on the Intel Xeon processor running at 3.1GHz. As illustrated in Table II, considering the total worst-case execution time, our embedded PB-MPC hardware smart sensor is almost 58 times faster than its equivalent embedded software, and is almost 5 times faster than the baseline Matlab model. TABLE II EXECUTION TIME AND SPEEDUP: EMBEDDED HARDWARE VS. EMBEDDED our proposed embedded PB-MPC hardware smart sensor deployed on a single chip/FPGA would be able to monitor and control multiple battery cells, individually, in BMS. These speedup results also indicate that FPGAs could accommodate more computationally intense versions/configurations of the physics-based model (PBM), and still perform within the required timeframe. It should be noted that this total worst-case execution time is due to the 500 iterations required for HQP computation. Hence, this is an area for further investigation to determine, when the best return-on-investment is, in terms of performance improvement versus the number of HQP iterations. Our proposed embedded hardware architecture for the PB-MPC smart sensor without the HQP activation executes in 20.8μs, leaving a large margin for performance improvement. Another opportunity for performance improvement would be to condense the iteration time of the HQP using faster IP cores. These hardware optimizations and performance improvements will be explored as future work. 2) FPGA RESOURCE UTILIZATION FOR OUR EMBEDDED HARDWARE The cost analysis on space (or area) is carried out to examine the area-efficiency of our proposed embedded hardware architecture for PB-MPC smart sensor (comprising the PBEKF). The FPGA resource utilization for our proposed embedded hardware architecture presented in Table III, includes the overall system-level design (based on Fig. 2). This cost analysis is similar to the space analysis for our previously proposed embedded PB-EKF hardware [18]. In this case, significant resource utilization parameters are the occupied slices, BRAMs, and DSPs, whereas the occupied slices contain the slice registers and LUTs. As in Table III (row 2), the total number of occupied slices, total number of BRAMs, and total number of DSP slices required for embedded hardware (HW) architecture for PB-MPC smart sensor (comprising PB-EKF), are 7825, 42, and 117, respectively. As demonstrated in [8],[18], most of the areaefficient embedded hardware architectures with the systemlevel designs, typically occupy similar or more area on chip. TABLE III <u>FPGA</u> <u>RESOURCE UTILIZATION</u> <u>SOFTWARE, AND BASELINE MATLAB</u> Configuration Worst-case Speedup execution over time (in ms) embedded Configuration Worst-case Speedup Speedup execution over over time (in ms) embedded Matlab <u>software</u> <u>software</u> Embedded software 68.213 -<u>architecture (100MHz)</u> Speedup over embedded <u>software</u> No. of occupi ed <u>Slices</u> Slice Register s LUTs No. of BRAMS RAMB36 <u>E1</u> No. of DSP4 8E1 68.213 - Embedded hardware <u>architecture (100MHz)</u> Baseline Matlab model <u>(3.10 GHz)</u> 1.180 57.96 4.93 5.820 - Configuration Embedded HW for PB-MPC smart sensor (on VC707 board with Virtex-7 <u>FPGA)</u> Embedded HW for PB-EKF (on ML605 board with Virtex-6 <u>FPGA)</u> 7825 23004 21930 42 117 10702 19501 32169 40 49 From these results and analysis, it is evident that utilizing FPGA-based hardware to support and accelerate computationally complex algorithms, such as PB-MPC (comprising PB-EKF), we can achieve substantial speedup compared to its software counterparts. With these speedups, In Table III (row 3), we also present the FPGA resource utilization for our previously proposed PB-EKF in [18]. We anticipate that our proposed embedded PB-MPC hardware architecture would occupy more slices on the chip, compared to our PB-EKF [18], since the former comprises the latter. However, as demonstrated in Table III, our proposed PBMPC occupies less slices on chip compared to previous PBEKF, i.e., 7825 slices versus 10702 slices, respectively. This reduction in occupied slices, which led to the improvement of area-efficiency, is mainly due to several scenarios. One would be due to the continuous improvement of the internal hardware architectures, while creating the PB-MPC and integrating the PB-EKF. Another would be due to the Xilinx Vivado design tools utilized in this research work, which is more advanced and recent design tools compared to the Xilinx ISE design tools utilized for our previous work [18]. It can be inferred, since the Vivado and ISE are not truly compatible, that Xilinx has implemented quite a few improvements to their syntheses and implementation algorithms for hardware placement and routing in advanced Vivado design tools. Another would be due to migrating to a more advanced Virtex-7 FPGA (on VC707 board) from Virtex-6 FPGA (on ML605 board). As detailed in Section III.C, since these FPGAs are not fully backward compatible, we dramatically modify our previous PB-EKF hardware, which led to an increase in clock frequency from 50MHz to 100MHz. One of these modifications include replacing all the native Xilinx IP cores supported by Virtex-6 FPGA and Xilinx ISE development environment, with the AXI IP cores supported by Virtex-7 FPGA and the Xilinx Vivado development environment, which may have reduced the interconnect resource requirements. In this research work, the adaptation of the AXI Xilinx IP cores and the additional optimization for latency would be responsible for the increase in number of DSP48E1 slices from 49 to 117, and partly responsible for the reduction in number of LUTs. The DSP48E1 slice is a custom logic arrangement, separate from the slice registers and the LUTs, that is optimized to support digital signal processing and arithmetic functions. With the modified version of PB-EKF architecture as well as the overall PB-MPC architecture, we optimize the IP cores for low latency in order to ensure proper timing closure for the overall design. This in turn results in a core generation that uses the maximum possible number of DSP48E1 slices for that specific core. Furthermore, Stage 2 for PB-MPC hardware architecture also incorporates 9 additional floating-point IP cores into the overall design, increasing the number of DSP48E1 slices. The timing closure consideration enables our proposed PBMPC architecture to achieve an operating clock frequency of 100MHz, as opposed to our previous PB-EKF [18] operating at 50MHz. In case of timing closure failure, the seamless solution is to slower the clock speed to allow more time for signals to adhere to all the timing requirements. In Table IV, we present the percentage of FPGA resource utilization for our proposed PB-MPC executed on VC707 board with Virtex-7 FPGA (in row 2) [38] and for our previous PB-EKF executed on ML605 board with Virtex-6 FPGA (in row 3) [39]. In this case, the percentages are reported only for significant utilization parameters, i.e., occupied slices, BRAMs, and DSPs. As in Table IV (row 2), the percentage of occupied slices, percentage of BRAMs, and percentage of DSP slices, for our proposed PB-MPC (comprising PB-EKF) smart sensor, are only 10.3%, 4.1%, and 4.2%, respectively. In this research work, although we employ VC707 board with Virtex-7 FPGA as a prototyping platform, these percentages demonstrate that there is significant amount of unoccupied area on chip that can be utilized for other control systems techniques, if need be. TABLE IV <u>PERCENTAGE OF RESOURCE UTILIZATION</u> % of no. of DSP48E1 4.18% (117/2800) 6.38% <u>(49/768)</u> % of no. of Configuration occupied Slices Embedded HW for PBMPC smart sensor (on VC707 board with <u>Virtex-7 FPGA)</u> Embedded HW for PBEKF (on ML605 board with Virtex-6 FPGA) 10.31% (7825/75900) 28.40% <u>(10702/37680)</u> % of no. of BRAMS <u>RAMB36E1</u> 4.08% (42/1030) 9.62% <u>(40/416)</u> _C._ _COMPARISON WITH RELATED WORK: PB-MPC AND_ _PB-EKF_ We investigated the existing works on FPGA-based and/or embedded hardware architectures for ECM-based MPC smart sensors as well as PB-MPC smart sensors, each comprising EKF. From our extensive investigation and to the best of our knowledge, similar work does not exist in the published literature that provides FPGA-based and/or embedded hardware accelerator for MPC (comprising EKF) specifically for physics-based battery cell models. Focusing on the MPC, very few research work has been done for embedded architectures of PB-MPC, to this point. Although not embedded architectures, the most promising works were done by [6],[29], for ECM-based MPC and by [7],[9] for PBM-based MPC, all of which were based on Matlab software models. In [7] and [29], the authors create Matlab designs to prove the efficacy of their models and the MPC algorithm approaches. The design decisions made in [7] and [29] to reduce the complexity make these Matlab models excellent candidates for successful embedded hardware as well as embedded software architectures. Considering the EKF, most of the existing embedded EKF architectures were designed for the equivalent circuit model (ECM). We found two existing research works [30],[31] that performed experiments, similar to ours, to obtain speed and space. In [30], a dual EKF was designed using the ECM for the battery cell; this was implemented on Altera FPGAs without the system-level architecture. Another ECM-based EKF [31] was designed to estimate the state of charge (SOC) using fixed-point arithmetic, which was implemented on Altera Cyclone II FPGA. Since these existing works were created for different EKF algorithms and were implemented on different development platforms, it is challenging to make a fair comparison in terms of space and speed. VI. CONCLUSION AND FUTURE WORK In this paper, we introduced a novel, unique, efficient, and functional embedded hardware architecture for the PB-MPC smart sensor (comprising PB-EKF) for lithium-ion battery cell control, by considering the computational complexity of PBM. Our proposed embedded hardware architecture for the PB-MPC performed well within the required 1second update intervals of the battery management system (BMS), while running at only 100MHz. Considering the worst-case execution times, our embedded PB-MPC hardware accelerator (running at 100MHz) was almost 58 times faster than the equivalent embedded software, running on the same FPGA, while maintaining a small footprint required for portable systems. Our proposed hardware was almost 5 times faster than the baseline Matlab software model (running at 3.1 GHz) on desktop computer. From our results and analysis, it is evident that utilizing FPGA-based hardware to support and accelerate computationally complex PB-MPC (comprising PB-EKF), we can achieve substantial speedup compared to its software counterparts. With these speedups, our proposed embedded PB-MPC hardware smart sensor deployed on a single chip/FPGA would be able to monitor and control multiple battery cells, individually, in BMS, compared to that of embedded microprocessors. Considering a typical battery pack made up of 84 cells, our embedded hardware on a single chip could easily execute the PB-MPC algorithm for all the 84 cells with the required 1s update intervals, since the worst-case execution time is only 1.2 milliseconds. These speedup results also indicate that FPGAs could accommodate more computationally intense versions/configurations of the physics-based model (PBM), and still perform within the required timeframe. The use of the MPC as a smart sensor is a logical step forward in battery control and management for many hybrid electric vehicles (HEVs). Our results illustrate that the increase in FPGA resource utilization is minimal from our previous PB-EKF [18] to our current PB-MPC smart sensor (comprising PB-EKF). This research work also demonstrates the feasibility of deploying/realizing computationally intense methods, such as PB-MPC comprising PB-EKF, normally reserved for industrial control, on resource-constrained portable and embedded systems. From our investigation on the existing works and to the best of our knowledge, no similar work exists in the published literature that provides a full and functional embedded hardware architecture for a PB-MPC smart sensor (comprising PB-EKF) specifically for battery cell control and monitoring, highlighting the uniqueness of our contribution. Utilization of physics-based model (PBM) enables closer observation as well as tracking and controlling of the chemical aging mechanisms in lithium-ion batteries, which could otherwise be disregarded when utilizing equivalentcircuit model (ECM). The ability to monitor the aging mechanisms facilitates the accurate settings of the safety margins, which in turn would enhance the performance and extend the useful life of the battery. Our proposed FPGAbased embedded hardware accelerator was designed in such a way to reuse the linearized output matrices by the PBMPC, thus making it more area-efficient. Our proposed PB MPC coupled with the physics-based observer (i.e., PBEKF) can be used as a smart sensor for a larger BMS, reducing the computational complexity of the overall PBMPC algorithm and minimizing the dependency of a central controller. As future work, we are planning to study and integrate dynamic reconfiguration techniques [32],[33] to create dynamic reconfigurable hardware architectures (similar to [34]) to further enhance various traits, especially adaptability traits, of our proposed PB-MPC smart sensor. Also, as future work, we will explore and create parallel processing architectures, such as [35], for our PB-MPC hardware accelerator to further improve the speedup, while considering the speed-space tradeoffs of the resourceconstrained embedded devices. To facilitate this endeavor, we will incorporate multi-ported memory designs, such as [28], to potential parallel processing hardware architecture, which would substantially elevate the performance. ACKNOWLEDGMENT The authors would like to thank Dr. Scott Trimboli, Associate Professor, in the Electrical and Computer Engineering Department at the University of Colorado Colorado Springs, for providing access to the baseline Matlab model. REFERENCES [1] A. Foley, B.M. Smyth, T. Pukšec, N. Markovska, and N. Duić, “A review of developments in technologies and research that have had a direct measurable impact on sustainability considering the Paris agreement on climate change”, Renewable and Sustainable Energy Reviews, Elsevier Journal, Vol. 68, No. 2, pp. 835-839, February 2017. [2] Y. Qin, X. Tang, T. Jia, Z. Duan, J. Zhang, Y. Li, and L. Zheng, “Noise and vibration suppression in hybrid electric vehicles: State of the art and challenges”, Renewable and Sustainable Energy Reviews, Elsevier Journal, Vol. 124, 109782, 2020. [3] Alternative Fuels Data Center, “Electric Vehicle Benefits and Considerations”, US Department of Energy, <u>[https://afdc.energy.gov/fuels/electricity_benefits.html, access on 11](https://afdc.energy.gov/fuels/electricity_benefits.html)</u> <sup>th</sup> June 2023. [4] K.D. Stetzel, L.L. Aldrich, M.S. Trimboli and G.L. Plett, "Electrochemical state and internal variables estimation using a reduced-order physics-based model of a lithium-ion cell an an extended Kalman filter," _Journal of Power Sources,_ vol. 278, pp. 490505, 2015. [5] G.L. Plett, Battery Management Systems, Volume I: Battery Modeling, Norwood, MA: Artech House, 2015. [6] M.A. Xavier and M.S. Trimboli, "Lithium-ion battery cell-level control using constrained model predictive control and equivalent circuit models," _Journal of Power Sources,_ vol. 285, pp. 374-384, 2015. [7] G. Florentino, _Model Predictive Control Implementations for_ _Management of Lithium-ion Batter Cells and Packs using Reduced-_ _Order Electrochemical Models,_ Colorado Springs: University of Colorado Colorado Springs, 2017. [8] A.K. Madsen and D.G. Perera, "Efficient Embedded Architectures for Model Predictive Controller for Battery Cell Management in Electric Vehicles", EURASIP Journal on Embedded Systems, SpringerOpen, vol. 2018, article no. 2, 36-page manuscript, 16th July 2018. [9] G. Florentino and M. S. Trimboli, "Lithium-ion Battery Management Using Physics-based model Predictive Control and DC-DC converter", in _IEEE Transportation Electrification Conference and_ _Expo (ITEC)_, Long Beach, 2018. [10] X. Tian, B. Jeppesen, T. Ikushima, F. Baronti and R. Morello, "Accelerating state-of-charge estimation in FPGA-based Battery Management Systems," in proceedings of 6 <sup>th</sup> Hybrid and Electric Vehicles Conference (HEVC’16), pp. 1-6, 2016. [11] H. Dai, X. Wei and Z. Sun, "State and Parameter Estimation of a HEV Li-ion Battery Pack Using Adaptive Kalman Filter with a New SOCOCV Concept," in proceedings of International Conference on Measuring Technology and Mechatronics Automation, 2009. [12] K. Man, T. Ting, T. Krilavičius, K. Wan, C. Chen, J. Chang and S. Poon, "Towards a hybrid approach to SoC estimation for a smart Battery Management System (BMS) and battery supported CyberPhysical Systems (CPS)," in proceedings of 2 <sup>nd</sup> Baltic Congress on Future Internet Communications (BCFIC’12), 2012. [13] J. Zambreno and A. Mills, "Estimating state of charge and state of health of rechargable batteries on a per-cell basis," in proceedings of Workshop on Modeling and Simulation of Cyber-Physical Energy System, 2015. [14] G. L. Plett, "Extended Kalman filtering for battery management systems of LiPb-based HEV battery packs Par 3. State and parameter estimation," Journal of Power Sources, vol. 134, pp. 277-292, 2004. [15] A. Smiley and G.L. Plett, "An adaptive physics-based reduced-order model of an aged lithium-ion cell, selected using an interacting multiple-model kalman filter," _Journal of Enery Storage,_ vol. 2018, pp. 120-134, 2018. [16] M. Rhudy, R.A. Salguero and K. Holappa, "A Kalman Filtering Tutorial for Undergraduate Students," International Journal of Computer Science & Engineering Survey, vol. 08, pp. 1-18, 2017. [17] D.G. Perera and K.F. Li, "Analysis of Single-Chip Hardware Support for Mobile and Embedded Applications", in Proceedings of IEEE Pacific Rim International Conference on Communication, Computers, and Signal Processing, (PacRim'13), pp. 369-376, August 2013. [18] A.K. Madsen, M.S. Trimboli and D.G. Perera, "An Optimized FPGA Based Hardware Accelerator for Physics-Based EKF for Battery Cell Management", in Proceedings of the IEEE International Symposium on Circuits and Systems, (ISCAS'20), 5-page manuscript, Seville, Spain, May 2020. [19] A.K. Madsen and D.G. Perera, "Composing Optimized Embedded Software Architectures for Physics-Based EKF-MPC Smart Sensor for Li-Ion Battery Cell Management", Sensors, MDPI open access journal, Intelligent Sensors Section, 21-page manuscript, vol. 22, no. 17, 26th August 2022. [20] M. A. Xavier, "Lithuim-ion battery cell management: a model preditve control approach, University of Colorado Colorado Springs Department of Electrical and Computer Engineering," UCCS, Colorado Springs, 2013. [21] Xililnx Inc, “VC707 Evaluation Board for the Virtex-7 FPGA”, User Guide, UG885 (v1.8) 2019. [22] Xilinx Inc., “Floating-Point Operator v7.1”, LogiCORE IP Product Guide, Vivado Design Suite PG060, December 16, 2020, <u>[https://docs.xilinx.com/v/u/en-US/pg060-floating-point](https://docs.xilinx.com/v/u/en-US/pg060-floating-point)</u> [23] Environmental Protection Agency, "Vehicle and Fuel Emissions Testing Dynanometer Drive Schedules," EPA Web Archive, 2017. [Online]. Available: https://www.epa.gov/vehicle-and-fuelemissions-testing/dynamometer-drive-schedules. [Accessed 2023]. [24] Xilinx, AXI Reference User Guide (UG 761) v13.1, www.Xilinx.com, 2011. [25] Xilinx Inc., “AXI Timer v2.0”, LogiCORE IP Product Guide, Vivado [Design Suite PG079, October 5, 2016, https://docs.xilinx.com/v/u/en-](https://docs.xilinx.com/v/u/en-US/pg079-axi-timer) <u>[US/pg079-axi-timer](https://docs.xilinx.com/v/u/en-US/pg079-axi-timer)</u> [26] J. L. Lee, A. Chemistruck and G. L. Plett, "One-dimensional physics based reduced order model of lithium-ion dynamics," _Journal of_ _Power Sources,_ vol. 220, pp. 430-448, 2012. [27] A. Benoit, F. Chyza, A. Darrasse, S. Gerhold, M. Mezzarobba and B. Salvy, "Dynamic Dictionary of Mathematical Functions," Microsoft research - INRIA Joint Centre, May 2013, <u>[http://algo.inria.fr/ecs/1.9.1/ddmf?service=MainIndex&rendering=js](http://algo.inria.fr/ecs/1.9.1/ddmf?service=MainIndex&rendering=jsMath)</u> <u>Math..</u> [28] S.N. Shahrouzi, A. Alkamil, and D.G. Perera, "Towards Composing Optimized Bi-Directional Multi-Ported Memories for NextGeneration FPGAs", IEEE Access, an open access IEEE journal, vol. 8, no. 1, pp. 91531-91545, 14th May 2020. [29] M. A. Xavier, "Efficient strategies for predictive cell-level control of lithium-ion batteries, Department of Electrical and Computer Engineering," UCCS, Colorado Springs, 2016. [30] X. Tian, B. Jeppesen, T. Ikushima, F. Baronti and R. Morello, "Accelerating state-of-charge estimation in FPGA-based Battery Management Systems," _6th Hybrid and Electric Vehicles Conference_ _(HEVC 2016),_ pp. 1-6, 2016. [31] N. Otero, H. Rahimi-Eichi, J. J. Rodriguez-Andina and M. Chow, "FPGA implementation of an observer for state of charge estimation in lithium-polymer batteries," in _2014 International Conference on_ _Mechatronics and Control (ICMC)_, Jinzhou, 2014. [32] D.G. Perera and K.F. Li, “A Design Methodology for Mobile and Embedded Applications on FPGA-Based Dynamic Reconfigurable Hardware”, International Journal of Embedded Systems, (IJES), Inderscience publishers, 23-page manuscript, vol. 11, no. 5, September 2019. [33] D.G. Perera, “Analysis of FPGA-Based Reconfiguration Methods for Mobile and Embedded Applications”, in Proceedings of 12th ACM FPGAWorld International Conference, (FPGAWorld’15), pp. 15-20, September 2015. [34] D.G. Perera and K.F. Li, “FPGA-Based Reconfigurable Hardware for Compute Intensive Data Mining Applications”, in Proceedings of 6th IEEE International Conference on P2P, Parallel, Grid, Cloud, and Internet Computing, (3PGCIC’11), pp. 100-108, October 2011. [35] D.G. Perera and K.F. Li, “Parallel Computation of Similarity Measures Using an FPGA-Based Processor Array,” in Proceedings of 22nd IEEE International Conference on Advanced Information Networking and Applications, (AINA’08), pp. 955-962, March 2008. [36] M.D. Ciletti, “Advanced Digital Design with the Verilog Hardware Description Language.” Upper Saddle River, NJ: Prentice-Hall, 2010. [37] A.K. Madsen, “Optimized Embedded Architectures for Model Predictive Control Algorithms for Battery Cell Management Systems in Electric Vehicles”, PhD Dissertation, Department of Electrical & Computer Engineering, University of Colorado Colorado Springs, August 2020. [38] Xilinx Inc., “7 Series FPGAs Data Sheet: Overview”, Product Specification, DS180 (v2.6.1), September 8, 2020, <u>[https://docs.xilinx.com/v/u/en-US/ds180_7Series_Overview](https://docs.xilinx.com/v/u/en-US/ds180_7Series_Overview)</u> [39] Xilinx Inc., “Virtex-6 Family Overview”, Product Specification, DS150 (v2.5) August 20, 2015, <u>[https://docs.xilinx.com/v/u/en-](https://docs.xilinx.com/v/u/en-US/ds150)</u> <u>[US/ds150](https://docs.xilinx.com/v/u/en-US/ds150)</u> Anne K. Madsen. received her Ph.D. degree in Electrical and Computer Engineering from University of Colorado Colorado Springs (UCCS), USA, and her M.Sc. and B.Sc. degrees in Electrical Engineering from Naval Postgraduate School (Monterey, CA, USA), and United States Naval Academy, respectively. Anne completed her PhD under the supervision of Dr. Darshika G. Perera at UCCS. She served as an Officer in the U.S. Navy, and taught at both the Air Force and Navy Service Academies, in Math and Engineering divisions, respectively. She also worked as an Engineer and Acquisition Specialist for Air Force Space and Missile Command’s Ground-Based Space Surveillance Division for 14 years. Currently, she is working as a researcher at the Space Force, in Colorado Springs. Her research interests are cyber-physical systems, control theory, and hardware optimization. Darshika G. Perera. received her Ph.D. degree in Electrical and Computer Engineering from University of Victoria (Canada), and M.Sc. and B.Sc. degrees in Electrical Engineering from Royal Institute of Technology (Sweden) and University of Peradeniya (Sri Lanka) respectively. She is an Associate Professor in the Department of Electrical and Computer Engineering, University of Colorado Colorado Springs (UCCS), USA, and also an Adjunct Professor at University of Victoria, Canada. Prior to joining UCCS, Darshika worked as the Senior Engineer and Group Leader of Embedded Systems at CMC Microsystems, Canada. Her research interests are reconfigurable computing, mobile and embedded systems, and digital systems. Darshika received the “Outstanding Teacher Award” at UCCS in 2022, and “Teacher of the Year – Tenure Track Award” from the Engineering College, UCCS, in 2019. She also received a best paper award at IEEE 3PGCIC conference in 2011, and a best poster paper award at ACM HEART symposium in 2018. She serves on organizing and program committees for several IEEE/ACM conferences and workshops, and as a reviewer for several IEEE, Springer, and Elsevier journals. Darshika is a Senior Member of the IEEE, the IEEE CAS VLSI Society, and the IEEE Women in Engineering. Currently, she serves on the VLSI Systems and Applications Technical Committee (VSATC) of IEEE Circuits and Systems Society, and also serves as an Editor for Elsevier Microprocessor and Microsystems (MICPRO) journal and an Associated Editor for Elsevier Microelectronics Journal (MEJ).

섹션 본문 215문단 · 106,440자

(제목 없음)

1In the era of climate change, and with the rapid depletion of fossil resources, efficient and sustainable transportation systems, such as hybrid electric vehicles (HEVs), are becoming imperative.The cornerstone of HEVs is the efficient battery technology, in order to extend the useful life of the battery and to provide improved performance to fossil fuel technology.Model predictive control (MPC) is an effective technique for battery management systems (BMS), which enables cell-level monitoring and controlling of the battery pack, reducing the safety margin of operation, while maintaining the safety requirements.Furthermore, utilizing the physics-based model (PBM) of the battery allows the control system to operate on the chemical and physical process of the battery that are the root cause of battery degradation.The nonlinear extended Kalman filter (EKF) serves as the state observer to monitor the physical and chemical properties/processes of each battery cell, since these are internal processes of the battery, making them physically unobservable.The amalgamation of the aforementioned techniques, i.e., MPC, PBM, and EKF, can extend the useful life of the battery cell/pack, especially for lithium-ion batteries.In real-world scenarios, HEVs and smart applications often require portable BMS, compelling BMS to be executed on highly constrained embedded devices.Also, the inherent adaptive control process of physics-based (PB) MPC is uniquely suited for smart systems/applications.However, the high computational complexity of PB-MPC, comprising PB-EKF, prevents it from being realized on resource-constrained embedded devices, making it infeasible for portable BMS.In this research work, we introduce novel, unique, and efficient FPGA-based embedded hardware accelerator for PB-MPC smart sensor (comprising PB-EKF) for BMS, specifically on embedded devices, by addressing the computational complexity of PBM.Our proposed embedded PB-MPC hardware accelerator achieved 58 times speedup compared to its embedded software counterpart, while maintain a small footprint required for portable systems.This speedup enables us to manage more battery cells utilizing a single chip compared to that of embedded processor-based solutions.INDEX TERMS FPGAs, embedded hardware architectures, model predictive control, physics-based model, smart sensors, battery cell management.

I. INTRODUCTION

2In the era of climate change and global warming, and with the rapid depletion of fossil resources, efficient and sustainable

3The associate editor coordinating the review of this manuscript and approving it for publication was Christian Pilato .transportation systems are becoming imperative [1], [2].This has led to novel automobile technologies such as hybrid electric vehicles (HEVs) and electric vehicles (EVs) [2].As stated in [3], HEVs achieve better fuel efficiency compared to analogous conventional vehicles.For instance, ''the estimated fuel consumption, for 2021 Toyota Corolla Hybrid at a combined city-and-highway, is about 52 miles per gallon (MPG), whereas for conventional 2021 Corolla (four cylinder, automatic), fuel consumption is estimated to be 34 MPG'' [3].As a result, HEVs are becoming ubiquitous in today's environment.

4In order to compete with the performance and ease of the fossil-fuel vehicles, the batteries of the HEVs must be capable of providing the required power, longevity, and fast recharge times.This has led to research in techniques for battery management systems (BMS), including techniques to optimize the control of the battery cells using Model Predictive Control (MPC) to enhance performance, while extending the useful life of the battery cells as well as providing safe operating environment [4], [5], [6].MPC is one of the most effective techniques for cell-level monitoring and controlling of the battery packs [7], [8], since it inherently incorporates constraints and refines the safety margins, thus enabling the battery cells to be fully utilized.However, MPC is computationally intensive and typically used for industrial control.This research demonstrates the feasibility of MPC on portable and embedded devices.

5A modular BMS with MPC was proposed in [7] and [9] that reduces the computational load on the battery cell controller, while retaining the ability to protect the battery from degradation.This proposed BMS comprising MPC enables the control burden to be split among the energy management subsystems, effectively reducing the computational load for the battery cell controller [7], [9].This idea is similar to the edge computing concept, where the subsystems handle as much of the computation as possible, and only provide the minimum necessary information to the overarching system.To achieve this endeavor, the modular BMS utilizes a smart sensor based on MPC that will regulate the cell current proposed by the higher-level management system for safe and reliable performance of individual battery cells, while a DC-DC converter subsystem handles the state of charge (SOC) balancing of the battery cells and the bus voltage regulation for powering auxiliary systems [9].The measurement cycle for a battery cell for our proposed architecture is 1 second, which is based on the rate of change of the internal state of the battery [20].

6The MPC based smart sensor will utilize MPC's ''lookahead'' strategy to predict the impact of the requested control signal would have on the battery cell, and accordingly optimize the signal based on the model and the constraints to prevent degradation [8].The optimization step will only occur if the requested control signal violates the constraints being monitored by the smart sensor.In this approach, the control signal is an externally provided input, which simplifies the computation of the unconstrained solution for predictive control.Consequently, the smart sensor focuses on monitoring the requested control input, and the sensor executes the MPC optimization only if the control input violates the constraints.The MPC optimization then calculates a correction factor for the requested control signal that will keep the battery cell operating at peak performance and prevent the conditions that cause degradation.If the constraints are not violated, the smart sensor optimization does not engage, and the sensor acts as a pass-through.

7The effectiveness of the MPC algorithm depends on the accuracy of the mathematical model of the battery cell.Two main mathematical models of the battery cell are the equivalent circuit model (ECM) [10], [11], [12], [13] and the electro-chemical physics-based model (PBM) [4], [7].The ECM model comprises simplified algorithms and provides solid performance.However, the ECM is an empirical model derived from battery performance and is not able to incorporate the different chemical and physical reactions that occur internally in the battery.These reactions are the basis for battery degradation and reduced performance [4], [14], [15].Conversely, the PBM model incorporates these electrochemical reactions, providing an adaptive capability but is extremely non-linear and not as easily described by a discrete state space representation [4], [14].However, the PBM has the distinct advantage of modeling the internal dynamics of the battery cell, enabling the MPC algorithm to consider aging, which in turn would extend the useful life of the battery cells as well as enhance the performance [12].

8Since the PBM is based on the internal dynamics of the battery cell, measurements of the control values must be estimated.Direct measurements of internal chemical processes cannot be done without invasive techniques [14].The Kalman filter (KF) is one of the most widely used state estimator/observers known for robust and effective state estimation for linear systems [14].The Extended Kalman Filter (EKF) is one of many non-linear adaptations of KF [16], selected due to its adaptability to MPC [7].Thus far, the computation complexity of the PBM model has prevented this model as a viable option for portable BMS.The authors in [14] envision that with powerful embedded microcontrollers (consisting of substantial on-chip memory), it is possible to support and utilize the physics-based (PB) EKF and physics-based (PB) MPC, in order to obtain the maximum performance and lifetime from the batteries.Recent work [4], [7] described a reduced-order state-space physics-based battery model that approaches the simplicity of the ECM.Even with the adaptation made in [4], [5], and [7] the PB-EKF and the PB-MPC would require powerful embedded microcontroller or microprocessors.An alternative is to utilize Field Programmable Gate Arrays (FPGAs) to create and map the increasingly complex PBM model for BMS.

9Our former analysis [17] illustrated that Field-Programmable Gate Arrays (FPGAs) are one of the best avenues to create hardware architectures on resourceconstrained embedded devices, especially suitable for portable BMS.We have been introducing many FPGA-based hardware architectures to support and accelerate several compute and data intensive applications, including data analytics, control systems [8], [18], [19], [36], machine learning, and cybersecurity, specifically on highly constrained embedded devices.The customized and optimized FPGA-based hardware architectures/techniques will further improve the speed-performance of the PB-MPC smart sensor (comprising PB-EKF), while addressing the stringent requirements of embedded devices, which in turn would lead to more areaefficient, low power, and high-performance designs.

10From our investigation on related work (presented in Section V-C), we could not find any FPGA-based embedded hardware architectures, specifically for PB-MPC.Our investigation further revealed that most of the existing works [10], [11], [12], [13] on EKF for batteries, were based on the ECM approach for estimating the state of charge (SOC) and state of health (SOH) of the batteries, and not much research has been done on physics-based (PB) EKF.Existing works in the published literature for PB-MPC designs, such as [7], [9], and [15] were focused mainly on using Matlab software models to verify and improve the physics-based (PB) approaches.

11To facilitate our endeavor of creating embedded architectures for PB-MPC for portable BMS, we initially introduced an efficient embedded software architecture for PB-MPC smart sensor (comprising PB-EKF) that functioned effectively on a 32-bit embedded microprocessor (running at 100MHz) with 128KB of on-chip memory [19].In this case, multiple embedded microprocessors would be needed to successfully manage a full battery pack.For instance, battery packs can consist of tens, hundreds, or thousands of battery cells depending on the type of cell used, thus requiring 5, 100, or even more embedded microprocessors to support a single battery pack.We also introduced an embedded hardware architecture for EKF that functioned on Virtex-6 FPGA running at 50MHz [18].

12In this research work, our main objective is to create a novel, unique, and efficient FPGA-based embedded hardware accelerator for the PB-MPC smart sensor, comprising the PB-EKF observer for predicting the state of the battery cell, which can support multiple battery packs with a single chip/FPGA.Our proposed embedded hardware accelerator for PB-MPC (running at 100MHz) would ultimately be utilized in the overarching BMS.With our proposed embedded hardware accelerators, we strive to retain the accuracy and the insight provided by the PBM model, while reducing the associated design/computational complexity.

13In this paper, our contributions are as follows:

14• We introduce a novel, unique, and efficient FPGA-based embedded hardware architecture for PB-MPC smart sensor, (comprising PB-EKF), for lithium-ion battery cell control.

15• Our proposed embedded hardware architecture realized on a single chip/FPGA can be utilized to control multiple battery cells/packs individually, in a timemultiplexed fashion, thus significantly reducing the hardware resources required for BMS, which is ideal for resource-constrained embedded devices.

16• We perform experiments to evaluate the feasibility and efficiency of our proposed embedded hardware architectures, which demonstrate that our hardware design for PB-MPC smart sensor is indeed a viable approach for battery cell management.

17• We demonstrate the feasibility of deploying/realizing computationally intensive methods, such as PB-MPC comprising PB-EKF, normally reserved for industrial control, on resource-constrained portable and embedded systems.The organization of the paper is as follows: In Section II, we present the background of our work, summarizing the PB-MPC algorithm utilized for this research work, including the physics-based model (PBM), extended Kalman filter (EKF), optimization, and model predictive control (MPC).Our design approach and development platform, including our system-level architecture are presented in Section III.In Section IV, we present the internal architectures of our proposed FPGA-based embedded hardware architecture for PB-MPC (comprising PB-EKF).In Section V, we report our experimental results and analyses for our embedded hardware architectures, including the functional verifications with baseline Matlab model, performance analysis, etc.Our analysis on existing works on embedded hardware designs for PB-MPC (in the published literature) is also discussed and presented in Section V.In Section VI, we summarize our work, conclude, and discuss future directions.

II. BACKGROUND

18In order to compose our FPGA-based hardware accelerator for the overall PB-MPC smart sensor, we modify and utilize four main algorithms/techniques, including the physics-based model (PBM) of a battery, the Extended Kalman Filter (EKF) observer, the Hildreth's Quadratic Programming (HQP) technique to optimize the cost function in MPC, and the Model Predictive Control (MPC) algorithm itself.In this section, we discuss and present a brief overview of each of these algorithms/techniques.

A. PHYSICS-BASED MODEL (PBM)

19There are two main mathematical models of the battery cell: equivalent circuit model (ECM) and the electro-chemical physics-based model (PBM) [7], [9], [20].The ECM models are empirical models widely used in the industry due to their simplicity.The ECM typically focuses on the measurable aspects of the battery such as current, voltage, and resistance.The PBM of the battery provides insight into the factors that impact the performance, the State of Charge (SOC), and the life of the battery; whereas the ECM cannot provide insight into the internal electro-chemical processes of the battery that directly impact the performance and aging [7].In this case, insight into these processes enable the safety margins of the batteries to be reduced, thus increasing the usable capacity of the battery, while ensuring that the physical processes, which cause aging are respected, which in turn will preserve the life of the battery [7].The PBM incorporates the theory of the electro-chemical processes to predict performance.The PBM models are highly non-linear and more computationally complex than ECMs.However, the PBM models are inherently adaptive to the dynamic/changing environment without the need for extensive data gathering typically required by the ECM models.Due to the aforementioned traits, the PBMs are always considered to be overly complex to use in resource-constrained computing environments, such as embedded devices.To address some of the complexities associated with the PBMs, authors in [14] introduced a reduced-order state-space physics-based battery model that approximates the simplicity of the ECM models.

20In this research work, the PBM utilized in our approach is a first order model introduced in [10], which reduces the model to 5 basic reactions: (1) charge conservation in the solid, (2) mass conservation in the solid, (3) mass conservation in the electrolyte, (4) charge conservation in the electrolyte, and (5) lithium flux.We focus on this approach, since it was stated [10] that this reduced order model (ROM) was deemed suitable for embedded applications/devices, based on the first order principles.In this case, the Discrete Realization Algorithm (DRA) (in [14]) is used to transform the first order partial differential equations into a discrete state-space representation suitable for a Kalman Filter and MPC approach.This state-space representation is completely linear and composed of debiased variables; thus, as in [11] and [14] a series of non-linear corrections are added back to the debiased variables to accommodate the non-linear nature of the model.In this case, the lithium flux is the only reaction that does not require a non-linear correction.In order to create a more optimized state-space model, the battery cell is split into three regions [11] as illustrated in Fig. 1.

FIGURE 1.

21Cell schematic illustrating three regions and the associated variables [11].

22As illustrated in Fig. 1, the internal variables of the battery are described by position as related to x or z.The variables (in Fig. 1) are as follows: φ represents the electric potential, which is used to calculate the charge conservation; c represents the concentration of lithium, which is used in mass conservation calculations; j represents the flux and η is the reaction overpotential tied to the open circuit voltage (OCV) of the battery (U ocp ), both of which (i.e.,; j and η), are used to calculate the fifth reaction, lithium flux.The subscripts s and e indicate solid and electrolyte, respectively, whereas the subscript s,e together indicates the surface of the solid.One limitation of the linearized PBM is that the prediction errors will increase as the cell state moves away from the set points of temperature and the state of charge (SOC) utilized to perform linearization [14].To address this limitation and then to create accurate models over a wide range of temperatures and SOC, in [14], the authors developed the concept of a blended model created from the adjacent single temperature SOC models.This technique also reduces the number of models, the data, and the calculations required for accurate prediction.

23The state space model is a single-input, multiple-output model.In this case, the outputs are defined by the variables being modeled.As illustrated in Fig. 1, each of the six variables (c e , ϕ e , c s , ϕ s , j n , η) has at least four special locations.By solving the 6 variables for all the locations, it would generate 28 outputs for the state-space model [7].A detailed description of this specific technique can be found in [14].

B. EXTENDED KALMAN FILTER (EKF)

24An observer mechanism is required to monitor the internal non-measurable, non-linear electro-chemical processes of the battery.Therefore, for this research work, an Extended Kalman Filter (EKF) is selected to serve as the observer, due to the non-linearity of the PBM.As illustrated in Fig. 2, the EKF utilized in our research is a non-linear adaptation of the Kalman filter, which linearizes the PBM model around the current state developed in [10], [12], and [13].Our proposed smart sensor is created in such a way to reduce the aging effects caused by lithium plating; and the EKF is created to monitor the model states and the side reaction overpotential (ϕ s−e ), where the latter is a major factor in battery aging and performance degradation [13], [14].In this case, the state values of the model are based on the five reactions in the PBM: (1) the electric potential in solid (ϕ s ) for conservation of charge in the solid, (2) the lithium solid surface concentration (c s ) for conservation of mass in the solid, (3) the electric potential in electrolyte (ϕ e ) for conservation of charge in the electrolyte, (4) the lithium concentration in electrolyte (c e ) for conservation of mass in the electrolyte and (5) the reaction in flux (j n and η).The input value for the EKF is the current, and the output value is the voltage.The main process of an EKF is similar to the Kalman Filter with the modified steps as shown in Fig. 2.This process and the associated steps are detailed in Section IV-B.

25The Kalman Filter uses the linear state equations ( 1) and (2).

26where x k+1 represents the predicted state, x k is the current state, u k is the current input state (e.g., I gref ), and A and B are the state matrices.The standard output equation is used to generate different outputs for the Kalman filter created in equations ( 5)- (7).The y k is the current output, and C and D are the output matrices.Typically, the EKF uses the following equations ( 3) and ( 4) to express a nonlinear set of equations:

27where w k and v k represent the state and the output noise, respectively, and f and h are vector-valued nonlinear functions [7].Instead of using the nonlinear equations, in this research work, our approach utilizes the linear expressions in equations (1) and (2) with matrices A, C, and D, created from the non-linear look up tables (LUTs) based on the blended models.A set of non-linear corrections (using equation (5)) are applied to C and D matrices to ensure that the electrochemical processes are accounted for, and then the C and D matrices are linearized again, which are represented by C and D. This approach adds an additional step 3.5 non-linear corrections to the process in Fig. 2. A detailed description of this approach can be found in [6].The output voltage in equation (6), y volt,k , is a function of the chemical processes in the battery and the open circuit voltage (OCV).The equation ( 7) is output SOC, which dependents on the current state, the surface potential, and a Doyle cell parameter, θ.These output equations are further detailed in Section IV.

28In order to reduce the amount of memory required to run the smart sensor, we limit the parameters to temperatures ranging between 0 • C and 25 • C and SOC steps of 5% (from 0 to 100%).Considering that the EKF itself is an estimation, selecting a single blended model with the above temperature range produces results that are within the accepted tolerance for state estimation [7] of battery performance.

C. OPTIMIZATION

29A key component of model predictive control (MPC) is optimizing the cost function.We use two techniques to reduce the complexity of the problem (i.e., solving the cost function), and then numerically solve the optimization using the Hildreth Quadratic programming (HQP) technique.The first simplification technique is to utilize only the active constraints that are active during the solution interval, and to ignore the inactive constraints; this in turn has the potential to reduce the number of calculations required for a solution.The second technique is the primal-dual approach.This technique simultaneously identifies the active constraints and reduces the optimization to a single min-max problem enabling the use of the HQP.Detailed description of the aforementioned techniques can be found in [4] and [14].We briefly explain these two techniques below.

30In this case, we start with an augmented cost function, J , developed by MPC algorithm in the next subsection (i.e., Section II-D) that incorporates the Lagrange multiplier (λ), and the constraints from the MPC relationship; then we would have an augmented cost function that enables the exclusion of the inactive constraints.As presented below, the cost function (in equation ( 9)) is augmented with the equality constraint (in equation ( 8)), and multiplied by the Lagrange multiplier (λ).

31where E and F are standard objective or cost function matrices, which are further developed in equations ( 38) and (39), respectively; and M is the matrix reflecting the constraints.In this case, using partial derivatives with respect to x and λ, and setting them to zero allows us to explicitly solve x in terms of λ.This primal dual approach allows us to reduce the optimization problem to equation (10) below.

32where,

33If we further denote the active constraints as M act and λ act , then the explicit solution for x is (equation ( 13)):

34Typically, in MPC, −E −1 F represents the unconstrained solution denoted by u • .The correction factor needed for the constrained solutions is E −1 M T act λ act .Hildreth's Quadratic Programming (HQP) is a numerical solver for this correction factor.The HQP is an iterative approach that always produces an executable solution which prevents the hardware and software from crashing or entering into an unrecoverable state that hangs the system.Additionally, the HQP does not require matrix conversion, and is executed using basic math functions readily available in hardware.The HQP initially calculates the unconstrained solution ( u • ), and then compares it to the constraints.If none of the constraints are violated, u • will be the solution, and the algorithm exits.

35If a constraint is violated, the HQP then invokes an iterative process to calculate the correction factor.It does this by iteratively applying P and K to the previous vector of Lagrange variables using the following two equations ( 14) and ( 15):

36where,

37where P and K are defined in equations ( 11) and ( 12), respectively.

38The HQP converges when λ m+1 ∼ = λ m , or when the maximum number of iterations (a set threshold value) is reached.Once this occurs, the HQP uses the final λ to create the correction factor and applies it to u • to calculate the constrained solution.This process is further detailed with our proposed FPGA-based hardware architecture in Section IV.

D. MODEL PREDICTIVE CONTROL

39MPC is an adaptive control theory that attempts to adjust the control signal that results in the target response.MPC uses a model of the system under control to predict the system's response and optimization theory to iteratively adjust the control signal until the target response is achieved.We use the receding horizon principle to determine the prediction horizon (N p ), which is known as the optimization window; and the receding horizon results in a moving control window (N c ).There are two advantages to this approach: (1) the vectors remain manageable in size and, (2) once the control vector is determined, only the most recent control is applied to the system.In this research, our proposed FPGA-based hardware architecture uses a standard MPC flow; however, since we are using this as a smart sensor, the cost function is tailored specifically to produce the desired smart sensor behavior.Also, for the MPC approach in our proposed hardware architecture, we use the augmented state space equations.

40We briefly describe the MPC approach utilized for our research work, as follows.In the equations below, k is the current time interval; k-1 is the previous time interval; k+1 is the predicted or future time interval; x is vector describing the state of the system; y is a vector of measured outputs; and u is the control or input vector.The augmentation is used to eliminate the steady state error, which is achieved by applying the difference operations to both sides of the standard state space model of a plant.

41Therefore, following the development in [26], if we start with the standard state space equations:

42And we subtract the previous values from the current values:

43Then we get the following:

44In order to put MPC equations back into a standard form, we define a new augmented state vector as x k which are defined as follows:

45x m,k y k and x k+1 = x m,k+1 y k+1 (22) Then the plant equations become:

46Which simplifies down to:

47Once we have the plant equations, we can calculate the predicted plant output, given the control signal ( u k ), which we calculate using our optimization approach.The state vector (x k ) describes the current state of the plant.Since we are working with the internal electrochemical processes of the battery, x k cannot be directly measured.To determine the current state, we use the PB-EKF observer detailed in Section II-B.The prediction horizon (N p ) determines the number of future state variables calculated (i.e., x k+1 ), whereas the control horizon (N c ) determines the number of control values as shown below in equation (27).

48The state variables are calculated sequentially and the predicted output variables (y k+1 ) are calculated by multiplying the state variable by C as follows:

49. . .

50These predictions are expressed in terms of the current state (x k ), and the input or future control signal ( u k+j ), where 106146 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.j = 0, 1, 2, . . ., (N c -1).Then the output vector is expressed as:

51The output equation can be written in a more compact form as:

52where,

53and

54After developing the prediction matrix, the next step is to determine the cost or optimization function.In order to use the MPC as a smart sensor, the optimization function has to be tailored to support that behavior.Hence, if we organize U in the same fashion as Y we get the following:

55Which can be expressed as U = U + U 0 .For the smart sensor, the control vector is expressed as I g as follows:

56To develop our optimization, the basic cost function becomes:

57Substituting for I g and rearranging the terms to match the standard optimization format below:

58Results in:

59where,

60The aforementioned equations and the corresponding functions are used by our HPQ optimization approach to determine the optimal control signal.

61The overall battery management system/architecture, described in Section III and illustrated in Fig. 4, is a distributed management system, where separate subsystems handle the voltage regulation and SOC balancing.This in turn enables the smart sensor to focus solely on monitoring the battery current to protect the battery cells from aging and degradation.This significantly simplifies the design and development of our MPC architecture; thus, reducing the computational complexity of calculating the unconstrained global optimal control signal ( u • ).In Fig. 4, u • is represented by i g ref .The electrochemical process of side reaction overpotential (ϕ s−e ) is the primary factor in battery life and performance degradation, and also the main constraint used in our MPC architecture.Further adaptations of MPC for our proposed FPGA-based hardware architecture are discussed in Sections III and IV.A detailed description of the PB-MPC theory can be found in [14].

III. DESIGN APPROACH AND DEVELOPMENT PLATFORM

62In this research work, we introduce our novel and unique FPGA-based hardware architecture for the PB-MPC smart sensor (comprising PB-EKF) to support the battery management system (BMS) using the MPC for physics-based electro-chemical battery model.Previously, in [19], we introduced embedded software architecture for PB-MPC smart sensor for BMS, which is executed on an embedded processor.In this work, we use our PB-MPC embedded software architecture to evaluate our proposed embedded FPGA-based hardware architecture.Prior to creating our PB-MPC embedded software architecture, we created the software for PB-MPC smart sensor in C and execute on the desktop computer.The desktop C program is also utilized to verify the results and correct functionality of both our embedded hardware and embedded software architectures.Furthermore, we compare our embedded FPGA-based hardware architecture with the baseline model for the PB-MPC smart sensor written in Matlab [7], in order to evaluate and validate the correctness and functionalities of our proposed design.Our desktop results are also compared and verified with the baseline Matlab results.

63During the design and development, both our embedded hardware and software versions of various computations/modules are implemented using a hierarchical platform-based design approach to facilitate component reuse at different levels of abstraction.Our proposed architecture comprises different levels of abstractions, where higher-level functions utilize lower-level sub-functions and operators.In this case, the PB-MPC is at the highest level, whereas the fundamental operators such as add, subtract, multiply, divide, etc. are at the lowest level.

A. EXPERIMENTAL PLATFORM

64All our embedded hardware and software experiments are carried on the Xilinx VC707 development board, which utilizes a Virtex-7 XC7VX485TFFG1761-2 FPGA [21].This VC707 FPGA development board includes large on-chip logic resources (75,900 slices), MicroBlaze soft processors, and 37MB on-chip BRAM (Block Random Access Memory) to store data/results.This development board also consists of numerous peripherals that could be utilized to support a physical test of the embedded FPGA-based hardware accelerator for BMS.It should be noted that we utilized VC707 with Virtex-7 FPGA as a prototyping platform to design, develop, test, and verify our proposed architectures.However, in a real-world scenario, our intention is to execute our PB-MPC (comprising PB-EKF) hardware design on low-cost smallfootprint FPGAs.

65All our embedded hardware modules are designed in Verilog.They are executed on the Virtex-7 FPGA (running at 100MHz) to verify their correctness and performance.Xilinx Vivado 2020.1 design tools are used to create our embedded hardware designs.Xilinx Vivado design suite environment has an integrated simulator, which we utilize to verify the functionality of the design at the bit and signal level prior to downloading and reconfiguring the FPGA.Our previously proposed embedded software modules for PB-MPC [19] were written in C and executed on the 32-bit RISC MicroBlaze soft processor (running at 100 MHz) on the same Virtex-7 FPGA.For our proposed embedded hardware architecture, the MicroBlaze soft processor is incorporated to execute some high-level control functions, which are also written in C.

66The hardware modules for the fundamental operators are designed using single precision floating-point units [22] from the Xilinx IP core library.The MicroBlaze processor was also configured to use single precision floating-point units for the embedded software modules in [19].Conversely, the baseline Matlab model [7] was designed using double-precision floating-point operators.

67Our experiments are performed using an Urban Dynamometer Driving Schedule (UDDS) [23] current profile for the input (u k ) and the measured output (v k ), similar to our previously proposed PB-EKF in [18].This driving schedule (i.e., UDDS) reflects the typical driving pattern of city or urban drivers with many starts and stops and speed changes, all of which exercise battery cell management.Our proposed hardware architecture for PB-MPC comprising modified PB-EKF is initialized using a SOC (state of charge) of 0.6 and an initial state covariance of diagonal matrix [1E5, 1E5, 1E7, 1E7, 5E9], similar to the baseline model in [7].Our proposed FPGA-based PB-MPC smart sensor is created in such a way to support the normal driving of HEVs with the charging and discharging based on the UDDS driving profile [7].

B. SYSTEM-LEVEL ARCHITECTURE

68We create system-level architectures for our FPGA-based embedded hardware design for PB-MPC.For our proposed embedded hardware architecture, we integrate on-chip BRAMs to store the input data needed to process the PB-MPC algorithm and to store the final and intermediate results from the PB-MPC algorithm.Our system-level architecture is depicted in Fig. 3.As illustrated in Fig. 3, the AXI (Advanced Extensible Interface) bus acts as the glue logic for the system.The AXI bus [24] provides improved design mobility through the use of industry standards and interface protocol standardization, which is compatible with the modern Xilinx IP cores.Although the AXI bus protocol supports the burst transfers and streaming, we decide to use the AXI4-lite bus, due to its small logic footprint and support of single memory mapped transactions suitable for use with the control and status registers, which is ideal for our proposed embedded hardware architecture for PB-MPC.

69For our system-level architecture, we incorporate the MicroBlaze processor to perform some high-level control functions, as well as to support testing and verification of our embedded FPGA-based hardware architectures.In this case, MicroBlaze processor is configured to have 128KB of local on-chip memory.As depicted in Fig. 3, our proposed user-designed hardware module communicates with the MicroBlaze and with the other peripherals via AXI bus [24], through the AXI Intellectual Property Interface (IPIF) module, using a set of ports called the Intellectual Property Interconnect (IPIC).MicroBlaze processor is employed: to send a flag to our user-designed hardware IP to initiate the whole PB-MPC process including the PB-EKF, start the AXI Timer to measure the execution time, receive a flag from our user-designed hardware IP, once the process is completed.The execution times for our proposed hardware are obtained using the AXI Timer [25] running at 100MHz.

C. TOP-LEVEL ARCHITECTURE FOR PB-MPC SMART SENSOR

70In this sub-section, we briefly describe the overall top-level architecture of a battery management systems (BMS) with the PB-MPC smart sensor, (comprising PB-EKF), whereas detailed description can be found in [7] and [19].This overall top-level block diagram is demonstrated in Fig. 4 [19].As illustrated, the color blocks, Cell, EKF, and MPC are the elements in the PB-MPC smart sensor.The unique design for a distributed control system, proposed in [7] and shown in Fig. 1, has the subsystems effectively handling voltage regulation and SOC balancing, leaving the smart sensor to handle the battery current and protect the battery cell from aging and degradation.This in turn greatly simplifies the overall PB-MPC, (comprising PB-EKF), created in such a way that the computation for the unconstrained global optimal control is greatly reduced; and when using a control horizon of 1 and a prediction horizon of 2, this computation is almost eliminated.In this case, in order to act as a pass through, if the proposed control signal i g ref elicits no constraint violations, i g ref must then be the PB-MPC's unconstrained global solution ( u).

71In Fig. 4, the block diagram describes the inputs to the PB-MPC, (comprising PB-EKF), and the outputs necessary for proper operation of the PB-MPC.In this case, the PB-MPC is a single-input and single-output approach that evaluates the cell current control requested by the higher level BMS.For instance, if the requested cell current is within acceptable operating conditions, then the PB-MPC simply acts as a pass through.Conversely, if the requested cell current would cause lithium plating (a known aging mechanism), then the PB-MPC intervenes to take appropriate action and computes an acceptable cell current.For this PB-MPC, the primary constraint is based on the side reaction overpotential (ϕ s−e ), which is a major factor in the reduction of battery life and degradation in performance.This type of PB-MPC is detailed in [7].

72As depicted in Fig. 4, the inputs to the PB-EKF are the cell current and voltage, whereas the outputs of the PB-EKF, including the current-state of the battery, state of ϕ s−e , state and output matrices (A, B, C, D), are the inputs to the PB-MPC.In this case, the cell current is a combination of string current (I string ) and control current (i g ).The PB-EKF operates on the current-state while the PB-MPC operates on the change-in state from the current-state to the next-state, and computes the change-in current.In order to function correctly, the change-in current is added to the control current to produce a change-in state for the PB-MPC with the aid of PB-EKF.Then, the PB-MPC outputs an updated control signal (i * gref ) that meets the current and ϕ s−e constraints to prevent aging and battery degradation, while satisfying the required performance of the BMS.

73The PB-MPC smart sensor algorithm is similar to the standard MPC algorithm; however, instead of focusing the cost function on the amplitude of the control increment ( u k ), which is the norm for the standard MPC [8]; with PB-MPC, the cost function will target the amplitude of the current signal (u k ).This is further explored and detailed with Module 8 in Section IV-C.1.

74As mentioned in Section III-A, in this research work, our proposed FPGA-based embedded hardware architecture/accelerator for PB-MPC comprising the PB-EKF, is designed and developed on the VC707 development board with the Virtex-7 FPGA using the Xilinx Vivado design tools.We previously introduced an embedded hardware architecture for PB-EKF [18], which was designed and developed on the ML605 development board with Virtex-6 FPGA using the Xilinx ISE design tools.We realized that these FPGA development boards were not fully backwards compatible.Hence, we modify our previous PB-EKF hardware version, which includes redesigning and upgrading all the interfaces to the Advanced eXtensible Interface (AXI) protocol, as well as certain internal architectures.We further modify our previous PB-EKF version, in order to incorporate the PB-MPC portion of the smart sensor architecture.These upgrades and redesigns, on the new VC707 development platform, enable us to increase the clock frequency of our proposed PB-MPC architecture (comprising the modified PB-EKF) to 100MHz, as opposed to our previous PB-EKF version running at 50MHz.

IV. OUR PROPOSED EMBEDDED HARDWARE ARCHITECTURE FOR PB-MPC SMART SENSOR

75In this section, we discuss and present our novel, unique, customized, and optimized embedded hardware architectures for the PB-MPC smart sensor (comprising PB-EKF).We initially investigate the functional flow of the PB-MPC [7], [9], [18], [19] in order to gain insight, and subsequently to decompose this complex and computationally intensive algorithm into several sub-tasks.This enables us to dramatically simplify the design process, without compromising the integrity and the performance of the baseline PB-MPC algorithm.

76The hardware functional flow of our PB-MPC smart sensor is illustrated in Fig. 5.As shown, we decompose the PB-MPC algorithm into four stages, which are built with 13 modules.As shown in Fig. 5, Stage 2 (in purple) and the corresponding modules (i.e., modules 2 to 7) are utilized to create the EKF portion of the smart sensor architecture; Stage 3 (in pink) and the corresponding modules (i.e., modules 8 to 12) are utilized to create the MPC portion of the smart sensor architecture; and Stage 4 (in green) and module 13 are utilized to enable the operating temperature updates and the external memory access as needed.

77In this research work, we modify our previously proposed PB-EKF [18], in order to incorporate the PB-MPC portion of the smart sensor architecture.For instance, Module 7 from [18] is modified and expanded to include the linearized output matrices.Next, subsequent stages and modules are added to create the MPC algorithm utilized for our smart sensor.As detailed in Section II, our PB-EKF architecture is inspired by the reduced order physics-based model introduced in [4], [14], [15], and [26].As detailed in Section III-C, our proposed PB-MPC hardware architecture (comprising PB-EKF) is designed and developed on VC707 development board with the Virtex-7 FPGA using the Xilinx Vivado design tools; whereas our previously proposed PB-EKF [18] was designed and developed on the ML605 development board with Virtex-6 FPGA, and using the Xilinx ISE design tools.Since these FPGA development boards were not fully compatible, we further modify our previous PB-EKF version, including redesigning and upgrading interfaces and internal architectures, in order to make it compatible with the newest VC707 development board, as well as to cater to the PB-MPC portion of our proposed hardware architecture.

78The internal architectures of the hardware modules (i.e., all 13 modules in Fig. 5) are detailed below.

A. STAGE 1: INITIALIZATION 1) MODULE 1

79In Stage 1, Module 1 consists of a finite state machine (FSM) that retrieves relevant constants from the read only memories (ROMs) and then writes these into the designated memory locations in the random access memories (RAMs).In this case, ROMs are preloaded with a text file comprising the constants, while downloading and programming the chip/FPGA.Utilizing a text file enables the FPGA/chip designers to easily modify the constants and lookup tables (LUTs) used throughout the design, without changing the underlying Verilog hardware codes/architecture in the XIL-INX IDE.The constants include the initial state vector (x k ), SOC, and the error covariance matrix (σ x ).This module is executed only once during the initialization.After the initialization process, x k , SOC, and σ x are updated continuously by the PB-EKF in Stage 2, and the control signal is updated by the PB-MPC in Stage 3 as illustrated in Fig. 5.

B. STAGE 2: PB-EKF COMPUTATION 1) MODULE 2

80In Stage 2, Module 2 executes the first step in the PB-EKF (i.e., equation ( 40)), in order to compute the state matrix (A), followed by the state time update (x k ).The high-level architecture of the Module 2 is illustrated in Fig. 6.

81The ''state time update'' (i.e., step 1 of Fig. 2) uses the apriori information; thus, the subscripts indicate previous state (k-1) and the current state (k).The state matrix (A) is built using look-up-tables (LUTs) and two dimensional (2-D)-interpolation.The LUTs are created using two temperature values (0 • C and 25 The generic approach to producing the scaling factors and indices is presented in equations ( 41) and (42).In this case, if Z represents the array of 20 SOC values, and T represents the array of 2 temperatures, α 0 and β 0 are computed with these two equations ( 41) and (42).

82Our hardware architecture for the index finder (Fig. 7) is designed in such a way to find the SOC indices, and the β values.This requires integrating a check condition (i.e., β < 0) to the result to ensure that ''Low'' represents the lower bounding integer, since the FPI (floating-point-to-integer) component rounds to the nearest integer instead of always rounding down.This Check module determines whether β 0 is negative by examining the most significant bit (MSB).In the case, where β 0 is negative, it considers High =(int)soc_val and Low = High-1; otherwise, where β 0 is positive, it considers Low = (int)soc_val and High = Low +1.In our hardware design, the computation of ''soc_val'' is followed by two parallel operations: (1) one that performs FPI, in order to find ''Low'', and then converting ''Low'' back to floating point using the int2flt component; (2) another one that computes ''soc_val+1''.For both parallel operations, only one adder is utilized, due to careful timing of the computations.We also design a separate ''Check_T'' module (Fig 8 ) to compute α values based on the temperature input.This Check_T module is also used to determine the case value input to the user-designed e x module utilized in Module 4. The Check_T module uses a multiplier and an adder to create α 1 and α 0 ; and uses a comparator to determine the case value for the user-designed e x module.The internal architecture of the Check_T module is illustrated in Fig. 8.

83The aforementioned ''case value'' is stored in the on-chip BRAMs for subsequent analysis.The resulting α and β are used in the 2-dimensional linear interpretation, to create the state matrix (A) as presented in equation ( 43), where [i] represents the states.

84The original LUT for A matrix (BigA) was a 3D matrix, composed of temperature, state of charge (SOC), and system state values, which led to a 2×20×5 matrix.For our proposed architecture, we split the LUT into two 20×5 matrices (BigA 0 and BigA 1 ), in order to utilize the dual-port BRAMs as well as to reduce the associated overhead.As in equation (43), A[i] represents the diagonal of the 5 × 5 state matrix.Since A is a diagonal matrix, A is stored as a vector in our hardware module, with the implied zeros.Furthermore, the state x k is also a vector; hence, the operation Ax k−1 no longer requires addition.Also, since B is a set of ones, the operation Bu k−1 = u k−1 .As a result, the state time update (i.e., equation ( 40)) is reduced to the equation (44) below.This in turn enables the state time updated to be executed using a single FP multiplier and a single FP adder.

85The internal hardware architecture to compute the A matrix (equations (41), (42), and (43)) is shown in Fig. 9.As illustrated, the first two parallel multipliers compute the four terms in equation (43), i.e., α 1 β 1 * BigA 0 [Low] [i] for each state i.In this case, Mult1 and Mult2 perform multiplications on the BigA 0 and BigA 1 data, respectively.Next, the addition operation (using Add1) is performed to add the first two terms and the last two terms together.The result of the Add1 is forwarded to Add2 to obtain the final A[i] matrix.Add2 result is written to the BRAM, while simultaneously this result is also multiplied with x k−1 [i] using Mult3.Next, Mult3 result is added to u k−1 , and the final addition result (using Add3) is also stored in the BRAM.

86Our overall Module 2 is designed using only two multipliers and two adders shared by the sub modules.In this case, each multiplier and adder comprise an output_ready signal to indicate that the output is valid, and an input_valid signal to trigger multiply/addition operations.Using the output_ready signal as the input_valid signal reduces the overhead of the FSM.In the standard Kalmann Filter (KF) process, the next step is to compute the error covariance time update.However, in our hardware architecture, this computation is delayed and done in Module 5 with the Covariance Matrix computation.

2) MODULE 3

87Module 3 is used for the error covariance time update (i.e., step 2 of Fig. 2) that occurs after Module 2, and again for the error covariance measurement update (i.e., step 6 of Fig. 2) that occurs after Module 6.In both instances, Module 3 updates the SOC, creates the observation matrices (C, D), and computes the output function (y var,k ).In both updates, the output function contains de-biased variables, which have meaning only when the nonlinear corrections are applied [7].

88The top-level architecture of Module 3 is illustrated in Fig. 10.As shown, in the beginning, Module 3 computes the SOC based on the time update (x k ), and the lithium concentration in the solid surface at the negative electrode (c neg s ).For our proposed hardware architecture, we use the cell model parameters from the Doyle cell parameters in [7].These paramters are held constant for the temperature range used for our hardware architecture.The SOC computation is obtained using the following steps:

891. Calculate the average solid surface concentration in the negative electrode, c neg s,avg using x k , and the cell 106152 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.2. Calculate the ratio of the average to the maximum solid surface concentration in the negative electrode.

903. Calculate the SOC using θ neg and precalculated m and b constants.

91By combining the cell model constants and rearranging the terms of the SOC computations from [7], we manage to use the standard equation (y = mx+b) to compute the values of the SOC in steps 1 and 3.By using this approach, we reduce the number of variables stored in the ROM, and replace the division with multiplication.The AXI-IP division function takes 20 clock cycles in hardware, while multiplication takes only 5 clock cycles.The internal architecture of the SOC module is depicted in Fig. 11.In this case, in loop 2 (L2), the necessary data are sent to the adders and multipliers from the on-chip memory.In loop 1 (L1), the SOC module checks the c neg s,avg value to insure, whether this value falls in bounds before it is written to memory.If c neg s,avg < c s,min , SOC_store stores the minimum, else if c neg s,avg > c s,max , SOC_store stores the maximum value; otherwise SOC_store writes the adder output c neg s,avg to memory.The SOC values are also stored in the memory.The updates of the SOC drive the updates to the SOC indices as well as the α and β terms discussed previously, thus reusing the two sub-modules (i.e., Index Finder and Alpha Beta) from Module 2.

92As illustrated in Fig. 10, the C and D matrices are created using the following 2D interpolation, where i represents the 5 states and j represents the 19 outputs in this Model 3.

93The C and D matrices (in Fig. 10) are created by adapting the A Matrix module (in Fig. 9).For the D matrix module, 19 iterations are used instead of 5 iterations as in A matrix.For the C matrix module, an outer loop is added to the A matrix module to create an additional dimension.After computing the C and D matrices, the PB-EKF output equation ( 50) is computed using Y_out module (in Fig. 10), and represents step 3 of Fig 2.

94In order to compute C k x k , in equation (50), we create an optimized linear multiply accumulate (MAC) module, which consists of one FP multiplier and 3 FP adders (as shown in Fig. 12).Our primary goal of designing this efficient MAC module is to reduce the area, and the secondary goal is to optimize the speedup.In this case, the parallel computation of the 19 × 5 C k matrix by our proposed MAC module would optimize the execution time.While the MAC module performs C k x k , the Index Finder module simultaneously computes the open circuit index values and the β terms for the LUTs for analysis in Module 4. These index values are stored in the RAM in a dedicated address space for subsequent analysis.Not shown in Fig. 12 is the parallel addressing logic that updates the address as the MAC provides an output.Unlike our previously introduced MAC modules [8], the proposed MAC module in this paper does not use input buffers at each stage.Instead, as shown in Fig. 12, the ''ready signals'' from the preceding multiplier/adder sub-modules are used to drive the subsequent sub-modules.

95For the MAC module (in Fig. 12), the input C matrix is partitioned into 19 vectors, and fed into the MAC module one vector at a time.The result of the MAC module is added to the corresponding D k u k term, in order to compute the output function y k .Once y k is calculated, the non-linear corrections (represented by y var,k = g k (y k , u k )) can be calculated.

TABLE 1. Important debiased variables.

96In Table 1, we list the important debiased variables from y k used in the non-linear corrections.

3) MODULE 4

97Module 4 is used after Module 3, and is the starting point for Module 7. In both cases, Module 4 computes the non-linear corrections and the output voltage (y volt,k ), which is step 3 and step 3.5 of Fig 2 .As illustrated in Fig. 13, Module 4 is created with five sub-modules and various FP IPs.In this case, the non-linear corrections computation is iterative, thus is not a good candidate for parallelism.The first correction is the concentration in the electrolyte (c e ), at both ends of the terminal, which is represented by equations (51) and (52).

98The internal architecture for the φe computation is illustrated in Fig. 14.Both Taylor series are 6 th order, however, their coefficients differ.Both are executed in parallel to reduce the execution time.We also split the temperature range into six sections to further reduce the errors from the numerical approximation of e x .After selecting the focal point, the constants of the Taylor series become the multiples of the base values.These base values (for the six temperature regions) are stored in the memory.Next, each of the expansion terms are computed using a selected base value.In the flux computation (Fig. 15), the square-root, e x neg , and e x pos are computed in parallel to reduce the overall execution time.These results are sent through an inverter to generate inverse of j 0,pos and, j 0,neg and are stored in the memory for subsequent analysis.

99The over-potential correction ( η) is obtained using the following equation (58) where 2R/F is stored as a constant in ROM.

100The internal architecture for η is illustrated in Fig. 16.

101To create the equation (58), we design our own IP for hyperbolic arcsine (asinh) utilizing the Chebyshev Approximation, since Xilinx IP is not available for this operation on the Virtex 7 series FPGA.As stated in [27], the Chebyshev Approximation spreads the error over the interval, allowing a single equation to be used for the entire temperature region.Furthermore, no division is required, resulting in more efficient design.We use the following 8 th order Chebyshev equation from [27] to approximate asinh: asinh(x) = −0.017123x7 + 0.0629397944x 5 − 0.16460894x 3 + 0.9999157047x (59)

102The 8 th order function results in a 0.00957% error versus the 0.19% error of the 6 th order function; and use only 3 more multiplications and one addition to compute the asinh function.This is deemed an acceptable tradeoff.The internal architecture for the Asinh is demonstrated in Fig. 17 The open circuit voltage (OCV) or open circuit potential (OCP) is the final linear-correction needed to compute y volt,k .The OCV and its derivative are non-linear functions, which are represented by two LUTs.The index computations are performed in Module 3 and stored in the memory.The Uocp is computed using the interpolation presented in equation ( 60).This interpolation is organized in such a way to reduce the addressing needed for the memory calls, as well as to minimize the number of adders and multipliers used.

103The same equation (60) with different LUTs is utilized to compute the derivative ( dUocp) dUocp, in order to determine the C in Module 5. Hence, the Uocp Uocp module (Fig. 18) is reused to generate Uocp Uocp and dUocp in sequence dUocp.The internal architecture for the Uocp Uocp module, which is reused for dUocp, is illustrated in Fig. 18.

104The second execution (i.e., dUocp) is performed in parallel with the computation of y volt,k y volt,k .Once the linear-correction results are available, the output voltage (y volt,k ) is computed using the equation (61), as follows:

105In this case, the parameters for resistance in the film and the terminal, FR film,pos , FR film,neg , and R terminal , are precomputed constants, stored in the ROM.In Module 4, the final step is to compute the error between the computed and measured voltage, known as the voltage residual, i.e., V res = y volt,k − v k , where v k is the measured voltage.The first step (in Module 5) is to create linearized matrices C, and D. We will also be using these linearized matrices for other modules in PB-MPC architecture, which dramatically reduce the number of computations in the PB-MPC algorithm.Since the state equation (i.e., A = A, B = 1) is linear, the authors in [6], linearized the C and D matrices based on y volt,k values.

106In equations ( 62) and (63), for each part [i] represents the states 0 through 4. For instance, Part 1 is based on the film resistance, as follows:

107Part 2 is based on the potential in electrolyte (ϕ e ), as follows:

108(66)

109Part 3 is based on the overpotential, as follows:

110Part 4 is based on the derivative of the OCV, as follows:

111where the constants dSOC [i], R F, ϕ const , FR film,pos , and FR film,neg are all stored in ROM.

112As illustrated in Fig. 19, the Chat_Dhat module serves as the input module for Module 5.The internal architecture of the Chat_Dhat module is demonstrated in Fig. 20.During the execution of Chat_Dhat module, all the associated memory ports are utilized.As a result, the SigmaX_time module (in Module 5), which computes the time update to the error covariance matrix, has to be executed directly after the execution of Chat_Dhat module.As in [28], multi-ported memories could be utilized to execute the Chat_Dhat and the SigmaX_time modules in parallel.The SigmaX_time module is designed to execute the following equation (72).

113The internal architecture of the SigmaX_time module is shown in Fig. 21.In this case, σ w is the uncertainty of the 106156 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.current sensor, and is a constant 5 × 5 matrix stored in the ROM.Since the A matrix is a 5 × 5 diagonal matrix, each term in the Aσ

The zeros in the A matrix eliminates the accumulation portion of the matrix multiplication. Firstly, the most efficient computation (A [n] A[m]

114) is performed.In this case, the output_valid signal of the first multiplier (MULT1) is registered to provide a one clock cycle delay before forwarding it as the input_valid signal of the second multiplier (MULT2).The other input to the second multiplier (MULT2) is σ x,k−1 .Similarly, the output_ready signal of the second multiplier (MULT2) is registered and forwarded as the input_valid signal of the adder (ADD1).The output of the MULT2 and σ x,k−1 are the inputs to the adder (ADD1).The results of the adder (ADD1) are stored in the memory for subsequent computations of Module 5.

115Next step is to compute the Kalman gain utilizing the Update_SigmaX module (in Module 5).The Kalman Gain matrix (L) is computed using the following equation (73).

116where σ y is the voltage error covariance, computed using equation (74).

117From equations (74), σ v is the error in voltage measurement.Since C is a vector, σ x,k C T is computed first, stored in the memory, and then reused for L, σ y , and σ x,k+1 .Since σ y is a scalar, we can simplify the computation for the error covariance measurement update (σ x,k+1 ).The MAC module (in Module 5) is used to compute the Cσ x,k , and then the MAC result is loaded into a local register array (ChatSigX).Simultaneously, the MAC result is multiplied with an appropriate term from the Chat, and the result is forwarded to an adder to perform the final accumulation Cσ x,k C T .The internal architecture for voltage error covariance (σ y ) is illustrated in Fig. 22.Once the voltage error covariance (σ y ) is computed, a FP divider is employed to compute the final division of the Kalman Gain (L), in equation ( 73), and the division result is forwarded to the Update_Xhat module with a ready signal.The final step of the Update_SigmaX module is to compute the measurement update of the error covariance matrix (σ x,k+1 ) as in equation (75).

118Considering that σ y is a scalar, and the L = σ x,k C T σ y and Lσ y L T reduces to (σ x,k C T )L T or ChatSigX •L T , which in turn leads to a 5 × 5 matrix that requires only a single multiplier.The multiplier result is added to the σ x,k , term by term, to get σ x,k+1 .The result of the adder is written to the on-chip memory, thus replacing the current σ x,k−1 for the next iteration.The internal architecture for Update_SigmaX is demonstrated in Fig. 23.

119In Module 5, the state update (i.e., equation ( 76)) is obtained by the Update_Xhat module executed in parallel with the Update_SigmaX module.In this case, the Update_Xhat receives a start signal from Update_SigmaX once the divider inputs are valid.Next, Update_Xhat loads V res into one input of the multiplier and then waits for the ready signal from Update_SigmaX to load L[i] into the other input of the multiplier.The output of the multiplier is fed to an adder to add x k [i].The adder result is sent to Store5 (in Fig. 23) to be written to memory.This completes all the computations in Module 5.

5) MODULE 6 AND 7

120For our proposed architecture, Module 6 is a reuse of Module 3, where the input is the measurement update of the state vector, and the output is an updated SOC and the updated output.Similarly, Module 7 is a reuse of Module 4, where the inputs are the outputs of Module 3 (i.e., Module 6 above), and the output is the final output voltage (y volt,k ) and updated non-linear corrections.These final computations of Modules 6 and 7, completes the PB-EKF Stage 2.

C. STAGE 3: PB-MPC COMPUTATION

121In Stage 3, we execute the steps of the PB-MPC algorithm utilizing Algorithm 1.

122For Stage 3, in order to execute the PB-MPC algorithm (in Algorithm 1), we create additional five hardware modules.In the following sub-sections, we briefly describe the PB-MPC algorithm with our corresponding modules, whereas a detailed description of the PB-MPC algorithm can be found in [7].In order to facilitate this process, we also create an overarching FSM to control the flow of the data, as well as to provide unified access to the RAMs and ROMs of our design.As illustrated in Fig. 24, our FSM comprises 11 states to execute the final PB-MPC operations for the smart sensor.

1) MODULE 8

123For our proposed architecture, Module 8 comprises three user-designed submodules (IPs): StartPhi_se, Xekf_state, and Phi_se_Store.These three submodules are designed in such a way to be executed in parallel.In this case, Module 8 composed of these three submodules executes the initial PB-MPC During the PHISE state (as in Fig. 24), in Module 8, the StartPhi_se submodule controls the read port A addresses of RAM1, RAM0 and ROM1, a FP adder (ADD1), and a FP multiplier (MULT1), as shown in Fig. 25.The Xekf_state submodule controls the port address of ROM1, ADD2, and MULT2.Finally, the Phi_se_Store submodule controls the port B read/write addresses of RAM1 and RAM0 and a read port A address of ROM0.Considering the on-chip RAMs are true dual port memories, for our proposed architecture, only the Phi_se_Store module has the ''write access'', in order to reduce the possibilities of race conditions and/or contention issues.

124As mentioned in Section II-D, our PB-MPC approach incorporates integral action by using the augmented state vector from equation (22).In this research work, our specific creation of equation ( 22) is presented below (in equation ( 77)) using χ k to differentiate the MPC state variable from the EKF state variable, and replacing the generic y k with the side-reaction overpotential (ϕ s−e ).

125In order to calculate χ k (i.e., equation (77)), our system uses the current state provided by the PB-EKF and the A matrix from the PB-EKF to calculate the next state as shown in equation (78).In this case, χ k is the difference between the current state and the next state (i.e., equation ( 79)) for all but the last element in the vector, which is ϕ s−e .

126In Module 8, the Xekf_state submodule is responsible for computing χ (i.e., equations ( 78) and ( 79)), ϕse 106158 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.(equations ( 83) and ( 84)) and part of γ (equation ( 87)) The StartPhi_se submodule is responsible for computing x mpc,k+1 , ϕ s−e , C ϕse , D ϕse , G ϕse , M and the rest of γ .The Phi_se_Store submodule is responsible for writing critical outputs to memory.The block-level views of the StartPhi_se, Xekf_state, and Phi_se_Store submodules are illustrated in Fig. 25.

127To reduce the complexity of the multiplexers in Module 8, and also to reduce the number of state switches due to memory port availability, Phi_se_Store submodule controls the memory reads for Xekf_state submodule.For instance, to compute step 1 and step 2 of the PB-MPC (in Algorithm 1), the StartPhi_se and Xekf_state submodules execute the state equation (80) using the state and state matrices provided by the PB-EKF.Fig. 26 illustrates the internal architecture for computing χ k , i.e., for equations ( 78) and (79).

128For our hardware architecture, the computation in equation ( 80) reduces to a simple vector multiplication, (i.e., A diag * x k ), with u k added to each result (where, B is a vector of 1's), as shown in equation ( 78).In this case, as illustrated in Fig. 26, the StartPhi_se submodule gets A from RAM0 and x from RAM1.Also, the RAM outputs are accessible to all three submodules; thus, the Xekf_state submodule can seamlessly forward the A and x values to MULT1, and then to ADD1.In our design (in Fig. 26), the addition (in ADD1 and ADD2) is automated by coupling the add_valid signal of the ADD1 to the mult_rdy signal of the MULT1, as well as the add_valid signal of ADD2 to the add_rdy signal of ADD1.In this case, the automated denotes that the addition is set independently of the current state in StartPhi_se or Xekf_state, which is done using a separate block in Verilog.For our design, a single clock cycle delay is added to the mult_rdy signal to enable the result of the multiplier (MULT1) to be loaded into the input register of the adder (ADD1).For our design, certain control mechanisms/signals are added, so that the coupled signals (e.g., add_valid and mult_rdy signals) and one-cycle delay signal are only active during the operations, such as calculating χ k ,and are grounded otherwise.Without these control mechanisms/signals in place, the one-cycle delay signal would be active throughout the whole system's operation, due to the parallel nature of the hardware architectures.Also, since the one-cycle delay signal (denoted by 1 in green circle in Fig. 26) is physically attached to ADD1, whenever ADD1 is accessed by any of the submodules, this one-cycle delay signal would also be unnecessarily active, incurring a dynamic power penalty for each change in state between 1 and 0. Admittedly, this individual signal alone has a minute impact on the dynamic power; however, this setup is prevalent throughout the design, thus, the cumulative effect, unchecked, could become significant.It is indeed good design practice to ensure that signals are grounded when not in use [35].In our design, adding the control mechanisms suppresses the switching action, which in turn connects the one-cycle delay signal to the ground, thus, could reduce the active/dynamic power requirement.

129In order to compute χ k (i.e., equation ( 77)), StartPhi_se submodule calls x k from RAM1, and time it appropriately, in such a way that x k is available when the output of ADD1 is ready, with add_rdy signal, as shown in Fig. 26.In this case, the output of ADD1 and the -x k (created by placing a 1 in the most significant digit) are fed to the input of the ADD2 to achieve the x k terms for χ k , in equation (77).The last term of χ k is ϕ s−e , which is computed in parallel by the StartPhi_se submodule.The Phi_se_Store places the ϕ s−e value in the memory address that corresponds to the last term of χ k , which completes this computation.

130Since the PB-MPC system uses a control horizon of 1 and a prediction horizon of 2 [7], the computations for the Module 8 are fairly straight forward.For step 3 (in Algorithm 1), the StartPhi_se submodule computes the C ϕse and D ϕse as below.

131The gain matrices, ϕse and G ϕse are computed using the following approach:

132Since B is a vector of 1's, this becomes the accumulated portion of the multiply-accumulate action.The G ϕse uses an augmented C ϕse matrix, C ϕse 1 as follows:

133The first row of G ϕse (i.e., equation ( 85)) is another accumulate function, while the order of operations for the second row of G ϕse (i.e., equation ( 86)) is to add 1 to each element of A diag and then multiply-accumulate (MAC) C ϕse and the result together.The final terms of 1 in each row (i.e., in both equations ( 85) and ( 86)) are simply stored in the memory.

134Once G ϕse and ϕse are computed, Module 8 can compute the constraint matrices, M and γ .From equation (87), only the first and last two terms of γ are computed.The last two terms of M are simply the two terms in the φ ϕse gain matrix.The remaining terms of M are constants determined by the operating conditions of the battery.For M, = I = 1, which is stored in the ROM and can be changed in future designs.

135The first two terms of γ (in equation ( 87)) are simple addition/subtraction operations, whereas the final term is a MAC of G ϕse to χ .Working within the limitation of memory ports, the two terms of G ϕse χ are computed in parallel using the three submodules (Start-Phi_se, Xekf_state, and Phi_se_Store).In this case, Start-Phi_se submodule extracts/reads the χ terms and the first row of G ϕse , equation (85) from the memory, while the Phi_se_Store submodule extracts/reads the second row of G ϕse , equation (86) from the memory.Next, as illustrated in Fig. 27, the StartPhi_se submodule executes the MAC of row 0, G ϕse [0] χ [0] , and the Xekf_state submodule executes the MAC of row 1, G ϕse [1] χ [1] .Our MAC module for this architecture (i.e., Module 8) is very similar to the MAC module in Fig. 12; however, Module 8 uses a counter with the length of χ, and in this case, the control mechanisms/signals to load the adder are based on the least significant bit (LSB) of the count value: 0 for even, 1 for odd.Similar to our other modules, the control signals/mechanisms are generated independently of the FSMs in Xekf_state and StartPhi_se, lowering the number of FSM states.The shortness of the vector length and the latency of the adder enable building the MAC using a single multiplier and single adder.We use handshaking protocol to ensure that three submodules operate in parallel.The next step is to compute the unconstrained solution.

2) MODULE 9

136For our proposed PB-MPC architecture, Module 9 comprises two submodules: DNP submodule and P_inverse submodule.The top-level architecture for Module 9 is illustrated in Fig. 28.The DNP submodule is responsible for computing the u • = −F E, which simplifies to the difference between the current and previous control signal amplitudes as in equation ( 88).

137The DNP submodule computes K and P as shown below using equation (89).For our design, these K and P are utilized in the Hildreth Quadratic Programming (HQP) function as needed.

138where M is from Module 8 and equation (87); and E = 2 , and F = −2 u mpc,k+1 from [19].In this case, a control horizon of N c = 1 results in a scalar for E. The P matrix (in equation ( 89)) becomes a set of simple multiplications that are continuously executed for the length of the vector.As shown in equation ( 89), the term ME −1 is computed first and stored in the memory.Then P and K can be executed in parallel (as shown in Fig. 29), since there are no dependencies between the two computations P and K .In this case, the inverse of E is stored in memory, so that a floatingpoint (FP) multiplier can be used to compute the term ME −1 , instead of utilizing a FP divider, since the latter IP is more expensive both in terms of execution time and chip area.The F simplifies to 2 u when N c = 1.For our design, the HQP algorithm (i.e., Algorithm 2) uses the inverse of the terms on the diagonal of the P matrix.The P_inverse submodule (in Fig. 29) executes in parallel with DNP submodule to compute the inverse of the diagonal elements as these elements are being generated.During this time, a FP divider takes 20 clock cycles to complete executing the inversion.The design executes the inverse, even though it may not be required, which in turn reduces the stall time of the HQP, should it be invoked.In this case, the P_inverse submodule sets up the division action, the Phi_se_Store submodule saves the first 4 values to the memory, while the HP_store, (which is part of the HQP shown in Fig. 31) manages the final two values.The final two values are only stored, if HQP is activated.This would save the 20 clock cycles that would take to wait for the results of the divider, before moving to the next state.

3) MODULE 10

139The compare function (M u • ≤ γ ), is performed by Module 10.If we rearrange and substitute terms as shown in equation (90), it is evident that we can use the K computation to determine if the constraints meet the condition, M u • ≤ γ .The architecture is based on the fact that if a K term is negative, the constraints fail and HQP is activated.

140The top-level architecture for Module 10 is illustrated in Fig. 30.In this design, the address signals are registered at the abstraction-level of the overall FSM (in Fig. 24), and are not registered at the higher-level of abstraction.Registering the address signals at the abstraction-level of the overall FSM (in Fig. 24) results in a 2-cycle latency when reading data from the memory, if called from overall FSM and a three-cycle latency when called from a user IP such as DNP submodule.As a result, as in Fig. 24 and Fig. 30, the SET_D state sets the correct address; the CALL_D state waits a single clock cycle for the result to be on the RAM output; the LOAD_D state registers the RAM output into a temporary register; and the CHECK_D state uses the most significant bit (MSB) of the temporary register to determine if a constraint is violated.This in turn takes advantage of the hardware convention that 1 = true and 0 = false, and the IEEE floating point standards, where the MSB is used to indicate the sign of the value.In this case, if the MSB =1, the corresponding value is negative.

141The compare module (i.e., Module 10) processes all 6 terms of K(i.e., equation ( 89)).Once the first negative value appears, the FSM transitions to Module 11 to execute the HQP.If there are no negative values, upon completion, the FSM transitions to Module 12 to perform the NEW_UK (as in Fig. 24).

4) MODULE 11

142For our previous work on equivalent circuit model (ECM) based MPC, we introduced embedded hardware architecture for Hildreth's Quadratic Programming (HQP) algorithm [8].However, for this research work, we modify our previously proposed HQP [8] for ECM-based MPC, in order to cater to the PB-MPC smart sensor architecture, due to two main reasons.(1) Our previously introduced HQP for ECM-based MPC was designed and developed on the ML605 development board with Virtex-6 FPGA, and using the Xilinx ISE design tools.In this research work, our proposed hardware architectures, including the HQP for PB-MPC, are designed and developed on the VC707 development board with the Virtex-7 FPGA using the Xilinx Vivado design tools.As detailed in Section III-C, these FPGA development boards are not fully backward compatible, which in turn required modifications, including redesigning and upgrading all the interfaces to the AXI protocol.(2) Furthermore, the differences in memory structures between the HQP hardware design for ECM-based MPC and the HQP hardware design for PB-MPC made reusing the same HQP design impractical.Also, the HQP hardware design in the ECM-based MPC was designed to handle a much larger P matrix, thus, would be more powerful than necessary for our current PB-MPC algorithm.For instance, in the ECM-based MPC hardware design [8] the P matrix had 1024 terms, stored on its own RAM; whereas in our current PB-MPC hardware design the P matrix has 36 terms and can fit in the available RAM.

143A summary of the HQP algorithm utilized for this research work is illustrated in Algorithm 2 [19].

144Algorithm 2 Hildreth's Quadratic Programming Technique (HQP Algorithm) for loop = 0 to value Calculate λ λ previous ← λ

145The top-level architecture for Module 11 for HQP algorithm is illustrated in Fig. 31.Upon entering the HP state (as shown in Fig. 24), the Module 11 starts the HQP submodules.Our proposed HQP hardware architecture has four associated main submodules that are executed in parallel.The HP_Store submodule manages all the memory writes for the HQP Module 11.The HP_Lambda submodule (in Fig. 32) manages the computation of the λ elements from the HQP algorithm (i.e., Algorithm 2).In this case, P is a diagonal matrix and the second term (i.e., M size j=0 P ij λ j ) is 0 resulting in following equation (91).

146The third submodule, Lambda_final (in Fig. 32), operates in parallel with HP_Lambda and executes the rest of the λ element computations using equation (92).

147As illustrated in Fig. 31, the HP_Store submodule stores the result of equation (92) in a temporary register.The temporary register exists at the abstraction level of the overall FSM (in Fig. 24).In this case, the overall FSM (Fig. 24) sends a control signal called ''lambda_choice'', which is set as the MSB of this temporary register.Similar to the Compare module (i.e., Module 10 in Section IV-C.3), the HP_Store submodule uses the lambda_choice signal to determine if the element (λ i ) is 0 or the result of equation (92), accordingly stores the appropriate value in memory, and then informs the Lambda_final submodule that the correct value is available.The Lambda_final submodule sets up the multiplier to square λ i , and then waits for the next element.This continues until all the elements of λ are computed.

148The fourth submodule, HP_Length (in Fig. 33), is responsible for computing the Euclidean Norm of λ for the current state, by summing the squares from the Lambda_Final submodule, and then taking the square root of the result.The Lambda_Final submodule is also responsible for inverting the norm from the previous state, so that the ratio of ∥λ∥ ∥λprevious∥ can be assessed for convergence.For our proposed architecture, the convergence occurs when the following criteria is satisfied:

149As in equation ( 93), the divisor is the norm of the previous λ, which is 0 for the first iteration; hence, in our hardware architecture, a control logic is in place to indicate when the first loop occurs, in order to avoid any division by zero operations.Alternatively, the ratio (in equation ( 93)) could be reversed, which in turn would also prevent division by zero operations.However, the latter option would not save any iteration cycles, since the ratio will be zero for the first iteration, thus would not meet the criteria in equation ( 93).In this case, the HP_length submodule (as shown in Fig. 34) sets the ''converged'' signal high if the ratio meets the criteria in equation ( 93).This ''converged'' signal is forwarded to all the four main HQP submodules (i.e., HP_Store, HP_Lambda, Lambda_final, and HP_Length) to stop the operation and clear the necessary states, as well as to the overall FSM (Fig. 24).

150While the HP_length submodule is summing the λ 2 i terms for the norm, this submodule also computes the correction factor for updating the control signal.Similar to the HQP hardware design for ECM-based MPC, for PB-MPC also, this value is computed in each iteration, and discarded if the iteration does not converge.Upon completion of the HP_length computation (∥λ∥), the state changes from HP state to HP_LOOP state at the abstraction-level of the overall FSM, as illustrated in Fig. 24.At HP_LOOP state (in Fig. 24), the overall FSM evaluates if the ''converged'' signal is high or if the maximum number of iterations has been reached.If neither of these conditions are satisfied, (i.e., not true), the counter is incremented, and the overall FSM transitions back to the HP state.If any one of these conditions are satisfied (i.e., true), the overall FSM transitions to NEW_UK and sets a ''New_DU'' signal high to indicate that the correction factor is necessary.

5) MODULE 12

151For our proposed architecture, Module 12 (as depicted in Fig. 35) is the final computing module for the PB-MPC.As illustrated in Fig. 3 (in Section III-C), the cell current is composed of I string + i g .In this case, the I string is controlled by the higher-level energy management system, and is not subject to the smart sensor, leaving limiting i g via i g ref as the only signal option available to the MPC.Then, Module 12 is responsible for updating the control signal (u k ), where u k represents i g ref .

152If the control on the current, (i.e., i g ref ), developed by the smart sensor is insufficient to prevent the degradation of the battery cells, then the system takes action to reduce i g to zero, so that i cell is limited to I string .As in Fig. 35, Module 12 evaluates the control signal ''New_DU'' to determine if the FSM executes the states that add the correction factor to u • or if those states are bypassed.Moduel 12 then adds u • to u k−1 to update the control signal, New_DU.If New_DU = 0, the new control signal is equal to the original input (i g ref ); else, the new control signal is equal to i g ref plus the correction factor.A final set of comparisons is made to ensure the new control signal is sufficiently limited based on the minimum and maximum allowed I string .The control signal prior to this last compare is the one stored in memory to act as u k−1 , while the output of the comparisons becomes i * g ref .Upon completion of Module 12, the control signal is sent to the top module (i.e., the highest abstraction-level of our architecture) of our proposed architecture, indicating that the overall FSM (Fig. 24) is completed.The top-level architecture for Module 12 for Control Update is illustrated in Fig. 35.

D. STAGE 4: TEMPERATURE UPDATE 1) MODULE 13

153Stage 4 comprising Module 13 consists of a short FSM that loads the measured temperature of the battery into RAM to be utilized in the next iteration.Theoretically, the embedded microprocessor, in our case, MicroBlaze soft processor, that interfaces with our proposed hardware accelerator, would measure the temperature and provide the value via the AXI-Lite protocol.Module 13 also allows the MicroBlaze processor to access the four memories as needed.When creating our proposed hardware architectures, these memory access would be set to the control signal i * g ref , and the SOC.However, for evaluation and troubleshooting purposes, it is useful to be able to access the intermediate values stored by the hardware architectures.When the MicroBlaze processor completes accessing the memory, the processor asserts the ''end_test'' signal, i.e., sets this signal high.When that occurs, Stage 4 (comprising Module 13) transitions to the idle state in the top module (i.e., the highest abstraction-level of our architecture) of our proposed architecture, and waits for the next start signal for Stage 2, indicating another control interval has begun.

V. EXPERIMENTAL RESULTS AND ANALYSIS

154We perform experiments to evaluate the feasibility and efficiency of our proposed FPGA-based embedded hardware architecture/accelerator for the PB-MPC (comprising PB-EKF) smart sensor to support the battery management system using the model predictive control (MPC) for physicsbased electro-chemical battery model.We also compare our proposed FPGA-based embedded hardware architecture with the baseline Matlab model [7] for the PB-MPC in order to 106164 VOLUME 11, 2023 Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.evaluate and validate the correctness and functionalities of our proposed design.Furthermore, we utilize our previously introduced embedded software architecture for PB-MPC [19] to evaluate our embedded hardware architecture proposed in this research work.It should be noted that the evaluation setups for our embedded hardware and embedded software architectures are based on real implementations, whereas the evaluation setup for the baseline Matlab model is based on simulation.Our embedded hardware and embedded software results are obtained in real-time, while these designs are actually running on the Virtex-7 FPGA; whereas the baseline Matlab results are obtained through simulation on a desktop computer.Prior to our embedded hardware and embedded software architectures, we also create software designs for PB-MPC (comprising PB-EKF) in C, which is executed on desktop computers.These desktop C results are also compared and verified with the baseline Matlab results as well as with our embedded hardware and embedded software results.

155As detailed in Section III-A, our experiments are performed using an Urban Dynamometer Driving Schedule (UDDS) [23] current profile for the input (u k ) and the measured output (v k ).Our proposed hardware architecture for PB-MPC (comprising PB-EKF) is initialized using a state of charge (SOC) of 0.6 and an initial state covariance of diagonal matrix [1E5, 1E5, 1E7, 1E7, 5E9], similar to the baseline model in [7].The time-step or measurement interval for our experiments is 1 second, which is based on the slow dynamics of the lithium diffusion process in the battery cells [20].Our proposed PB-MPC smart sensor is created in such a way to support the normal driving of HEVs with the charging and discharging based on the UDDS driving profile [7].

156versus double-precision FPUs in baseline Matlab.Our results support this with a mean error of −6.53E-9 and a standard deviation of 3.35E-8, which again are very minute values, thus negligible.In summary, from the aforementioned results and analysis, we can conclude that our proposed embedded hardware architecture for PB-MPC (comprising PB-EKF) shows similar behaviors and functionalities as that of the baseline Matlab model, thus verifying the correctness and functionality of our proposed embedded hardware designs.These analyses show that the error difference values for all three functionalities are very minute, thus negligible.

B. PERFORMANCE ANALYSIS: EXECUTION TIME, SPEEDUP, AND RESOURCE UTILIZATION

157We perform experiments to evaluate the feasibility and efficiency of our proposed embedded hardware architectures in terms of speed-performance and resource utilization on the chip.

1) EXECUTION TIME AND SPEEDUP: EMBEDDED HARDWARE VS. EMBEDDED SOFTWARE, BASELINE MATLAB

158To evaluate the execution time and speedup of PB-MPC smart sensor, we compare the execution time of our proposed embedded hardware architecture with our embedded software design in [19], as well as the baseline Matlab mode.However, unlike the average execution time comparison in [19], in this research work, we compare the worst-case execution time as presented in Table 2.In this case, similar to our previously proposed ECM-based MPC designs [8], the total worst-case time to execute an iteration of the PB-MPC smart sensor (comprising PB-EKF) occurs when the HQP algorithm is activated, as the initial process fails to converge.The HQP algorithm, which solves the optimization of the cost function, is currently the largest bottleneck of our proposed design.This is mainly because HQP is a purely serial process that iterates until the conditions are met for an optimal solution or 500 iterations for a suboptimal solution.While we could use fewer iterations, it results in HQP being called more often.It is indeed a tradeoff that will be examined as future work.For our experiments, the worst-case execution time is mainly used to ensure there are enough resources to compute any situation.The worst-case time is also crucial to determine how many individual battery cells can safely be monitored and controlled by our proposed design on a single chip/FPGA.

159The total worst-case execution times for our proposed embedded PB-MPC hardware architecture as well as for our previously proposed embedded PB-MPC software architecture [19] are presented in Table 2.The total worst-case execution times for the baseline Matlab model is also presented in Table 2.The execution time for each design is measured 10 times and the average is presented.In this case, our embedded hardware is executed on the Virtex-7 FPGA running at 100MHz, whereas our embedded software is executed on the MicroBlaze soft processor running at 100MHz on the same FPGA, for fair comparison purpose.Also, Matlab software model is executed on the Intel Xeon processor running at 3.1GHz.As illustrated in Table 2, considering the total worst-case execution time, our embedded PB-MPC hardware smart sensor is almost 58 times faster than its equivalent embedded software, and is almost 5 times faster than the baseline Matlab model.

160From these results and analysis, it is evident that utilizing FPGA-based hardware to support and accelerate computationally complex algorithms, such as PB-MPC (comprising PB-EKF), we can achieve substantial speedup compared to its software counterparts.With these speedups, our proposed embedded PB-MPC hardware smart sensor deployed on a single chip/FPGA would be able to monitor and control multiple battery cells, individually, in BMS.These speedup results also indicate that FPGAs could accommodate more computationally intense versions/configurations of the physics-based model (PBM), and still perform within the required timeframe.

161It should be noted that this total worst-case execution time is due to the 500 iterations required for HQP computation.Hence, this is an area for further investigation to determine, when the best return-on-investment is, in terms of performance improvement versus the number of HQP iterations.Our proposed embedded hardware architecture for the PB-MPC smart sensor without the HQP activation executes in 20.8µs, leaving a large margin for performance improvement.Another opportunity for performance improvement would be to condense the iteration time of the HQP using faster IP cores.These hardware optimizations and performance improvements will be explored as future work.

2) FPGA RESOURCE UTILIZATION FOR OUR EMBEDDED HARDWARE

162The cost analysis on space (or area) is carried out to examine the area-efficiency of our proposed embedded hardware architecture for PB-MPC smart sensor (comprising the PB-EKF).The FPGA resource utilization for our proposed embedded hardware architecture presented in Table 3, includes the overall system-level design (based on Fig. 2).This cost analysis is similar to the space analysis for our previously proposed embedded PB-EKF hardware [18].In this case, significant resource utilization parameters are the occupied slices, BRAMs, and DSPs, whereas the occupied slices contain the slice registers and LUTs.As in Table 3 (row 2), the total number of occupied slices, total number of BRAMs, and total number of DSP slices required for embedded hardware (HW) architecture for PB-MPC smart sensor (comprising PB-EKF), are 7825, 42, and 117, respectively.As demonstrated in [8] and [18], most of the areaefficient embedded hardware architectures with the systemlevel designs, typically occupy similar or more area on chip.

163In Table 3 (row 3), we also present the FPGA resource utilization for our previously proposed PB-EKF in [18].We anticipate that our proposed embedded PB-MPC hardware architecture would occupy more slices on the chip, compared to our PB-EKF [18], since the former comprises the latter.However, as demonstrated in Table 3, our proposed PB-MPC occupies less slices on chip compared to previous PB-EKF, i.e., 7825 slices versus 10702 slices, respectively.This reduction in occupied slices, which led to the improvement of areaefficiency, is mainly due to several scenarios.One would be due to the continuous improvement of the internal hardware architectures, while creating the PB-MPC and integrating the PB-EKF.Another would be due to the Xilinx Vivado design tools utilized in this research work, which is more advanced and recent design tools compared to the Xilinx ISE design tools utilized for our previous work [18].It can be inferred, since the Vivado and ISE are not truly compatible, that Xilinx has implemented quite a few improvements to their syntheses and implementation algorithms for hardware placement and routing in advanced Vivado design tools.Another would be due to migrating to a more advanced Virtex-7 FPGA (on VC707 board) from Virtex-6 FPGA (on ML605 board).As detailed in Section III-C, since these FPGAs are not fully backward compatible, we dramatically modify our previous PB-EKF hardware, which led to an increase in clock frequency from 50MHz to 100MHz.One of these modifications include replacing all the native Xilinx IP cores supported by Virtex-6 FPGA and Xilinx ISE development environment, with the AXI IP cores supported by Virtex-7 FPGA and the Xilinx Vivado development environment, which may have reduced the interconnect resource requirements.

164In this research work, the adaptation of the AXI Xilinx IP cores and the additional optimization for latency would be responsible for the increase in number of DSP48E1 slices from 49 to 117, and partly responsible for the reduction in number of LUTs.The DSP48E1 slice is a custom logic arrangement, separate from the slice registers and the LUTs, that is optimized to support digital signal processing and arithmetic functions.With the modified version of PB-EKF architecture as well as the overall PB-MPC architecture, we optimize the IP cores for low latency in order to ensure proper timing closure for the overall design.This in turn results in a core generation that uses the maximum possible number of DSP48E1 slices for that specific core.Furthermore, Stage 2 for PB-MPC hardware architecture also incorporates 9 additional floating-point IP cores into the overall design, increasing the number of DSP48E1 slices.The timing closure consideration enables our proposed PB-MPC architecture to achieve an operating clock frequency of 100MHz, as opposed to our previous PB-EKF [18] operating at 50MHz.In case of timing closure failure, the seamless solution is to slower the clock speed to allow more time for signals to adhere to all the timing requirements.

165In Table 4, we present the percentage of FPGA resource utilization for our proposed PB-MPC executed on VC707 board with Virtex-7 FPGA (in row 2) [37] and for our previous PB-EKF executed on ML605 board with Virtex-6 FPGA (in row 3) [38].In this case, the percentages are reported only for significant utilization parameters, i.e., occupied slices, BRAMs, and DSPs.As in Table 4 (row 2), the percentage of occupied slices, percentage of BRAMs, and percentage of DSP slices, for our proposed PB-MPC (comprising PB-EKF) smart sensor, are only 10.3%, 4.1%, and 4.2%, respectively.In this research work, although we employ VC707 board with Virtex-7 FPGA as a prototyping platform, these percentages demonstrate that there is significant amount of unoccupied area on chip that can be utilized for other control systems techniques, if need be.

C. COMPARISON WITH RELATED WORK: PB-MPC AND PB-EKF

166We investigated the existing works on FPGA-based and/or embedded hardware architectures for ECM-based MPC smart sensors as well as PB-MPC smart sensors, each comprising EKF.From our extensive investigation and to the best of our knowledge, similar work does not exist in the published literature that provides FPGA-based and/or embedded hardware accelerator for MPC (comprising EKF) specifically for physics-based battery cell models.Focusing on the MPC, very few research work has been done for embedded architectures of PB-MPC, to this point.Although not embedded architectures, the most promising works were done by [6], [29], for ECM-based MPC and by [7] and [9] for PBM-based MPC, all of which were based on Matlab software models.In [7] and [29], the authors create Matlab designs to prove the efficacy of their models and the MPC algorithm approaches.The design decisions made in [7] and [29] to reduce the complexity make these Matlab models excellent candidates for successful embedded hardware as well as embedded software architectures.

167Considering the EKF, most of the existing embedded EKF architectures were designed for the equivalent circuit model (ECM).We found two existing research works [10], [30] that performed experiments, similar to ours, to obtain speed and space.In [10], a dual EKF was designed using the ECM for the battery cell; this was implemented on Altera FPGAs without the system-level architecture.Another ECMbased EKF [30] was designed to estimate the state of charge (SOC) using fixed-point arithmetic, which was implemented on Altera Cyclone II FPGA.Since these existing works were created for different EKF algorithms and were implemented on different development platforms, it is challenging to make a fair comparison in terms of space and speed.

VI. CONCLUSION AND FUTURE WORK

168In this paper, we introduced a novel, unique, efficient, and functional embedded hardware architecture for the PB-MPC smart sensor (comprising PB-EKF) for lithium-ion battery cell control, by considering the computational complexity of PBM.Our proposed embedded hardware architecture for the PB-MPC performed well within the required 1second update intervals of the battery management system (BMS), while running at only 100MHz.Considering the worst-case execution times, our embedded PB-MPC hardware accelerator (running at 100MHz) was almost 58 times faster than the equivalent embedded software, running on the same FPGA, while maintaining a small footprint required for portable systems.Our proposed hardware was almost 5 times faster than the baseline Matlab software model (running at 3.1 GHz) on desktop computer.

169From our results and analysis, it is evident that utilizing FPGA-based hardware to support and accelerate computationally complex PB-MPC (comprising PB-EKF), we can achieve substantial speedup compared to its software counterparts.With these speedups, our proposed embedded PB-MPC hardware smart sensor deployed on a single chip/FPGA would be able to monitor and control multiple battery cells, individually, in BMS, compared to that of embedded microprocessors.Considering a typical battery pack made up of 84 cells, our embedded hardware on a single chip could easily execute the PB-MPC algorithm for all the 84 cells with the required 1s update intervals, since the worst-case execution time is only 1.2 milliseconds.These speedup results also indicate that FPGAs could accommodate more computationally intense versions/configurations of the physics-based model (PBM), and still perform within the required timeframe.

170The use of the MPC as a smart sensor is a logical step forward in battery control and management for many hybrid electric vehicles (HEVs).Our results illustrate that the increase in FPGA resource utilization is minimal from our previous PB-EKF [18] to our current PB-MPC smart sensor (comprising PB-EKF).This research work also demonstrates the feasibility of deploying/realizing computationally intense methods, such as PB-MPC comprising PB-EKF, normally reserved for industrial control, on resource-constrained portable and embedded systems.

171From our investigation on the existing works and to the best of our knowledge, no similar work exists in the published literature that provides a full and functional embedded hardware architecture for a PB-MPC smart sensor (comprising PB-EKF) specifically for battery cell control and monitoring, highlighting the uniqueness of our contribution.

172Utilization of physics-based model (PBM) enables closer observation as well as tracking and controlling of the chemical aging mechanisms in lithium-ion batteries, which could otherwise be disregarded when utilizing equivalent-circuit model (ECM).The ability to monitor the aging mechanisms facilitates the accurate settings of the safety margins, which in turn would enhance the performance and extend the useful life of the battery.Our proposed FPGA-based embedded hardware accelerator was designed in such a way to reuse the linearized output matrices by the PB-MPC, thus making it more area-efficient.Our proposed PB-MPC coupled with the physics-based observer (i.e., PB-EKF) can be used as a smart sensor for a larger BMS, reducing the computational complexity of the overall PB-MPC algorithm and minimizing the dependency of a central controller.

173As future work, we are planning to study and integrate dynamic reconfiguration techniques [31], [32] to create dynamic reconfigurable hardware architectures (similar to [33]) to further enhance various traits, especially adaptability traits, of our proposed PB-MPC smart sensor.Also, as future work, we will explore and create parallel processing architectures, such as [34], for our PB-MPC hardware accelerator to further improve the speedup, while considering the speed-space tradeoffs of the resource-constrained embedded devices.To facilitate this endeavor, we will incorporate multi-ported memory designs, such as [28], to potential parallel processing hardware architecture, which would substantially elevate the performance.

FIGURE 2 .

174FIGURE 2. Extended kalman filter process.

FIGURE 3 .

175FIGURE 3. System-level architecture for our PB-MPC smart sensor.

FIGURE 4 .

176FIGURE 4. Block diagram of the BMS with a PB-MPC smart sensor [19].

FIGURE 5 .

177FIGURE 5. Block diagram of the hardware flow for our PB-MPC smart sensor.

FIGURE 6 .

178FIGURE 6. Top-level architecture for Module 2.

FIGURE 7 .

179FIGURE 7. Internal architecture for Index Finder.

FIGURE 8 .

180FIGURE 8. Internal architecture for Check_T module.

FIGURE 9 .

181FIGURE 9. Internal architecture for a matrix computation.

FIGURE 10 .

182FIGURE 10.Top-level architecture for Module 3.

FIGURE 11 .

183FIGURE 11.Internal architecture for SOC computation.

FIGURE 12 .

184FIGURE 12. Internal architecture for MAC computation.

FIGURE 13 .

185FIGURE 13.Top level architecture for Module 4.The aforementioned corrections comprise simple memory calls and additions (by a FP adder).The concentrations in

186c s,0 = y k [7] + b c,neg (53) c s,L = y k [7] + b c,pos (54) where b c,neg and b c,pos are functions of the maximum negative and positive SOC and maximum negative and positive c s , respectively.These are implemented using a Xilinx FP adder.However, all these variables are constant for this temperature range, hence are pre-calculated and placed in the ROM.The next two corrections, which are potential in the electrolyte and flux computations, are interleaved to avoid waiting for any long-lead time operations such as square root, division and natural logarithmic.The equation (55) below presents the computation of the total potential in the electrolyte ( φe ).In this case, T k is the current temperature, and ϕ const is a pre-calculated value based on the Doyle parameters.We use Xilinx FP natural logarithmic IP to compute φe .φe = y k [6] + T k ϕ const ln c e,L c e,0

FIGURE 14 .

187FIGURE 14. Internal architecture for φe .

FIGURE 15 .

188FIGURE 15.Internal architecture for Flux computation.

FIGURE 16 .

189FIGURE 16.Internal architecture for η.

190.

FIGURE 17 .

191FIGURE 17. Internal architecture for Asinh computation.

FIGURE 18 .

192FIGURE 18. Internal architecture for Uocp and dUocp.

4) MODULE 5 Module 5

193computes the Kalman gain, the state measurement updates and the error covariance time/measurement updates, which are steps 4, 5 and 6 of Fig 2. The top-level architecture of Module 5 is illustrated in Fig. 19.

FIGURE 19 .

194FIGURE 19.Top level architecture for Module 5.

FIGURE 20 .

195FIGURE 20.Internal architecture for Chat_Dhat module.

FIGURE 21 .

196FIGURE 21.Internal architecture for SigmaX_time computation.

FIGURE 22 .

197FIGURE 22. Internal architecture for voltage error covariance (σ y ).

FIGURE 23 .

198FIGURE 23.Internal architecture for Update_SigmaX.

Algorithm 1

199Steps of Physics-Based MPC 1. Compute the next state for the state vector, x mpc,k+1 , based on the predicted state from PB EKF, x k+1 .2. Compute the augmented state vector for MPC, χ k 3. Build the output matrices, C ϕse and D ϕse .4. Build the gain matrices, G ϕse and ϕse from equation (32). 5. Build the constraint matrices, M and γ .6. Compute E and F from the cost optimization equations (38) and (39).7. Compute the unconstrained solution, u • .8. Check the solution against the constraints ( M ( u • ) ≤ γ ). 9. → If the check passes, U k = u • , then, jump to step 11. 10. → If the check fails, execute Hildreth QP to provide a constrained solution increment, u k .11. Update the control signal, i * gref = i gref + U k [0].setup steps 1 to 4 (in Algorithm 1).The top-level architecture of Module 8 is illustrated in Fig. 25.

FIGURE 24 .

200FIGURE 24.Overall FSM for our five modules of PB-MPC.

FIGURE 25 .

201FIGURE 25.Top level architecture for Module 8.

FIGURE 26 .

202FIGURE 26.Internal architecture for computing χ k .

FIGURE 27 .

203FIGURE 27.Parallel computation of G ϕse χ for γ .

FIGURE 28 .

204FIGURE 28.Top level architecture for Module 9.

FIGURE 29 .

205FIGURE 29.Computation of K, P and P −1 .

FIGURE 30 .

206FIGURE 30.Top level architecture for Module 10.

FIGURE 31 .

207FIGURE 31.Top-level architecture of Module 11 -HQP.

FIGURE 32 .

208FIGURE 32.Internal architecture for computation of w and lambda_choice.

FIGURE 33 .

209FIGURE 33.Internal architecture for computation of convergence ratio and u corr .

FIGURE 34 .

210FIGURE 34.Determining convergence.

FIGURE 35 .

211FIGURE 35.Top level architecture for Module 12.

FIGURE 41 .

212FIGURE 41.Our embedded hardware architecture error for ϕ s−e .

TABLE 2 .

213Execution time and speedup: Embedded hardware vs. Embedded software, and baseline Matlab.

TABLE 3 .

214FPGA resource utilization.

TABLE 4 .

215Percentage of resource utilization.

참고문헌 27건

  1. FPGA implementation of an observer for state of charge estimation in lithium-polymer batteries 2014 10.1109/icmc.2014.7231839
  2. The Dynamic Dictionary of Mathematical Functions (DDMF) Lecture notes in computer science · Springer Science+Business Media · 2010 10.1007/978-3-642-15582-6_7
  3. Estimating state of charge and state of health of rechargable batteries on a per-cell basis 2015 10.1109/mscpes.2015.7115399
  4. Towards a hybrid approach to SoC estimation for a smart Battery Management System (BMS) and battery supported Cyber-Physical Systems (CPS) 2012 10.1109/bcfic.2012.6217989
  5. Analysis of single-chip hardware support for mobile and embedded applications 2013 10.1109/pacrim.2013.6625505
  6. FPGA-Based Reconfigurable Hardware for Compute Intensive Data Mining Applications 2011 10.1109/3pgcic.2011.25
  7. One-dimensional physics-based reduced-order model of lithium-ion dynamics Journal of Power Sources · Elsevier BV · 2012 10.1016/j.jpowsour.2012.07.075
  8. Electrochemical state and internal variables estimation using a reduced-order physics-based model of a lithium-ion cell and an extended Kalman filter Journal of Power Sources · Elsevier BV · 2014 10.1016/j.jpowsour.2014.11.135
  9. Lithium-ion battery cell-level control using constrained model predictive control and equivalent circuit models Journal of Power Sources · Elsevier BV · 2015 10.1016/j.jpowsour.2015.03.074
  10. Parallel Computation of Similarity Measures Using an FPGA-Based Processor Array 2008 10.1109/aina.2008.97
  11. Extended Kalman filtering for battery management systems of LiPB-based HEV battery packs Journal of Power Sources · Elsevier BV · 2004 10.1016/j.jpowsour.2004.02.033
  12. State and Parameter Estimation of a HEV Li-ion Battery Pack Using Adaptive Kalman Filter with a New SOC-OCV Concept International Conference on Measuring Technology and Mechatronics Automation · 2009 10.1109/icmtma.2009.333
  13. Analysis of FPGA-Based Reconfiguration Methods for Mobile and Embedded Applications 2015 10.1145/2889287.2889297
  14. A review of developments in technologies and research that have had a direct measurable impact on sustainability considering the Paris agreement on climate change Renewable and Sustainable Energy Reviews · Elsevier BV · 2016 10.1016/j.rser.2016.11.215
  15. Accelerating State-Of-Charge Estimation in FPGA-based Battery Management Systems 2016 10.1049/cp.2016.0964
  16. Efficient Strategies for Predictive Cell-Level Control of Lithium-Ion Batteries 2016
  17. A Kalman Filtering Tutorial for Undergraduate Students International Journal of Computer Science & Engineering Survey · Academy and Industry Research Collaboration Center · 2017 10.5121/ijcses.2017.8101
  18. An adaptive physics-based reduced-order model of an aged lithium-ion cell, selected using an interacting multiple-model Kalman filter Journal of Energy Storage · Elsevier BV · 2018 10.1016/j.est.2018.07.004
  19. Efficient embedded architectures for fast-charge model predictive controller for battery cell management in electric vehicles EURASIP Journal on Embedded Systems · Springer Nature · 2018 10.1186/s13639-018-0084-3
  20. Lithium-ion Battery Management Using Physics-based Model Predictive Control and DC-DC Converters 2018 10.1109/itec.2018.8450187
  21. Noise and vibration suppression in hybrid electric vehicles: State of the art and challenges Renewable and Sustainable Energy Reviews · Elsevier BV · 2020 10.1016/j.rser.2020.109782
  22. Towards Composing Optimized Bi-Directional Multi-Ported Memories for Next-Generation FPGAs IEEE Access · Institute of Electrical and Electronics Engineers · 2020 10.1109/access.2020.2994882
  23. An Optimized FPGA-Based Hardware Accelerator for Physics-Based EKF for Battery Cell Management 2022 IEEE International Symposium on Circuits and Systems (ISCAS) · 2020 10.1109/iscas45731.2020.9181073
  24. Optimized Embedded Architectures for Model Predictive Control Algorithms for Battery Cell Management Systems in Electric Vehicles Digital Collections of Colorado (Colorado State University) · Colorado State University · 2020
  25. Battery Management Systems, Volume I: Battery Modeling 2015
  26. A design methodology for mobile and embedded applications on FPGA-based dynamic reconfigurable hardware International Journal of Embedded Systems · Inderscience Publishers · 2019 10.1504/ijes.2019.102416
  27. Composing Optimized Embedded Software Architectures for Physics-Based EKF-MPC Smart Sensor for Li-Ion Battery Cell Management Sensors · Multidisciplinary Digital Publishing Institute · 2022 10.3390/s22176438