Virtual scene-based bench test system building method
By building a bench test system based on virtual scenes, using software such as Unity3D and 3ds MAX, the problems of insufficient fidelity and poor interactivity of the existing bench test system are solved, and efficient and low-cost bench test system development is achieved, which improves the testing effect.
Patent Information
- Application Number
- CN202510689995.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-09-02
AI Technical Summary
The existing bench test system has problems in insufficient fidelity, unrealistic sports performance, large differences with the actual traffic environment, weak system interaction and high equipment costs, which limits its wide application.
The construction method of bench testing system based on virtual scenes is adopted, including building a vehicle dynamic model, bench vision system and vehicle model, and using software such as Unity3D and 3ds MAX to build virtual scenes, combining vehicle transmission system, longitudinal dynamic model and driving simulation system to realize the dynamic motion and interactive operation of the vehicle in the virtual environment.
It reduces the workload of the underlying layer, improves development efficiency, reduces the overall R&D cost, enhances the fidelity and interactivity of bench tests, and is close to the actual vehicle test effect.
Smart Images

Figure BDA0005421647720000021 
Figure BDA0005421647720000022 
Figure BDA0005421647720000031
Abstract
Description
Technical Field
[0001] The present invention relates to the field of testing technology, and in particular to a method for building a bench testing system based on a virtual scene. Background Art
[0002] Compared to narrow hardware-in-the-loop testing, the hardware-in-the-loop test bench is not limited to simple control algorithms and TCU hardware, but also introduces real test objects, such as electric drive assemblies and vehicle powertrain assemblies. Taking the transmission hardware-in-the-loop test bench as an example, the transmission hardware-in-the-loop test bench mainly includes a power unit, a loading device, a control system, and the transmission body. The power unit generally uses an AC motor to simulate the engine to provide source power for the automatic transmission; the loading device is used to simulate the vehicle's actual road conditions and load the test transmission; the control system mainly runs a virtual vehicle model, providing a virtual vehicle environment for bench testing, and also enables test personnel to collect and process test data. It combines the advantages of hardware-in-the-loop testing and traditional bench testing, making indoor bench testing closer to the results of real-vehicle testing.
[0003] The continuous advancement of intelligent vehicles presents new challenges for test benches. The development of virtual visualization technology offers new avenues for upgrading test benches. Virtual visualization technology is commonly used in training and game development, creating realistic scenes to simulate real-world situations and enhance user interaction with the platform. In test benches, test results are often displayed as curves, which is not intuitive and vivid. Therefore, test benches need to be upgraded by constructing virtual driving scenarios to simulate real-world traffic conditions. Recent advances in computer measurement and control technology have provided strong support for the development of vehicle-in-the-loop testing. By modeling vehicle and test bench models, designing a test bench visualization system, and constructing realistic road test scenarios, the system can simulate real-world vehicle testing. Current visual simulation systems suffer from issues such as insufficient fidelity, unrealistic motion representation, significant differences from actual traffic conditions, poor system interoperability, and high equipment costs, which hinder their widespread application. Summary of the Invention
[0004] In view of the above-mentioned deficiencies in the existing technology, the technical problem to be solved by the present invention is: how to provide a method for building a bench test system based on a virtual scene that can reduce the underlying workload, improve development efficiency, and reduce overall R&D costs.
[0005] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0006] A method for building a bench test system based on a virtual scene, characterized by comprising the following steps:
[0007] S1. First, build a vehicle dynamics model, which includes a vehicle transmission system model for simulating the vehicle transmission system, a vehicle longitudinal dynamics model for simulating the longitudinal force conditions during vehicle driving, and a vehicle control model for simulating vehicle handling;
[0008] S2. Build a test bench visual system, which includes a road module and a terrain module for simulating driving conditions, a vehicle model for simulating vehicle movement, and a driving simulation system for controlling the vehicle model; map the vehicle model with the whole vehicle dynamics model so that the vehicle model moves on the road model according to the power output of the whole vehicle dynamics model; the driving simulation system includes an accelerator pedal, a brake pedal, and a steering wheel for inputting accelerator, brake, and direction signals respectively, and the accelerator pedal, brake pedal, and steering wheel are all connected to the vehicle model.
[0009] Furthermore, in step S2, the road model, terrain model and vehicle model are constructed using the following steps:
[0010] S21. Based on the requirements of road testing, the terrain model was built using the Terrain tool in Unity3D.
[0011] S22. Build a road model on the terrain model that has been built using the EasyRoad tool in Unity3D;
[0012] S23. Use 3ds MAX to build a vehicle model, convert the vehicle model into FBX format and import it into Unity3D to complete the construction of the virtual scene.
[0013] Furthermore, the vehicle dynamics model sends the vehicle's yaw rate, speed, steering wheel angle, and displacement in the X, Y, and Z directions to the Unity3D platform for mapping with the vehicle model. The vehicle model is translated, rotated, and scaled within the Unity3D platform to achieve dynamic motion of the vehicle model in the virtual scene. The translation transformation matrix is:
[0014]
[0015] Where Δx, Δy, and Δz are the translation distances of the vehicle model along the X-axis, Y-axis, and Z-axis, respectively, and (x0, y0, z0) is the current coordinate.
[0016] Rotation includes Euler rotation and matrix rotation. The transformation matrix of Euler rotation is:
[0017]
[0018] Where (α0, β0, γ0) are the Euler angles of the vehicle model rotation, Δα, Δβ and Δγ are the angles of rotation along the X-axis, Y-axis and Z-axis respectively, and (α1, β1, γ1) are the coordinates after rotation;
[0019] The transformation matrix for matrix rotation is:
[0020]
[0021] Where θ1 is the angle of rotation of the vehicle model around the X-axis, (x2, y2, z2) are the coordinates after rotation around the X-axis; θ2 is the angle of rotation of the vehicle model around the Y-axis, (x3, y3, z3) are the coordinates after rotation around the Y-axis; θ3 is the angle of rotation of the vehicle model around the Z-axis, and the rotated coordinates (x4, y4, z4) are the coordinates after rotation around the Z-axis;
[0022] The transformation matrix for scaling is:
[0023]
[0024] Where a is the scaling factor on the X axis, b is the scaling factor on the Y axis, c is the scaling factor on the Z axis, and (x5, y5, z5) are the scaled coordinates.
[0025] Furthermore, the vehicle transmission system model includes an engine model, a clutch model and a transmission model, and the engine model is:
[0026] T e =f(n e ,K)=a0+a1n e n +a2n e n-1 K+...+a n+1 K n
[0027] Where, T e is the engine torque, n e is the engine speed, K is the throttle opening, a i Polynomial fitting coefficient, n is the polynomial degree;
[0028] The clutch model includes a disengagement phase, a sliding friction phase, and an engagement phase. The expression of the disengagement phase is:
[0029]
[0030] The expression of the sliding wear stage is:
[0031]
[0032] Where n is the number of clutch friction surfaces, μ is the clutch friction coefficient, and F n The clamping force between the master and slave discs, R0 and R1 are the inner and outer diameters of the clutch;
[0033] The expression of the combination stage is:
[0034]
[0035] Where, J clu_in With J clu_out are the moments of inertia of the clutch driving plate and driven plate respectively, T clu_in With T clu_out The end torque of the clutch driving plate and the driven plate, T c It is the transmission torque between the clutch driving plate and the driven plate.
[0036] Furthermore, the transmission model satisfies the following formula:
[0037]
[0038] In the formula, ω and T i are the input or output shaft angular velocity and the torque transmitted by the corresponding target gear gear, J is the moment of inertia of the shaft, and i is the transmission gear.
[0039] Furthermore, in the vehicle longitudinal dynamics model, the longitudinal force balance equation is:
[0040]
[0041] F f =Gfcosα
[0042] F i =Gsinα
[0043]
[0044] Where m is the vehicle mass, F t is the driving force, F f is the rolling resistance, F i is the slope resistance, F w is the air resistance, F b is the braking resistance; G is the vehicle weight, f is the rolling resistance coefficient, α is the horizontal angle of the road slope; A is the vehicle's frontal area, v is the vehicle's speed; T b is the braking torque of the brake disc, and r is the wheel radius.
[0045] In summary, the present invention has the advantages of reducing the underlying workload, improving development efficiency, and reducing overall R&D costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 This is the engine steady-state output characteristic diagram.
[0047] Figure 2 It is a dynamic engine model.
[0048] Figure 3 The clutch dynamics model.
[0049] Figure 4 This is a simplified diagram of the synchronizer structure.
[0050] Figure 5 This is the driver control schematic.
[0051] Figure 6 It is a dynamic upshift curve diagram.
[0052] Figure 7 This is the dynamic downshift curve.
[0053] Figure 8 This is the automatic transmission shift logic diagram.
[0054] Figure 9 For the whole vehicle model.
[0055] Figure 10 For vehicle speed tracking.
[0056] Figure 11 This is the gear diagram.
[0057] Figure 12 This is the pedal opening diagram.
[0058] Figure 13 This is the engine torque curve.
[0059] Figure 14 It is a visual system framework diagram.
[0060] Figure 15 and Figure 16 This is a diagram of the vehicle model.
[0061] Figure 17 Create a flow chart for the road.
[0062] Figure 18 Schematic diagram of the road model.
[0063] Figure 19 and Figure 20 A schematic diagram of a virtual scene.
[0064] Figure 21 It is a dynamic principle.
[0065] Figure 22 This is a schematic diagram of the script-driven principle.
[0066] Figure 23 Schematic diagram of simulation test results. DETAILED DESCRIPTION
[0067] The present invention will be further described in detail below with reference to the embodiments.
[0068] Vehicle dynamics model - engine model:
[0069] As the core component of a car, the engine is also the power source of the vehicle. It drives the vehicle through the clutch, transmission, and differential transmission components. There are currently two main methods for engine modeling: theoretical modeling and experimental modeling. The theoretical modeling method is based on the working principle of the engine, taking into account the transient characteristics of the engine, and combining multidisciplinary knowledge theories such as air, fuel, combustion characteristics, and thermodynamic principles to conduct detailed modeling. The experimental modeling method obtains engine performance data through engine bench tests, and simulates the various working characteristics of the engine by polynomial fitting and table lookup methods. Compared with the first method, this method is simpler, and at the same time, considering that the bench test simulation process has higher requirements for the real-time operation of the model, the theoretical modeling method has a complex calculation process, low real-time performance, and increases the hardware cost of the test. Therefore, the experimental modeling method is adopted, and the diesel engine installed on a certain model of Jiangling light truck is used as the research object. Its basic parameters are shown in Table 1:
[0070] Table 1 Main parameters of the engine
[0071]
[0072] The engine is modeled by fitting the engine data with a polynomial, and the expression is as follows:
[0073] T e =f(n e ,K)=a0+a1n e n +a2n e n-1 K+...+a n+1 K n (1)
[0074] Where, T e is the engine torque, n e is the engine speed, K is the throttle opening, a i Polynomial fitting coefficients, n is the degree of the polynomial.
[0075] The unknown parameters in the above polynomial can be calculated using the fitting toolbox in MATLAB software, such as Figure 1 As shown in the figure, by processing the test data, the characteristic MAP diagram of the engine under steady-state output is obtained.
[0076] During actual vehicle operation, the engine is often in a non-steady-state operating state due to changes in operating conditions, which differs from steady-state operating conditions. This is primarily due to factors such as in-cylinder air volume, ignition control, and combustion quality. During this non-steady-state state, the engine torque drop is linearly related to crankshaft acceleration, and the torque drop does not exceed 4% to 5% of the maximum torque value. Therefore, a correction coefficient method is used to correct the obtained engine bench steady-state data. The calculation formula is as follows:
[0077]
[0078] Where, ω e is the engine speed, ε is the torque reduction coefficient, usually taken as 0.07-0.09.
[0079] like Figure 2 As shown in the figure, for modeling convenience, the engine's fitted steady-state data is imported into a two-dimensional lookup table module in Simulink. The throttle opening and engine speed feedback from the driver model are used as module inputs. The steady-state output torque is obtained through interpolation. Coefficient correction is then applied to the data to ultimately determine the output torque under dynamic engine conditions.
[0080] Vehicle dynamics model - clutch model:
[0081] The clutch, a key component of the transmission system, disconnects and connects during gear shifts, enabling power transmission and disconnection. The clutch model primarily includes the clutch actuator and the torque transmission model. The clutch actuator primarily consists of three components: a worm gear, a hydraulic transmission, and a release fork.
[0082] The worm gear model expression is as follows:
[0083] T out =T in *i*eff (3)
[0084] ω in =ω out *i (4)
[0085] Where i and eff are the worm gear transmission ratio and transmission efficiency, T in and T out is the input and output torque, ω in With ω out is the input and output speed.
[0086] The hydraulic transmission mechanism expression is as follows:
[0087]
[0088] Vol=S1L1=S2L2 (6)
[0089]
[0090] Where F1 and F2 are the pressures on the main and slave pumps of the hydraulic pipeline respectively, i is the pressure ratio, S1 and S2 are the cross-sectional areas of the hydraulic main pump and slave pump respectively, and L1 and L2 are the working strokes of the hydraulic main pump and slave pump respectively.
[0091] According to the lever principle, the clutch slave cylinder output thrust is further amplified by the release fork, as shown in the following formula:
[0092] F2=F1i (8)
[0093] Where i is the lever ratio, F1 is the thrust at the clutch slave cylinder, and F2 is the clutch release force after amplification.
[0094] AMT automatic transmission uses a dry clutch, which simplifies the clutch torque transmission model into three states: separation, sliding and engagement. Figure 3 As shown, J clu_in With J clu_out are the moments of inertia of the clutch driving plate and driven plate respectively, T clu_in With T clu_out The end torque of the clutch driving plate and the driven plate, T c It is the transmission torque between the clutch driving plate and the driven plate.
[0095] 1) Disengagement stage: In this stage, the clutch active plate and the driven plate are not in contact, so the untransmitted torque is equal to 0. Its expression is as follows:
[0096]
[0097] 2) Sliding stage: In this stage, the clutch master and slave plates slowly come into contact to generate friction torque, which is expressed as follows:
[0098]
[0099] Where n is the number of clutch friction surfaces, μ is the clutch friction coefficient, and F n The clamping force between the driver and driven plates, R0 and R1 are the inner and outer diameters of the clutch.
[0100] 3) Engagement stage: In this stage, there is no relative friction between the clutch master and slave plates, and the speeds are the same. The expression is as follows:
[0101]
[0102] Vehicle dynamics model - transmission model:
[0103] The transmission adjusts the speed and torque at the output of the transmission system by changing the transmission ratio to meet the vehicle's driving requirements. The AMT transmission is structurally divided into two parts: the shift mechanism and the fixed-axis gear model. These two parts are modeled separately.
[0104] The gear selection and shifting actuator mainly includes modules such as the gear selection and shifting worm gear, the gear selection finger, and the gear shifting gear fan.
[0105] The automatic transmission of this embodiment is a six-speed AMT automatic transmission for a light commercial vehicle. Its specific speed ratio information is shown in Table 2:
[0106] Table 2 AMT automatic transmission gear ratio information
[0107]
[0108] Based on the structure of the transmission, it is necessary to model the input and output shafts of the transmission and calculate their speeds. According to Newton's second law, angular acceleration = torque / mass, as shown in the following formula:
[0109]
[0110] Where ω and T i are the input or output shaft angular velocity and the torque transmitted by the gear in the corresponding target gear, J is the moment of inertia of the shaft, and i is the transmission gear (i = 1, 2, 3, 4, 5, 6, 7).
[0111] When the transmission is in neutral, the moment of inertia is the inertia of the current rotating shaft. When the transmission is not in neutral, the equivalent moment of inertia when transmitting power is J eq .
[0112]
[0113] Assuming that the system has m moving parts and n rotating parts, the total kinetic energy of the system is expressed as:
[0114]
[0115] Assume that the moment of inertia of the system after equivalent is J eq , the total kinetic energy of the system is obtained from the equivalent moment of inertia:
[0116]
[0117] According to the law of conservation of kinetic energy, the kinetic energy before and after the equivalent is equal, so the moment of inertia after the equivalent can be deduced as:
[0118]
[0119] In order to calculate the speed of the input and output shafts, it is also necessary to calculate the torque on each gear. The transmission synchronization process is simplified into three states.
[0120] 1) Neutral state, at this time the vehicle's power transmission is disconnected and the synchronizer is in the middle position.
[0121] 2) Synchronous state, the clutch is disconnected, the synchronizer moves left and right, relying on friction to synchronize the input and output speeds. The structural diagram is as follows Figure 4 As shown, where F N represents the force exerted by the conical surface, d0 and d i Respectively represent the outer diameter and inner diameter of the cone contact surface, α represents the cone half angle, and the dynamic friction torque is expressed as:
[0122] τ K =k K ·F N ·r eff ·sgn(ω) (20)
[0123]
[0124] Where r eff Indicates the effective torsion radius, k K represents the coefficient of kinetic friction, and ω represents the relative angular velocity.
[0125] 3) Locking state, at this time the gear shift speed synchronization process is completed, the synchronizer meshes the master and driven gears to achieve power recovery. At this time:
[0126]
[0127] is equivalent to:
[0128]
[0129] Bundle T eq , the formula is unified into a form:
[0130]
[0131] At this time, the speed of the input and output shafts can be calculated using a unified formula. When calculating the speed under different gears, the torque can be appropriately amplified by the equivalent moment of inertia.
[0132] Based on the aforementioned principles for transitions between synchronizer operating states, the synchronizer's operating process was modeled in Simulink. Switching between two gears can be accomplished with a single synchronizer. Since there are six forward gears, three synchronizers were built, and a module for calculating the transmission's input and output speeds was added to create the final transmission model.
[0133] Vehicle Longitudinal Dynamics Modeling: This example primarily considers the longitudinal forces acting on the vehicle during driving, and therefore analyzes these forces. During driving, the engine, acting as a power source, generates force to pull the vehicle forward. Simultaneously, the vehicle's wheels and the road surface generate rolling resistance, slope resistance, and air resistance. When braking, the vehicle is subject to the braking force. The longitudinal force balance equation is as follows:
[0134]
[0135] Where m is the vehicle mass, F t is the driving force, F f is the rolling resistance, F i is the slope resistance, F w is the air resistance, F b is the braking resistance.
[0136] F f =Gfcosα (26)
[0137] Where G is the weight of the vehicle body, f is the rolling resistance coefficient, and α is the horizontal angle of the road slope.
[0138] F i =Gsinα (27)
[0139] Where α is the horizontal angle of the road slope.
[0140]
[0141] Where A is the frontal area of the vehicle and v is the vehicle speed.
[0142]
[0143] Where, T b is the braking torque of the brake disc, and r is the wheel radius.
[0144] The vehicle control model includes the driver model and the power shift curve.
[0145] Vehicle Control Model - Driver Model: The driver model simulates the real-world driving process of a human driver, who manipulates the accelerator and brake pedals to achieve vehicle tracking based on the desired and actual vehicle speeds. It has two main control modes: automatic driver control to achieve speed tracking based on a reference cyclical operating condition, and manual control of vehicle operation by the operator using the accelerator and brake pedals. A switch allows for manual switching between different operating modes.
[0146] like Figure 5As shown in the figure, the control principle of the driver model is used. The corresponding pedal opening is calculated through the control algorithm for a given driving condition. This embodiment adopts PI control, and the input is the error between the target vehicle speed and the actual vehicle speed. The corresponding acceleration and brake pedal openings are output through proportional and integral regulation.
[0147] Vehicle Control Model - Dynamic Shift Curve: For transmissions, developing a suitable shift schedule allows the vehicle to find the appropriate shift timing based on the driving environment, improving driving efficiency. Considering the use case of commercial vehicles, dynamics is a key performance indicator, determining the vehicle's acceleration and climbing capabilities. Therefore, this embodiment develops a shift schedule based on the principle of optimal dynamics.
[0148] Currently, there are two methods for determining shift points: one is to assume that the speeds of two adjacent gears are equal at the time of the shift, and to determine the shift points based on the acceleration of each gear at the same speed; the other is to determine the shift points based on the driving force of each gear at the same speed. However, due to the different moments of inertia of each gear, a greater driving force does not always result in a greater acceleration. Therefore, this embodiment chooses to use acceleration as the basis for designing a dynamic shift schedule.
[0149] The specific method is as follows: at a constant accelerator pedal opening, if the acceleration characteristic curves of adjacent gears intersect and the intersection is non-negative, the vehicle speed at the intersection of each adjacent gear is used as the shift point. If no intersection exists, the maximum achievable speed for that gear is used as the shift point speed. By gradually calculating the shift points for different accelerator pedal openings, these intersection points are finally connected in the form of a curve to form a dynamic shift curve. First, a dynamic upshift rule is developed, and the development process is as follows.
[0150]
[0151] The above formula is transformed into:
[0152]
[0153] When the throttle opening is constant, the engine torque-speed curve can be fitted with a quadratic function, and the engine speed and vehicle speed satisfy the following relationship:
[0154]
[0155] Therefore, the engine torque-vehicle speed can be expressed as:
[0156] T e =a0+a1v+a2v 2 (33)
[0157] Substituting formula (33) into formula (31), we can get:
[0158]
[0159] Find the intersection of the acceleration characteristic curves of two adjacent gears:
[0160] (δ n A n+1 -δ n+1 A n )v 2 +(δ n B n+1 -δ n+1 B n )v+(δ n C n+1 -δ n+1 C n )=0 (35)
[0161] Right now:
[0162] a n v 2 +b n v+c n =0 (36)
[0163] Solving the quadratic equation, we can get the shift point speed of two adjacent gears:
[0164]
[0165] like Figure 6 As shown in FIG, the above process is solved by writing code in Matlab to obtain the dynamic upshift curve.
[0166] A dynamic downshift curve is formulated based on the dynamic upshift curve. At the same time, constraints should be added to reduce the occurrence of cyclic shifting. For a convergent shift schedule, the following conditions should usually be met:
[0167] To prevent the engine from stalling when downshifting, the vehicle speed after downshifting must be greater than or equal to the vehicle's designed minimum speed; usually, the speed at the downshift point is 2-8 km / h lower than the upshift point;
[0168] To formulate a downshift law curve based on the upshift law curve, it is necessary to satisfy the convergence evaluation formula of the shift law:
[0169]
[0170] Where, v n ↑ is the vehicle speed when shifting from N gear to N+1 gear, v n+1 ↓ is the vehicle speed when shifting from gear n+1 to gear n. Usually, the convergence coefficient K is less than 0.45. For a large throttle opening, K is 0.3, and for a small throttle opening, K is 0.4.
[0171] According to the above constraints, the dynamic downshift curve is finally obtained, as shown in Figure 7 shown.
[0172] Transmission shift control model: The shift process of a manual transmission can be used as a reference. The difference between an automatic transmission and a manual transmission is that it introduces a gear selection and shift actuator. Therefore, the shift process of a manual transmission is used to analyze the switching between various gear states. Take the shift process of an upshift as an example. Figure 8 As shown in the figure, when the upshift state is reached, the TCU sends an upshift request to the transmission. The clutch motor disengages the clutch, and the clutch position sensor ensures complete disengagement. Subsequently, the shift motor activates, shifting the gear to neutral, which is monitored by the shift position sensor. Next, the selector motor activates, precisely controlling gear selection until the corresponding shift shaft position is reached. The shift motor then activates, smoothly shifting the transmission into the target gear. Finally, the clutch motor activates, engaging the clutch, completing the shift process.
[0173] According to the transmission shifting logic, a transmission gear state switching model is built through Simulink / Stateflow.
[0174] Simulation model verification: Integrate the models built above to obtain the final complete vehicle model. At the same time, it is necessary to verify whether the built vehicle model and transmission control model can shift gears normally, in preparation for the virtual scene vehicle model. The final integrated model is as follows Figure 9 As shown, the model is verified below, and the ECE cycle condition is selected as the reference condition. Table 2 shows the main parameters of the simulation model.
[0175] Table 3 Main parameters of the model
[0176]
[0177] Such as 10~ Figure 13 As shown in the figure, the simulation results of the cyclic working condition are shown. It can be seen that the driver model adjusts the opening of the accelerator pedal and the brake pedal according to the reference speed, changes the engine output torque to drive the vehicle model to operate. At the same time, the transmission control model can change the transmission gear and adjust the speed ratio according to the vehicle operating status to achieve good tracking of the target vehicle speed to meet the vehicle's dynamic requirements.
[0178] Test bench visual system: The current visual simulation system has problems such as insufficient realism, unrealistic motion performance, large differences from the actual traffic environment, weak system interaction and high equipment costs, which restrict its wide application. Solving these problems requires improvements in graphics rendering, physical engine technology, interactive design, etc., while reducing hardware equipment costs to improve the performance and popularity of the system. The system studied in this embodiment is designed to feed the test bench information collected during the transmission system test bench into the vehicle model and display it in a visual scene, thereby improving the interactivity between the test bench and the visual system. Generally speaking, the development of the visual system must meet the following requirements, as shown in Table 4.
[0179] Table 4 Visual system requirements
[0180]
[0181] A single development platform is insufficient to meet the diverse functional requirements of visual simulation systems. However, some commercially available software already fulfills some of these functions. Therefore, building an integrated development platform by combining multiple, complementary software or development environments can address this shortcoming. For example, combining existing modeling software with a virtual reality development engine can reduce underlying workload, improve development efficiency, and lower overall R&D costs.
[0182] 1) 3D modeling software selection: 3ds MAX is a professional 3D modeling and rendering software used to create large-scale simulation scenes. It supports multiple output formats to facilitate compatibility and resource sharing with other software. It is considered an excellent software in terms of model accuracy and comprehensive functionality, and is widely used in many fields, including multimedia production, web content creation, industrial design, and film and television advertising. Its strong compatibility and easy modification and portability enable developers to create models in a variety of styles, providing them with more options and creative opportunities. As a world-renowned 3D production software, it not only excels in modeling and comprehensive functionality, but also has achieved outstanding results in the production of different types of materials and textures.
[0183] Compared to other 3D modeling software, 3ds MAX offers significant advantages in virtual reality research. Its powerful material mapping and rendering capabilities make model and animation creation convenient and efficient, while also producing highly realistic results. Therefore, this system selected 3ds MAX for basic modeling, as well as for the creation, optimization, and rendering of models of vehicles, buildings, roads, and other transportation facilities.
[0184] 2) VR Engine Selection: The VR engine software selected must meet the requirements of visual system development, offering realistic rendering capabilities, flexible cross-platform compatibility, and ease of use. Table 5 compares various VR software currently available on the market.
[0185] Table 5 Advantages and disadvantages of common virtual reality engines
[0186]
[0187] After comparison, this embodiment uses the Unity3D platform as a design and development tool for the gantry vision system. Unity3D is a virtual reality engine that is widely used in the development and production of games, and is widely recognized for its excellent stability and efficiency. The engine is equipped with a complete rendering system, a high-speed rendering channel, and a built-in real physics engine provided by NVIDIA, which can highly restore the real-world environment and scene information, allowing users to immerse themselves in the experience. At the same time, Unity3D's programming development environment supports multiple programming languages such as C#, JavaScript and Python, and provides a variety of API interfaces, allowing developers to choose the appropriate programming language based on personal experience. In addition, Unity3D supports the import of multiple file types, including common three-dimensional model file formats such as FBX, OBJ, etc., so it can be used in conjunction with 3ds MAX. Complex models can be modeled through 3ds MAX and then imported into it, and the platform has high scalability.
[0188] The gantry visualization system of this embodiment is as follows Figure 14 As shown in the figure, the system consists of four main components: a driving simulator, a vehicle dynamics model, a 3D vehicle model, and a visualization scene system. The driving simulator includes the accelerator pedal, brake pedal, and steering wheel. The vehicle dynamics model is a full-scale model of an AMT-equipped vehicle. The 3D vehicle model was constructed using 3ds MAX. The visualization scene system includes modules for buildings, roads, weather, and terrain. The vehicle model in the visualization scene moves within the virtual scene as the driver manipulates the driving simulator. The driver can also adjust the accelerator and brake pedal openings based on visual feedback, completing a closed-loop simulation test.
[0189] The visual development platform is a system comprised of four primary software components. First, leveraging the exceptional modeling capabilities of 3ds MAX, elements such as vehicles, roads, buildings, and traffic signs within the virtual scene are precisely created. These models are then imported into the Unity3D platform in FBX format, providing rich detail and realism to the entire virtual environment. Second, the vehicle dynamics model in MATLAB / Simulink is processed by a compiler, and motion scripts written in C# are mapped to the 3D vehicle model. This integration enables the dynamics model to directly drive vehicle motion within the virtual environment, achieving high simulation accuracy. The compiled model can then be seamlessly integrated into the Unity3D platform, providing an accurate and controllable foundation for virtual environment motion. Finally, leveraging the real-time rendering capabilities of the Unity3D virtual engine, the entire visual system is run, ensuring a smooth and realistic user experience. This seamless integration, from model building to dynamics simulation to real-time rendering, provides a comprehensive and efficient solution for virtual simulation.
[0190] 3ds MAX-Based Vehicle Model Construction: This example primarily utilizes 3ds MAX modeling software to create vehicles and other objects. The production process employs various techniques, including polygonal modeling and surface modeling. To achieve a more realistic model, the model is textured and rendered.
[0191] To facilitate model construction, the vehicle was simplified and divided into four main components: the steering wheel, seats, frame, and chassis. Throughout the vehicle modeling process, when dealing with complex symmetrical structures, such as the left-right symmetry of the vehicle, symmetrical units were created and then mirrored to complete the symmetry on the other side. It is important to note that when performing a mirror copy operation, the instance method must be selected to ensure that modifications to the left side are correctly applied to the right. Modeling methods such as the Editable Mesh command and the Editable Polygon command were used repeatedly. Techniques such as the Add Triangle command and the Weld command were employed when modeling the various vehicle components. The overall modeling includes components such as the frame, seats, steering wheel, and chassis. Each component can be modeled independently based on its structural characteristics to improve work efficiency and accuracy.
[0192] When modeling irregular objects such as seats and steering wheels, the first step is to draw a 2D cross-section image and specify the path, and then use the lofting function to adjust the details. Finally, when integrating these parts to form a complete vehicle model, the Boolean function is used for built-in operations, and the collapse function is used to perform Boolean processing on multiple objects to obtain the final vehicle effect. Figure 15 As shown:
[0193] As can be seen, the assembled vehicle model is still quite different from the real thing and requires texturing. Therefore, the combined vehicle model requires texturing. 3ds MAX texturing provides a key visual enhancement for 3D modeling, adding texture, color, and detail to give the model a more realistic and vivid appearance. This not only improves visual quality and model detail, but also allows users to customize the appearance based on their creative needs. Simultaneously, texturing accelerates the rendering process, reduces the burden on the rendering engine, and improves productivity, enabling the creation of complex and highly realistic models in a short period of time.
[0194] Therefore, it is necessary to use the UVW mapping and unfolding commands in 3ds MAX to map the vehicle appearance, and then adjust the size, direction, and coverage of the map to apply it to the vehicle model. This will give the material texture to the surface of the object, and finally export the model in FBX format to prepare for importing the test scene below. The final effect is as follows Figure 16 As shown, it can be seen that compared with before mapping, the appearance of the vehicle has been greatly improved, closer to the real vehicle model, and the difficulty of subsequent rendering is greatly reduced.
[0195] Virtual scene construction: This is crucial for simulation systems and includes elements such as terrain, roads, and surrounding transportation facilities. A realistic scene provides a realistic simulation experience, comprehensively tests system performance, verifies model accuracy, enhances user immersion, and improves the overall simulation effect. Therefore, the terrain, roads, and transportation facilities within the test site are constructed.
[0196] Terrain: Terrain is a built-in terrain creation component in Unity3D that allows you to easily create various terrains, so it is chosen as the terrain creation tool. First, create a Terrain block in the Assets window. Then, use the PaintTerrain command to select terrain brushes of different shapes and roughly set the terrain height. After that, you can use the PaintDetails function to paint the terrain in detail. You can also accurately set the terrain height to simulate different road slope test scenarios.
[0197] Road: Since roads are complex and manual modeling is too time-consuming, this example uses the EasyRoad tool to build roads, bridges and other basic road facilities in Unity3D. The creation process is as follows: Figure 17As shown, first, in Unity3D, by importing the EasyRoad road module library resource package and creating a road object, and then drawing the path to define its direction and shape. By adjusting the curve and slope to meet the design specifications, the EasyRoad tool can be used to implement functions such as intersections and connecting roads. At the same time, the road's material, width, number of lanes and other properties are adjusted, and necessary optimization and detail processing are performed to ensure the integration of the road system and the scene to meet project requirements, such as Figure 18 Shown is the created corridor model.
[0198] Surrounding Environment and Traffic Facilities: The surrounding environment occupies the majority of the field of view, and its realism directly affects the authenticity of vehicle movement. To enrich the scene, elements such as traffic signs and buildings need to be added. Specifically, 3D models of buildings and traffic facilities are constructed using 3ds MAX. After a series of model optimization processes, these models are finally converted to FBX format for import into Unity3D.
[0199] After completing the construction of the terrain model and various entity models, they were arranged and laid out according to the predetermined requirements through Unity3D. The model was processed using the advanced rendering technology of the virtual engine to further enhance the realism of the model. This series of operations finally successfully realized the construction of the virtual scene, such as Figure 19 and Figure 20 shown.
[0200] Vehicle motion control: To achieve dynamic motion of vehicles in virtual scenes, we must first understand the implementation principle of dynamic behavior of models in Unity3D. This mechanism is mainly based on the geometric transformation theory of 3D graphics and is achieved by real-time driving of three basic dynamic behaviors of the model, such as translation, rotation and scaling. Figure 21 As shown in the figure, translation moves the model along a specified axis in the virtual scene, rotation allows it to rotate freely around a specific point or axis, and scaling is used to adjust the model's size. The combination of these basic behaviors creates flexible and vivid dynamic movement of the model in the virtual environment, providing a solid foundation for achieving realism and interactivity, making its behavior more detailed and consistent with the motion laws of real objects.
[0201] Basic geometric transformations are implemented using a fourth-order transformation matrix based on the coordinate axes and the origin. Assuming the model's coordinate system is the current spatial coordinate system (x, y, z), the current coordinates relative to the origin are represented as (α0, β0, γ0). Therefore, the transformations of the three dynamic behaviors can be represented by the corresponding transformation matrices.
[0202] a) Translation: Assume that the translation distance of the vehicle model along the X-axis is Δx, the translation distance along the Y-axis is Δy, and the translation distance along the Z-axis is Δz. The coordinates after translation are expressed as (x1, y1, z1). This process is expressed in the form of a transformation matrix as follows:
[0203]
[0204] b) Euler rotation: In three-dimensional space, Euler rotation is a method of rotating a model by a corresponding angle by changing the position of the coordinate axes, while the coordinate axes themselves remain unchanged. Assume that the Euler angles of the vehicle model are (α0, β0, γ0), and the angles of rotation along the X-axis, Y-axis, and Z-axis are Δα, Δβ, and Δγ respectively. The coordinates after rotation are expressed as (α1, β1, γ1). This rotation process can be expressed in the form of a transformation matrix as follows:
[0205]
[0206] c) Matrix rotation: By using a 4x4 rotation matrix to change the coordinates, assuming that the vehicle model rotates around the X-axis by an angle of θ1, the rotated coordinates are expressed as (x2, y2, z2). This process can be expressed in the form of a transformation matrix as follows:
[0207]
[0208] Assuming that the angle of rotation of the vehicle model around the Y axis is θ2, and the coordinates after rotation are (x3, y3, z3), this process can be expressed in the form of a transformation matrix as follows:
[0209]
[0210] Similarly, assuming that the angle of rotation of the vehicle model around the Z axis is θ3, and the coordinates after rotation are (x4, y4, z4), this process can be expressed in the form of a transformation matrix as follows:
[0211]
[0212] d) Scaling: Scaling is to change the size of the model by creating a 4x4 scaling matrix consisting of scaling factors. Assuming the scaling factor on the X axis is a, the scaling factor on the Y axis is b, and the scaling factor on the Z axis is c, the scaled coordinates are expressed as (x5, y5, z5). This process can be expressed in the form of a transformation matrix as follows:
[0213]
[0214] To implement these features, you can use the Transform component. The Transform component is a component shared by all objects in a Unity3D scene. It contains three basic properties: position, rotation, and scale. These properties define the spatial location, orientation, and size of an object in the scene. These Transform component properties make it easy to control and adjust the position, rotation, and size of objects in the scene in Unity3D, as shown in Table 6:
[0215] Table 6 Component properties
[0216]
[0217] like Figure 22 The diagram below shows the schematic for implementing vehicle operation. The vehicle's driving state in the virtual environment is determined by the vehicle dynamics model. Based on the required data for the virtual vehicle, operational status information such as the vehicle's yaw rate, displacement in the X, Y, and Z directions, velocity, and steering angle is packaged and sent to the Unity3D platform. In Unity3D, all scripts must inherit from the MonoBehaviour class. Throughout the script's lifecycle, several methods, such as Start and Update, are common. Their specific call stages and functions are shown in Table 7. Therefore, by attaching components to the desired model through C# scripts, calling class methods within the script can modify the object's component properties, thereby driving the virtual model.
[0218] Table 7 Script call
[0219]
[0220] Driving Simulator Device Connection: The Logitech G29 driving simulator is widely used in driving games and has good interactivity with Unity3D. Therefore, this example uses the Logitech G29 game kit as the driving simulator. The device includes pedals, a gear lever, and a steering wheel.
[0221] To enable data exchange between the driving simulator and Unity3D, the software needs to be configured. First, install the Logitech G29 driver on the PC from the official Logitech website and connect the device to the PC via USB. Pedal opening, steering wheel angle, and gear signal information can be transmitted to Unity3D via USB. To receive the collected signals, the interface needs to be configured in Unity3D. The Logitech official website provides a matching plug-in. You need to download the Logitech GamingSDK from the Asset Store and import it into Unity3D to process the feedback signals.
[0222] Unity Input System's Input Actions provide a more modular and maintainable approach to processing input signals, particularly suitable for projects that need to support multiple input devices. First, define a set of Input Actions on the control panel, create a pedal action graph, and then create accelerator and brake pedal actions on top of it. By pressing the accelerator and brake pedals, you can monitor the action responses and bind them to the created accelerator and brake pedal actions, respectively. To more conveniently read and process these input signals, write code in C#.
[0223] By monitoring the received signal, it can be found that the value range read by the device is between -1 and 1, which cannot be used directly. The obtained value needs to be quantified, and the collected signal is multiplied by the appropriate parameter and mapped to a range of 0-100 to represent the degree of pedal opening, so as to achieve control of the vehicle model.
[0224] The driver operates the driving simulator and transmits information such as pedal opening to Unity3D through the USB data interface. In order to make the virtual vehicle model move according to the driving intention, this information also needs to be transmitted to the Simulink simulation platform. At the same time, the vehicle status information (displacement, speed, engine speed, etc.) can be obtained through real-time calculation of the dynamic model, and then fed back to the virtual vehicle model to complete the closed-loop simulation.
[0225] This embodiment uses the UDP communication method. UDP (User Datagram Protocol) is a connectionless, simple, datagram-oriented transport layer protocol. Compared to TCP (Transmission Control Protocol), UDP does not provide reliable, connection-oriented data transmission, but instead focuses on fast transmission to meet real-time requirements. UDP communication can also be implemented using sockets, and programming languages such as C, C++, C#, and Python provide relevant UDP programming interfaces.
[0226] For the Simulink dynamics model, the Simulink library includes UDP Receive and UDP Send modules, which can be used to receive and send data. Similarly, communication scripts can be written on the Unity3D side.
[0227] Because the model focuses solely on longitudinal dynamics, it controls only pedal opening and ignores steering input. Unity3D collects the driver's pedal signals and transmits them to the vehicle model. Simulink also transmits the vehicle's state information, calculated by the model, to the virtual model in Unity3D, achieving closed-loop vehicle operation.
[0228] To verify the feasibility of the entire system and its interoperability with the driving simulator, a joint simulation was conducted with a full vehicle model equipped with an automated manual transmission (AMT). The driver model was set to manual input, and the model was run to control vehicle motion by varying the simulator's acceleration and brake pedal openings.
[0229] like Figure 23 The results of the co-simulation are shown, simulating the accelerator pedal's upshift and the brake pedal's downshift. The transmission smoothly shifts up and down according to the driver's intent, and the vehicle speed is relatively stable, with slight fluctuations during shifts. Furthermore, the visual system simulates the vehicle-road environment, displaying the vehicle's motion status for driver feedback. Compared to curve information, this provides a more intuitive and realistic representation of the actual driving environment.
[0230] The above description is only a preferred embodiment of the present invention and does not limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for building a bench test system based on a virtual scene, characterized in that: The steps include: S1. First, build a vehicle dynamics model, which includes a vehicle transmission system model for simulating the vehicle transmission system, a vehicle longitudinal dynamics model for simulating the longitudinal force conditions during vehicle driving, and a vehicle control model for simulating vehicle handling; S2. Build a test bench visual system, the test bench visual system including a road module and a terrain module for simulating driving conditions, a vehicle model for simulating vehicle motion, and a driving simulation system for manipulating the vehicle model; map the vehicle model to the full vehicle dynamics model so that the vehicle model moves on the road model according to the power output of the full vehicle dynamics model; The driving simulation system includes an accelerator pedal, a brake pedal, and a steering wheel for inputting accelerator, brake, and steering signals, respectively, and the accelerator pedal, brake pedal, and steering wheel are all connected to the vehicle model.
2. The method for constructing a bench test system based on a virtual scene according to claim 1, wherein: In step S2, the road model, terrain model and vehicle model are constructed using the following steps: S21. Based on the requirements of road testing, the terrain model was built using the Terrain tool in Unity3D. S22. Build a road model on the terrain model that has been built using the EasyRoad tool in Unity3D; S23. Use 3ds MAX to build a vehicle model, convert the vehicle model into FBX format and import it into Unity3D to complete the construction of the virtual scene.
3. The method for constructing a bench test system based on a virtual scene according to claim 2, wherein: The vehicle dynamics model sends the vehicle's yaw rate, speed, steering wheel angle, and displacement in the X, Y, and Z directions to the Unity3D platform for mapping with the vehicle model. The vehicle model is translated, rotated, and scaled within the Unity3D platform to achieve dynamic motion of the vehicle model in the virtual scene. The translation transformation matrix is: Where Δx, Δy, and Δz are the translation distances of the vehicle model along the X-axis, Y-axis, and Z-axis, respectively, and (x0, y0, z0) is the current coordinate. Rotation includes Euler rotation and matrix rotation. The transformation matrix of Euler rotation is: Where (α0, β0, γ0) are the Euler angles of the vehicle model rotation, Δα, Δβ and Δγ are the angles of rotation along the X-axis, Y-axis and Z-axis respectively, and (α1, β1, γ1) are the coordinates after rotation; The transformation matrix for matrix rotation is: Where θ1 is the angle of rotation of the vehicle model around the X-axis, (x2, y2, z2) are the coordinates after rotation around the X-axis; θ2 is the angle of rotation of the vehicle model around the Y-axis, (x3, y3, z3) are the coordinates after rotation around the Y-axis; θ3 is the angle of rotation of the vehicle model around the Z-axis, and the rotated coordinates (x4, y4, z4) are the coordinates after rotation around the Z-axis; The transformation matrix for scaling is: Where a is the scaling factor on the X axis, b is the scaling factor on the Y axis, c is the scaling factor on the Z axis, and (x5, y5, z5) are the scaled coordinates.
4. The method for constructing a bench test system based on a virtual scene according to claim 1, wherein: The vehicle transmission system model includes an engine model, a clutch model and a transmission model, and the engine model is: T e =f(n e ,K)=a0+a1n e n +a2n e n-1 K+...+a n+1 K n Where, T e is the engine torque, n e is the engine speed, K is the throttle opening, a i Polynomial fitting coefficient, n is the polynomial degree; The clutch model includes a disengagement phase, a sliding friction phase, and an engagement phase. The expression of the disengagement phase is: The expression of the sliding wear stage is: Where n is the number of clutch friction surfaces, μ is the clutch friction coefficient, and F n The clamping force between the driver and driven discs, R0 and R1 are the inner and outer diameters of the clutch; The expression of the combination stage is: Where, J clu_in With J clu_out are the moments of inertia of the clutch driving plate and driven plate respectively, T clu_in With T clu_out The end torque of the clutch driving plate and the driven plate, T c It is the transmission torque between the clutch driving plate and the driven plate.
5. The method for constructing a bench test system based on a virtual scene according to claim 4, wherein: The transmission model satisfies the following formula: In the formula, ω and T i are the input or output shaft angular velocity and the torque transmitted by the corresponding target gear gear, J is the moment of inertia of the shaft, and i is the transmission gear.
6. The method for constructing a bench test system based on a virtual scene according to claim 4, wherein: In the vehicle longitudinal dynamics model, the longitudinal force balance equation is: F f =Gfcosα F i =Gsinα Where m is the vehicle mass, F t is the driving force, F f is the rolling resistance, F i is the slope resistance, F w is the air resistance, F b is the braking resistance; G is the vehicle weight, f is the rolling resistance coefficient, α is the horizontal angle of the road slope; A is the vehicle's frontal area, v is the vehicle's speed; T b is the braking torque of the brake disc, and r is the wheel radius.