# Tiny Machine Learning Battery State-of-Charge Estimation Hardware Accelerated
## 1 Introduction  
Electric vehicles (EVs) have seen a significant increase in adoption over the past decade [1]. Sales of EVs, such as city cars, buses, scooters and e-bikes, are supported by a quest for more energy-efficient urban transport. Furthermore, light-duty electric vehicles fit perfectly with new urban mobility macro trends, such as car and bike sharing [2]. Technological advances in electronic devices and batteries have played a major role in successes in recent years; in particular, lithium-based technology [3, 4] has established itself as the most widely adopted choice for energy storage in EVs [5]. The price of lithium-ion batteries has been reduced by approximately 97% since their introduction on the market [6], facilitating the market penetration of electric vehicles. Projections of future adoption indicate that EVs could achieve a position of dominance before 2050 within urban areas [1]. EV performance is strongly influenced by the battery and the specific battery management system (BMS). The main responsibilities of the BMS is to ensure the safety and reliability of the battery by estimating the most relevant states of the battery system, such as its state-of-charge (SoC) and state of health (SoH) [7]. The BMS collects real-time data about the temperature, voltage and current of the cells embedded into the battery packs, then uses these data processed by embedded algorithms to estimate SoC and SoH. SoC measures the amount of energy left inside an electric battery. Its correct estimation is an essential element to ensure the safety of the vehicle and, therefore, the safety ofany human using the vehicle or in its proximity. It can be calculated using Equation (1) as follows:  
\[SoC(t)=\frac{\int_{t_{0}}^{t}I_{b}(\tau)d\tau}{Q_{0}}\times 100 \tag{1}\]  
where \(I_{b}(\tau)\) is the charging current, the charge delivered to the battery is \(\int_{t_{0}}^{t}I_{b}(\tau)d\tau\) and \(Q_{0}=\int_{t_{0}}^{\infty}I_{b}(\tau)d\tau\) is the total charge the battery can hold [8]. SoC plays a key role in the optimized management of the vehicle's electrical energy, enabling efficient use of battery power. However, the SoC is not a direct observable quantity in a low-cost way, at least from the consumer perspective, and the relationship between it and the observable physical quantities of the battery is not linear. Due to the importance and complexity of the estimation process, SoC prediction has been the focus of numerous recent studies. Traditional estimation methods not based on machine learning (ML) techniques have shown numerous limitations. One of the simplest approaches to estimate SoC is the Coulomb Counting (CC) method. It has been adopted for small electrical devices due to its simple computational nature. However, the conventional CC algorithm has been deemed unsuitable for the online SoC estimation problem due to the following two main problems: the initial value of the SoC should be known, and high error accumulation tends to occur [9]. Furthermore, the aging process and temperature could affect the accuracy of SoC calculation by varying the Coulomb efficiency. SoC estimation via the Ampere-hour (Ah) counting method has also been widely used due to the low computational complexity required. This algorithm is based on current measurement, representing one of its main problems due to current sensor drift and current measurement error. The current measurement error increases over time and is not reliable without re-calibration [10]. In general, it has been suggested that to achieve acceptable levels of accuracy through Ah counting, a re-calibration of the method is required, which cannot exceed 10 days, and this is not usually allowed for automotive applications. SoC estimation methods based on closed-loop models, such as filter- or observer-based approaches, overcome the shortcomings of traditional approaches [11].