Computer Simulation as a Tool for Managing the Technical Development of Methods for Diagnosing the Technical Condition of a Vehicle

: Introduced by the Civil Code, the rules of road safety are introducing continuously increasingly strict requirements on motor vehicles. These requirements relate to various aspects of the technical condition of vehicles, both those that determine tra ﬃ c safety and those that a ﬀ ect the vehicle’s environmental impact. The law requires regular diagnosis of the technical condition of vehicles in service. Diagnostic tests conducted in the form of road tests or the tests performed in workshop conditions allow to determine the symptoms of dysfunctions of the tested vehicle, not always clearly deﬁning the causes and location of damage. The purpose of the work is the design the simulation of a station for of vehicle dynamics tests up to 3.5 t using simulation programs OpenModelica and SciLab. A simulation of the work of the stand for testing the dynamics of vehicles in the form of a chassis dynamometer was achieved. The program enables the simulation of tests: NEDC (New European Drive Cycle), WLTP (Worldwide Harmonized Light Vehicle Test Procedure), CADCM150 (joint Artemis driving cycle—Motorway at vMax = 150 kph), CADCU (Common Artemis Driving Cycle—Urban), FTP75 EPA (Federal Test Procedure, Environmental Protection Agency). The simulator (for any assumed type of vehicle) can be used in two modes: 1. Introduction of the presumed cause—Generates the expected results in the functioning of the vehicle. This function can be used to create a cause–e ﬀ ect relational database. 2. Analysis of data from the actual diagnostic system suggesting the causes of the observed (measured) errors in the functioning of the system. The simulator can be used both to design and implement the technological development of intelligent diagnostic systems, and to support the creation of application software for a workshop diagnostic system. Introducing the simulator into practice will also enable the improvement of road safety management.


Introduction
Recent years have been a time of increased efforts to protect the natural environment [1][2][3][4]. Industrial and technological progress meant that the car became the most frequently chosen means of transport [5][6][7]. In addition to changes in the way of heating buildings and changes in industry, ecological transport is one of the most important tasks to be achieved in order to obtain an improvement in air cleanliness [8][9][10][11]. Each internal combustion engine produces exhaust gas. The number of vehicles travelling on the road increases every year, therefore air pollution is increasing [12][13][14][15]. As a The FTP represents a commuting cycle with some urban journeys including frequent stops as well as some motorway journeys [77][78][79]. The entire FTP-75 cycle consists of the following segments: Transient cold start phase (ambient temperature 20-30 • C), duration 0-505 s, stabilized phase, duration 506-1372 s, hot soaking (duration min 540 s, max 660 s), transient hot start phase, duration 0-505 s. The third phase begins after the engine stops for 10 min. The distance covered during the cycle is 17.77 km, the average speed is 34.12 kph and the maximum speed is 91.25 kph [80,81]. The FTP-75 cycle is known in Australia as the ADR 37 (Australian Design Rules) cycle, and in Brazil as the NBR6601 test standard [82,83]. The four-segment variant of the FTP-75 cycle, in which the stabilized phase is restarted after the hot start phase, is sometimes used in some applications, e.g., in certain hybrid vehicle tests.
The European Artemis project developed procedures for testing emissions on the Common Artemis Driving Cycles (CADC) chassis dynamometer [84,85]. To achieve the project goals, a statistical analysis of a database of European real driving patterns was used, including, e.g., driving conditions, vehicle use, speed, and gearbox usage. The developed procedures support the analysis of vehicle behaviour, not only in the context of driving cycles, but also in the context of emission modelling. The cycles include urban, rural and motorway driving schedules. The motorway cycle includes variants with maximum speeds of 130 and 150 kph [86][87][88].
The current number of vehicles on the road requires that the diagnosis of the technical condition of the vehicle be as fast as possible and also very precise. Due to the technological advancement of modern motor vehicles, this requires special modern control and measuring equipment as well as appropriate knowledge and experience of the person conducting the tests.
Workstations for testing vehicle dynamics make it possible to carry out these tests in laboratory conditions, with the vehicle placed on a chassis dynamometer. For the needs of science and the development of the automotive market, computer simulations are increasingly used, which map the given driving cycle. Virtual computer models include both the model of the measuring station and the model of the analyzed vehicle [89][90][91].
The use of a simulation that allows for the comparison of the required loads for individual classes of cars within the driving test, type of synchronous generator and diameter of brake rollers will allow to avoid unnecessary costs with the construction of many prototype solutions. The simulation provided a set of optimal solutions for a set of cars with variable masses that comply with driving test standards (455.0, 510.0, 570.0, . . . , 2270.0 kg).
The chassis dynamometers available on the market are characterized by high purchase costs, which is due to the use of high-power electric eddy current brakes. For driving tests, such power values are not used. The construction of brake rollers with lower power consumption values adapted to the driving test standards and the use of cheaper electroviral brake substitutes in the form of controlled synchronous generators will allow for a significant reduction of purchase costs. Such devices can potentially be used in vehicle inspection stations and detect cases of vehicles that do not comply with the emission limits. One of the elements of road safety management is the consistent elimination of vehicles that do not meet the driving test requirements. At present, the rules on the authorisation of vehicles for road traffic only allow the detection of key vehicle damage. Periodic rapid driving tests for the vehicle will allow an objective assessment of its technical performance.
In the case of planning studies on real objects, the authors often prepare the necessary simulations to select the appropriate range of changes in parameters to ensure safe research. Simulation procedures have in many cases reduced the cost of building research stations by avoiding unnecessary purchases, unnecessary work and execution errors. According to the authors, such a course of action is right.
The results of the simulation showed that it is possible to build a chassis dynamometer, whose parameters will be consistent with the current driving tests, but with a much-simplified design and lower power output. We will not be able to use such a chassis dynamometer for full load testing of a vehicle (these types of chassis dynamometer are available on the market and their purchase cost is very high), but for quick testing of vehicles suspected of exceeding the permissible limits for exhaust emissions and fuel consumption. At the University, the authors have vehicle inspection stations that allow testing of vehicles up to 3.5 tonnes on public roads. In the results of cooperation with the Vehicle Inspection Station, analysis of the data of technical tests carried out on vehicles, the authors noted that in this type of test, the stations do not have the possibility to exclude vehicles with increased emissions under load. Current regulations require the exhaust gas composition to be measured at engine idling speed. Such measurement is not sufficient for modern vehicles. The authors assume that part of the vehicles which do not comply with the emission limits is released into service as a result of lack of appropriate tools. According to the authors, such a tool may be a chassis dynamometer, whose components were selected as a result of a computer simulation. The safety of the roadworthiness of vehicles does not result directly from computer simulation, but from the production process and implementation of this type of dynamometer at Vehicle Inspection Stations.

Materials and Methods
The aim of this paper is to design a station for simulation of dynamics tests for vehicles up to 3.5 tons, using OpenModelica and SciLab simulation programs.
A workstation for dynamics testing in the form of a chassis dynamometer was created in a computer environment, the appropriate generator and chassis dynamometer rollers were selected. NEDC, WLTP, CADCM150, CADC150, FTP75 driving tests were simulated in the SciLab Program for various classes of passenger vehicles with a maximum weight of up to 3.5 tons. Then, driving tests were simulated on a built-up generator simulation station in the OpenModelica program.
As for the choice of the braking element, standard solutions were used: Three-phase AC synchronous generators available on the market with the option of controlling the field current (braking momentum control) manufactured by the company Mecc Alte (Vicenza, Italy) [92]. These generators were selected for their compliance with variable brake roller diameters (0.217, 0.318, 0.504 and 0.762 m).
The developed driving test simulator in case of a change in the type of generator with a different rated operating speed and power rating will generate unacceptable differences between the required compliant loads and the actual loads generated by the generator. The driving test standards contain unambiguous maximum error values between required and actual values. An applied alternator that does not meet the requirements of the tests will not allow the tested vehicle to be loaded correctly. These cases were shown by the simulator. The use of generators with too low a braking torque will not allow for a correct driving test.
The simulation is part of the process to make a real chassis dynamometer for testing vehicles as part of the driving tests. Ultimately, a chassis dynamometer should have features that allow it to be used in vehicle control stations: Power absorbed by the dynamometer and a braking torque that matches the driving test guidelines (significantly less than the maximum power of modern engines), the low cost of purchasing a synchronous generator as a load on the vehicle, the possibility of transferring the energy drawn from the vehicle to the power network using the generator to reduce the cost of operating the device. The authors plan to use the elements indicated by the simulations to build such a device and to carry out a full set of tests using vehicles. The value of the simulation is that a tool has been created that allows the selection of operating parameters of the synchronous generators under conditions of a large range of speed and power variability. Such generators available on the market in the literature have not been tested under such conditions. These types of generators are made to produce electricity with a stable frequency and voltage.
The authors are aware that many simulation environments are available on the market. The university is licensed to Matlab Simulink packages. However, these packages are limited in their applications to scientific research. Due to the scientific and implementation nature of the materials presented in the article, the environments possessed by the universities cannot be used. Authors in these types of activities often use environments that do not contain a ban on implementation work commercially.

Determination of Dynamometer Requirements Based on Simulation of Driving Tests in SciLab
SciLab is a free program created for mathematical, engineering and data analysis purposes. SciLab contains hundreds of mathematical functions, has a high-level programming language that enables access to advanced data structures, 2D and 3D graphic functions. It can be used for engineering and scientific purposes based on mathematical operations and data analysis [93][94][95].
A simulation was built using the SciLab program, the purpose of which was to determine the requirements for the chassis dynamometer brake, with the possibility of testing vehicles up to 3.5 tons in road tests. Tests with the longest times and the largest loads during measurements were selected for the simulation:   The "Vehicle" module reproduces the actual loads acting on the vehicle during the test, in accordance with the standards for conducting this type of test. Due to the fact that the available driving test data include the required courses of the vehicle speed in kilometres per hour, the first to convert in the module is the vehicle speed in the basic unit: m/s. In the calculation of the forces on the vehicle wheels, according to the vehicle, a component was used which enabled the determination of instantaneous acceleration of the vehicle. Calculations for the component force on the wheels resulting from the friction resistance included the following conversion factors, as required in the norm:  [96][97][98]. These forces are added together and forwarded to the next elements of the simulation. To generate graphs from driving test simulations, components (to workspace) were used to save the results of the simulation for later visualization.
The simulation block diagram developed in the SciLab program also includes a simulation module responsible for calculating the required torque and angular speed for the brake in the chassis dynamometer. In this case, these calculations include the diameters of the brake rollers adopted in the tests.
On top of the waveforms resulting from the driving test, additional lines were drawn that imaged the characteristic parameters of synchronous generators, which can be used as brakes in the chassis dynamometer. Due to the fact that changing the diameter of the brake rollers greatly affects the speed of the generators, two sets of generators with different operating speeds were selected to determine the parameters of the required device.
The momentary values of braking forces from vehicle dynamics (Fm) were calculated based on Equation (1): The values of forces from motion resistance (Fv) were calculated according to relation (2):  (5):  (6) and (7): In the case of brake roll diameters of 0.217 and 0.318 m, the graphs are marked with lines corresponding to the work parameters of generators operating at 3600 rpm:

Simulation of the Braking Process for the Generator in the OpenModelica Program, in the Context of Driving Tests
OpenModelica is an open, interdisciplinary, comprehensive environment with graphic editors for modelling, compilation and construction of complex models and simulation control. The object-oriented modelling language Modelica is based on equations for industrial and academic applications. It is equipped with a large number of libraries dedicated to different domains [99][100][101].
A simulation has been developed in the OpenModelica program, the purpose of which is to obtain information on the possibility of using vehicles tested in braking of three-phase synchronous generators for braking (Figure 2a). In this simulation, the following components are responsible for the process of providing the required test parameters: TestW-Provides instant values of the angular speed of the brake rollers including the diameter of the rollers, TestM-Provides instantaneous values of the required braking torque. The element performing load simulations is a generator controlled by direct current excitation ("dcee"). A component ("pid"), simulating the PID controller with restrictions, was used to control the generator's work parameters to create the necessary braking torque value.
The stator resistance and stray inductance is modelled directly in the stator phases, and then using a phase-space transformation and an AirGap model with a built-in rotor. The stray resistance and inductance of the rotor cage is modelled in two axes of the coordinate system mounted on the rotor. The electrical excitation is modelled by converting the excitation current and voltage into the spatial phases of the d axis. Machine models take into account the following loss effects: Heat losses in temperature-dependent stator winding resistances; heat losses depending on the temperature of the winding excitation; optionally, after switching on: Heat losses in cage resistances and temperature-dependent throttle; brush losses in the excitation circuit; losses due to friction; basic losses (only eddy current losses, no hysteresis losses); stray load losses. Figure 2b shows a schematic view of the simulation component of a three-phase synchronous generator included in the OpenModelica package [102].

Results
The simulation results obtained in the SciLab program were presented in the form of line and 3D graphs. Then, the simulation block diagrams made using the OpenModelica program, which referred to: determining the dynamometer requirements, calculating the instantaneous values of forces on the wheels of the vehicle during driving tests, calculating the instantaneous values of the torque and angular velocity in the dynamometer during tests and the loads of the tested brake were used to determine the possibility of using the generators tested in driving tests for braking.
These parameters are clearly defined in driving tests and are independent of vehicle operating parameters. A technically fit vehicle must only be able to achieve a course of instantaneous vehicle speed that matches the required test mileage during the test. At this stage, the purpose of which was to select the components of the chassis dynamometer, the operating parameters of the vehicles were not taken into account.

SciLab Simulation Results of Driving Tests for Various Braking Elements and Roller Sizes
The results of the simulation process for the adopted driving test were presented in the form of the course of the instantaneous value of the vehicle speed and the course of the instantaneous acceleration values acting on the vehicle. Then, the required loads in the vehicle movement were calculated using the vehicle mass classes, some examples of which are presented in the figure below (selected vehicle weight classes are included for the readability of the drawings) ( Figure 3).   Then, the waveforms of instantaneous angular velocity and braking torque values required for proper operation of the chassis dynamometer were generated. In this case, the largest allowable vehicle mass included in the standards (which generates the largest loads) and the change in the diameter of the brake rollers were taken into account. On top of the waveforms resulting from the driving test, additional lines were drawn that imaged the characteristic parameters of synchronous generators, which can be used as brakes in the chassis dynamometer. Due to the fact that changing the diameter of the brake rollers greatly affects the speed of the generators, two sets of generators with different operating speeds were selected to determine the parameters of the required device.

CADCM150 Driving Test
The results of the simulation process for the adopted CADCM150 test and including the above model were presented in waveforms of resistance force for selected vehicle masses in Figure 5. In the case of using a three-phase synchronous generator characterized by a maximum braking torque smaller than the maximum braking vehicle value resulting from the driving test, the waveform courses presented in the figures below exceed the values of restrictions arising from the lines drawn for individual generators. This situation potentially makes it impossible to carry out correct driving tests for the tested car (the vehicle load courses will not fit in the maximum defined deviations for the driving test).

CADC150 Driving Test
In the case of the CADC150 driving test, just like in the previous test, after performing the necessary simulations, the maximum load values required to correctly conduct the driving test were collected in waveforms of instantaneous braking torque values, roller speed for assumed brake roller diameters. In addition, waveforms of instantaneous required angular velocity and torque values for the largest vehicle weight were also generated, taking into account the diameter of the rollers (Figure 6).

FTP75 Driving Test
The scheme for generating simulation results for the FTP75 travel test was identical for each type of driving test performed. Below (Figure 7) are shown the waveforms of instantaneous values of angular velocity and braking torque required for proper operation of the chassis dynamometer, taking into account the change in diameter of the brake rollers and lines characteristic for selected synchronous generators.

NEDC Driving Test
For the NEDC driving test, the simulation provided results that are presented below. The waveforms of the instantaneous torque and angular velocity values for the largest vehicle weight considered, including the diameter of the brake rollers, are shown in Figure 8.

WLTP Driving Test
In the case of the WLTP travel test simulation, the results are presented in the form of graphs below. The instantaneous waveforms of braking torque and angular velocity for selected brake roller diameters are summarized in Figure 9. As in the previous examples, only the vehicle with the highest mass in the norm was included.

OpenModelica Simulation Results of the Braking Process for the Generator for Driving Tests
First, the results of the simulation of the generator's operation were generated for the selected driving test in the form of a component containing the instantaneous value of rotational speed of the brake rollers. The figures below summarize the simulation results including the required braking torque and braking torque resulting from the actual simulation produced by the component of a three-phase synchronous generator ("dcee").
The graphical results of computer simulations carried out for the tests are presented below: CADCM150, CAD150; FTP75, NEDC and WLTP ( Figure 10).
The presented waveforms practically coincide with the values required for the test runs, which means that it is possible to use the generator for braking purposes in driving tests. In this case, it can be noticed that this component behaves like a generator loading the vehicle in the case of load simulation or as an electrical motor in the event of the vehicle decelerating.

Conclusions
The paper presents issues related to conducting driving tests in accordance with the accepted standards within the European Union and outside the EU (e.g., the USA).

•
Driving tests became the basis for building simulation models. However, to check the simulation position for the most common driving tests carried out worldwide (NEDC and WLTP), the following simulation input data were added to the set of simulation input data: CADCM150, CADC150, FTP75, which were characterized by the use of high speed of the vehicle movement during testing, which resulted in high demand of mechanical energy reception by the chassis dynamometer brake.

•
In order to determine the minimum required parameters of the element receiving energy from the vehicle in the aforementioned tests, a simulation was developed using the SciLab package. Based on the results obtained from the simulation processes, including the change in the driving test mode of the vehicle mass and the adopted diameter of the brake rollers, the minimum brake power value of 200 kVA at the rated speed of 3600 rpm was selected.

•
In the OpenModelica program, simulations of the component receiving mechanical power during the test were developed for: A generator with the option of controlling the excitation current. Based on the obtained results of the component, it can be concluded that the generators, due to the possibility of their work as an engine or generator, are better suited to a chassis dynamometer with dynamic tests of light vehicles up to 3.5 tons.

•
The analysis of the simulation results, including simulated driving tests, variable diameter of brake rollers and types of synchronous generators allowed to choose a generator that meets the requirements and is available on the market. Consequently, the simulation is the basis for further implementation work. • The special advantage of this type of electrical machine is the possibility of transferring the received energy during the driving test to the power grid, which reduces the amount of heat generated into the environment and irreversible energy losses.

•
The developed simulation constitutes a useful tool for initial research or planning of real experiments. It may be an element of a more comprehensive system or an independent system. • The authors in future research, presented in the manuscript of the tool, will expand on the results of experimental tests carried out on combustion engines powered by selected fuels and on simulations of work of other system components.

Discussion
The prepared simulation will be converted into software controlling the actual brake rollers. In the case of an actual test, the control application will perform the required load test for a vehicle with fixed mass values. During the drive test using the eOBD system, momentary operating values of the propulsion system will be collected from the vehicle control systems. Their analysis will be crucial in deciding whether or not to allow the vehicle to be put into service, and information on the errors of the said system, with an emphasis on emission-related errors.
Incorrect selection of the synchronous generator or incorrect operation of the synchronous generator and the control system for the excitation current of the synchronous generator leads to increased differences between the set driving test parameters resulting from the standards and the actual simulation parameters. Mileage errors can be caused by incorrect operation of the drive system (damage affecting engine power) and by incorrect operation of the brake rollers themselves.
The authors presented in the manuscript only the results of simulated driving tests and their analysis. It is planned to transfer the developed simulation to systems enabling real-time operation. The following environments are taken into account: FreeRTOS in the frame of software systems STM32CubeIDE, Matlab Simulink Real-Time.
In the developed simulation, the vehicle speed is the setpoint resulting from the specifics of the driving tests under consideration. At the simulation stage, no precise measurements of vehicle speed were made. However, the next steps in driving tests for the actual equipment and vehicles will use speed measurements using: Data acquisition from the vehicle's OBD system, encoder sensor enabling measurement of the instantaneous value of the angle of rotation of the brake rollers. These sensors are characterized by a very high precision of the angle of rotation measurement and will be the basis for determining the vehicle speed. The signal from the vehicle's ODB system, on the other hand, will compensate for the adverse effects on the speed measurement results, i.e., the deflection of the tyre on the brake rollers.
The authors use the Open Modelica environment in many threads of their research work. This is an open source environment for which all components are available in source form. The environment is not restricted in scientific implementation projects. The authors plan to use the library within the Open Modelica Modelica Device Drivers environment, Embedded Targets in future implementation work to build a brake roller control part. For this reason, the authors chose this environment. The authors have a license for the Matlab Simulink package; however, the license allows them to perform research and not implementation work.