An article takes you to understand the new energy vehicle vehicle controller VCU hardware-in-the-loop (HiL) simulation test solution

1. Definition of 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 a virtual controller, and the simulation of an actual object is called a virtual object, the control system can be obtained 3 forms of emulation :)

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 solution mainly introduces the VCU HiL system solution.

2. HiL system solution:

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.

 

2.1. System architecture:

The VCU HiL test system mainly includes: upper computer (PC), PXI chassis, real-time processor, data acquisition board, CAN communication board, DIO board, resistance simulation board, low-voltage programmable power supply, etc. The system principle is shown in the figure below Show:

 

The host computer in the VCU 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 is installed 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.

2.2. Main functions:

The main functions of the VCU HiL test system include:

➢ Simulate all hard-wired input signals of VCU, including AI, DI, PWM IN, resistance and other input signals;

➢ Collect all hard-wire output signals of VCU, including DO, AO, PWM OUT and other output signals;

➢ Simulate VCU CAN bus receiving signals and receiving CAN bus sending signals;

➢ Realize the closed-loop test verification of VCU through the real-time simulation model of the whole vehicle and I/O interface;

➢ Realize VCU-related electrical fault simulation through software/hardware, including short circuit to ground, short circuit to power supply, open circuit, etc.;

➢ Simulate the power supply of VCU through a programmable DC power supply;

➢ Realize automated testing and automatically generate test reports by editing test sequences;

➢ The test data can be monitored in real time and the parameters of the simulation model can be modified online through the human-computer interaction interface of the upper computer;

➢ Support test and verification of all I/O ports of VCU;

➢ Support VCU CAN communication function test verification;

➢ Support full-function verification of VCU vehicle control strategy. Such as: key, pedal, gear position signal processing logic verification, power on and off control logic verification, acceleration and deceleration control logic verification, torque coordination logic verification, energy recovery logic verification, charging related logic verification, relay control logic verification, driving mileage estimation logic verify……

➢ Support VCU fault diagnosis function test verification;

➢ Support VCU control function test verification under extreme working conditions;

➢ Support VCU regression test;

➢ Support VCU durability test;

➢ Support typical standard working condition tests such as NEDC and self-defined working condition tests;

2.3. System composition

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

 

1) Hardware platform:

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

 

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.

 

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) 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.

The VCU HiL test system simulation model is a pure electric vehicle simulation model, including vehicle longitudinal dynamics model, driver model, motor model, power battery model, final drive model, virtual controller model, I/O model, road and Environmental model, etc., the main features are as follows:

➢Completely meet the requirements for functional testing and verification of electric vehicle control strategies;

➢Based on MATLAB/Simulink software development, realize the modularization and parameterization of the model, and the model has high precision;

➢Support user graphical interface to input data;

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

➢Support offline simulation and online simulation under MATLAB;

➢Meet the real-time requirements of the new energy vehicle HiL test system, the entire simulation model runs on the real-time system, and the overall model

➢All models are open source, standardized, and easy to read. Each module has a detailed model description, which is convenient for users to carry out secondary development of the model and model change and expansion.

 

The vehicle longitudinal dynamics model is used to simulate the basic mechanical relationship of the vehicle dynamics, while considering the influence of wind resistance, slope resistance, and road on the vehicle. According to the torque signal received by the transmission shaft, combined with the dynamic characteristics of the vehicle and the characteristic parameters of the road surface, the current vehicle acceleration, vehicle speed and wheel speed information are calculated and output.

The driver model is used to simulate the changes of the accelerator pedal and brake pedal during the actual driving process of the vehicle. By receiving the target vehicle speed and actual vehicle speed under operating conditions, the model is solved to output accelerator pedal and brake pedal commands.

The driver model has both manual and automatic driving modes. In the manual driving mode, the opening degree of the accelerator pedal or the brake pedal is set through the monitoring interface. In the automatic driving mode, the target vehicle speed can be set on the monitoring interface or test conditions such as NEDC can be selected, and the automatic driving module can adjust the opening of the accelerator pedal and brake pedal in real time according to the deviation between the actual vehicle speed and the target vehicle speed.

According to the torque demand of the motor, the motor model is solved through the motor model, and the actual torque, moment of inertia, and electric power of the motor are output to simulate the real motor system.

The battery model mainly simulates 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 main reducer model calculates and outputs the decelerated speed and torque through the set reduction ratio and transmission efficiency of the main reducer.

The charging 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 virtual controller model mainly simulates the necessary communication signals and IO signals of other required controllers except the controller under test, so as to seamlessly connect with the real controller to complete the verification of the function under test.

The road and environment model simulates different road surfaces, altitudes, ambient temperatures, wind speeds, and air densities, etc., to meet the needs of virtual simulation for different roads and different environments, and provide virtual environment simulation for HiL testing.

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.

3. HiL test process:

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

3.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;

3.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;

3.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.;

3.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 BMS and MCU and the controller under test through artificial assignment, 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.

3.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.

4. 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.

Guess you like

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