CN111064628B - CAN bus automatic test system - Google Patents
CAN bus automatic test system Download PDFInfo
- Publication number
- CN111064628B CN111064628B CN201811204075.6A CN201811204075A CN111064628B CN 111064628 B CN111064628 B CN 111064628B CN 201811204075 A CN201811204075 A CN 201811204075A CN 111064628 B CN111064628 B CN 111064628B
- Authority
- CN
- China
- Prior art keywords
- motor controller
- test
- signal
- hardware
- test system
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B23/00—Testing or monitoring of control systems or parts thereof
- G05B23/02—Electric testing or monitoring
- G05B23/0205—Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults
- G05B23/0208—Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterized by the configuration of the monitoring system
- G05B23/0213—Modular or universal configuration of the monitoring system, e.g. monitoring system having modules that may be combined to build monitoring program; monitoring system that can be applied to legacy systems; adaptable monitoring system; using different communication protocols
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/14—Arrangements for monitoring or testing data switching networks using software, i.e. software packages
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40208—Bus networks characterized by the use of a particular bus standard
- H04L2012/40215—Controller Area Network CAN
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40267—Bus for use in transportation systems
- H04L2012/40273—Bus for use in transportation systems the transportation system being a vehicle
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Automation & Control Theory (AREA)
- Computer Security & Cryptography (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention provides a CAN bus automatic test system, which comprises a motor controller, a hardware-in-loop test system, a calibration system and CAN test software, wherein the hardware-in-loop test system is communicated with a tested motor controller through CAN communication and is used for simulating a motor, a battery and a whole vehicle controlled by the motor controller, modifying model parameters of the hardware in the loop test system and comparing signal values correspondingly received in the motor controller so as to test the CAN signal receiving function of the motor controller; the calibration system observes and calibrates parameters of the motor controller through CAN calibration, modifies a calibration quantity value in the motor controller, and compares signal values correspondingly received by hardware in a loop test system to test a CAN signal sending function of the motor controller; the CAN test software analyzes the files of the motor controller and the hardware in the ring test system, establishes the mapping relation of each CAN signal from the motor controller to the hardware in the ring test system, generates a test case aiming at each CAN signal and executes the test case.
Description
Technical Field
The invention relates to the technical field of automobile control, in particular to an automatic test system for a CAN bus.
Background
The CAN test of the motor controller is realized based on a hardware-in-loop test system and a calibration system. As shown in fig. 1, the hardware-in-loop test system 20 is a LABCAR system provided by ETAS, and includes LABCAR hardware 22 and LABCAR software 21, which communicate with the tested motor controller 10 through a communication CAN, mainly simulating a motor, a battery and a whole vehicle; the calibration system 30 includes INCA software 31 and a hardware CAN card 32(ES581), which are respectively provided by ETAS for calibration, through which parameters of the motor controller 10 under test are observed and calibrated. During CAN testing, testing the CAN signal receiving function of the motor controller 10 by modifying the model parameters of the hardware in the ring test system 20 and comparing the signal values correspondingly received in the motor controller; the CAN signal transmission function of the motor controller 10 is tested by modifying the quantitative value in the motor controller 10 and the signal value correspondingly received by the comparison hardware in the loop test system 20.
However, in the CAN test of the motor controller, because the number of CAN signals is large, if test cases are compiled and executed manually one by one, not only is time spent, but also errors are easy to occur; after the test is finished, a CAN test report needs to be written, so that more time is needed, and the test has stronger subjectivity.
Therefore, the system capable of automatically testing the CAN signals of the motor controller is designed to be of great significance for effectively improving the CAN testing efficiency and reducing errors caused by human negligence.
Disclosure of Invention
The invention aims to provide an automatic CAN bus test system to solve the problem of low CAN test efficiency of the existing motor controller.
In order to solve the technical problem, the invention provides an automatic test system of a CAN bus, which comprises a motor controller, a hardware-in-loop test system, a calibration system and CAN test software, wherein:
the hardware-in-loop test system is communicated with the motor controller through CAN communication and is used for simulating a motor, a battery and a whole vehicle controlled by the motor controller, modifying model parameters in the hardware-in-loop test system and comparing signal values correspondingly received in the motor controller so as to test the CAN signal receiving function of the motor controller;
the calibration system observes and calibrates parameters of the motor controller through CAN calibration, modifies a calibration quantity value in the motor controller, and compares signal values correspondingly received by the hardware in the loop test system to test a CAN signal sending function of the motor controller;
the CAN test software analyzes the files of the motor controller and the hardware in the ring test system, establishes a mapping relation from the motor controller to the hardware in the ring test system of each CAN signal, generates a test case aiming at each CAN signal and executes the test case.
Optionally, in the CAN bus automatic test system, the hardware-in-the-loop test system includes Labcar software and Labcar hardware, where:
the Labcar software is used for creating and modifying the motor, the battery and the whole vehicle model, controlling real-time simulation, sequencing the CAN signals and driving the Labcar hardware;
the Labcar hardware is used for simulating the motor, the battery and a sensor and an actuator of the whole vehicle, receiving the CAN signal output by the motor controller and generating an input CAN signal of the motor controller.
Optionally, in the CAN bus automatic test system, the calibration system includes a hardware CAN card and an INCA software, wherein:
the INCA software is used for creating and modifying a standard quantity value of the motor controller and driving the hardware CAN card;
the hardware CAN card is used for receiving the CAN signal output by the motor controller and generating an input CAN signal of the motor controller.
Optionally, in the CAN bus automatic test system, the CAN test software, the Labcar software, and the INCA software are installed on the same computer, and the CAN test software controls the hardware-in-loop test system and the calibration system through API interfaces of the Labcar software and the INCA software.
Optionally, in the CAN bus automatic test system, the CAN test software includes a CAN signal mapping module, a CAN test case generation module, and a CAN test case execution module, where:
the CAN signal mapping module obtains a CAN signal mapping relation provided by the hardware-in-the-loop test system to the motor controller;
the CAN test case generation module generates a test case in a CAN test;
and the CAN test case execution module executes the test case.
Optionally, in the CAN bus automatic test system, the obtaining, by the CAN signal mapping module, a CAN signal mapping relationship provided by the hardware-in-the-loop test system to the motor controller includes:
the CAN signal mapping module establishes a mapping relation of each CAN signal from the motor controller to Labcar software according to a motor controller C code, an A2L file, a DBC file and a Labcar engineering file of the Labcar software;
the A2L file contains a physical description of the data and parameters of the control unit;
the DBC file includes a CAN protocol library file.
Optionally, in the CAN bus automatic test system,
the model parameters of the hardware-in-loop test system are connected with an interface of the hardware-in-loop test system;
the observed quantity and the standard quantity of the motor controller are connected with an interface of the motor controller;
the interface of the hardware-in-the-loop test system and the interface of the motor controller interact through a CAN network;
the Labcar engineering file comprises the motor, the battery, the whole vehicle model parameters and the mapping relation with the interface;
the DBC file stores the information of the hardware-in-the-loop test system interface and the motor controller interface;
the A2L file stores observed quantity and standard quantity information in a motor controller;
the code C of the motor controller stores the mapping relation between the observed quantity and the standard quantity and the interface;
and analyzing the C code, the A2L file, the DBC file and the Labcar engineering file of the motor controller to obtain the CAN signal mapping relation from the hardware-in-the-loop test system to the motor controller.
Optionally, in the CAN bus automatic test system, the generating of the test case in the CAN test by the CAN test case generating module includes: and generating the test case based on the boundary value and the equivalence class principle.
Optionally, in the CAN bus automatic test system, generating the test case based on the boundary value and the equivalence class principle includes:
forming Max +, Max-, intermediate value, Min +, Min (minimum value, the same below), Min-according to the value of the CAN signal:
max + is equal to the maximum value of the CAN signal range plus 1 precision;
max is equal to the maximum value of the CAN signal range;
max-equals to the maximum value of the CAN signal range minus 1 precision;
the intermediate value is equal to the average value of the maximum value and the minimum value of the CAN signal range;
min + is equal to the minimum value of the CAN signal range plus 1 precision;
min is equal to the minimum value of the CAN signal range;
min-is equal to the minimum value of the CAN signal range minus 1 precision;
when the CAN signal value sent by the motor controller is Max, Max-, Min +, Min and a middle value, if the CAN signal tested by the hardware-in-the-loop test system is equal to the sent CAN signal, the test is passed, otherwise, the test is not passed;
when the CAN signal value sent by the motor controller is Max + and Min-, if the CAN signal received by the hardware-in-the-loop test system is not equal to the sent CAN signal, the test is passed, otherwise, the test is not passed;
when the CAN signal value sent by the hardware-in-the-loop test system is Max, Max-, Min +, Min and a middle value, if the CAN signal received by the motor controller is equal to the sent CAN signal, the test is passed, otherwise, the test is not passed;
when the value of the CAN signal sent by the hardware-in-the-loop test system is Max + and Min-, if the CAN signal received by the motor controller is not equal to the sent CAN signal, the test is passed, otherwise, the test is not passed.
Optionally, in the CAN bus automatic test system, the executing of the test case by the CAN test case executing module includes:
the control hardware sends CAN signals in a ring test system and compares the CAN signals correspondingly received by the motor controller, and the accuracy of the CAN signals received by the motor controller is tested;
and the control motor controller sends a CAN signal and compares the CAN signal correspondingly received by the hardware-in-the-loop test system, and the accuracy of the CAN signal sent by the control motor controller is tested.
Optionally, in the CAN bus automatic test system,
the CAN test case execution module controls the hardware-in-the-loop test system to send each CAN signal through a communication CAN network, and controls the calibration system to read out a corresponding value, so that whether the CAN receiving function of the motor controller is correct or not is judged;
the CAN test case execution module controls the motor controller to send each CAN signal through controlling the calibration system, reads out the CAN signal received by the hardware in the loop test system, and judges whether the CAN sending function of the motor controller is correct.
Optionally, in the CAN bus automatic test system, the CAN test case execution module controls the hardware-in-loop test system and the calibration system by calling API interfaces of Labcar software and INCA software.
Optionally, in the CAN bus automatic test system,
the CAN test case execution module reads and writes model parameters of a motor, a battery and a whole vehicle so as to control CAN messages sent and received by a hardware-in-loop test system;
and the CAN test case execution module reads and writes the observed quantity and the standard quantity in the motor controller so as to control messages sent and received by the motor controller.
Optionally, in the CAN bus automatic test system, after the test is completed, the CAN test software automatically generates a test report according to the test result.
In the CAN bus automatic test system provided by the invention, the files of the motor controller and the hardware in the ring test system are analyzed through CAN test software, the mapping relation of each CAN signal from the motor controller to the hardware in the ring test system is established, a test case is generated aiming at each CAN signal, and the test case is executed.
Furthermore, the CAN bus automatic test system maps each signal from the hardware-in-loop test system to the motor controller by analyzing the DBC file, the A2L file, the Labcar project and the C code of the motor controller, and automatically generates a test case according to a boundary value and an equivalence principle, so that the time for compiling the test case is saved. The automation of the motor controller CAN test and test case compilation CAN reduce errors caused by human negligence in the test process. After the CAN test is finished, the test report CAN be automatically generated according to the test result, the test report is not required to be written manually, and the subjectivity of manually writing the test report is avoided.
Drawings
FIG. 1 is a schematic diagram of a conventional CAN bus automatic test system;
FIG. 2 is a schematic diagram of an automatic test system for CAN bus according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of CAN test software in another embodiment of the present invention;
FIG. 4 is a schematic diagram of a CAN signal mapping relationship between a hardware-in-the-loop test system and a motor controller obtained by a CAN signal mapping module according to another embodiment of the present invention;
FIG. 5 is a schematic diagram of an example of a CAN test case execution module executing a test according to another embodiment of the present invention;
shown in the figure: 10-a motor controller; 20-hardware-in-the-loop test system; 21-Labcar software; 22-Labcar hardware; 30-a calibration system; 31-INCA software; 32-hardware CAN card; 40-CAN test software; 41-CAN signal mapping module; a 42-CAN test case generation module; and the 43-CAN test case execution module.
Detailed Description
The automatic test system for the CAN bus according to the present invention is further described in detail with reference to the accompanying drawings and the embodiments. Advantages and features of the present invention will become apparent from the following description and from the claims. It is to be noted that the drawings are in a very simplified form and are not to precise scale, which is merely for the purpose of facilitating and distinctly claiming the embodiments of the present invention.
The core idea of the invention is to provide an automatic test system of a CAN bus, which aims to solve the problem of low CAN test efficiency of the existing motor controller.
In order to realize the idea, the invention provides a CAN bus automatic test system, which comprises a motor controller, a hardware-in-loop test system, a calibration system and CAN test software, wherein: the hardware-in-loop test system is communicated with the motor controller through CAN communication and is used for simulating a motor, a battery and a whole vehicle controlled by the motor controller, modifying model parameters in the hardware-in-loop test system and comparing signal values correspondingly received in the motor controller so as to test the CAN signal receiving function of the motor controller; the calibration system observes and calibrates parameters of the motor controller through CAN calibration, modifies a calibration quantity value in the motor controller, and compares signal values correspondingly received by the hardware in the loop test system to test a CAN signal sending function of the motor controller; the CAN test software analyzes the files of the motor controller and the hardware in the ring test system, establishes a mapping relation from the motor controller to the hardware in the ring test system of each CAN signal, generates a test case aiming at each CAN signal and executes the test case.
As shown in fig. 2, an embodiment of the present invention provides an automatic CAN bus test system, which includes a motor controller 10, a hardware-in-the-loop test system 20, a calibration system 30, and CAN test software 40, wherein: the hardware-in-loop test system 20 communicates with the motor controller 10 through CAN communication, and is used for simulating a motor, a battery and a whole vehicle controlled by the motor controller 10, modifying model parameters in the hardware-in-loop test system 20, and comparing signal values correspondingly received in the motor controller 10 to test a CAN signal receiving function of the motor controller 10; the calibration system 30 observes and calibrates the parameters of the motor controller 10 through the CAN calibration, modifies the calibration quantity value in the motor controller 10, and compares the signal value correspondingly received by the hardware in the loop test system 20 to test the CAN signal sending function of the motor controller 10; the CAN test software 40 analyzes the files of the motor controller 10 and the hardware in the ring test system 20, establishes a mapping relationship between each CAN signal from the motor controller 10 to the hardware in the ring test system 20, generates a test case for each CAN signal, and executes the test case.
Specifically, in the CAN bus automatic test system, the hardware-in-the-loop test system 20 includes Labcar software 21 and Labcar hardware 22, where: the Labcar software 21 is used for creating and modifying the motor, the battery and the whole vehicle model, controlling real-time simulation, sequencing the CAN signals and driving the Labcar hardware 22; the Labcar hardware 22 is configured to emulate the motor, the battery, and the sensors and actuators of the entire vehicle, receive the CAN signal output by the motor controller 10, and generate the input CAN signal of the motor controller 10. The calibration system 30 comprises a hardware CAN card 32 and INCA software 31, wherein: the INCA software 31 is used for creating and modifying a standard quantity value of the motor controller 10 and driving the hardware CAN card 32; the hardware CAN card 32 is configured to receive CAN signals output by the motor controller 10 and generate input CAN signals for the motor controller 10.
As shown in fig. 2, in the CAN bus automatic test system, the CAN test software 40, the Labcar software 21, and the INCA software 31 are installed on the same computer (PC), and the CAN test software 40 controls the hardware-in-loop test system 20 and the calibration system 30 through API interfaces of the Labcar software 21 and the INCA software 31.
As shown in fig. 3, in the CAN bus automatic test system, the CAN test software 40 includes a CAN signal mapping module 41, a CAN test case generating module 42, and a CAN test case executing module 43, where: the CAN signal mapping module 41 obtains a CAN signal mapping relation provided by the hardware-in-the-loop test system 20 to the motor controller 10; the CAN test case generation module 42 generates a test case in a CAN test; the CAN test case execution module 43 executes the test case.
Specifically, the obtaining, by the CAN signal mapping module 41, the CAN signal mapping relationship provided by the hardware-in-loop test system 20 to the motor controller 10 includes: the CAN signal mapping module 41 establishes a mapping relation of each CAN signal from the motor controller 10 to the Labcar software 21 according to a motor controller 10C code, an A2L file, a DBC file, and a Labcar engineering file of the Labcar software 21; the A2L file contains a physical description of the data and parameters of the control unit; the DBC file includes a CAN protocol library file.
As shown in fig. 4, the model parameters of the hardware-in-loop test system 20 are connected to the interface of the hardware-in-loop test system 20; the observed quantity and the standard quantity of the motor controller 10 are connected with an interface of the motor controller 10; the interface of the hardware-in-the-loop test system 20 and the interface of the motor controller 10 interact through a CAN network; the Labcar engineering file comprises the motor, the battery, the whole vehicle model parameters and the mapping relation with the interface; the DBC file stores the information of the hardware-in-the-loop test system 20 interface and the motor controller 10 interface; the A2L file stores observed quantity and standard quantity information in the motor controller 10; the motor controller 10C stores the mapping relation between the observed quantity, the standard quantity and the interface; and acquiring the CAN signal mapping relation of the hardware-in-the-loop test system 20 to the motor controller 10 by analyzing the C code, the A2L file, the DBC file and the Labcar engineering file of the motor controller 10.
In addition, in the CAN bus automatic test system, the generating of the test case in the CAN test by the CAN test case generating module 42 includes: generating the test case based on the boundary value and the equivalence class principle, wherein the generating of the test case based on the boundary value and the equivalence class principle comprises the following steps: forming Max +, Max-, intermediate value, Min +, Min (minimum value, the same below), Min-according to the value of the CAN signal: max + is equal to the maximum value of the CAN signal range plus 1 precision; max is equal to the maximum value of the CAN signal range; max-equals to the maximum value of the CAN signal range minus 1 precision; the intermediate value is equal to the average value of the maximum value and the minimum value of the CAN signal range; min + is equal to the minimum value of the CAN signal range plus 1 precision; min is equal to the minimum value of the CAN signal range; min-is equal to the minimum value of the CAN signal range minus 1 precision; when the CAN signal value sent by the motor controller 10 is Max, Max-, Min +, Min and a middle value, if the CAN signal tested by the hardware-in-the-loop test system 20 is equal to the sent CAN signal, the test is passed, otherwise, the test is not passed; when the CAN signal value sent by the motor controller 10 is Max + and Min-, if the CAN signal received by the hardware-in-the-loop test system 20 is not equal to the sent CAN signal, the test is passed, otherwise, the test is not passed; when the value of the CAN signal sent by the hardware-in-the-loop test system 20 is Max, Max-, Min +, Min and a middle value, if the CAN signal received by the motor controller 10 is equal to the sent CAN signal, the test is passed, otherwise, the test is not passed; when the value of the CAN signal sent by the hardware-in-the-loop test system 20 is Max + and Min-, if the CAN signal received by the motor controller 10 is not equal to the sent CAN signal, the test is passed, otherwise, the test is not passed.
As shown in fig. 3 and 5, in the CAN bus automatic test system, the executing of the test case by the CAN test case executing module 43 includes: the control hardware sends CAN signals to the ring test system 20 and compares the CAN signals correspondingly received by the motor controller 10, and the accuracy of the CAN signals received by the motor controller 10 is tested; the control motor controller 10 sends a CAN signal and compares the CAN signal correspondingly received by the hardware-in-the-loop test system 20, and the accuracy of the CAN signal sent by the control motor controller 10 is tested. Specifically, the CAN test case execution module 43 controls the hardware-in-the-loop test system 20 to send each CAN signal through the communication CAN network, and controls the calibration system 30 to read out a corresponding value, thereby determining whether the CAN receiving function of the motor controller 10 is correct; the CAN test case execution module 43 controls the motor controller 10 to send each CAN signal by controlling the calibration system 30, reads out the CAN signal received by the hardware in the loop test system 20, and determines whether the CAN sending function of the motor controller 10 is correct.
Further, in the CAN bus automatic test system, the CAN test case execution module 43 controls the hardware-in-loop test system 20 and the calibration system 30 by calling API interfaces of the Labcar software 21 and the INCA software 31. The CAN test case execution module 43 reads and writes model parameters of a motor, a battery and a whole vehicle so as to control CAN messages sent and received by the hardware-in-the-loop test system 20; the CAN test case execution module 43 reads and writes the observed quantity and the standard quantity in the motor controller 10 to control the messages sent and received by the motor controller 10. After the test is completed, the CAN test software 40 automatically generates a test report according to the test result.
The embodiment of the invention specifically tests the CAN bus as follows:
the CAN test software automatically acquires a CAN signal in the motor controller according to the DBC file;
the CAN test software CAN automatically acquire the model parameters of the hardware in the ring test system and the mapping relation of the signals in the corresponding DBC according to the Labcar project;
the CAN test software automatically acquires the observed quantity and the standard quantity information in the motor controller according to the A2L file;
the CAN test software acquires the mapping relation between the observed quantity and the standard quantity and the signal in the DBC according to the code C of the motor controller;
the CAN test software automatically generates CAN test cases based on equivalence class and boundary value principles according to the maximum value, the minimum value and the precision of each signal in the DBC file, wherein the CAN test cases comprise Max +, Max, Max-, Min +, Min, Min-and intermediate values;
the CAN test software controls the hardware-in-the-loop test system to send various CAN signals including Max +, Max, Max-, Min +, Min, Min-and intermediate values through a communication CAN network, and controls the calibration system to read out corresponding values, so that whether the CAN receiving function of the motor controller is correct or not is judged; the CAN test software controls the motor controller to send various CAN signals including Max +, Max, Max-, Min +, Min, Min-and intermediate values through the calibration system, reads out the CAN signals received by the hardware in the loop test system, and judges whether the CAN sending function of the motor controller is correct or not;
after the test is finished, the CAN test software automatically generates a test report according to the test result.
In the automatic test system of the CAN bus provided by the invention, the CAN test software 40 is used for analyzing the files of the motor controller 10 and the hardware in the ring test system 20, establishing the mapping relation of each CAN signal from the motor controller 10 to the hardware in the ring test system 20, generating a test case aiming at each CAN signal and executing the test case, and the automatic test system of the CAN bus automates the operation of the hardware in the ring test system 20 and the calibration system 30 without manual operation, so that the CAN test of the motor controller 10 is automated, the CAN test efficiency is improved, and the labor cost is saved.
Further, the automatic test system for the CAN bus maps signals from the hardware-in-loop test system 20 to the motor controller 10 by analyzing the DBC file, the A2L file, the Labcar project and the motor controller 10C code, and automatically generates a test case according to a boundary value and an equivalence principle, so that the time for writing the test case is saved. The automation of CAN testing and test case compilation for the motor controller 10 CAN reduce errors caused by human oversight during testing. After the CAN test is finished, the test report CAN be automatically generated according to the test result, the test report is not required to be written manually, and the subjectivity of manually writing the test report is avoided.
In summary, the above embodiments describe in detail different configurations of the CAN bus automatic test system, and it goes without saying that the present invention includes but is not limited to the configurations listed in the above embodiments, and any modifications made on the configurations provided in the above embodiments are within the scope of the present invention. One skilled in the art can take the contents of the above embodiments to take a counter-measure.
The above description is only for the purpose of describing the preferred embodiments of the present invention, and is not intended to limit the scope of the present invention, and any variations and modifications made by those skilled in the art based on the above disclosure are within the scope of the appended claims.
Claims (14)
1. The CAN bus automatic test system is characterized by comprising a motor controller, a hardware-in-the-loop test system, a calibration system and CAN test software, wherein:
the hardware-in-loop test system is communicated with the motor controller through CAN communication and is used for simulating a motor, a battery and a whole vehicle controlled by the motor controller, modifying model parameters in the hardware-in-loop test system and comparing signal values correspondingly received in the motor controller so as to test the CAN signal receiving function of the motor controller;
the calibration system observes and calibrates parameters of the motor controller through CAN calibration, modifies a calibration quantity value in the motor controller, and compares signal values correspondingly received by the hardware in the loop test system to test a CAN signal sending function of the motor controller;
the CAN test software analyzes the files of the motor controller and the hardware in the ring test system, establishes a mapping relation from the motor controller to the hardware in the ring test system of each CAN signal, generates a test case aiming at each CAN signal and executes the test case.
2. The CAN bus automatic test system of claim 1, wherein the hardware-in-the-loop test system comprises Labcar software and Labcar hardware, wherein:
the Labcar software is used for creating and modifying the motor, the battery and the whole vehicle model, controlling real-time simulation, sequencing the CAN signals and driving the Labcar hardware;
the Labcar hardware is used for simulating the motor, the battery and a sensor and an actuator of the whole vehicle, receiving the CAN signal output by the motor controller and generating an input CAN signal of the motor controller.
3. The CAN bus automatic test system of claim 2, wherein the calibration system comprises a hardware CAN card and INCA software, wherein:
the INCA software is used for creating and modifying a standard quantity value of the motor controller and driving the hardware CAN card;
the hardware CAN card is used for receiving the CAN signal output by the motor controller and generating an input CAN signal of the motor controller.
4. The CAN bus automatic test system of claim 3 wherein the CAN test software, the Labcar software and the INCA software are installed on the same computer, the CAN test software controlling the hardware-in-the-loop test system and the calibration system through API interfaces of the Labcar software and the INCA software.
5. The CAN bus automatic test system of claim 4, wherein the CAN test software comprises a CAN signal mapping module, a CAN test case generation module, and a CAN test case execution module, wherein:
the CAN signal mapping module obtains a CAN signal mapping relation provided by the hardware-in-the-loop test system to the motor controller;
the CAN test case generation module generates a test case in a CAN test;
and the CAN test case execution module executes the test case.
6. The CAN bus automatic test system of claim 5 wherein the CAN signal mapping module obtaining the CAN signal mapping provided by the hardware-in-the-loop test system to the motor controller comprises:
the CAN signal mapping module establishes a mapping relation of each CAN signal from the motor controller to Labcar software according to a motor controller C code, an A2L file, a DBC file and a Labcar engineering file of the Labcar software;
the A2L file contains a physical description of the data and parameters of the control unit;
the DBC file includes a CAN protocol library file.
7. The CAN-bus automatic test system of claim 6,
the model of the hardware-in-loop test system is connected with an interface of the hardware-in-loop test system;
the interface of the motor controller is used for acquiring and modifying observed quantity and standard quantity in the motor controller;
the interface of the hardware-in-the-loop test system and the interface of the motor controller interact through a CAN network;
the Labcar engineering file comprises the motor, the battery, the whole vehicle model parameters and the mapping relation with the interface;
the DBC file stores the information of the hardware-in-the-loop test system interface and the motor controller interface;
the A2L file stores observed quantity and standard quantity information in a motor controller;
the code C of the motor controller stores the mapping relation between the observed quantity and the standard quantity and the interface;
and analyzing the C code, the A2L file, the DBC file and the Labcar engineering file of the motor controller to obtain the CAN signal mapping relation from the hardware-in-the-loop test system to the motor controller.
8. The CAN bus automatic test system of claim 5, wherein the CAN test case generation module generating the test cases in the CAN test comprises: and generating the test case based on the boundary value and the equivalence class principle.
9. The CAN bus automatic test system of claim 8, wherein generating the test case based on boundary values and equivalence class principles comprises:
forming Max +, Max-, intermediate values, Min +, Min-according to the value of the CAN signal:
max + is equal to the maximum value of the CAN signal range plus 1 precision;
max is equal to the maximum value of the CAN signal range;
max-equals to the maximum value of the CAN signal range minus 1 precision;
the intermediate value is equal to the average value of the maximum value and the minimum value of the CAN signal range;
min + is equal to the minimum value of the CAN signal range plus 1 precision;
min is equal to the minimum value of the CAN signal range;
min-is equal to the minimum value of the CAN signal range minus 1 precision;
when the CAN signal value sent by the motor controller is Max, Max-, Min +, Min and a middle value, if the CAN signal tested by the hardware-in-the-loop test system is equal to the sent CAN signal, the test is passed, otherwise, the test is not passed;
when the CAN signal value sent by the motor controller is Max + and Min-, if the CAN signal received by the hardware-in-the-loop test system is not equal to the sent CAN signal, the test is passed, otherwise, the test is not passed;
when the CAN signal value sent by the hardware-in-the-loop test system is Max, Max-, Min +, Min and a middle value, if the CAN signal received by the motor controller is equal to the sent CAN signal, the test is passed, otherwise, the test is not passed;
when the value of the CAN signal sent by the hardware-in-the-loop test system is Max + and Min-, if the CAN signal received by the motor controller is not equal to the sent CAN signal, the test is passed, otherwise, the test is not passed.
10. The CAN bus automatic test system of claim 5, wherein the CAN test case execution module executing the test case comprises:
the control hardware sends CAN signals in a ring test system and compares the CAN signals correspondingly received by the motor controller, and the accuracy of the CAN signals received by the motor controller is tested;
and the control motor controller sends a CAN signal and compares the CAN signal correspondingly received by the hardware-in-the-loop test system, and the accuracy of the CAN signal sent by the control motor controller is tested.
11. The CAN-bus automatic test system of claim 10,
the CAN test case execution module controls the hardware-in-the-loop test system to send each CAN signal through a communication CAN network, and controls the calibration system to read out a corresponding value, so that whether the CAN receiving function of the motor controller is correct or not is judged;
the CAN test case execution module controls the motor controller to send each CAN signal through controlling the calibration system, reads out the CAN signal received by the hardware in the loop test system, and judges whether the CAN sending function of the motor controller is correct.
12. The CAN bus automatic test system of claim 11, wherein the CAN test case execution module controls the hardware-in-the-loop test system and the calibration system by calling API interfaces of Labcar software, INCA software.
13. The CAN-bus automatic test system of claim 12,
the CAN test case execution module reads and writes model parameters of a motor, a battery and a whole vehicle so as to control CAN messages sent and received by a hardware-in-loop test system;
and the CAN test case execution module reads and writes the observed quantity and the standard quantity in the motor controller so as to control messages sent and received by the motor controller.
14. The CAN bus automatic test system of claim 1 wherein the CAN test software automatically generates a test report based on the test results after the test is completed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811204075.6A CN111064628B (en) | 2018-10-16 | 2018-10-16 | CAN bus automatic test system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811204075.6A CN111064628B (en) | 2018-10-16 | 2018-10-16 | CAN bus automatic test system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111064628A CN111064628A (en) | 2020-04-24 |
CN111064628B true CN111064628B (en) | 2021-10-01 |
Family
ID=70296612
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811204075.6A Active CN111064628B (en) | 2018-10-16 | 2018-10-16 | CAN bus automatic test system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111064628B (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112526966B (en) * | 2020-11-20 | 2024-04-05 | 广西玉柴机器股份有限公司 | Automatic test method and system for HIL (high-performance liquid chromatography) of controller |
CN112783137A (en) * | 2020-12-29 | 2021-05-11 | 联合汽车电子有限公司 | Hybrid component OBD service automatic test system and method |
CN112732558A (en) * | 2020-12-30 | 2021-04-30 | 重庆金康赛力斯新能源汽车设计院有限公司 | System and method for testing functions of whole vehicle |
WO2022198550A1 (en) * | 2021-03-25 | 2022-09-29 | 华为技术有限公司 | Testing system, vehicle simulation apparatus, testing apparatus and testing method |
CN113904967B (en) * | 2021-09-01 | 2023-05-26 | 重庆长安新能源汽车科技有限公司 | Automatic testing device and testing method for automobile CAN communication module interface software |
CN117043699A (en) * | 2021-09-16 | 2023-11-10 | 华为技术有限公司 | Signal connection method, signal connection device and test system |
CN114296432A (en) * | 2021-12-28 | 2022-04-08 | 重庆集诚汽车电子有限责任公司 | Automatic hardware-in-loop testing method, device, medium and equipment |
CN114460925B (en) * | 2022-01-29 | 2023-05-23 | 重庆长安新能源汽车科技有限公司 | Automatic test method for CAN interface HIL of electric automobile controller |
CN115933432B (en) * | 2022-11-24 | 2023-12-19 | 北京蓝天航空科技股份有限公司 | Simulation test system based on controller area network |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101847120A (en) * | 2010-03-31 | 2010-09-29 | 中兴通讯股份有限公司 | Design method and system of test case |
CN101968630A (en) * | 2010-09-16 | 2011-02-09 | 联合汽车电子有限公司 | Simulation test bed for automatic gearbox controller and simulation model establishing method |
CN102297765A (en) * | 2011-05-18 | 2011-12-28 | 联合汽车电子有限公司 | Hardware-in-loop simulation test bed for external characteristics of direct current converter |
US8204711B2 (en) * | 2009-03-25 | 2012-06-19 | GM Global Technology Operations LLC | System and apparatus for managing test procedures within a hardware-in-the-loop simulation system |
CN205121329U (en) * | 2015-11-23 | 2016-03-30 | 北汽福田汽车股份有限公司 | Electric motor car hardware is at ring test system |
CN105511326A (en) * | 2015-12-31 | 2016-04-20 | 北京长城华冠汽车科技股份有限公司 | Calibration system and calibration method for whole automobile controller of electric automobile |
CN106094802A (en) * | 2016-07-12 | 2016-11-09 | 重庆长安汽车股份有限公司 | A kind of automobile electronic controller communication test system and method |
CN106444721A (en) * | 2016-11-21 | 2017-02-22 | 南京越博动力系统股份有限公司 | Hardware-in-the-loop test system for whole vehicle controller for electric vehicle and test method |
CN206224231U (en) * | 2016-11-01 | 2017-06-06 | 宝沃汽车(中国)有限公司 | A kind of HIL test systems of entire car controller VCU |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170146987A1 (en) * | 2015-11-20 | 2017-05-25 | Caterpillar Inc. | Electronic control module testing system |
-
2018
- 2018-10-16 CN CN201811204075.6A patent/CN111064628B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8204711B2 (en) * | 2009-03-25 | 2012-06-19 | GM Global Technology Operations LLC | System and apparatus for managing test procedures within a hardware-in-the-loop simulation system |
CN101847120A (en) * | 2010-03-31 | 2010-09-29 | 中兴通讯股份有限公司 | Design method and system of test case |
CN101968630A (en) * | 2010-09-16 | 2011-02-09 | 联合汽车电子有限公司 | Simulation test bed for automatic gearbox controller and simulation model establishing method |
CN102297765A (en) * | 2011-05-18 | 2011-12-28 | 联合汽车电子有限公司 | Hardware-in-loop simulation test bed for external characteristics of direct current converter |
CN205121329U (en) * | 2015-11-23 | 2016-03-30 | 北汽福田汽车股份有限公司 | Electric motor car hardware is at ring test system |
CN105511326A (en) * | 2015-12-31 | 2016-04-20 | 北京长城华冠汽车科技股份有限公司 | Calibration system and calibration method for whole automobile controller of electric automobile |
CN106094802A (en) * | 2016-07-12 | 2016-11-09 | 重庆长安汽车股份有限公司 | A kind of automobile electronic controller communication test system and method |
CN206224231U (en) * | 2016-11-01 | 2017-06-06 | 宝沃汽车(中国)有限公司 | A kind of HIL test systems of entire car controller VCU |
CN106444721A (en) * | 2016-11-21 | 2017-02-22 | 南京越博动力系统股份有限公司 | Hardware-in-the-loop test system for whole vehicle controller for electric vehicle and test method |
Non-Patent Citations (3)
Title |
---|
"Reconfigurable real-time hardware-in-the-loop environment for automotive electronic control unit testing and verification";Krisztian Enisz,;《IEEE Instrumentation & Measurement Magazine》;20140811;第17卷(第14期);全文 * |
"RTLinux based Simulator for Hardware-in-the Loop Simulations";Naveed ur Rehman,;《2007 International Bhurban Conference on Applied Sciences & Technology》;20071112;全文 * |
"基于HIL仿真系统的TCU应用软件测试";范萍萍,;《农业装备与车辆工程》;20151231;第53卷(第12期);第72-76页 * |
Also Published As
Publication number | Publication date |
---|---|
CN111064628A (en) | 2020-04-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111064628B (en) | CAN bus automatic test system | |
CN107145140B (en) | Automatic test system and test method for CAN interface of vehicle-mounted electronic control unit | |
CN112817872B (en) | Development test system and method | |
CN106850372B (en) | Method and system for testing controller CAN signal | |
CN113190454A (en) | Real-vehicle test method and system for vehicle-mounted terminal software | |
CN111176984A (en) | Signal-oriented automatic test implementation method | |
CN113904967B (en) | Automatic testing device and testing method for automobile CAN communication module interface software | |
CN108984400B (en) | Automatic interface testing method based on early warning detection system | |
CN110989549B (en) | Software test general automation control method and device for train control system | |
CN114924546A (en) | Calibration system and method for hardware-in-loop test | |
CN109309598B (en) | Sampling point automatic test system and method for tested vehicle-mounted module with CAN function | |
CN113064618B (en) | System and method for simulating new energy vehicle conformance detection | |
CN109960238B (en) | Automatic test system and method for vehicle diagnostic instrument | |
CN116224963A (en) | Automatic testing device of remote vehicle control system and construction method thereof | |
CN115185258A (en) | HIL simulation test system and method suitable for vehicle control unit | |
CN116136662B (en) | Vehicle-mounted system simulation platform and testing method and device thereof | |
CN113093688B (en) | Input and output testing method and system for new energy vehicle control unit | |
CN115268403A (en) | Automatic EOL (Ethernet out load) testing method for whole vehicle | |
KR20240075065A (en) | Simulation device of the automatic charging system configuration module of the electric vehicle and the simulation method using it | |
CN118445203A (en) | Software RTE interface test method, system, electronic equipment and storage medium | |
CN118606215A (en) | Automatic test method and system for CAN signal of electronic controller | |
CN118409964A (en) | Solid state disk firmware debugging method, system, device, computer equipment and storage medium | |
CN118090232A (en) | Vehicle testing method, device, equipment and storage medium | |
CN115248775A (en) | Test system, test method, test terminal, and storage medium | |
CN115150431A (en) | Finished vehicle MCU remote debugging system, method and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |