An article takes you to understand the BMS hardware-in-the-loop (HiL) simulation test of the new energy vehicle battery management system

1. What is BMS ?

BMS (Battery Management System) stands for battery management system, which is one of the core systems of new energy vehicles. New energy vehicles are very different from traditional fuel vehicles. Taking pure electric vehicles as an example, they use battery packs as the power source, so the state of battery packs is particularly important for pure electric vehicles. The battery management system is to monitor the operating status of the battery pack in real time, accurately estimate the remaining capacity of the battery, and promptly alarm the occurrence of failures, so as to maximize the cycle life of the battery and make the battery work in the best state. The main functions of BMS are shown in the figure below:

 BMS main function diagram

2. What is HiL?

HiL (Hardware-in-the-Loop) is a computer term, that is, hardware-in-the-loop. By using "hardware-in-the-loop" (HiL), development time and costs can be significantly reduced. In the past, the use of computer simulation and actual experimentation have been separated from each other when developing electromechanical components or systems. However, by using a hardware-in-the-loop approach, the two processes can be combined and exhibit a significant increase in efficiency.

Hardware-in-the-loop: that is, hardware-in-the-loop (HiL), first look at the difference between the following three situations (if the simulation of the actual controller is called the virtual controller, and the simulation of the actual object is called the virtual object, the control system simulation can be obtained 3 forms :)

1) Virtual controller + virtual object = dynamic simulation system, which is a pure software system simulation;

2) Virtual controller + actual object = Rapid Control Prototyping (RCP) simulation system, which is a semi-physical simulation of the system;

3) Actual controller + virtual object = hardware-in-the-loop (HiL) simulation system, which is another half-physical simulation of the system.

HiL currently has three major hardware platforms, including NI platform, Dspace platform, and ETAS platform (which has announced its withdrawal from the HiL business). The following solutions are mainly introduced with the NI platform. The following mainly introduces the BMS HiL system solution.

3. HiL system solution architecture:

The overall architecture of the HiL test system is shown in the figure below, which mainly includes three layers. The first layer is the software and hardware architecture of the HiL test system, which mainly includes the hardware equipment, experiment management software, and the controller under test of the HiL test system; the second layer is HiL test system development, on the basis of the first level of software and hardware architecture, the development of the simulation model of the tested object, real-time I/O interface matching, hard line signal matching and experiment definition, etc.; the third level is HiL testing, which mainly refers to the HiL testing is carried out on the basis of the first and second levels, mainly including test sequence development, stimulus generation and loading, model parameter debugging, fault simulation implementation, test analysis and evaluation, etc.

Schematic diagram of HiL test system architecture

3.1 . B MS H iL system architecture:

BMS HiL test system mainly includes: host computer (PC), PXI chassis, processor board, data acquisition board, CAN card, battery simulator, high-voltage power supply, low-voltage power supply, etc. BMS HiL test system provides and BMS controller hardware The resources corresponding to the IO signal and the vehicle model and battery model corresponding to the control strategy of the BMS controller. A BMS system generally includes a main board, a slave board, and a high-voltage acquisition module. The principle of the BMS HiL test system is shown in the figure below:

 Schematic diagram of BMS HiL test system principle

The host computer in the BMS HiL test system installs Veristand and Teststand software for test process management and test sequence editing, and connects to the real-time processor in the PXI chassis through Ethernet, and the real-time system (Real Time) runs in the real-time processor and installs The Veristand terminal engine deploys the simulation model to the real-time system and controls the running status through data transmission with the host computer; PXI chassis is equipped with various types of boards to provide different types of signal simulation and acquisition functions for the system, through PXI The bus communicates data with the real-time processor.

3.2 . Main functions:

The main functions of BMS HiL test system include:

  • Provide battery cell voltage simulation;
  • Provide battery cell temperature sensor resistance signal simulation;
  • Support battery cell fault injection, including cell voltage/temperature sampling line disconnection, sampling line short circuit, over-threshold, cell polarity reverse connection and other faults;
  • Provide multi-channel high voltage signal simulation;
  • Provide insulation resistance simulation;
  • Provide current sensor signal simulation;
  • Provide bus communication signal simulation;
  • Provide other input signal simulation of BMS system;
  • Provide various output signal acquisition of BMS system;
  • Support low-voltage I/O signal fault injection;
  • Integrated dynamic simulation model to realize real-time closed-loop test of the controller under test;
  • Support model variables to be modified in real time on the host computer interface without recompiling the model;
  • Support host computer interface channel configuration and parameter setting to realize manual testing of the controller under test;
  • Support test case editing, realize automated testing, and automatically generate test reports;
  • Support standard working condition tests such as NEDC and custom working condition tests;
  • Support host computer interface to view all channel data in real time, including hard line, bus and model data;
  • Support the function test of BMS, mainly including unit acquisition, high voltage acquisition, current acquisition, relay control, unit equalization, SOC estimation, thermal management and national standard AC and DC charging function verification;

3.3 . System composition

The BMS HiL test system mainly consists of three parts: hardware platform, software platform and control model.

HiL system composition diagram

3.3.1 Hardware platform:

The BMS HiL test system adopts a distributed design mode. As the control core of the entire system, the upper computer is mainly responsible for software and hardware configuration and process management; the lower computer takes PXI chassis, real-time processor and I/O board as the core, and is mainly responsible for sequence execution. Called with the device. The system hardware platform consists of PXI chassis, real-time processor, I/O board, communication board, power management module, fault injection board, high-voltage programmable power supply, low-voltage programmable power supply, battery simulator, signal conditioning module, cabinet and Host computer and other components.

 HiL test system lower computer real-time system reference diagram

3.3.2 Software platform

The software platform includes experiment management software and automated testing software to realize functions such as experiment management, fault injection, test case editing and automated testing.

 Software platform interface reference diagram

The test management software of this program is based on the NI VeriStand software platform to realize system configuration management and test management. The test management software is a professional real-time test and simulation software based on configuration. It can create test applications without programming, and quickly integrate hardware I/O with simulation models developed in various environments. At the same time, it can use NI LabVIEW and other software Adding custom and other automated testing functions reduces the difficulty of system development and shortens the development time while maintaining flexibility and openness.

The automated testing software of this solution is based on the NI TestStand software platform. The automated testing software is a test management software that can be executed immediately, which can help users develop automated testing and verification systems faster. The main functions of automated testing software include:

➢ Visual test sequence editing environment

➢ Test management function

➢ Test Execution

➢ Multi-thread parallel testing

➢ User Management

➢ Test report management

➢ Customizable operator interface

➢ Source code control integration

➢ Database records

3.3.3 Simulation model

The simulation model provides a complete virtual environment for the HiL system, and matches the corresponding I/O signals and CAN signals of the ECU under test through the hardware board to realize the seamless connection between the control object simulation model and the input and output signals of the controller, thereby Form a closed-loop test environment.

BMS HiL test system simulation models mainly include battery model, vehicle model, national standard charging pile model, I/O model, UDS model, etc.

1) The model meets the functional test requirements of electric vehicle BMS;

2) Developed based on MATLAB/Simulink, it can realize model modularization, parameterization setting, and high model accuracy;

3) Support data input with GUI;

4) The parameters used by each module in the model can be modified online in real time without recompiling and downloading the model;

5) Support offline simulation and online simulation under MATLAB;

6) Meet the real-time requirements of the new energy hardware-in-the-loop test system, the entire simulation model runs on the real-time system, and the overall solution step of the model is ≤1ms;

7) All models are open source, standardized, and easy to read, and can be used for secondary development of the model. Each module has a detailed model description, which is convenient for users to modify model parameters.

BMS HiL test system simulation model reference diagram

For the BMS HiL test, a power battery simulation model needs to be established to simulate the response of the battery voltage based on the battery current excitation obtained from the vehicle dynamics model. The battery model fully considers the dynamic characteristics of the battery, and at the same time takes into account the inconsistency of the battery cells in practical applications.

The battery simulation model supports various types of lithium batteries such as ternary and lithium iron phosphate, including battery cell models and series battery pack models.

The vehicle model is mainly used to provide the vehicle signals required for BMS HiL testing, including driver, vehicle dynamics model, motor model, final drive model, road and environment model and virtual controller model, providing virtual car environment.

The charging pile model includes a fast charging model and a slow charging model. The charging model mainly realizes the charging gun, charging parameter control logic and fault mode setting, etc., and simulates the pre-charging function under normal and fault conditions. In the charging mode, it can identify the fast and slow charging mode according to the action of inserting the gun, automatically send out the handshake parameters, and output the corresponding charging voltage, current and other parameters. According to the national standard requirements, the corresponding fault type can be set to complete the fault simulation test.

The UDS model mainly realizes the parameter calibration of the controller under test according to the UDS protocol. According to the DID calibration protocol provided by Party A, the parameter calibration can be completed in the automatic test step (such as writing SOC to BMS and reading the SOC of BMS).

The I/O model realizes the signal connection between the vehicle simulation model and the controller under test. The I/O model includes sensor signal output interface, actuator signal acquisition interface, communication interface, etc.

4. HiL test process

The HiL test process includes test preparation, test case development, test engineering construction, test debugging, and test summary.

HiL test flow chart

4.1 . Test preparation

Test preparation includes: interface analysis of the controller under test, allocation of HiL device hardware resources, controller wiring harness design, function analysis of the device under test, and test plan arrangement;

4.2 . Test case development

Research on test case development method is one of the key points of testing. Using reasonable test methods to develop reasonable and effective test cases can not only increase test coverage and reduce redundant and repeated tests, but also greatly reduce test time and improve test efficiency.

Test case development includes: test case definition, test case development method (black box test, white box test, experience-based test), automated test case development;

4.3 . Test project construction

The test project construction is mainly that the test engineer builds the test project based on the experiment management software and automated test software, including: software and hardware engineering configuration, test interface construction, model configuration, communication configuration, etc.;

4.4 . Test and debug

1) Smoke test: After the test project is built, connect the controller under test. It is necessary to perform a smoke test on the controller under test and the HiL test equipment to verify whether there are basic problems in the connection between the equipment and the original components. The smoke test is completed by the tester and the developer. During the test, a problem is found. The tester finds a bug, and then the developer will fix the bug. Whether the smoke test is passed determines whether the next round of system testing can be performed. .

2) Interface test: The interface test is only the controller under test and does not form a closed-loop test with the vehicle simulation model, which belongs to the open-loop test. The interface test simulates the data interaction between external controllers such as VCU and MCU and the controller under test by artificially assigning values, and verifies whether the data interaction of the controller under test is normal, focusing on signal interaction verification. If there is a test program for general interface testing, it can be tested automatically. If there is no test program, it can be tested manually.

3) Automated test: The test in which the controller under test and the vehicle simulation model form a closed loop is a closed loop test. The closed-loop test enables the vehicle model to automatically interact with the controller under test by simulating the variables in the cab, verifies the software strategy of the controller under test, and focuses on functional and performance verification.

4) Test report: load the test sequence through the HiL test management software, execute the test, and output the test report.

4.5 . Test summary

After the test is completed, after the tested function reaches the test pass standard, it is necessary to summarize and organize the HiL test work, and generate and compile the HiL test summary. The HiL test summary mainly includes the following contents: HiL test environment, test cycle, testers and test content, etc., statistics and analysis of problems during the test process, and records of the remaining problems in the test, and check the test work and completion after the test Submit work results, including: test case description documents, test matrix documents, executable files and generated test reports, etc.

5. Summary :

The hardware-in-the-loop simulation test system uses a real-time processor to run a simulation model to simulate the running state of the controlled object, connects with the ECU under test through the I/O interface, and conducts comprehensive and systematic tests on the ECU under test. Considering safety, feasibility and reasonable cost, HiL hardware-in-the-loop simulation test has become a very important part of the ECU development process, reducing the number of real vehicle road tests, shortening development time and cost while improving ECU The quality of the software can reduce the risk of the automobile factory. In the field of new energy vehicles, HiL hardware-in-the-loop simulation testing is extremely important for core electronic control systems: vehicle control system, BMS battery management system, MCU motor controller, body system, chassis suspension, ADAS assisted driving, etc.

In recent years, with the intensive investment of capital in the automotive industry, the demand for new energy vehicle HiL test engineers is high, and the salary is also increasing. At present, the salary of engineers has reached 20K-50K. From the perspective of long-term career planning, HiL test engineers are considered to be A sustainable job. Everyone can exchange and learn about new energy vehicles.

Guess you like

Origin blog.csdn.net/moyunzhiyin/article/details/127957341