Disclosure of Invention
Aiming at the defects of the prior art, the invention aims to provide a software and hardware decoupling simulation test system which can highly fit an actual scene, and the design is optimized by verifying the performances of the design in different fitting scenes from the actual scene.
The technical scheme of the invention is that the software and hardware decoupling simulation test system comprises:
The environment simulation module is used as an integrated tool and platform for realizing virtual research and development of the automobile through an analog simulation technology, integrates an automobile driving environment model, an on-board environment sensing model and a traffic model, can be seamlessly linked with Matlab/Simulink, supports offline and real-time simulation functions, and provides three-dimensional digital virtual test scene modeling and editing functions;
The vehicle dynamics simulation module is used for providing vehicle dynamics simulation, scene construction, sensor construction and data interface construction, constructing a control algorithm through a Simulink platform, realizing dynamics simulation through connecting hardware, software and images, wherein the images are automatically generated through the environment simulation module;
the evaluation index and evaluation software module is used for receiving the perception result output by the environment simulation module, receiving the planning target track, the vehicle speed, the control state quantity and the control execution quantity output by the vehicle dynamics simulation module, defining the evaluation index and the target function, outputting the model algorithm capability report, and outputting the algorithm module and the strategy algorithm parameter to be optimized aiming at the report.
As a further improvement, the environment simulation module designs a plurality of scene libraries according to different working conditions and ground conditions, and the operation coefficient K of the scene type can be calculated according to the following linear formula:
K=α* K1+β* K2+γ*K3+δ*K4;
Wherein alpha is ground condition consideration specific gravity, K1 is ground comprehensive coefficient, beta is weather condition consideration specific gravity, K2 is weather comprehensive coefficient, gamma is crop growth condition consideration specific gravity, K3 is crop growth condition comprehensive coefficient, delta is operation scene consideration specific gravity, and K4 is operation scene comprehensive coefficient.
Further, the vehicle dynamics simulation module comprises a power unit module, a chassis unit module and an intelligent driving unit module;
the power unit module is used for simulating the driving process of the power system, and the power output is calculated by adopting the following formula:
P=2π×T×n/60;
wherein P is power, T is torque, and n is rotation speed;
the chassis unit module is used for calibrating energy loss k generated in the power transmission process of the engine and calculating a final power output value;
P1=P*(1-k);
Wherein P1 is output power;
The intelligent driving unit module calculates and generates a control quantity according to a difference error between the target speed and the measured speed by using a PID formula, wherein the PID formula is as follows:
;
wherein, the For the target speed to be the same,In order to achieve a proportional gain,In order to integrate the gain,Is a differential gain.
Further, there is the following relationship between torque and speed:
T=F*L;
F=M*a;
v(t)=∫a(t)dt;
where F is force, L is force acting distance, M is vehicle mass, a is acceleration, and v (t) is speed.
Further, a data sharing interface is arranged among the power unit module, the chassis unit module and the intelligent driving unit module.
Further, the power system comprises a diesel engine system, an extended range hybrid system and a pure electric system.
Further, the KP, KI and KD of the PID controller are adaptively adjusted by adopting an adaptive PID adjustment strategy to adapt to each road section, and the adaptive PID adjustment strategy comprises:
The data-driven self-adaptive adjustment is that the historical data and the machine learning technology are utilized to analyze the performances of different vehicle types under different road conditions, and the training model predicts the optimal PID parameters;
the modularized PID control comprises the steps of configuring independent PID controller modules for each vehicle type and road condition, wherein each module is provided with self-adaptive adjustment logic;
Real-time road condition feedback, namely collecting road condition information in real time through a sensor, wherein the road condition information comprises road surface friction coefficient, gradient and curvature, and dynamically adjusting PID parameters according to the road condition information;
the vehicle dynamics model is used for establishing a detailed dynamics model for each vehicle type, simulating the behavior of each vehicle type under different road conditions, and adjusting PID parameters based on model prediction;
Implementing an adaptive control algorithm to dynamically adjust PID parameters according to the current and predicted errors;
The fuzzy logic system is used for processing multiple input variables and nonlinear system characteristics by using fuzzy logic and outputting adaptive PID parameters;
genetic algorithm optimization, namely optimizing PID parameters by applying a genetic algorithm, and finding out optimal parameters adapting to the current road section and vehicle type through an iterative process;
designing a layered control structure, wherein the bottom layer is responsible for real-time PID parameter adjustment, and the upper layer is responsible for selecting a control strategy according to the vehicle type and road conditions;
Simulating driving behaviors of different drivers in a simulation system, and adjusting PID parameters according to simulation results to adapt to different driving styles;
taking into consideration control targets which possibly conflict with different vehicle types and road conditions, balancing the targets by using a multi-target optimization method, and finding out the most suitable PID parameters;
reinforcement learning, namely using reinforcement learning algorithm to enable a control system to learn itself through interaction with the environment, and continuously optimizing PID parameters to obtain better control effect;
the system integration and coordination ensures that all modules can work cooperatively and share information so as to more comprehensively understand the state and environmental conditions of the vehicle and perform more effective PID parameter adjustment;
real-time monitoring and adjustment, namely implementing a real-time monitoring system, continuously evaluating control performance, and immediately adjusting PID parameters once performance degradation or specific trigger conditions are detected;
And the user self-defines setting, namely allowing the user to self-define an adjustment strategy of the PID parameters according to experience or specific requirements, and correspondingly adjusting the PID parameters according to user input by the system.
Advantageous effects
Compared with the prior art, the invention has the advantages that:
The invention emphasizes the simulation of the working condition, road condition and situation of the real vehicle, and ensures the transmission of data streams among the modules. According to the requirements of various test environments in the research and development process, related models are designed on the ring, software on the ring and hardware on the ring, so that the test environments are guaranteed to be highly similar to the actual vehicle conditions, and the designed algorithm models, software and hardware are tested, so that problems are found as soon as possible, and the problems are solved. The invention starts from a working scene, has the characteristics of coupling with actual scene data, highly sharing data among subsystems, decoupling software and hardware, modularization of the subsystems and suitability for flexible construction.
Detailed Description
The invention will be further described with reference to specific embodiments in the drawings.
Referring to fig. 1-2, a software and hardware decoupling simulation test system comprises an environment simulation module, a vehicle dynamics simulation module, an evaluation index and an evaluation software module.
The environment simulation module is used as an integrated tool and platform for realizing virtual research and development of the automobile through an analog simulation technology, integrates an automobile driving environment model, an on-board environment sensing model and a traffic model, can be seamlessly linked with Matlab/Simulink, supports offline and real-time simulation functions, and provides modeling and editing functions of a three-dimensional digital virtual test scene.
The environment simulation module supports modeling and editing of the running environment of the automobile for roads, road textures, lane lines, traffic signs and facilities, weather and night scenes. The model establishment and setting of various types of sensors can be supported, including a fisheye camera, a monocular camera, a binocular camera, a millimeter wave radar, a laser radar, an ultrasonic radar, a V2X communication sensor, a lane line sensor and a target object identification sensor. The road model can be set and edited, the road model has the road database with gradient, curvature, side inclination and overhead, the parameterized road model is provided, the automatic test is supported, the non-paved road simulation is supported, and the high-precision map importing of the third-party map OSM/OpenDRIVE is supported. The environment model can be built, and comprises a pavement and roadside facility database, a traffic sign database, a building, a green belt database and a 3D model for supporting user definition. The method supports the creation and editing of road users, including cars, motorcycles, commercial vehicles, pedestrians, bicycles and test balloon vehicles. The method supports the construction of weather conditions such as weather, illumination and the like, and comprises the steps of creating daytime, night rainy and snowy weather, setting car lights and street lamps. The illumination model has sensor response characteristics. Uneven roads (e.g., deceleration strips, potholes) can be simulated, and the real road environment can be imported directly from the HERE map. The driver model can define the driving style (aggressive type and robust type), can support complex driving operation, has learning function, and can adapt to different vehicles and road characteristics. The traffic flow model may define an almost unlimited number of traffic participants, each of which may add a kinetic model, and may exercise fine control over the participants based on events.
The vehicle dynamics simulation module supports modeling and simulation analysis of large, medium and small cars in various typical driving types and suspension forms, is used for providing vehicle dynamics simulation, scene construction, sensor construction and data interface construction, builds a control algorithm through a Simulink platform, and realizes dynamics simulation through connecting hardware, software and images. The image is automatically generated by the environment simulation module. The hardware connection I/O relates to the communication between a singlechip of embedded system hardware and a PC system, CAN signal reading and real-time feedback of signals to a roll, pitch and yaw control system on a steering wheel and a base.
The evaluation index and evaluation software module is used for receiving the perception result output by the environment simulation module, receiving the planning target track, the vehicle speed, the control state quantity and the control execution quantity output by the vehicle dynamics simulation module, defining the evaluation index and the target function, outputting the model algorithm capability report, and outputting the algorithm module and the strategy algorithm parameter to be optimized aiming at the report. The output capability report comprises perception capability, planning capability, control capability, communication capability and intelligent driving comprehensive capability evaluation. And according to the model selection and evaluation indexes, the automatic test software and the test cases, performing optimization variable selection, optimization variable and constraint condition definition, and finally performing algorithm optimization on the tested object.
The environment simulation module designs a plurality of scene libraries according to different working conditions and ground conditions, and mainly comprehensively considers the ground conditions (the hardness of cultivated lands, the ground flatness and inclination, the ground friction and the adhesion), the weather conditions (the rain and snow conditions), the crop growth conditions and the operation scenes (the harvesting scenes, the seeding scenes, the field management scenes and the cultivated land scenes), and the operation coefficient K of the scene type can be calculated according to the following linear formula:
K=α* K1+β* K2+γ*K3+δ*K4;
Wherein alpha is ground condition consideration specific gravity, K1 is ground comprehensive coefficient, beta is weather condition consideration specific gravity, K2 is weather comprehensive coefficient, gamma is crop growth condition consideration specific gravity, K3 is crop growth condition comprehensive coefficient, delta is operation scene consideration specific gravity, and K4 is operation scene comprehensive coefficient. According to the above, a scene coefficient correspondence table is made in the format shown in table 1 below:
TABLE 1
The vehicle dynamics simulation module comprises a power unit module, a chassis unit module and an intelligent driving unit module, and the software and hardware are decoupled as follows:
The power unit module is used for simulating the driving process of a power system, the power system comprises a diesel engine system, a range-extending hybrid system and a pure electric system, and the power output is calculated by adopting the following formula:
P=2π×T×n/60;
wherein P is power, T is torque, and n is rotational speed.
The chassis unit module is used for calibrating energy loss k generated in the power transmission process of the engine and calculating a final power output value. According to the power output, the relation between the power output and the longitudinal acceleration and the longitudinal speed of the vehicle is calibrated according to the actual working condition, and the diesel engine system, the hybrid electric system and the pure electric system are distinguished through coefficients.
P1=P*(1-k);
Wherein P1 is the output power.
The intelligent driving unit module calculates and generates a control quantity according to the difference error between the target speed and the measured speed by using a PID formula, wherein the PID formula is as follows:
;
wherein, the For the target speed to be the same,In order to achieve a proportional gain,In order to integrate the gain,Is a differential gain.
The torque and speed have the following relationship:
T=F*L;
F=M*a;
;
Where F is force, L is force acting distance, M is vehicle mass, a is acceleration, and v (t) is speed. Therefore, the three modules of the power unit module, the chassis unit module and the intelligent driving unit module generate certain correlation through torque.
And a data sharing interface is arranged among the power unit module, the chassis unit module and the intelligent driving unit module so as to realize data sharing among the power unit module, the chassis unit module and the intelligent driving unit module and ensure that required data is transmitted among different modules or systems. For example, an acceleration output calculated from a simulation of the engine output power, is used in the simulation of actual parameters of the intelligent driving system, especially in PID control, to calibrate the difference between the measured speed and the target speed.
In this embodiment, the KP, KI, KD of the PID controller is adaptively adjusted to adapt to each road section by adopting an adaptive PID adjustment strategy. The adaptive PID tuning strategy includes:
1. And (3) data-driven self-adaptive adjustment, namely analyzing the performances of different vehicle types under different road conditions by utilizing historical data and a machine learning technology, and predicting the optimal PID parameters by a training model.
2. And (3) modular PID control, namely configuring independent PID controller modules for each vehicle type and road condition, wherein each module is provided with self-adaptive adjustment logic.
3. And (3) real-time road condition feedback, namely collecting road condition information in real time through a sensor, wherein the road condition information comprises road surface friction coefficient, gradient and curvature, and dynamically adjusting PID parameters according to the road condition information.
4. And the vehicle dynamics model is used for establishing a detailed dynamics model for each vehicle type, simulating the behavior of each vehicle type under different road conditions and adjusting PID parameters based on model prediction.
5. Adaptive control strategy-implementing an adaptive control algorithm, such as Model Predictive Control (MPC), dynamically adjusts PID parameters based on current and predicted errors.
6. Fuzzy logic system, which uses fuzzy logic to process multiple input variables (such as vehicle speed, steering angle, acceleration, etc.) and nonlinear system characteristics, and outputs adaptive PID parameters.
7. Genetic algorithm optimization, namely optimizing PID parameters by applying a genetic algorithm, and finding out optimal parameters adapting to the current road section and vehicle type through an iterative process.
8. And the hierarchical control structure is designed, wherein the bottom layer is responsible for real-time PID parameter adjustment, and the upper layer is responsible for selecting a control strategy according to the vehicle type and road conditions.
9. And (3) simulating the driving behaviors of different drivers in a simulation system, and adjusting PID parameters according to simulation results to adapt to different driving styles.
10. And (3) multi-objective optimization, namely taking control objectives which possibly conflict with different vehicle types and road conditions into consideration, balancing the objectives by using a multi-objective optimization method, and finding out the most suitable PID parameters.
11. Reinforcement learning, namely using reinforcement learning algorithm to enable the control system to learn itself through interaction with the environment, and continuously optimizing PID parameters to obtain better control effect.
12. System integration and collaboration, ensuring that all modules (e.g., sensing, decision, control) can work cooperatively, share information, so as to more fully understand vehicle status and environmental conditions, and thus make more efficient PID parameter adjustments.
13. And (3) real-time monitoring and adjustment, namely implementing a real-time monitoring system, continuously evaluating the control performance, and immediately adjusting the PID parameters once the performance degradation or the specific triggering condition is detected.
14. And the user self-defines setting, namely allowing the user to self-define an adjustment strategy of the PID parameters according to experience or specific requirements, and correspondingly adjusting the PID parameters according to user input by the system.
The system fits the actual scene to a high degree, starts from the actual scene, and optimizes the design by verifying the performances of the design in different fitting scenes. In terms of data application, part of the test pattern is more focused on independent application of data. Because the system focuses on virtual integration and data integration between different subsystems (a power unit module, a chassis unit module and a intelligent driving unit module), data are coupled in the different subsystems. The software and hardware of each system are decoupled, the data are shared, and the subsystems can be flexibly matched to serve different purposes.
The foregoing is merely a preferred embodiment of the present invention, and it should be noted that modifications and improvements can be made by those skilled in the art without departing from the structure of the present invention, and these do not affect the effect of the implementation of the present invention and the utility of the patent.