Application of TinyML in Power Management Systems
[Copy link]
Original link: https://www.eeworld.com.cn/zt/Qorvo/view/1551
Today, data processing architectures are split. Cloud computing, with its massive scale and computing power, has become the focus, while edge computing puts the processing process on the "front line," connecting electronic devices to the real world. In the cloud, data storage is huge, and processing requires queuing and scheduling; at the edge, processing is done in a targeted and immediate manner.
This enables the system to respond quickly to local commands and application feedback while reducing data traffic to ensure a safer process. Of course, these two areas will also interact, with edge nodes transmitting data back to the cloud for aggregation and analysis across devices or locations, while global commands and firmware updates are transmitted back to the edge.
Both processing environments benefit from recent advances in artificial intelligence (AI) and machine learning (ML). For example, in data centers, thousands of servers containing tens of thousands of processors (mostly GPUs) perform massively parallel computations to generate and run large language models (LLMs) such as ChatGPT. By some metrics, the performance of these platforms now exceeds that of humans.
At the edge, processing responds to feedback sensors and commands based on operating algorithms. But with machine learning, the algorithms are now also able to effectively learn from feedback; thereby improving the algorithms and their calculation coefficients, making the controlled processes more accurate, efficient, and safer.
Differences in energy consumption between the cloud and the edge
There are big practical differences between cloud computing and edge computing in terms of the scale of energy used. In both cases, energy consumption must be minimized; but data centers consume a lot of electricity, estimated by the International Energy Agency (IEA) at around 240-340 terawatt hours (TWh), or 1%-1.3% of global demand. Artificial intelligence and machine learning will further accelerate energy consumption; the IEA predicts an increase of 20%-40% in the next few years, while historical data for this figure is only around 3%.
Unlike on-demand data processing tasks such as gaming and video streaming, AI consists of two phases: learning and reasoning; the learning phase uses data sets to train models. ChatGPT reportedly consumed more than 1.2TWh of electricity in the process. On the other hand, according to de Vries, LLM in the reasoning or running phase may consume 564MWh of electricity per day.
At the other end of the data processing architecture, edge computing in an Internet of Things (IoT) node or wearable device may consume no more than milliwatts of power. Even for industrial and electric vehicle (EV) applications such as motor control and battery management, the loss budget reserved for control circuits is small and cannot accommodate the significant increase in energy consumption brought about by the introduction of AI and machine learning.
As a result, tiny machine learning (tinyML) has evolved as an application and technology field for implementing sensor data analysis on-device, while being optimized for extremely low power consumption.
tinyML and power management
Adopting machine learning techniques in specific applications is a multi-dimensional problem. For example, tinyML can be used for battery management, where the goal is to charge as quickly, safely, and efficiently as possible while controlling discharge with minimal stress. Battery management also monitors the health of the battery and actively balances the cells to ensure even aging for maximum reliability and lifespan.
The monitored parameters include the voltage, current and temperature of a single cell; management systems often need to predict the battery's state of charge (SOC) and state of health (SOH). These parameters are dynamic quantities and have complex and variable relationships with the battery's usage history and measured parameters.
Despite the complexity of the task, AI processing does not require the use of expensive GPUs. Modern microcontrollers such as the ARM Cortex M0 and M4 series can easily handle machine learning tasks in battery management, and they consume very little power and are now integrated into dedicated system-on-chips (SoCs) for this application.
Battery management ICs are common, but with the help of MCUs that implement machine learning algorithms, information and patterns based on historical and current data from sensors can be used to better predict SOC and SOH while ensuring a high degree of safety. Like other ML applications, this requires a learning phase based on training data; the data can come from log records containing different environmental conditions and multiple battery manufacturing tolerances; in the absence of actual field data, synthetic data obtained by modeling can also be used.
As is the nature of AI, models can be continuously updated as field data accumulates to scale up or down the application or for use in other similar systems. While the learning process is usually a pre-application task, it can also be a background task based on sensor data, processed offline locally or through the cloud to achieve continuous performance improvements. Automatic machine learning (AutoML) tools combined with evaluation kits for battery management SoCs enable this capability.
Machine Learning Models
In edge applications such as machine learning and battery management, there are a variety of models to choose from. A simple classification decision tree is a small resource hog, requiring only a few kilobytes of RAM at most, but provides enough functionality for such applications. This approach can simply classify the acquired data as “normal” or “abnormal”; an example is shown in Figure 1.
Figure 1: In this decision tree classifier example, “class 1” = normal and “class 0” = abnormal
Two parameters are used here to describe the state of a multi-cell battery pack during discharge: the SOC (state of charge) of the strongest cell, and the voltage difference between the strongest and weakest cells. Blue and white nodes represent normal data; classification areas are represented in blue ("Class 0" = normal) and gray ("Class 1" = abnormal).
If you want to evaluate continuous values of output data, rather than just categories, you can use more complex regression decision trees. Other common ML models include support vector machines (SVMs), kernel approximation classifiers, nearest neighbor classifiers, naive Bayes classifiers, logistic regression, and isolation forests. Neural network modeling can be included in AutoML tools to improve performance at the cost of increased complexity.
The entire development process of an ML application is called "MLOps," or "ML Operations," and includes data collection and organization, as well as model training, analysis, deployment, and monitoring. Figure 2 graphically illustrates the battery management application development process using the PAC25140 chip, which monitors, controls, and balances a battery pack consisting of up to 20 cells in series, suitable for lithium-ion, lithium-polymer, or lithium iron phosphate batteries.
Figure 2: The above design example highlights the tinyML development process
Case Study: Weak Cell Detection
Degraded cell detection is part of battery SOH monitoring. One of the characteristics of these cells may be an abnormally low battery voltage under load. However, the voltage is also affected by the actual discharge current, charge state and temperature, as shown in Figure 3, which highlights example curves of strong and weak cells at different temperatures and load currents.
Figure 3: Discharge curves of strong and weak cells
Figure 3 shows the significant difference between the voltage of the strong and weak cells as the cells near exhaustion; however, detecting the weak cell at this point may be too late to avoid overheating and safety issues. Therefore, implementing ML becomes a solution to find relevant patterns in the data at an earlier stage of the discharge cycle.
The effectiveness of the ML approach was demonstrated in an experiment conducted by Qorvo. In this experiment, a weak cell was inserted into a battery pack consisting of 10 cells and compared with a battery pack in good condition. The two groups of cells were discharged at different constant current rates and temperatures to generate training data; the monitoring parameters included their current, temperature, the voltage difference between the strongest and weakest cells, and the SOC of the strongest cell.
During the 20 discharge cycles, the parameters were synchronously sampled every 10 seconds and analyzed using the different models listed in Table 1. Comparison of the results with independent test data of the 20 discharge cycles shows that the consistency of the two methods is very close; with more training samples, their consistency will be further improved.
Figure 4: Example results extracted from training and testing data for different ML models
SoCs are powerful enough to support ML
Although the current focus of AI is on large-scale, high-power applications; however, for applications such as battery monitoring, "edge-deployed" AI using MCU and tinyML technology can also be part of a high-performance, low-power solution. In this scenario, the SoC solution has all the processing power required and can integrate various machine learning algorithms.
All necessary sensors and communication interfaces are built in; in addition, the SoC is supported by a rich ecosystem of evaluation and design tools.
|