A Segmentation Model of ECU Excitation Signal Based on Characteristic Parameters

According to the basic structure and working principle of the excitation signal sensors of a diesel engine electronic control unit (ECU), a segmentation model of an ECU excitation signal based on characteristic parameters (ESCP-SM) is proposed. In the ESCP-SM, the ECU excitation signal is divided into several parts, and each part has its characteristic parameters model. By using the same global parameters and strictly controlling each part’s proportional parameters, the ESCP-SM can achieve signal alignment and dynamic frequency modulation. Based on the simulation experiment, spectrum analysis proves that this modeling method ensures that the original signal’s effective information is not lost. Pearson similarity analysis shows that the similarity between the simulation signal and practical signal reaches 74%, exhibiting strong correlation. In addition, we set up a physical testing environment. ESCP-SM is realized based on virtual instrument technology, and provides excitation signals for a Komatsu 8 ECU. By modifying the parameter configuration, the ECU can drive the injector to work correctly.


Introduction
Infrastructure construction plays an essential role in the development of a regional economy. The most often utilized equipment in infrastructure building is engineering vehicles [1]. Diesel engines are mostly employed in construction trucks. The engine ECU is the brain that controls the coordinated operation of all parts. A malfunctioning ECU might result in construction delays and accidents [2]. In the construction vehicle industry, ECU testing technology has been extensively used [3]. ECU drives the engine based on various signals from the actual sensors. The signal generator can be used in place of the actual sensor to complete dynamic measurements and engine ECU testing in an offline condition [4,5]. Therefore, the design of the signal generator is the key aspect of the dynamic testing of the engine ECU [6,7]. Signal generator testing can reduce cost and complexity by up to 90% compared to traditional testing [8]. Therefore, the accuracy and synchronization of crankshaft and camshaft signal simulation are critical to ECU offline testing.
The ECU obtains real-time engine status during engine operation by collecting various excitation signals via the sensor, including the crankshaft position (CKP) signal, the camshaft position (CMP) signal, the knock signal, and the throttle signal [9,10]. Among all excitation signals, the CKP and CMP signals are the most critical for fuel injection regulation [11][12][13]. The CKP signal and the CMP signal are a set of synchronous signals; the crankshaft turns two times, and the camshaft turns once. There are usually several missing teeth on the signal panel of the crankshaft to distinguish the number of crankshaft turns. In addition to the gear shaping, the camshaft gear slots are equally spaced. The ECU collects engine speed and cylinder information through the crankshaft position sensor (CKPS) and camshaft position sensor (CMPS) [14]. The ECU uses the unique crankshaft angle and the combined camshaft signal to identify which cylinder is operating and to The research on ECU excitation signal simulation is primarily focused on two factors: Hardware circuit simulation [15] and the virtual instrument signal generator. In terms of hardware circuit simulation, the signal generator is designed by a single chip microcomputer and digital to analogue conversion technology [16]. In the case of the HBS-6 type excavator ECU detector (HBS-EED), the disadvantages of hardware circuit simulation include limited scalability, low signal accuracy, and a complex circuit structure. In terms of the virtual instrument signal generator, the signal generator is designed using virtual instrument technology such as LabVIEW and MATLAB [17,18]. The precision of the analogue signal is high, and the complexity of the signal generator is reduced. However, due to the different structure of the engine, the CKP and CMP signals are numerous. A single software module cannot easily accommodate the requirements of several signals. This paper proposes a segmentation model based on characteristic parameters for easily and quickly simulating various CKP and CMP signals. In contrast to the prior method, which concentrated only on the precision of the analogue signal, we sought to improve the signal's variety while maintaining its accuracy and synchronization. To pursue a higher signal accuracy, we adopted the following design. Firstly, the characteristic parameters of the CKP and CMP signals were analyzed so that the signals could be modeled piecewise. Subsequently, the proportional coefficient was set to strictly control the periodic relationship of each piecewise function. Finally, the analogue signal was output through the high precision synchronous data acquisition (DAQ) card. The DAQ card is only responsible for the digital-to-analogue conversion to output analogue signals, so the model's design can ensure the high precision of the signals. To ensure the synchronization of the CKP and CMP signals, we extracted and set the frequency of the signals. The characteristic parameters control the relative position between the missing teeth of the CKP signal and the gear shaping the CMP signal. To increase the diversity of signals, we simulated different crankshaft and camshaft signals by setting the characteristic parameters of the signals. The experimental results show that the similarity between the simulated ESCP-SM signal and the original signal is up to 74%, and the accuracy is improved by 26% compared with the hardware HBS-EED signal. This study makes the following contributions: 1.
The characteristic parameters of crankshaft position sensor (CKP) signals and camshaft position sensor (CMP) signals were analyzed. The signal type can be distinguished by detecting the threshold value of the difference between adjacent points of the signal.
Fast Fourier transform (FFT) was used to obtain the frequency parameters of the original signal; 2.
A segmentation model of the ECU excitation signal based on characteristic parameters (ESCP-SM) is proposed. By the mathematical modeling of crankshaft and camshaft signals, high-precision analog signals were generated. Different CKP and CMP signals were generated by setting the characteristic parameters of the signals; 3.
The design of the ESCP-SM ensures a high signal accuracy and significantly increases signal diversity. We released the source code so that other researchers can better understand the control characteristics and operational parameters of the ECU. It provides a large quantity of valuable data for the research and evaluation of ECU simulation software. The LabVIEW source code used in this study can be found on GitHub [19].
The rest of the paper is organized as follows. In Section 2, the related work is summarized. In Section 3, we analyze the characteristic parameters of CKP and CMP signals. In Section 4, the modeling process of CKP and CMP signals is summarized, and the signal is simulated by the mathematical modeling method. In Section 5, the effectiveness of the proposed method is verified by experiments, and the the results of the method are analyzed by Pearson similarity. Finally, we conclude this work and provide some directions for future work in Section 6.

Related Work
In recent years, hardware-in-the-loop simulation (HIL) technology has been widely used in engine ECU testing [20]. The signal generator design is the essential step in the HIL process. The ECU provides for the precise control of the actuator through a series of sensors to obtain real-time operating data of the engine. The CKP and CMP signals are the most crucial input signals in the engine control system, as they are required for fuel injection and ignition timing regulation. In the relevant literature, the existing signal generation is mainly carried out considering two aspects: Single chip microcomputer (SCM) hardware simulation and virtual instrument software simulation.
In the traditional engine signal simulation platform, multiple signal generators are combined, and the signal is changed by manual adjustment. The operation is complicated, and the actual working condition cannot be simulated accurately. For example, the motor drives the optical hole disk to produce the crankshaft signal. The signal type is fixed and cannot be applied to the simulation of other kinds of engines. As the signal's speed change can only be regulated slowly by hand and cannot accurately imitate a failure condition such as the engine speed being out of control, this solution has difficulty meeting the requirements for real-time control. To solve the problems existing in the above traditional methods, A. Z. Jidin et al. [21,22] used SCM PIC18F458 as the core to simulate the actual crankshaft signal. A stable analog voltage value is generated by pulse width modulation (PWM) and sent to the integrated voltage-controlled oscillation device CD4046. The analog signal is created at low and medium frequencies to approximate a real CKP signal, but its accuracy and adjustability are limited, its dynamic response is sluggish, and parameter adjustment is cumbersome. To address the signal frequency modulation and precision, Yao Hongqiang et al. [23] and Zuo Wenlin et al. [24] adopted FPGA as a digital platform to design PWM signal generators. The module in Quartus II6.0 is used in FPGA to make the output PWM wave frequency constant using the socket method. However, the circuit design is complex, and the signal frequency is low and difficult to debug. To simplify the circuit and improve the resolution of frequency, Jiang Pengyu et al. [25] applied C8051F MCU to design the signal generator. They encapsulated a particular square wave function and sine function to improve the precision of the signal. Generally, the signal replicated by the single hardware circuit above has complex parameter tweaking and a limited number of signal kinds.
To solve the problem that parameters are difficult to adjust, I. J. Oleagordia Aguirre et al. [26] used a digital programmable signal generator (DPSG) to generate complex and diverse signals. The signal parameters set in the software module are sent to the hardware module to adjust the signal generated by the hardware circuit. However, much work is required during the software design stage, and the development time is rather significant. To reduce the complexity of software module development, Senol Gulgonul et al. [27] established the CAM and crank signal models in the Simulink environment. The model is compiled with a Simulink encoder and flashed into the target microcontroller NXP's MPC5744P development suite, which enables the model to be compiled and embedded into a variety of target microcontrollers. The above method of setting hardware circuits to generate signal parameters through software generally has low signal precision and complex hardware circuits.
In order to simplify the complexity of the circuit and improve the accuracy of the signal, Zhao Futang et al. [28] selected the sinusoidal signal generating function of Lab-VIEW and superposition of white noise to simulate the magnetoelectric crankshaft signal. The D/A conversion card of the NI series is used to output the analog signal simulated by the software to realize the signal simulation of the core sensor's engine ECU. However, the accuracy of the simulated signal is low in the missing part of the crankshaft. To improve the signal accuracy of the simulation of crankshaft tooth absence, Lian Huijuan et al. [29] established the simulation model for the crankshaft and camshaft sensors using Matlab/Simulink/Stateflow and the arcsine function (MSS-AS). According to the different number of teeth, a sinusoidal function and arcsine function are used to fit the crankshaft signal curve, especially in the missing teeth. However, this method involves heavy programming requirements. To reduce the workload of programming, Yanqiu Zhao et al. [30] realized the seamless connection between LabVIEW and MATLAB by using the LabVIEW Simulation Interface Toolkit. Through a dynamic call to the Simulink model, an accurate simulation of the engine excitation signal is realized.
The hardware-in-the-loop simulation links a portion of the real system equipment to the computer, simulates a portion of the real system equipment using the mathematical model, and simultaneously assures the function of the whole system. Krzysztof Wiecławski et al. [31,32] introduced a model of an injector in the form of a current waveform that describes the changes in current and voltage during its operation. The actual start time and duration of injection can be determined using a mathematical model that describes the voltage-current phenomenon during the injector operation. Zhai et al. [33] analyzed a framework of the speech emotion recognition system and summarized and modeled the characteristic parameters of different speech signals. We refer to the method of speech signal parameter modeling and apply it to the modeling of the ECU excitation signal. Om Prakash Yadav et al. [34] proposed a piecewise ECG signal compression model using Chebyshev polynomials for the approximate simulation of each line segment. A. A. Vorontsov et al. modeled the auditory route output signals of magnetostrictive linear or angular displacement sensors mathematically [35]. In view of the above mentioned shortcomings, we propose a segmentation model of the ECU excitation signal based on characteristic parameters (ESCP-SM).

CKP Signal Parameters
The CKP signal is a kind of waveform signal that is used to determine the engine's speed and crank angle. The CKP signal types K type can be classified as magnetoelectric or Hall according to the type of position sensors. The CKP signal can be divided into two parts: Multitooth signal and missing teeth signal. The total number of teeth N tot is equal to the number of missing teeth N mis plus the number of multiple teeth N mul . There are two kinds of missing gear signals used to identify the number of crankshaft revolutions N rev . In the first case, N mis can be set to 0. The missing teeth part is simulated by two sinusoidal waveforms with two frequencies. In the second case, the missing tooth waveform is simulated by splicing part of the sine wave, arc, and horizontal line, which are denoted as s 1 , s 2 , and s 3 , respectively. The N mul sinusoidal waves of frequency f can simulate the remaining multitooth waveform. For the Hall CKP signal, the missing part can be simulated by the square wave function with a duty ratio of 100%, while the square wave function simulates the other teeth with a duty ratio of 50%. The characteristic parameters of the CKP signal are shown in Table 1. The position of the parameters in the practical signal is shown in Figure 2.

CMP Signal Parameters
The CMP signal is a kind of waveform signal composed of a few pulses synchronized with the CKP signal. The CMP signal types M type can be classified as magnetoelectric or Hall according to the type of position sensors. The spacing of the pulse is consistent except for the marked pulse that is inserted. Determining the position of marked pulse generally requires two parameters: The number of pulses in the preceding interval N int of the marked pulse, and the interval distance D int between the marked pulse and the following pulse. The number of pulse waveforms in the CMP signal is represented by the parameter N pul , and the period ratio is µ. For the magnetoelectric CMP signal, the pulse part adopts the (N pul − 1) sinusoidal waveform for simulation. The interval part adopts a horizontal line for simulation, and the marked pulse adopts a single sinusoidal waveform for simulation. The position of the marking pulse can be determined by the parameters N int and D int . For Hall CMP signals, the teeth are symmetrically spliced by two square waves with a duty ratio of 50%, and square waves simulate the interval part with a duty ratio of 0%. The starting horizontal line offset L o f f set needs to be set so that the CMP signal is aligned with the CKP signal. The characteristic parameters of the CMP signal are shown in Table 2. The position of the parameters in the practical signal is shown in Figure 2. To mitigate the effect of individual noise spots on the overall amplitude of the waveform, the data must be normalized. We chose min-max normalization to change the data to a decimal between (0, 1), as shown in Equation (1): where x norm represents the normalized data. x min represents the minimum value of the data. x max represents the maximum value of the data. The types of signals include magnetoelectric and Hall types. The distinction between the two is the change in the difference between adjacent points. Hall signals vary greatly at high and low levels, while magnetoelectric signals vary significantly less. Figure 3 shows the continuous acquisition of different types of CKP and CMP signals.  In Figure 4, the red and blue curves represent the difference values of magnetoelectric signals. By contrast, the green and purple curves represent the different values of Hall signals. The difference in the wave peak of the magnetoelectric signal is below 0.5, and the difference in the wave of the Hall signal is greater than 0.5. In order to reduce the error of noise interference, it is necessary to average the difference wave peaks that meet a certain threshold. The average peak value is calculated as follows: where ξ represents the average of the peak. τ represents the threshold value of peak search, and peak detection is performed only when the point is greater than this threshold value.
Peak(x norm ) represents the peak detection function, and the maximum value of the local waveform is obtained. x norm represents the normalized data. N peak represents the number of peaks. The value of τ is set to 0.2 for wave peak detection. If N peak is equal to 0, ξ is assigned to 0. When ξ is greater than 0.5, it is judged to be a Hall signal. Otherwise, it is a magnetoelectric signal.

Signal Frequency Extraction
Frequency is a key global parameter of the signal, and it can determine the vehicle's speed information. Discrete Fourier transform (DFT) is used to extract the frequency domain features of the signal. The formula for the DFT is shown below: where N is the Fourier transform points, and k is the kth spectrum of the Fourier transform. X(k) represents the data after DFT transformation, and x(n) represents the actual signal sampled.
The larger the amplitude of k in the spectrum, the more frequencies corresponding to this k value are contained in the signal. However, the k value is not the actual signal's frequency, and the relationship between them is shown in Equation (4).
where k is the kth spectrum of the Fourier transform. f is the frequency of the actual signal. N f f t is the Fourier transform points. F s represents the sampling rate, which is the number of points of signal collected per second. As shown in Figure 5, the spectrum of magnetoelectric CKP signals and Hall CKP signals are analyzed using discrete Fourier transform (DFT). The oscilloscope is used to collect 1000 points within 0.1 s, so it can be concluded that the value of Fs is 10,000, and the point N f f t of the Fourier transform is 1000 HZ. In the spectrum, the amplitude is greatest when k is 100. Therefore, the frequency of the actual signal can be calculated as 1000 HZ.

Modeling Process
The CKP signal modeling process is detailed in Figure 6. The CKP signal is simulated according to the characteristic parameters. The frequency of the signal is set according to the fast Fourier transform. Firstly, load the CKP parameters file and initialize the characteristic parameters. Secondly, set and initialize global variables, including signal period T and duty cycle λ duty . Thirdly, the type of CKP signal is determined. If the K type ' value is 0, it is a magnetoelectric signal; otherwise, it is a Hall signal. Secondly, the multitooth waveform W multiteeth and the missing tooth waveform W missing are generated. The W multiteeth are generated by the sinusoidal waveform of N mul cycles. According to the number of missing teeth N mis , different types of missing tooth waves are generated, including missing tooth wave and no missing tooth wave W no_missing . Finally, the CKP signal waveform W CKP is offset upward.
The CMP signal modeling process is detailed in Figure 7. The CMP signal is simulated according to the characteristic parameters. Firstly, load the CMP parameters file and initialize the characteristic parameters. Secondly, set and initialize global variables, including signal period T and duty cycle λ duty . Thirdly, the length (L) of the horizontal line waveform W line between pulses based on µ, N pul , and other parameters is calculated. Fourthly, different types of pulse waveforms W pul are generated according to the value of parameter M type . When the M type ' value is 0, the pulse waveforms are generated by the sinusoidal waveform of N pul cycles. When the M type ' value is not 0, the pulse waveforms are generated by two opposite symmetrical square wave shapes. Fifthly, the position of the marked pulse waveform W mark_pulse is determined. Finally, the generated CMP signal waveform W CMP is offset upward.

Magnetoelectric CKP Signal Model
The magnetoelectric CKP signal can be divided into a missing teeth CKP waveform and no-missing-teeth CKP waveform according to the number of missing teeth. The magnetoelectric CKP signal can also be generally divided into two sections: The multitooth waveform and the missing tooth waveform. Usually, the waveform generated by the function is continuous, but the data sent to the data acquisition card are discrete. It is necessary to multiply the independent variable of the function by reciprocating the sampling rate to generate discrete waveforms at equal intervals. The ratio of the sampling rate F s to the frequency f is the number of points in a single period.

No-Missing-Teeth Two-Stage Modeling
The no-missing-teeth CKP signal comprises two sections: The multitooth signal and the marked tooth signal.
Stage 1: Multitooth Modeling. A sinusoidal waveform of N mul cycles generates the multitooth waveform, as shown in Equation (5): where y mk_zmp (x) represents the multitooth waveform of the no-missing-teeth signal. The independent variable x represents a sequence of sampling points. N mul f represents a sine wave with N mul periods.
Stage 2: Marked tooth Modeling. The two sinusoidal waveforms, the period of which is half of the sinusoidal waveform of the multitooth signal, generate the marked tooth signal, as shown in Equation (6): where y mar (x) represents the marked tooth waveform of the no-missing-teeth signal. (x − N mul f ) represents that the marked tooth waveform needs to be shifted to the right for the N mul period to be spliced behind the multitooth waveform. The mark tooth signal period is exactly a sinusoidal period in the multi-teeth signal, so the domain needs to add periodic sampling points.
The complete no-missing-teeth magnetoelectric CKP signal is shown in Figure 8.

Missing Teeth Six-Stage Modeling
The missing teeth CKP signal comprises six sections: The multitooth signal, the front sine part, the front circular arc part, the middle horizontal line part, the behind circular arc part, and the behind sine part. The last five components constitute the missing tooth waveform.
Stage 1: Multitooth modeling. This stage is the same as the first stage of the no-missingteeth CKP modeling.
where y mk_mp (x) represents the multitooth waveform of the missing teeth signal. The independent variable x represents a sequence of sampling points. N mul f represents a sine wave with N mul periods.
Stage 2: Front missing tooth sine modeling. For the front sinusoidal part of the missing teeth CKP signal, the sinusoidal waveform of s 1 times the period is generated according to Equation (8): where y f _sin (x) represents the front sinusoidal part of the missing teeth signal. The front sinusoidal part period is s 1 times period, so the domain needs to add s 1 times the periodic sampling points. Stage 3: Front missing tooth arc modeling. The sinusoidal part and arc part of the missing tooth waveform are s 1 times and s 2 times the sinusoidal function period, and then the remaining horizontal line part is s 3 , given as follows: The sinusoidal part and the horizontal line part of the missing teeth waveform are connected smoothly by the circular part. Suppose the radius of the circle is r, then the center coordinate of the circle is (r + s 1 f , b). The last value of the sine part is b.
where the independent variable of the last point of the sine part is s 1 f . After substituting b = Asin(2π f x), f is cancelled out: For the front arc part of the missing teeth CKP signal, the arc waveform of s 2 times the period is generated according to Equation (12): where y f _arc (x) represents the front arc part of the missing teeth signal. The first half of the missing teeth waveform is generated by Equations (8) and (12). In Figure 9, circle 1 in blue represents the sinusoidal portion, and circle 2 in red represents the arc portion.
Stage 4: Middle missing tooth line modeling. For the middle horizontal line of the missing teeth CKP signal, the horizontal line with s 3 times the period is generated according to Equation (13): where y m_line (x) represents the middle horizontal line of the missing teeth signal.
Stage 5: Behind missing tooth arc modeling. For the behind arc part of the missing teeth CKP signal, the center coordinate of the circle is ( s 1 f − r, −b). The circular arc waveform with s 2 times the period is generated according to Equation (14): where y b_arc (x) represents the behind arc part of the missing teeth signal. Stage 6: Behind missing tooth sine modeling. For the behind sinusoidal part of the missing teeth CKP signal, the sinusoidal waveform of s 1 times the period is generated according to Equation (15).
where y b_sin (x) represents the behind sinusoidal part of the missing teeth signal. The posterior part of the missing tooth waveform is generated by Equations (14) and (15). In Figure 10, circle 1 in red represents the arc portion, and circle 2 in blue represents the sinusoidal portion.  The complete missing teeth magnetoelectric CKP signal is shown in Figure 11. The whole part includes multitooth waveform and missing tooth waveform.

Hall CKP Signal Model
As shown in Figure 12, the Hall CKP signal can be generally divided into two sections: The multitooth waveform and the missing tooth waveform.
The function square(p) is defined as: where % is the modulo operation and λ duty is the duty ratio. Stage 1: Multitooth modeling. In the first stage of the Hall CKP signal, the square multitooth waveform part with N mul cycles is generated according to Equation (17).
where y hk_mmp (x) represents the square multitooth waveform. Stage 2: Missing teeth modeling. In the second stage of the Hall CKP signal, the square missing tooth waveform part with (N mis +1) cycles is generated according to Equation (18):

Magnetoelectric CMP Signal Model
The magnetoelectric CMP signal consists of three parts: A sinusoidal pulse waveform, horizontal line waveform, and sinusoidal marked pulse waveform.
Stage 1: Sine pulse modeling. The period of the sinusoidal pulse waveform in the CMP signal is µT; then, the sinusoidal pulse signal in the CMP waveform is generated according to Equation (19).
where y mm_sp (x) represents the sinusoidal pulse waveform. µ is the periodic multiples of the pulse signal. The modulo operation (%) ensures that the sinusoidal impulse is still a complete sine after being shifted by a certain unit. The meanings of other variables are shown in Table 2. Stage 2: Horizontal line modeling. The horizontal line waveform is generated according to Equation (20).
where y mm_hl (x) represents the horizontal line waveform. The length L of the horizontal line is calculated according to Equation (21): where N tot is the number of teeth of the gear. N rev is the number of revolutions of the crankshaft. Stage 3: Sinusoidal marked pulse modeling. One of the sinusoidal waveforms is the marked pulse waveform, and the interval length between the other sinusoidal waveforms is the same. The sinusoidal marked pulse waveform is generated according to Equation (22).
where y mm_mp (x) represents the sinusoidal marked pulse waveform. The complete magnetoelectric CMP signal is shown in Figure 13.

Hall CMP Signal Model
The Hall CMP signal consists of three parts: Rectangular pulse waveform, horizontal line waveform, and square marked pulse waveform.
Stage 1: Rectangular pulse Modeling. The front part of the rectangular pulse consists of a square wave with a duty ratio λ duty = 50%, the middle part consists of a square wave with a duty ratio λ duty = 100%, and the rear part consists of the front part turning 180°horizontally.

Signal Generator Software Development
According to the above modeling method, we designed a signal generator software. This software included four functional modules: The loading parameter file module, output channel selection module, rotating speed frequency modulation module, and simulation signal display module. The software can generate a variety of CKP and CMP signals so that the construction vehicle's ECU can be detected offline. To improve the software's extensibility, we designed the signal parameter editing page to meet the actual test requirements. The main interface of the signal generator software is shown in Figure 16. The CKP and CMP signals for different vehicle models are shown in Figure 17.

Simulation Experiment
The ECU excitation signal segment model with the above characteristic parameter configuration was realized by programming the previously mentioned computer software. The magnetoelectric CKP signal was taken as an example to generate the signal of the corresponding parameter configuration. In terms of the hardware circuit simulation, the HBs-EED method was selected to compare with the real vehicle signal. In relation to the virtual instrument simulation, the MSS-AS method was chosen to compare with the actual collected signal.
In Figure 18, the blue curve represents the actually collected CKP signal. The red curve represents the ESCP-SM simulation CKP signal. The actually collected CKP signal vibrated more, which was caused by the interference of other signals during the acquisition process. In Figure 19, the blue curve represents the actually collected CKP signal. The red curve represents the HBS-EED simulation CKP signal. In the HBS-EED simulation, the CKP signal vibration is large, and the signal amplitude fluctuates wildly. In Figure 20, the blue curve represents the actually collected CKP signal. The red curve represents the MSS-AS simulation CKP signal. The signal simulated by the MMS-AS method is simulated by the arcsine function at the missing tooth waveform, and the waveform is relatively steep. In Figure 21, the simulated signal of our proposed ESCP-SM method is most similar to the actually collected signal. The signal voltage simulated by the HBS-EED method is not stable. The signal simulated by the MMS-AS method is relatively steep in the missing tooth waveform, and can not be very close to the actual signal. To verify the parameter configuration model's accuracy, the Pearson similarity formula [36] was used to obtain the correlation coefficient, and the similarity between the simulation CKP signal and the actually collected CKP signal was analyzed. The similarity coefficient ρ X,Y can be calculated by Equation (26): where X and Y represent two groups of data, X represents the average value of the data of group X, and Y and represents the average value of the data of group Y. According to the Pearson correlation coefficient's value, we can estimate the degree of similarity between the two. By comparing the similarity between the ESCP-SM simulation CKP signals and the actual CKP signals, the final result was 0.74, which indicated a strong correlation. By comparing the similarity between the HBS-EED-simulated CKP signal and the actual CKP signal, the final result was 0.48. In the HBS-EED simulation, the CKP signal vibration is large due to the voltage instability of circuit components. The amplitude stabilizing circuit leads to difficulty in controlling the positive feedback, resulting in the amplitude of the sine wave fluctuating. Compared to the HBS-EED simulation method, our ESCP-SM simulation based on the modeling technique improved the accuracy by 26%. By comparing the similarity between the MSS-AS simulated CKP signal and actual CKP signal, the final result is 0.68. The MSS-AS method uses the arcsine function to generate the missing tooth waveform signal, which is relatively steep. Compared with the proposed ESCP-SM method, the signal accuracy is improved by 6%.
Since the environment of the engine test bench is difficult to build, we can only go to the real vehicle to collect signal data. The real vehicle data usually collected is easily affected by noise and uneven engine speed and other factors, resulting in a certain deviation of our simulated signal when compared. In fact, our simulated signal is much closer to the ideal signal, with an accuracy of more than 74%.
To verify that the simulation CKP signal's effective information was not lost, the actual CKP signals and simulation CKP signals were analyzed with a fast Fourier spectrum [37]. Observation of spectrum analysis shows that the software simulation signal's effective information is not lost, while the hardware simulation signal adds a redundant noise signal. The spectrum analysis diagram is shown in Figure 22.

Physical Experiment
The experimental environment was set up. The ESCP-SM was realized based on virtual instrument technology and provided an excitation signal for the ECU through the data acquisition (DAQ) card. The voltage-stabilized source supplied the ECU with power and the ignition switch signal. The experimental environment is shown in Figure 23.  Collecting the injection pulse signal output by the ECU with an oscilloscope can detect whether the ECU can recognize the simulated CKP and CMP signals. The ECU can recognize the signal normally and issue the injection instruction after the actual test. The injection waveform output of the ECU is shown in Figure 24. The PWM wave in the figure below is the injection duration.

Conclusions
This study analyzed the characteristic parameters of the ECU excitation signal, and a segmentation model of the ECU excitation signal based on characteristic parameters is proposed in this paper. The ESCP-SM is more dynamic and scalable, which leads to an improved complex excitation signal simulation. The experimental results show that the proposed ESCP-SM method is much better than the hardware simulation HBS-EED model in the similarity detection of signals collected from actual vehicle sensors. By the parameterized configuration, the diversity of signals is significantly increased.
The model can not only be applied to diesel vehicles but can also be extended to gasoline vehicles by adjusting the parameters. For part of the automotive camshaft signal, additional parameters of the proportional relationship between different protruding pulses are needed. For other excitation signals of ECUs, such as oxygen sensor signals, we need to add some additional uniform white noise signals to simulate actual sensor signals while adjusting characteristic parameters. Researchers in related fields can draw on the ideas of this model to develop corresponding simulation signals. First, the intrinsic characteristic parameters of the signals are extracted and abstracted, and then appropriate mathematical functions are used to piecemeal fit local signals. The accuracy of the simulation signal can be significantly improved by using this model.
When applied to the actual ECU test of engineering vehicles in the later stage, we need to burn the program into the development board and separately design the corresponding data acquisition card to reduce the test cost. The released open source code can help researchers in related fields to provide some ideas for reference when designing multi-type and complex parameter simulation signals. In future studies, we can further use more accurate characteristic parameters to simulate irregular signals.