Method, system and equipment for calculating and collecting automatic control data based on CAN (Controller Area Network) message and medium
By detecting and parsing CAN message data, defining indicator areas, and calculating execution time, steady-state time, overshoot, and steady-state error, the problems of low data calculation efficiency and reliability in steering wheel angle step response testing are solved, achieving efficient and reliable data processing and evaluation.
Patent Information
- Application Number
- CN202511647397.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-11
- Publication Date
- 2026-02-27
AI Technical Summary
In existing steering wheel angle step response tests, data calculation and statistical efficiency is low, data selection is greatly affected by subjective human factors, the reliability of calculation results is low, and there is a lack of unified calculation standards, which affects the reliability of test data and the accuracy of analysis results.
By detecting and parsing CAN message data, four index regions for steering wheel angle step are defined, and the execution time, steady-state time, overshoot, and steady-state error are calculated. The automatic control mode is determined by detecting the message type using a script, and data calculation is performed in combination with preset parameters to establish an evaluation index dataset to ensure the stability of automatic control.
It improved data processing efficiency and result reliability, ensured the efficiency and consistency of data selection, and enhanced the evaluation reliability and development progress of the automatic redirection function.
Smart Images

Figure CN121573064A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of vehicle steering angle control, and particularly relates to a method, system, device and medium for collecting and automatically controlling data based on CAN messages. BACKGROUND
[0002] In the current wave of intelligent and networked transformation of the automotive industry, automatic driving and automatic parking, as the core functions of advanced driver assistance systems, are penetrating the consumer car market at an unprecedented speed. From the widespread popularity of L2-level assisted driving to the landing application of L3-level automatic driving in specific scenarios, consumers' dependence on vehicle intelligent functions is increasing day by day, which not only drives the innovation of automotive technology, but also raises stringent requirements for the safety and timeliness of functions. Among them, the automatic steering function, as a key link to realize automatic driving path tracking and automatic parking precise warehousing, directly determines the reliability of the whole vehicle intelligent system. To ensure that the automatic steering function meets the design standards, on the one hand, the controller needs to be able to fuse real-time environmental perception data (such as road boundaries and obstacle information collected by cameras and radars) and vehicle state data (such as vehicle speed, yaw angular velocity, and wheel speed) to plan a smooth and safe steering wheel angle path. On the other hand, as the actuator, the steering machine must be able to quickly and accurately respond to the target angle request from the controller to avoid the vehicle deviating from the predetermined path due to response delay or insufficient accuracy, causing safety hazards. In the development and verification process of the automatic steering function, the steering wheel angle step response test is one of the core means to evaluate the steering machine's angle response performance. By sending a step target angle command to the steering machine, the tester can observe the dynamic process of the steering machine from the initial state to the target angle state, and extract key evaluation indicators based on this process, including execution time, steady-state time, overshoot, and steady-state error. These indicators not only quantify the response speed, control accuracy, and stability of the steering machine, but also serve as an important basis for subsequent optimization of the steering machine control algorithm and improvement of the overall performance of the automatic steering function. However, the current mainstream steering wheel angle step response test evaluation index acquisition method in the industry still has many problems to be solved, which seriously restricts the test efficiency and data reliability. First, in the data processing link, a complete steering wheel angle step response test will produce a large amount of test data, which is transmitted and stored in the form of CAN bus messages in real time. Among them, there are not only effective data directly related to the steering wheel angle response, such as steering wheel output angle, target angle, control command signal, but also a large amount of invalid data unrelated to this test, such as air conditioning status, window control, entertainment system message data sent by other vehicle ECUs. Since the existing technical means cannot filter and distinguish test data in real time, all data will be directly imported into the calculation link. The influx of a large amount of invalid data not only occupies a large amount of storage and computing resources, resulting in a significant decrease in data processing speed (for example, a calculation that would normally take only a few minutes may be delayed to tens of minutes or even hours due to interference from invalid data), but also may introduce noise in the data preprocessing process, affecting the accuracy of subsequent index calculation. Secondly, in the index extraction link, the existing method highly depends on manual operation, which is highly subjective and difficult to reproduce. Whether through manual punctuation calculation of message data using visualization tools or manual analysis after exporting data to Excel, MATLAB and other tools, test personnel need to judge key time nodes and data thresholds based on personal experience. This manual marking method has significant drawbacks: on the one hand, different test personnel have different understandings of index definitions (for example, some people believe that the steady-state time determination standard is that the angle stabilizes within ±2% of the target value, while another group of people may use ±5% standard), which may lead to completely different index results for the same set of test data in different hands, seriously affecting data consistency and reliability; on the other hand, the marking of key nodes often needs to rely on the subjective judgment of test personnel on the trend of data curve changes, lacking objective and quantitative judgment basis, which makes the test results unable to be accurately reproduced, making subsequent performance tracing and problem positioning extremely difficult. For example, when the steady-state time test data of a batch of steering machines fluctuates, test personnel cannot determine whether the performance difference of the steering machine itself exists or the deviation is caused by different marking habits of different test personnel, which brings great difficulty to problem troubleshooting. In addition, there is no unified calculation rule and standard in the industry in the index calculation link. Although there is a consensus on the definition of execution time and steady state time at the theoretical level, the calculation methods used by different enterprises or even different R&D teams within the same enterprise are different in the actual calculation process. Taking the steady state error calculation as an example, some teams take the difference between the average value of 5 consecutive sampling points after the data is stable and the target steering angle as the steady state error, and some teams use the average value of all sampling points after stabilization for calculation. The lack of uniform calculation rules leads to the lack of comparability of test data from different test institutions and different R&D stages, and the lack of a unified performance evaluation system. For example, differences in calculation rules between enterprises and suppliers may result in mismatched test results, requiring a lot of time for data checking and communication; during product iteration, it is difficult to effectively compare test data of different versions, and it is difficult to clearly determine the optimization direction and effect of the steering performance. The existence of these problems not only directly leads to low efficiency in data calculation and statistics in steering wheel angle step response test, wasting a lot of manpower, material resources and time cost, but also seriously affects the reliability of test data and the accuracy of analysis results. Based on unreliable data, the actual performance of the steering machine may be misjudged by the R&D team: for example, a "pseudo overshoot" caused by invalid data interference is mistaken for a defect in the steering control algorithm, unnecessary algorithm adjustment is made, and development progress is delayed; or the problem of too long steering steady state time is not found due to manual marking error, so that products with performance risks flow into subsequent links, which may eventually cause vehicle automatic steering function failure and threaten the safety of passengers. At the same time, the lack of calculation rules is also not conducive to the improvement of the overall technical level of the industry, and each enterprise fights for the test method, which cannot form a unified technical standard and best practice, resulting in waste of industry resources and hindering the rapid iteration and popularization of automatic driving and automatic parking technology. Under the background of the increasingly fierce competition of automobile intelligence, these problems have become a key bottleneck affecting the R&D efficiency and product competitiveness of enterprises, and need to be solved through technical innovation and standard setting.
[0003] Therefore, in the steering wheel angle step response test, the data calculation and statistics efficiency is low, and the data selection is greatly affected by human subjective factors, resulting in low reliability of the calculated data. Using these data for analysis leads to a decrease in the accuracy of the analysis results; and there is a lack of unified standard for data calculation, which is not conducive to overall evaluation and seriously affects the progress of function optimization. SUMMARY
[0004] In order to solve the above problems, the application provides a method, system, device and medium for collecting automatic control data based on CAN message, wherein the CAN message data is detected and analyzed by requesting the CAN message data, four index regions of steering wheel angle step are defined, and the execution time calculation interval, the steady state time calculation interval, the overshoot and the steady state error are calculated according to the index region definition; the message type is detected by a script to determine whether to enter the automatic control mode, and when the automatic control mode is entered, the execution time, the steady state time, the overshoot and the steady state error are calculated according to the defined data and the pre-prepared parameters, the evaluation index data set is established by the calculated values, and the advantages and disadvantages in the automatic control are evaluated; the automatic control is verified according to the exit judgment condition in the automatic control stage, and the stability of the automatic control is ensured.
[0005] In order to achieve the above object, the application adopts the following technical scheme: The first aspect of the application provides a method for collecting automatic control data based on CAN message, comprising the following steps: Step S1, the index regions are divided according to the steering wheel angle, and the execution time calculation interval, the steady state time calculation interval, the overshoot and the steady state error of each interval are defined according to the divided index regions; Step S2, the CAN tool actively sends a request to request the steering machine to turn, and then detects the CAN message by a script to determine whether to enter the automatic control mode; Step S3, when the automatic control mode is entered, the collection of automatic control data is started, the overshoot Os is obtained according to the request angle AngleReq and the actual angle value AngleAct of the steering machine, the execution time Tr, the steady state time Ts and the steady state error Se are calculated according to the request angle AngleReq and the actual angle value AngleAct in the CAN message and the execution time calculation interval and the steady state time calculation interval defined in step S1, and these data are recorded; Step S4, the CAN message and the calculation cycle response time are detected to determine whether to exit the automatic control state and end the data collection.
[0006] The second aspect of the application provides a system for collecting automatic control data based on CAN message, comprising a CAN tool module, a definition module, a state judgment module, a calculation module and an exit condition judgment module; the CAN tool module is connected with a vehicle controller to obtain the CAN message data of the controller; The CAN tool module comprises a message transceiving sub-module and a script detection sub-module; the message transceiving sub-module actively requests the CAN message data of the vehicle controller, and sends the received message data to the script sub-module, and the script sub-module detects and analyzes the CAN message; The definition module defines four request angle index regions according to steering wheel angle step, and defines execution time calculation interval, steady state time calculation interval, overshoot and steady state error according to the index regions; and provides calculation basis data and rules; The state judgment module judges the state of CAN data before calculation to determine whether the data enters the calculation stage; The calculation module includes execution time calculation submodule, steady state time calculation submodule, overshoot calculation submodule and steady state error calculation submodule; the values of execution time, steady state time, overshoot and steady state error of automatic control angle step are obtained through the calculation of each submodule; The execution time calculation submodule obtains the execution angle standard TrAngleReq corresponding to the request angle AngleReq from the defined execution time calculation interval according to the value of the request angle AngleReq in the EPS_Il message, for example, AngleReq=10, according to , TrAngleReq=8; the value of the actual angle AngleAct of the steering wheel in the EPS_Ol is obtained, and it is judged whether the actual angle AngleAct is greater than or equal to the execution angle standard TrAngleReq; if AngleAct≥TrAngleReq, and AngleAct<TrAngleReq at the last moment, the time at this moment is recorded, and the difference between TStartStep is obtained to get the execution time index of this step ; otherwise, discard this data and wait for the next EPS_Ol data.
[0007] The steady state time calculation submodule obtains the lower limit steady state angle standard TsAngleReq_l and the upper limit steady state angle standard TsAngleReq_u corresponding to the request angle AngleReq from the steady state time calculation interval according to the value of the request angle AngleReq in the EPS_Il message, for example, AngleReq=10, according to Ts_f= , TsAngleReq_l=9.5, TsAngleReq_u=10.5; the value of the actual angle AngleAct of the steering wheel in the EPS_Ol is obtained, and it is judged whether AngleAct is between TsAngleReq_l and TsAngleReq_u.
[0008] If AngleAct≥TsAngleReq_l, and AngleAct<TsAngleReq_l at the last moment, the time t0_ts at this moment is recorded, otherwise, wait for new EPS_Ol data, and execute step S32; After recording t0_ts, if TsAngleReq_l≤AngleAct and AngleAct≤TsAngleReq_u is satisfied for M_Ts consecutive periods, then the steady state time of this step response is obtained by subtracting TStartStep from t0_ts ; After recording t0_ts, if TsAngleReq_l≤AngleAct and AngleAct≤TsAngleReq_u is not satisfied for M_Ts consecutive periods, then the recorded t0_ts is discarded, and the value of the period that does not satisfy the condition is recorded as t0_ts, and the verification of the consecutive periods is performed until the steady state time is obtained. The overshoot calculation submodule obtains the value of the actual angle AngleAct variable in EPS_O1 and compares it with the value at the previous moment; if AngleAct(t) > AngleAct(t-1), then the value of AngleMax (initial value 0) is updated to AngleAct(t). If t0_ts has a value in the steady state time calculation, then step S322 in the steady state time calculation process is performed, and AngleAct at the current moment is compared with AngleMax; if AngleAct > AngleMax, then the value of AngleMax_ts (initial value AngleMax) is updated to AngleAct. If the value of t0_ts is not updated, then the steady state time has been calculated, and the overshoot is the difference between AngleMax and AngleReq. If the steady state time calculation does not satisfy the consecutive verification, then AngleMax = AngleMax_ts, and new EPS_O1 data is awaited for the calculation of the steady state time. The steady state error calculation submodule, if the steady state time has been obtained, then starting from t0_ts + M_Ts, (|AngleAct-AngleReq|) is compared with AngleSe (initial value 0); if |AngleAct-AngleReq| > AngleSe, then AngleSe = |AngleAct-AngleReq|, and Se = AngleAct-AngleReq is recorded; after N consecutive periods, the value of is recorded as the steady state error of this step response.
[0009] The exit condition judgment module is used to determine whether to exit this automatic angle step control process.
[0010] In a third aspect of the present application, an electronic device is provided, comprising a memory 102, a processor 101, a display module 103, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the preceding methods for calculating automatic control data based on CAN messages.
[0011] In a fourth aspect of the present application, a readable storage medium is provided, which stores a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the preceding methods for calculating automatic control data based on CAN messages.
[0012] The present application has the following beneficial effects: by dividing the steering wheel angle into four index regions and defining the execution time calculation interval, steady state time calculation interval, overshoot, and steady state error of each region, a test basis is provided for subsequent data calculation; by determining whether the automatic control stage is entered through state judgment, a flag is established for effective data, and the execution time, steady state time, overshoot, and steady state error of the corresponding data are calculated through the defined execution time calculation interval, steady state time calculation interval, overshoot, and steady state error of the data entering the automatic control stage, the reliability of the result data and the data selection efficiency are improved through unified standard data selection and automatic data calculation, the overall data processing efficiency is improved, high-quality steering wheel angle step response is provided for subsequent data analysis, the overall evaluation reliability is improved, and the development process and iteration speed are accelerated. BRIEF DESCRIPTION OF DRAWINGS
[0013] In order to more clearly illustrate the technical solutions of the present application, the drawings required in the description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0014] Figure 1 The flowchart of the method of the present application is shown in the figure. Figure 2 The system structure diagram of the present application is shown in the figure. Figure 3 The device structure diagram of the present application is shown in the figure.
[0015] Among them, 101-processor, 102-memory, 103-display module. DETAILED DESCRIPTION
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] Unless otherwise defined, all technical and scientific terms used in this application have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used in this application and in the specification of this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
[0018] Example 1, such as Figure 1 The method shown includes the following steps for calculating and acquiring automatic control data based on CAN messages: Step S1: Divide the indicator regions according to the steering wheel angle, and define the execution time calculation interval, steady-state time calculation interval, overshoot, and steady-state error for each interval based on the divided indicator regions; the specific steps are as follows: Step S11, the steering wheel angle step response test mainly involves the index range under four conditions, namely the steering wheel requested angle -10° to 10°, -20° to 20°, -50° to 50°, and -100° to 100°; Step S12: Based on the four defined indicator regions, define the execution time calculation interval rules: the time it takes for the actual steering wheel angle to jump from its minimum value to its maximum value when the requested steering wheel angle in each region jumps from its minimum value to the maximum value of the actual steering wheel angle region; the execution time calculation intervals corresponding to the four requested angle regions are the actual steering wheel angles from -10° to 8°, -20° to 16.4°, -50° to 41°, and -100° to 82°, respectively. ,in This indicates the time it takes for the actual steering wheel angle to change from -10° to 8° when the requested steering wheel angle increases from -10° to 10°; the same applies to other cases. Step S13: Based on the four divided regions, define the steady-state time calculation interval rules: when the requested steering wheel angle in each region jumps from its lowest value to its highest value, the actual steering wheel angle jumps from its minimum value to the beginning of the steady-state interval; the steady-state time calculation interval Ts_f corresponding to the four requested angle regions = ,in, This indicates the initial time when the steering wheel's requested angle jumps from -10° to 10°, and the actual steering wheel angle stabilizes within the range of (9.5°, 10.5°). The same applies to other cases.
[0019] Step S14, according to the divided four region ranges, define the overshoot Os rule: the difference between the maximum value of the actual steering wheel angle before reaching the steady state in each region and the maximum value in the index region; Step S15, according to the divided four region ranges, combined with the stable interval obtained in step S13, calculate the steady state error Se of each region, that is, the maximum value of the steering wheel angle deviating from the target value after reaching the steady state; such as-10° to 10° step, the minimum value of the steering wheel after reaching the steady state is 9.6, and the maximum value is 10.3, then the steady state error is-0.4.
[0020] Step S2, actively send a request through the CAN tool to request the steering machine to turn, and then detect the CAN message through the script to determine whether to enter the automatic control mode; The specific steps are as follows: Step S21: actively send a request through the CAN tool to request the steering machine to turn, and detect the CAN message through the script; Step S22, when the script detects that the CAN request message is a request angle EPS_I1 type, get the value of the Mode variable in the message, and judge whether the value is M1, M1 is the code of angle control mode; Step S23, if Mode=M1, enter the automatic control mode, execute step S24, otherwise execute the exit control judgment step S4; Step S24, get the value of the request angle AngleReq variable in EPS_I1 in the adjacent two periods, whether it meets the four index regions defined in step S11; Step S25, if it meets the four index regions defined in step S11, assign the variable StStep (initial value is 0) to 1, and record the time as the start time TStartStep of this request, execute step S3, otherwise execute step S4; Step S3, when entering the automatic control mode, start collecting automatic control data, get the overshoot Os according to the request angle AngleReq and the actual angle value AngleAct of the steering machine, according to the request angle AngleReq and the actual angle value AngleAct in the CAN message, and combined with the execution time calculation interval and the steady state time calculation interval defined in step S1, calculate the execution time Tr, the steady state time Ts and the steady state error Se; and record these data; the specific calculation process is as follows: Step S31, the execution time calculation process is as follows: Step S311, according to the value of AngleReq, get the execution angle standard TrAngleReq corresponding to AngleReq from steps S11 and S12, such as AngleReq=10, according to If AngleAct≥ TrAngleReq, and AngleAct< TrAngleReq at the last time, record the time at this moment, and get the execution time index of this step by subtracting TStartStep If AngleAct≥ TrAngleReq, and AngleAct< TrAngleReq at the last time, record the time at this moment, and get the execution time index of this step by subtracting TStartStep Otherwise, discard this data and wait for the next EPS_Ol data. Step S32, the calculation process of steady state time is as follows: Step S321, according to the value of AngleReq, get the corresponding lower limit steady state angle standard TsAngleReq_l and upper limit steady state angle standard TsAngleReq_u from step S1, S3, such as AngleReq=10, according to Ts_f= Then TsAngleReq_l=9.5, TsAngleReq_u=10.5; get the value of the actual angle AngleAct variable in EPS_Ol, and judge whether AngleAct is between TsAngleReq_l and TsAngleReq_u; Step S322, if AngleAct≥ TsAngleReq_l, and AngleAct< TsAngleReq_l at the last time, record the time t0_ts at this moment, Step S3221, if TsAngleReq_l≤ AngleAct and AngleAct≤ TsAngleReq_u conditions are met for M_Ts (according to the actual situation, default 5) periods, then t0_ts and TStartStep are subtracted to get the steady state time of this step response ; Step S3222, if TsAngleReq_l≤ AngleAct and AngleAct≤ TsAngleReq_u conditions are not met for M_Ts periods, discard the recorded t0_ts time, record the value that does not meet this period as t0_ts, execute step S3221, step S3222, until the steady state time is obtained; Step S323, otherwise, wait for new EPS_Ol data, execute step S32; Step S33, the calculation process of overshoot is as follows: Step S331, the value of the actual angle AngleAct variable in EPS_O1 is obtained and compared with the value at the previous moment; if AngleAct(t) > AngleAct(t-1), the value of AngleMax (initial value 0) is updated as AngleAct(t); Step S332, if t0_ts has a value in the steady state time calculation, step S322 in the steady state time calculation process is entered, AngleAct at the current moment is compared with AngleMax; if AngleAct > AngleMax, the value of AngleMax_ts (initial value AngleMax) is updated as AngleAct; Step S3321, if the value of t0_ts is not updated, the steady state time has been calculated, the overshoot is the difference between AngleMax and AngleReq; Step S3322, if the condition step S3222 is met when the steady state time calculation is in progress, AngleMax = AngleMax_ts, new EPS_O1 data is waited for, and step S33 is executed; Step S34, the calculation process of the steady state error is as follows: Step S341, if the steady state time has been calculated, from t0_ts+M_Ts, (|AngleAct-AngleReq|) is compared with AngleSe (initial value 0); if |AngleAct-AngleReq| > AngleSe, AngleSe = |AngleAct-AngleReq|, and Se = AngleAct-AngleReq is recorded; Step S342, after N (set according to the actual situation, default 5) periods, the value of is recorded, which is the steady state error of the current step response. Step S4, CAN message and calculation period response time detection are performed to determine whether to exit the automatic control state and end data collection; the judgment rule of the angle step automatic control exit condition is as follows: If the script detects that the CAN message is EPS_I1, and the message parameter Mode ≠ M1; If the script detects that the CAN message is EPS_I1, and the message parameter Mode = M1, but the message request angle AngleReq does not meet the four regions defined in step S11; If the request start time TStartStep after this time is TStartStep+Total_T, Total_T +M+N N is the number of consecutive cycles, M is the preset empirical value, and Total_T is the time within T cycles after TStartStep. T is set according to the actual situation, with a default value of 5. If the script detects that the CAN message type is EPS_O2 (human force), the human force value DriverTorque in the message is greater than the preset human force DriverTorqueReq; In summary, if any one of the above four conditions is met to exit the automatic control mode, the automatic control data acquisition will end and all variables in steps S1-S3 will be reset to their initial values; otherwise, the automatic control data acquisition will continue.
[0021] Example 2, as Figure 2 As shown, a system for calculating and acquiring automatic control data based on CAN messages includes a CAN tool module, a definition module, a status judgment module, a calculation module, and an exit condition judgment module; the CAN tool module is connected to the vehicle controller to acquire the controller's CAN message data; The CAN tool module includes a message transceiver submodule and a script detection submodule. The message transceiver submodule actively requests CAN message data from the vehicle controller and sends the received message data and the requested message to the script submodule. The script submodule detects and parses the CAN message. The module defines four request angle indicator regions based on the steering wheel angle step: -10° to 10°, -20° to 20°, -50° to 50°, and -100° to 100°. Based on the indicator regions, the module defines the execution time calculation interval, steady-state time calculation interval, overshoot, and steady-state error for each region. Based on the four defined indicator ranges, the actual steering wheel angle ranges are defined, and the execution time calculation interval rules are defined accordingly: the time it takes for the actual steering wheel angle to jump from its minimum value to its maximum value within each range when the requested steering wheel angle jumps from its minimum value to the maximum value of the actual steering wheel angle range; the execution time calculation intervals corresponding to the four requested angle ranges are the time for the actual steering wheel angle to change from -10° to 8°, -20° to 16.4°, -50° to 41°, and -100° to 82°, respectively. ,in This indicates the time it takes for the actual steering wheel angle to change from -10° to 8° when the requested steering wheel angle increases from -10° to 10°. The same applies to other parameters.
[0022] Based on the four defined index regions, the steady-state time calculation interval rule is defined as follows: when the requested steering wheel angle in each region jumps from its lowest value to its highest value, the actual steering wheel angle jumps from its minimum value to the beginning of the steady-state interval; the steady-state time calculation interval Ts_f corresponding to the four index regions is... ,in, It represents the starting time when the actual steering wheel angle changes from -10° to stabilize within the range of (9.5°, 10.5°) when the requested steering wheel angle steps from -10° to 10°. The same applies to others.
[0023] According to the four divided regional ranges, define the overshoot Os rule: the maximum value before the actual steering wheel angle reaches the steady state within each region, that is, the maximum value of the stable interval in step S13.
[0024] According to the four divided regional ranges and combining with the stable interval obtained in step S13, calculate the steady-state error Se for each region, which is the maximum value by which the steering wheel angle deviates from the target value after reaching the steady state; for example, for a step from -10° to 10°, the minimum value after the steering wheel reaches the steady state is 9.6 and the maximum value is 10.3, then the steady-state error is -0.4.
[0025] The status judgment module performs status judgment on the CAN data before calculation to determine whether the data enters the calculation stage; The calculation module includes an execution time calculation sub-module, a steady-state time calculation sub-module, an overshoot calculation sub-module, and a steady-state error calculation sub-module; the numerical values of the execution time, steady-state time, overshoot, and steady-state error of the automatic control angle step are obtained through the calculations of each sub-module; The execution time calculation sub-module, according to the value of the requested angle AngleReq in the EPS_Il message, obtains the corresponding execution angle standard TrAngleReq for the requested angle AngleReq from the defined execution time calculation interval. For example, if AngleReq = 10, according to , then TrAngleReq = 8; obtain the value of the actual angle AngleAct variable of the steering wheel in EPS_Ol, and judge whether the actual angle AngleAct is greater than or equal to the execution angle standard TrAngleReq; if AngleAct ≥ TrAngleReq and AngleAct < TrAngleReq at the previous moment, record the time at this moment and subtract it from TStartStep to obtain the execution time index of this step ; otherwise, discard this data without processing and wait for the next EPS_Ol data.
[0026] The steady-state time calculation sub-module, according to the value of the requested angle AngleReq in the EPS_Il message, obtains the corresponding lower steady-state angle standard TsAngleReq_l and upper steady-state angle standard TsAngleReq_u from the steady-state time calculation interval. For example, if AngleReq = 10, according to Ts_f = , then TsAngleReq_l = 9.5 and TsAngleReq_u = 10.5; obtain the value of the actual steering wheel angle AngleAct variable in EPS_O1, and determine whether AngleAct is between TsAngleReq_l and TsAngleReq_u.
[0027] If AngleAct ≥ TsAngleReq_l and AngleAct < TsAngleReq_l at the previous moment, record the time t0_ts at this time; otherwise, wait for new EPS_O1 data and execute step S32. After recording t0_ts, if the condition AngleAct < TsAngleReq_l is satisfied for M_Ts consecutive cycles, then the difference between t0_ts and TStartStep is the steady-state time of this step response. ; After recording t0_ts, if the condition AngleAct < TsAngleReq_l is not satisfied within M_Ts consecutive cycles, then discard the recorded t0_ts time, record the value that does not satisfy this cycle as the time t0_ts, and perform continuous cycle verification until the steady-state time is obtained. Overshoot calculation sub-module, obtain the value of the actual angle AngleAct variable in EPS_O1 and compare it with the value at the previous moment; if AngleAct(t) > AngleAct(t - 1), then update the value of AngleMax (initial value is 0) to AngleAct(t). If t0_ts in the steady-state time calculation has a value, then in step S322 of the steady-state time calculation process, compare the current AngleAct with AngleMax; if AngleAct > AngleMax, then update the value of AngleMax_ts (initial value is AngleMax) to AngleAct. If the value of t0_ts is not updated, then the steady-state time has been calculated, and the overshoot is the difference between AngleMax and AngleReq. If the continuous verification in the steady-state time calculation is not satisfied, then set AngleMax = AngleMax_ts, wait for new EPS_O1 data, and perform the steady-state time calculation. The steady-state error calculation submodule, if the steady-state time has been obtained, starts from time t0_ts+M_Ts and compares (|AngleAct-AngleReq|) with AngleSe (initially 0). If |AngleAct-AngleReq|>AngleSe, then let AngleSe=|AngleAct-AngleReq| and record Se=AngleAct-AngleReq. After N cycles, record... The value of is the steady-state error of this step response.
[0028] The exit condition judgment module is used to determine whether to exit the current automatic angle jump control process.
[0029] Example 3, as Figure 3 As shown, a computer device includes a processor 101, a memory 102, a display module 103, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps in the method for calculating and collecting automatic control data based on CAN messages described in Embodiment 1.
[0030] Example 4: A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in the method for calculating and acquiring automatic control data based on CAN messages as described in Example 1.
[0031] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.
[0032] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0033] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0034] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0035] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0036] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for calculating and acquiring automatic control data based on CAN messages, characterized in that: Includes the following steps: Step S1: Divide the index area according to the steering wheel angle, and define the execution time calculation interval, steady-state time calculation interval, overshoot, and steady-state error for each interval based on the divided index area; Step S2: Actively send a request through the CAN tool to request the steering gear to turn the angle, and then use the script to detect the CAN message to determine whether to enter the automatic control mode; Step S3: When entering automatic control mode, start collecting automatic control data. Obtain the overshoot Os based on the requested angle AngleReq and the actual angle value AngleAct of the steering gear. Calculate the execution time Tr, steady-state time Ts, and steady-state error Se based on the requested angle AngleReq and the actual angle value AngleAct in the CAN message, combined with the execution time calculation interval and steady-state time calculation interval defined in step S1; and record these data. Step S4: Detect the CAN message and calculate the cycle response time to determine whether to exit the automatic control state and end data acquisition.
2. The method for calculating and acquiring automatic control data based on CAN messages according to claim 1, characterized in that: The specific steps for S1 are as follows: [2] Step S11: Divide the steering wheel angle into four request angle indicator areas. The indicator areas are: -10°—— 10°、-20°—— 20°、-50°—— 50°、-100°—— 100°; Step S12: Based on the four divided indicator regions, define the execution time calculation interval Tr_f = ; Step S13: Define the steady-state time calculation interval based on the four index regions. ; Step S14: Based on the four index regions, define the overshoot Os: the difference between the maximum value of the actual steering wheel angle before it reaches steady state and the maximum value of the index region in each region. Step S15: Based on the four index regions, and combined with the steady-state time calculation interval defined in step S13, calculate the steady-state error Se for each region.
3. The method for calculating and acquiring automatic control data based on CAN messages according to claim 2, characterized in that: The specific steps of S2 are as follows: [3] Step S21: Actively send a request through the CAN tool to request the steering gear to turn, and then detect the CAN message through the script; Step S22: When the script detects that the CAN request message is of type EPS_I1, it obtains the value of the Mode variable in the message and determines whether its value is M1. Step S23: If Mode=M1, enter automatic control mode and execute step S24; otherwise, execute step S4. Step S24: Obtain the value of the request angle AngleReq variable in EPS_I1 in two adjacent periods, and determine whether it meets the four indicator areas defined in step S11. Step S25: If the four indicator regions defined in step S11 are satisfied, then the variable StStep is assigned the value 1, and the time at this time is recorded as the start time TStartStep of this request. Then, step S3 is executed. Otherwise, step S4 is executed.
4. The method for calculating and acquiring automatic control data based on CAN messages according to claim 3, characterized in that: The specific operation of S3 is as follows: When the script detects that the CAN message type is EPS_Ol and the variable StStep=1, it determines the execution time calculation interval and steady-state time calculation interval based on the requested angle AngleReq parameter value in the message. Combined with the actual steering wheel angle AngleAct, it calculates the execution time and steady-state time. Based on the requested angle AngleReq parameter value in the message and the actual steering wheel angle AngleAct, it calculates the overshoot and steady-state error.
5. The method for calculating and acquiring automatic control data based on CAN messages according to claim 4, characterized in that: The specific operation of S4 is as follows: The judgment rules for the automatic control exit condition are as follows: [5] If the script detects that the CAN message is EPS_I1 and its message parameter Mode ≠ M1; If the script detects that the CAN message is EPS_I1 and its message parameter Mode = M1, but the message request angle AngleReq does not satisfy the four regions defined in step S11; If the current request starts within Total_T cycles after TStartStep, Total_T > 1. +M+N> N is the number of consecutive periods, and M is a preset empirical value; If the script detects that the CAN message type is EPS_O2 and the message variable DriverTorque > DriverTorqueReq; In summary, if any of the above four cases is satisfied, the automatic control mode is exited, the automatic control data collection ends, and all variables in steps S1 - S3 are reset to their initial values. Otherwise, the automatic control data is continuously collected.
6. The method for calculating and acquiring automatic control data based on CAN messages according to any one of claims 5, characterized in that: The calculation process of the execution time and steady - state time in step S3 is: [6] Step S31, the calculation process of the execution time is as follows: Step S311, according to the value of AngleReq, obtain the corresponding execution angle standard TrAngleReq of AngleReq from steps S11 and S12, obtain the value of the actual angle AngleAct variable of the steering wheel in EPS_Ol, and determine whether AngleAct is greater than or equal to TrAngleReq; Step S312: If AngleAct ≥ TrAngleReq and AngleAct < TrAngleReq at the previous moment, record the current time, subtract it from TStartStep, and obtain the execution time index of this step And record this data; otherwise, discard this data without processing and wait for the next EPS_Ol data Step S32, the calculation process of the steady - state time is as follows: Step S321, according to the value of AngleReq, obtain the corresponding lower - limit steady - state angle standard TsAngleReq_l and upper - limit steady - state angle standard TsAngleReq_u from steps S1 and S3; obtain the value of the actual angle AngleAct variable of the steering wheel in EPS_O1, and determine whether AngleAct is between TsAngleReq_l and TsAngleReq_u; Step S322, if AngleAct ≥ TsAngleReq_l and the previous moment AngleAct < TsAngleReq_l, record the time t0_ts at this time, Step S3221: If the conditions TsAngleReq_l≤AngleAct and AngleAct≤TsAngleReq_u are satisfied for M_Ts consecutive periods, then the steady-state time of this step response is obtained by subtracting t0_ts from TStartStep. ; Step S3222, if the condition of TsAngleReq_l ≤ AngleAct and AngleAct ≤ TsAngleReq_u is not satisfied for M_Ts consecutive cycles, then discard the recorded t0_ts time, record the value of this cycle that does not satisfy as the time t0_ts, wait for new EPS_O1 data, and execute step S322 until the steady - state time is obtained; Step S323, otherwise wait for new EPS_O1 data and execute step S32.
7. The method for calculating and acquiring automatic control data based on CAN messages according to claim 5, characterized in that: The calculation process of the overshoot and steady - state error in step S3 is: [7] Step S33, the calculation process of the overshoot is as follows: Step S331, obtain the value of the actual angle AngleAct variable in EPS_O1 and compare it with the value of the previous moment; if AngleAct(t) > AngleAct(t - 1), then update the value of AngleMax to AngleAct(t); Step S332: If t0_ts in the steady-state time calculation has a value, then in step S322 of the steady-state time calculation process, compare AngleAct with AngleMax at the current time; if AngleAct>AngleMax, then update the value of AngleMax_ts to AngleAct. Step S3321: If the t0_ts value has not been updated, then the steady-state time and overshoot have been calculated. The difference between AngleMax and AngleReq Step S3322: If the steady-state time calculation meets the condition in step S3222, then let AngleMax = AngleMax_ts, wait for new EPS_O1 data, and execute step S33. Step S34, the calculation process of steady-state error is as follows: Step S341: If the steady-state time has been obtained, then starting from time t0_ts+M_Ts, compare |AngleAct-AngleReq| with AngleSe; if |AngleAct-AngleReq|>AngleSe, then let AngleSe=|AngleAct-AngleReq| and record Se=AngleAct-AngleReq; Step S342, after N cycles, record. The value of is the steady-state error of this step response.
8. A system for calculating and acquiring automatic control data based on CAN messages, characterized in that: It includes a CAN tool module, a definition module, a status judgment module, a calculation module, and an exit condition judgment module; the CAN tool module connects to the vehicle controller to obtain the controller's CAN message data [8]; The CAN tool module includes a message transmission and reception submodule and a script detection submodule; Message sending and receiving submodule; By actively requesting CAN message data from the vehicle controller, the received message data is sent to the script submodule, which then detects and parses the CAN message. The module defines four indicator regions based on the steering wheel angle, and defines the execution time calculation interval, steady-state time calculation interval, overshoot, and steady-state error for each indicator region. The status judgment module performs status judgment on the CAN data before calculation to determine whether the data has entered the automatic control stage. The calculation module includes an execution time calculation submodule, a steady-state time calculation submodule, an overshoot calculation submodule, and a steady-state error calculation submodule; the execution time, steady-state time, overshoot, and steady-state error of the automatic control angle step are obtained through the calculations of each submodule; The exit condition judgment module is used to determine whether to exit the current automatic control process.
9. An electronic device comprising a memory (102), a processor (101), a display module (103), and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method for calculating and acquiring automatic control data based on CAN messages as described in any one of claims 1 to 7.
10. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for calculating and acquiring automatic control data based on CAN messages as described in any one of claims 1 to 7.