Intelligent battery management system and control method based on DNN battery state prediction deployment

By using DNN model and STM32 chip in the lithium battery management system, combined with filtering algorithm, the error and real-time problems of lithium battery SOC measurement are solved, and high-accuracy and fast response battery status monitoring and control are achieved, suitable for a wide range of Hardware platform.

CN119291507APending Publication Date: 2025-01-10WUHAN UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411252173.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-09
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The existing lithium battery SOC measurement methods have large errors or cannot be measured in real time, and the artificial intelligence algorithms have poor compatibility when deploying on hardware platforms, making it impossible to achieve accurate lithium battery status monitoring and control.

Method used

An intelligent battery management system based on DNN is designed, using the STM32 chip as the main controller, combining Kalman filtering and anti-pulse interference average filtering algorithm, and deploying a DNN model for SOC prediction to achieve accurate measurement and control of battery status.

Benefits of technology

It improves the accuracy and controllability of the lithium battery management system, realizes accurate prediction of SOC, has fast response speed, is suitable for common hardware platforms, and has wide applicability and compatibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119291507A_ABST
    Figure CN119291507A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent battery management system and a control method based on DNN battery state prediction deployment, a single chip microcomputer hardware platform with a cortex-m4 main chip is constructed to form an SOC battery management system, the SOC battery management system is used for switching and switching of battery charging and discharging states and control data acquisition, a DNN model is deployed in the main chip, and the DNN model is used for predicting the state of a battery. And battery state prediction is carried out based on the collected data to obtain an accurate SOC value. The problem of compatibility when an artificial intelligence algorithm is deployed on a hardware platform is solved, and meanwhile, the SOC prediction accuracy of the lithium battery approaches a real measurement value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of new energy control technology, and more specifically, to an intelligent battery management control system and control method for lithium batteries and related new energy batteries. Background Art

[0002] Lithium batteries are key components in the field of new energy storage, and they play an important role from traditional industrial control to the new energy vehicle industry.

[0003] Real-time status monitoring of lithium batteries, especially the dynamic changes of parameters such as state of charge (SOC), current and voltage, ambient temperature and humidity, is crucial for the battery management system (BMS). Accurate estimation and measurement of SOC can prevent overcharging and over-discharging of batteries, thereby reducing safety risks and extending battery life. At the same time, changes in current and voltage can reflect the real-time operating status of the battery and provide a basis for maintenance and replacement strategies.

[0004] In the current SOC measurement, the commonly used traditional methods include: ampere-hour integration method, open circuit voltage method, and DC internal resistance method. First, build a hardware circuit, use the relationship between current and resistance to time charge and discharge, and use the physical model to estimate the SOC. Among them, the ampere-hour integration method is simple and easy to use, but the cumulative error is large and is not suitable for practical application. Although the open circuit voltage method and the DC internal resistance method have high accuracy, they cannot be measured in real time in the working system, and the battery needs to be refined before measurement.

[0005] Currently, artificial intelligence algorithms are used for SOC measurement and control. The neural network-based method can automatically learn the nonlinear relationship between measurement parameters and SOC values ​​while ignoring the complex working principle and mathematical model of lithium ions. However, neural networks are still in the theoretical stage of simulation experiments. There are matching and compatibility issues in the deployment of artificial intelligence algorithms and hardware physical platforms. It is impossible to truly implement the deployment of artificial intelligence algorithms on the current common hardware platforms, and therefore it is impossible to achieve accurate measurement and control of lithium battery SOC in real scenarios. Summary of the invention

[0006] In response to the problems existing in the prior art, this application provides an intelligent battery management system and control method based on DNN battery status prediction deployment to improve the compatibility issues when the artificial intelligence algorithm is deployed on the hardware platform, and at the same time, the accuracy of lithium battery SOC prediction is close to the actual measurement value.

[0007] The technical solution of this application is implemented as follows: An intelligent battery management system based on DNN battery state prediction deployment, characterized by comprising: A main controller module (100) comprises at least a single-chip microcomputer main chip and peripheral circuits, and is used for switching the battery charging and discharging state and controlling data collection, while deploying a DNN model in the main chip to predict the battery state based on the collected data to obtain an accurate SOC value; A charging and discharging module (200), comprising positive and negative electrodes arranged according to loads, for realizing charging and discharging functions of a battery; A drive control module (300), the output end of which is connected to the input end of the charge and discharge module (200), and the input end of which is connected to the output end of the main controller module (100), and is used to control the switching and starting of the charge and discharge state; The analog-to-digital conversion module (400) converts the collected battery working status data into a digital quantity that can be recognized by the single-chip microcomputer, and performs software filtering through Kalman filtering and pulse interference prevention average filtering algorithms; The working state acquisition module (500) is connected to the input end of the analog-to-digital conversion module (400) and the main controller module (100) with corresponding polarities; and is used to collect current, voltage, temperature and environmental operation data of the battery when it is working; The data display module (600) is connected to the main controller module (100) and is used to visualize the read and converted data; And a communication module (700) is connected to the main controller module (100) with corresponding polarity and is used to transmit battery operating data information to a communication host computer.

[0008] In the above technical solution, the main controller module (100) adopts a main chip whose main chip is a cortex-m4 chip.

[0009] In the above technical solution, the main chip is the STM32F407VET6 chip or the gd32 chip of the same architecture.

[0010] In the above technical solution, the charging and discharging module realizes the charging and discharging functions of the battery under the control of the driving control module. The generated current and voltage signals and environmental status are processed by the working status acquisition module and transmitted to the ADC conversion module to realize analog-to-digital conversion and filtered by the software filtering algorithm. After being sent to the main controller module for processing, the battery status is predicted through the deployed DNN model, and the processed parameters are transmitted to the data display module to display the working status and data, and the real-time values ​​are transmitted to the communication host computer through the communication module.

[0011] In the above technical solution, the charging and discharging module includes a charging control part and a discharging control part; the charging control part includes a TP4056A charging IC chip and its peripheral circuit, whose input end is connected to the positive pole of the battery and an external 5V DC power supply voltage; the discharging control circuit includes a cement resistor and a discharge status indicator light to simulate the normal working state of the battery.

[0012] In the above technical solution, the driver control module controls the switching and switching of the charging and discharging states by controlling the on and off of the relay; the output end of the driver control module is connected to the input end of the charging and discharging module; the input end of the driver control module is connected to the output end of the main controller module.

[0013] In the above technical scheme, the working status acquisition module includes: a charging and discharging working current sampling circuit, a charging and discharging working voltage sampling circuit, and an ambient temperature and humidity sampling circuit; the output ends of the charging and discharging working current sampling circuit, the charging and discharging working voltage sampling circuit, and the ambient temperature and humidity sampling circuit are all connected to the corresponding pins of the STM32F407VGT6 chip at the input end of the analog-to-digital conversion module.

[0014] In the above technical solution, the analog-to-digital conversion module performs software filtering on the collected battery operating status data through Kalman filtering and pulse interference-proof average filtering algorithm.

[0015] In the above technical solution, the data display module is based on the SPI protocol, and the collected battery working data is converted by the STM32 chip and displayed on the OLED display screen, thereby realizing the visualization and real-time observation of various data indicators.

[0016] In the above technical solution, the communication module includes an RS485 communication interface and a Wifi communication interface; the RS485 communication interface transmits the battery working data to the host computer through the RS485 bus through the Modbus_RTU protocol; the Wifi communication interface transmits the battery working data to the cloud platform through the ESP8266 control chip through the MQTT protocol.

[0017] In the above technical solution, the internal neural network structure of the DNN model consists of an input layer, a hidden layer and an output layer, and the hidden layer includes product neurons and summation neurons.

[0018] In the above technical solution, Relu is selected as the activation function.

[0019] In the above technical solution, the DNN model is trained using the Adam optimizer with weight decay or L2 regularization term, and the remaining parameters are optimized using five-fold cross validation and grid search.

[0020] In the above technical solution, the DNN model is based on the optimal hyperparameters, using 80% of the University of Maryland 18650 lithium battery dataset as the training set for model training, and the remaining 20% ​​as the test set for model performance testing.

[0021] In the above technical solution, the DNN model is expressed as: (1) (2) in, represents an n-dimensional input vector, express No. elements; Indicates from to Layer multiplies the weight matrices between neurons; Represents the adaptive weight matrix from the j-layer product neurons to the k-layer neurons; is the output of the neural network; Represents the number of layers of the corresponding neural network. When , the hidden layer contains only one layer of product neurons; represents the basis function vector; represents the adaptive threshold; is a non-linear activation function.

[0022] An intelligent battery SOC control method based on DNN battery state prediction deployment, characterized by comprising the following steps: Step S1: Determine the main parameters of the DNN model: including input layer size, hidden layer size list, output layer size, learning rate, batch size, number of iterations, and weight decay; Step S2: Select a suitable activation function for the DNN model and set the number of training times; Step S3: Training using the Adam optimizer with weight decay or L2 regularization term; Step S4: Use five-fold cross validation and grid search to optimize the three parameters of learning rate, batch size, and weight decay; Step S5: Based on the optimal hyperparameters, 80% of the University of Maryland 18650 lithium battery dataset is used as a training set for model training, and the remaining 20% ​​is used as a test set for model performance testing; Step S6: deploy the trained DNN model to the main chip of the main controller module with SOC management function for predicting the SOC value.

[0023] In the above technical solution, the five-fold cross validation and grid search described in step S4 for optimizing the three parameters include: dividing the data set into five subsets, taking each subset as a test set in turn, and the remaining four subsets as training sets, thereby evaluating the model five times.

[0024] In the above technical solution, the DNN model performance test in step S5 uses the mean absolute error, root mean square error, and correlation coefficient as evaluation indicators of the prediction results.

[0025] In the above technical solution, the University of Maryland 18650 lithium battery dataset described in step S5 is a battery charge and discharge dataset under BJDST working conditions at room temperature of 25°C.

[0026] In the above technical solution, in step S6, after the DNN model is trained by python, it is saved in ONNX format and imported into X-CUBE-AI. Using the X-CUBE-AI tool chain, the trained neural network model is implemented in C language and deployed to the main chip.

[0027] In summary, the beneficial effects of this application are: On the one hand, the battery management system hardware platform is realized by using single-chip microcomputer chips represented by STM32 chips, including rs485-modbus communication of industrial communication interface and esp8266 communication of Internet of Things interface. At the same time, the collected data is filtered by software. The Kalman filter combined with anti-pulse interference average filter is used. The collected data is more accurate and can be implemented and deployed based on artificial intelligence algorithms to realize intelligent control of battery charging and discharging, and realize real-time display of various data, which effectively improves the accuracy and controllability of the battery management system.

[0028] On the other hand, the deep neural network (DNN) is deployed in the STM32 chip, the main chip of the representative hardware platform, to achieve accurate prediction of SOC. Its prediction accuracy is higher than that of traditional prediction methods, and its response speed is faster. At the same time, it does not require a host computer and has great flexibility and portability.

[0029] Finally, the DNN algorithm deployed on this platform can be used on any cortex-m4 chip and is also portable. It can also be successfully ported to the domestic gd32 chip with the same architecture, so it has relatively wide applicability and compatibility. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0031] Figure 1 It is a schematic diagram of the overall structure of the intelligent battery management system of the present invention; Figure 2 is a schematic diagram of the main controller module 100 of the present invention; Figure 3 is a schematic diagram of a charge and discharge module 200 of the present invention; Figure 4 is a schematic diagram of a drive control module 300 of the present invention; Figure 5 is a schematic diagram of the working status acquisition module 500 of the present invention; Figure 6 is a schematic diagram of the communication module 700 of the present invention; Figure 7 It is the main function flow chart of the present invention; Figure 8 It is a flow chart of model training and deployment of the present invention; Fig. 9 It is a point-line diagram of the training model of the present invention and the true value; Fig.10 It is a dot-line graph of the deployment output value and the true value; The corresponding reference numerals in the figure are as follows: 100, main controller module; 101, single-chip microcomputer and its peripheral circuits; 102, JTAG download circuit; 103, filter circuit; 104, reset circuit; 105, external clock circuit; 200, charge and discharge module; 201, TP4056A charging circuit; 300, drive control module; 301, charging control circuit; 302, discharge control circuit; 400, analog-to-digital conversion module; 500, working status acquisition module; 501, ACS712 current acquisition circuit; 502, voltage acquisition circuit; 600, data display module; 700, communication module; 701, MAX485 communication control circuit. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.

[0033] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0034] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0035] In the description of the present application, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, or the positions or positional relationships in which the product of the application is usually placed when in use. They are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific position, be constructed and operated in a specific position, and therefore cannot be understood as a limitation on the present application. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.

[0036] In the description of this application, it should also be noted that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0037] The features and performance of the present application are further described in detail below in conjunction with the embodiments.

[0038] Example 1 refer to Figures 1 to 6The present invention provides an intelligent battery management system based on DNN battery state prediction deployment, including: a main controller module 100, a charge and discharge module 200, a drive control module 300, an analog-to-digital conversion module 400, a working state acquisition module 500, a data display module 600 and a communication module 700. Among them: the main controller module 100 is used to realize the switching and switching of the battery charge and discharge state, and collect the charge and discharge current voltage and environmental state in real time. At the same time, the DNN model is deployed to predict the battery state based on the collected real-time operation data to obtain an accurate SOC value. The main controller module 100 has a single-chip microcomputer 101 and its peripheral circuits, a JTAG download circuit 102, a filter circuit 103, a reset circuit 104, and an external clock circuit 105; the charge and discharge module 200 is used to realize the charging and discharging functions of the battery; the charge and discharge module 200 is connected to the drive control module 300 with corresponding polarity; the drive control module 300 is used to control the switching and starting of the charge and discharge state, and the output end of the drive control module 300 is connected to the input end of the charge and discharge module 200; the input end of the drive control module 300 is connected to the output end of the main controller module 100. The analog-to-digital conversion module 400 converts the collected battery working status data into digital quantities that can be recognized by the single-chip microcomputer, and performs software filtering through Kalman filtering and pulse interference protection average filtering algorithms; the working status acquisition module 500 is used to collect current, voltage, temperature and other data when the battery is working; the working status acquisition module 500 is connected to the input end of the analog-to-digital conversion module 400 and the main controller module 100 with corresponding polarities; the data display module 600 is used to visualize the read converted data; the data display module 600 is connected to the main controller module 100; the communication module 700 is used to transmit the battery working data information to the communication host computer; the communication module 700 is connected to the main controller module 100 with corresponding polarities.

[0039] In this example, the model of the single-chip microcomputer 101 is STM32F407VET6. The main controller module 100 includes: a single-chip microcomputer 101 and its peripheral circuits, a JTAG download circuit 102 electrically connected to the corresponding end of the single-chip microcomputer 101, a filter circuit 103, a reset circuit 104, an external clock circuit 105 and a 3.3V power supply circuit 106. Among them: the STM32 minimum system uses an HSE external high-speed clock and an external 8M passive crystal oscillator to provide a stable and high-speed clock signal. The STM32 configures the flash memory as the program startup area, connects the BOOT pin to a low level, and uses the J-LINK download mode to burn the software program through the JTAG download port. In order to ensure the stability of the STM32 microcontroller, the power supply pin of the STM32 is connected to an external filter capacitor to reduce the impact of noise. The STM32F407VET6 uses the Cortex-M4 core, the Thumb-2 instruction set, supports 16-bit and 32-bit instructions, and includes a floating-point unit (FPU) with a frequency of up to 168Mhz. The STM32F407VET6 chip has 3 ADCs, each with 16 channels, for a total of 48 channels that can be used for analog input. The A / D conversion of each channel can be performed in single, continuous, scan or intermittent mode. The maximum operating frequency of the ADC of the STM32F407VET6 is 36MHz, and its ADC clock (ADCCLK) comes from APB2, and the frequency of APB2 is usually 84MHz. The ADC clock is adjusted by setting the ADC input clock division. If you need to measure a wider voltage range, such as negative voltage or higher positive voltage, you can add a voltage conditioning circuit externally to adjust the voltage to be converted to 0~3.3V, so that the ADC can be measured. Interrupts during the running of the STM32 program can interrupt the normal execution of the program. Similarly, the conversion of the injection channel can interrupt the conversion of the regular channel. After the injection channel is converted, the regular channel can continue to convert. In this example, the data collected by the ADC is transmitted using DMA to achieve high-speed real-time.

[0040] In this example, the battery is usually measured by current and voltage in the charge and discharge working state. The 18650 lithium battery is used as the experimental object. The switching and switching of the battery charge and discharge state are controlled by the drive control module 300. The working state acquisition module 500 collects the real-time current, voltage, and temperature of the battery during operation and transmits them to the main controller module 100 through the analog-to-digital conversion module 400. The main controller module 100 predicts the SOC of the battery through the deployed DNN model, and visualizes the various battery working data through the display module 600. At the same time, the communication module 700 transmits the battery working data to the communication host computer. Intelligent control of battery operation and real-time detection of battery working status are realized, and a more accurate SOC range can be calculated, which effectively improves the data accuracy and portability of the battery management platform.

[0041] In the present invention, the charging and discharging module 200 includes a charging part 201 and a discharging part 202; the charging part 201 includes a TP4056A charging IC chip and its peripheral circuits. Among them: the charging part 201 includes a TP4056A charging IC chip and its peripheral circuits, and its output end is connected to the positive electrode of the battery; the discharging part 202 includes a cement resistor and a discharge status indicator light to simulate the normal working state of the battery; In this example, the TP4056A chip of the charging part 201 integrates an internal power MOSFET switch to control the charging process, without the need for an external isolation diode. It also has a built-in anti-reverse charging circuit to prevent the current from flowing in reverse, converting the external 5V supply voltage into a constant current input for the battery; In the present invention, the driving control module 300 includes a charging control circuit 301 and a discharging control circuit 302, wherein: the charging control circuit 301 and the discharging control circuit 302 are controlled by relays; the input end of the charging control circuit 301 and the input end of the discharging control circuit 302 are connected to the output end of the single-chip computer 101; the output end of the charging control circuit 301 is connected to the input end of the charging part 201, and the discharging control circuit 302 is connected to the input end of the discharging part 202; In this example, when the corresponding pin of the microcontroller 101 sends a high level, the relay is turned on, the corresponding control circuit is turned on, and the battery starts working; when the corresponding pin of the microcontroller 101 is a low level, the relay is turned off, the corresponding control circuit is turned off, and the battery stops working.

[0042] In the present invention, the analog-to-digital conversion module 400 adopts the unipolar 12-bit ADC in the single-chip microcomputer 101 chip to configure a continuous scanning conversion mode. The conversion result is represented by an unsigned binary number, which can realize AD conversion and clock synchronization, support conventional conversion for DMA operation requests, the input clock is up to 36Mhz, the shortest conversion time is 125 clock cycles, the highest sampling frequency is 1Mhz, and the voltage sampling range is 0~3.3V, which can be specifically converted into a 16-bit integer with a value range of 0~4095.

[0043] In the present invention, the working status acquisition module 500 includes a charging and discharging working current sampling circuit 501, a charging and discharging working voltage sampling circuit 502, and an ambient temperature and humidity sampling circuit 503, wherein: the output ends of the charging and discharging working current sampling circuit 501, the charging and discharging working voltage sampling circuit 502, and the ambient temperature and humidity sampling circuit 503 are all connected to the input end of the analog-to-digital conversion module 400 and the corresponding pins of the single-chip microcomputer 101.

[0044] In this example, the charge and discharge working current sampling circuit 501 is connected in series to the charge and discharge module 200 to convert the current signal into a voltage signal; the charge and discharge working voltage sampling circuit 502 converts the voltage signal into a voltage within the voltage sampling range by means of voltage component splitting; the temperature and humidity sampling circuit 503 uses the AHT20 temperature and humidity sensor to transmit the read temperature and humidity values ​​to the microcontroller 101 through the IIC protocol.

[0045] Specifically, the IIC (Inter-Integrated Circuit) protocol is used for data transmission between the temperature and humidity sampling circuit 503 and the single-chip microcomputer 101. This is a half-duplex serial communication protocol, and its main purpose is to establish a connection between a microcontroller and its peripheral devices. Specifically, the IIC bus consists of a data line SDA and a clock line SCL, through which data can be sent and received. Bidirectional data transmission can be carried out between the CPU and the controlled IC, or between ICs, and the rate of the standard IIC bus can generally reach more than 400kbps. In the application of the AHT20 temperature and humidity sensor, the protocol allows the sensor to transmit temperature and humidity data to the microcontroller through the IIC interface. In this example, the reading of the AHT20 sensor data by the single-chip microcomputer 101 is realized through programming.

[0046] In the present invention, the data display module 600 is realized by an external OLED display screen, based on the SPI communication protocol, to achieve high-speed synchronous transmission and display control of data, and the OLED display screen is connected to the corresponding pins of the single-chip microcomputer 101.

[0047] Specifically, the data display module 600 communicates with the single-chip computer 101 through the SPI protocol to achieve high-speed synchronous data transmission and display control. The SPI (Serial Peripheral Interface) protocol is a commonly used data communication method. The protocol uses two data lines, MOSI (Master Out Slave In) and MISO (Master In Slave Out), and the SCK (Serial Clock) clock line to achieve synchronous data transmission. At the beginning of SPI communication, the NSS (Chip Select) signal line changes from high to low, indicating the start of communication; and at the end, the NSS signal changes from low to high, marking the end of communication. SPI is divided into two modes, master and slave. An SPI communication system needs to include one (and only one) master device and one or more slave devices. The master device (Master) provides the clock, and the device that receives the clock is the slave device (Slave). The read and write operations of the SPI interface are all initiated by the master device. When there are multiple slave devices, they are managed through their respective chip select signals.

[0048] In the present invention, the communication module 700 includes an RS485 communication interface 701 and a Wifi communication interface 702, wherein: the communication module 700 is used to transmit battery working data information to the communication host computer; the RS485 communication interface 701 is connected to the corresponding end of the external 485 summary; the Wifi communication interface 702 is connected to the corresponding end of the ESP8266 chip.

[0049] Specifically, the RS485 communication interface 701 adopts the Modbus_RTU protocol to realize data communication of signed 32-bit floating point numbers. Modbus_RTU is a serial communication protocol commonly used in the field of industrial automation, characterized by simple and efficient, master-slave structure, and half-duplex communication. Physical layer connection is based on standards such as RS-232 or RS-485, and a simple frame format is used for data exchange. In this protocol, one device acts as a master station and the others as slave stations. The master station initiates a request, and the slave station responds according to the instruction. Information is transmitted in bytes, and each information frame includes a device address, a function code, data, and an error check code. This inquiry and response communication method is suitable for most industrial control scenarios. The communication module acts as a slave during the communication process. When the host sends a read register command, the communication module transmits the voltage and current real-time signal stored in the register to the host. The communication module baud rate is set to 9600, the data bit is 8, there is no parity check, and the stop bit is 1. MODBUS_RTU transmits 2 bytes of 16-bit data, which is usually used for communication of shaped data. In this example, the collected current and voltage are 32-bit signed floating-point numbers. To transmit integer data, 2 bytes are needed to pass the high and low eight bits of the integer data to the host, which obtains the specific data after identification. In the process of transmitting floating-point numbers, the original transmission rule of high eight bits and low eight bits is no longer appropriate, and the contents of 4 bytes and 2 registers should be transmitted. The accurate value is obtained by combining the 2 registers and identifying them as floating-point numbers on the host side.

[0050] Reference Figure 7In this example, the system software mainly completes data collection, filtering, deployment of DNN model to predict SOC, data visualization and communication functions. For data collection, since the signal is processed by external circuits, the processed data needs to be restored in the program. On the other hand, the ADC module conversion process will bring certain errors to the system, and the accuracy of the collected data is a fundamental indicator of the system design results. Therefore, Kalman filtering and anti-pulse interference average filtering algorithm are used for software filtering in software program design. Kalman filtering performs better in removing measurement noise. Kalman filtering can adapt to the dynamic changes of the system because it combines system models and measurement updates to provide more accurate estimates. Kalman filtering will consider previous historical information when updating the state, rather than relying only on the current or adjacent measurement values. This ensures the accuracy of the collected data. The anti-pulse interference average filtering algorithm is a combination of median filtering and arithmetic mean filtering. For occasional pulse interference, it can eliminate the sampling value deviation caused by pulse interference. This module uses the STM32F407VET6 chip in the Keil uVision5 environment with ARM software as the development environment, and the control center chooses ARM to develop the software program. ARM software mainly includes the following: initialization program, main program, A / D sampling subroutine, OLED drive subroutine, Modbus communication subroutine, interrupt service program, I / O output subroutine, DNN model deployment program and other software module components. The main program calls each subroutine module according to functional requirements, and each functional subroutine implements certain independent functions. A / D sampling adopts DMA mode, which is a technology used for high-speed data transmission between peripherals and memory. In the intelligent battery management system, the working status acquisition module 500 sends the collected voltage and current to the analog-to-digital conversion module 400 to obtain discrete digital measurement results, and uses the measurement values ​​obtained by digital measurement to calculate and analyze the battery operating parameters.

[0051] Reference Figure 8 In the present invention, DNN is used to realize battery state prediction. First, the main parameters of the DNN model are determined, including input layer size (input_size), hidden layer size list (hidden_sizes), output layer size (output_size), learning rate (learning_rate), batch size (batch_size), number of iterations (num_epochs) and weight decay (weight_decay); Among them, input_size is set to 2, hidden_sizes is set to [16,8], and output_size is set to 1.

[0052] Select a suitable activation function and set the number of training times. Select Relu as the activation function; the number of training times is set to 5000 times.

[0053] The Adam optimizer with weight decay is used for training. It combines the advantages of Adagrad and RMSProp and is implemented through weight decay, which helps to reduce model complexity and avoid overfitting.

[0054] Five-fold cross validation and grid search were used to optimize the remaining parameters.

[0055] Five-fold cross validation is a technique for evaluating model performance. It divides the data set into five subsets, uses each subset as a test set, and uses the remaining four subsets as training sets, so as to evaluate the model five times. The grid search is a parameter tuning method that finds the parameter settings that optimize the model performance by traversing pre-defined parameter combinations. In practical applications, the grid search will traverse the given parameter combinations, use cross-validation for each combination to evaluate the performance of the model, and select the best parameter combination.

[0056] The optimization result is learning_rate is 0.001, batch_size is 16, and weight_decay is 0.000001; The DNN model is based on the optimal hyperparameters and uses 80% of the University of Maryland 18650 lithium battery dataset as the training set for model training, and the remaining 20% ​​as the test set for model performance testing.

[0057] The University of Maryland 18650 lithium battery dataset is a battery charge and discharge dataset under BJDST conditions at room temperature of 25°C.

[0058] The DNN model performance test uses mean absolute error (MAE), root mean square error (RMSE), and correlation coefficient (R2) as evaluation indicators of the prediction results. The calculation formulas for each evaluation indicator are as follows: (1) (2) (3) To implement the deployment of the DNN model on the MCU 101, the X-CUBE-AI tool chain was used. This tool can implement the trained neural network model in C language, including the model structure, weights, and activation functions of the model. After the DNN model is trained in Python, it is saved in ONNX format and imported into X-CUBE-AI. The model occupies 10.57kb of FLASH and 3.27kb of RAM. At the application layer, the exported neural network (NeuralNetworks, NN) library contains source files for network topology (.c and .h) and weights / biases (_data.c and _data.h). These source files are based on the public network runtime library (network_runtime.a) and minimize dependencies on the system runtime. The ai_init() function is called, which is used to pass the weight / bias buffer and activation memory buffer to the neural network core library so that the neural network can be executed on the MCU 101. If external storage is used, the weights are saved in a separate network_data.bin file, and the code needs to point to the starting address of the external storage.

[0059] Reference Figures 9 and 10 In this example, the current and voltage under the charge and discharge state are used as the input of the DNN model. The current and voltage values ​​obtained after the data collected by the analog-to-digital conversion module 400 are converted as the input of the network model, and the neural network feedforward operation function is called to obtain the SOC prediction value. The battery operating parameters are then displayed on the OLED display screen in the data display module 600, and the data is transmitted to the communication host computer through the communication module 700.

[0060] Example 2 The DNN algorithm deployed on this platform can be used on any cortex-m4 chip and is also portable.

[0061] Example 2 replaces the main chip in Example 1 with a domestic chip of the same architecture gd32. The DNN algorithm on the chip gd32 is transplanted and deployed, which can be used to test a relatively accurate SOC value and has relatively wide applicability and compatibility.

[0062] The embodiments described above are part of the embodiments of the present application, rather than all of the embodiments. The detailed description of the embodiments of the present application is not intended to limit the scope of the present application for protection, but merely represents the selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.

Claims

1. An intelligent battery management system based on DNN battery status prediction deployment, characterized in that include: A main controller module (100) comprises at least a single-chip microcomputer main chip and peripheral circuits, and is used for switching the battery charging and discharging state and controlling data collection, while deploying a DNN model in the main chip to predict the battery state based on the collected data to obtain an accurate SOC value; A charging and discharging module (200), comprising positive and negative electrodes arranged according to loads, for realizing charging and discharging functions of a battery; A drive control module (300), the output end of which is connected to the input end of the charge and discharge module (200), and the input end of which is connected to the output end of the main controller module (100), and is used to control the switching and starting of the charge and discharge state; The analog-to-digital conversion module (400) converts the collected battery working status data into a digital quantity that can be recognized by the single-chip microcomputer, and performs software filtering through Kalman filtering and pulse interference prevention average filtering algorithms; The working state acquisition module (500) is connected to the input end of the analog-to-digital conversion module (400) and the main controller module (100) with corresponding polarities; and is used to collect current, voltage, temperature and environmental operation data of the battery when it is working; The data display module (600) is connected to the main controller module (100) and is used to visualize the read and converted data; And a communication module (700) is connected to the main controller module (100) with corresponding polarity and is used to transmit battery operating data information to a communication host computer.

2. The intelligent battery management system based on DNN battery status prediction deployment according to claim 1 is characterized in that The main controller module (100) uses a cortex-m4 chip as the main chip.

3. The intelligent battery management system based on DNN battery status prediction deployment according to claim 1 is characterized in that The main chip is an STM32F407VET6 chip or a chip of the same architecture, gd32.

4. The intelligent battery management system based on DNN battery status prediction deployment according to claim 1 is characterized in that The charging and discharging module includes a charging control part and a discharging control part; the charging control part includes a TP4056A charging IC chip and its peripheral circuit, whose input end is connected to the positive pole of the battery and is externally connected to a DC power supply voltage; the discharging control circuit includes a cement resistor and a discharging status indicator light to simulate the normal working state of the battery.

5. The intelligent battery management system based on DNN battery status prediction deployment according to claim 1 is characterized in that The communication module includes an RS485 communication interface and a Wifi communication interface; the RS485 communication interface transmits the battery working data to the host computer through the RS485 bus through the Modbus_RTU protocol; the Wifi communication interface transmits the battery working data to the cloud platform through the ESP8266 control chip through the MQTT protocol.

6. The intelligent battery management system based on DNN battery status prediction deployment according to claim 1 is characterized in that The DNN model is trained using the Adam optimizer with weight decay or L2 regularization term, and five-fold cross validation and grid search are used to optimize the three parameters of learning rate, batch size, and weight decay.

7. The intelligent battery management system based on DNN battery status prediction deployment according to claim 1 is characterized in that The DNN model is based on the optimal hyperparameters and uses the University of Maryland 18650 lithium battery dataset for model training; the University of Maryland 18650 lithium battery dataset is a BJDST working condition, a battery charging and discharging dataset at room temperature of 25°C.

8. An intelligent battery SOC control method based on DNN battery state prediction deployment, characterized in that The steps include: Step S1: Determine the main parameters of the DNN model: including input layer size, hidden layer size list, output layer size, learning rate, batch size, number of iterations, and weight decay; Step S2: Select a suitable activation function for the DNN model and set the number of training times; Step S3: Training using the Adam optimizer with weight decay or L2 regularization term; Step S4: Use five-fold cross validation and grid search to optimize the three parameters of learning rate, batch size, and weight decay; Step S5: Based on the optimal hyperparameters, 80% of the University of Maryland 18650 lithium battery dataset is used as a training set for model training, and the remaining 20% ​​is used as a test set for model performance testing; Step S6: deploy the trained DNN model to the main chip of the main controller module with SOC management function for predicting the SOC value.

9. The intelligent battery SOC control method based on DNN battery state prediction deployment according to claim 8 is characterized in that The five-fold cross validation and grid search described in step S4 for optimizing the three parameters include: dividing the data set into five subsets, taking each subset as a test set in turn, and the remaining four subsets as training sets, thereby evaluating the model five times.

10. The intelligent battery SOC control method based on DNN battery state prediction deployment according to claim 8 is characterized in that In step S6, after the DNN model is trained by Python, it is saved in ONNX format and imported into X-CUBE-AI. Using the X-CUBE-AI tool chain, the trained neural network model is implemented in C language and deployed to the main chip.

Citation Information

Patent Citations

  • Intelligent battery charging and discharging management system and method based on 5G cloud computing platform

    CN111913985A

  • Battery charge state estimation method based on deep learning and network compression

    CN116359762A