Crankshaft and camshaft sensor signal generation method and system with customizable sampling point number
By adopting a signal generation method with customizable sampling points in the diesel engine ECU, the problem of signal simulation complexity and inconvenience in the prior art is solved, and flexible, universal and portable signal generation is achieved.
Patent Information
- Application Number
- CN202310064654.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-17
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2043-01-17
AI Technical Summary
In the prior art, when simulating crankshaft and camshaft sensor signals in diesel engine ECUs, the virtual instrument simulation method is complex and not portable, and the hardware circuit simulation method is complex and not universal, making it difficult to adapt to different types of signal waveforms.
The crankshaft camshaft sensor signal generation method with customizable sampling points is adopted. The upper computer loads the common parameters and EECU excitation signal configuration file, and the lower computer's MCU calculates the total sampling points and generates a signal. The FPGA performs clock domain synchronization processing, based on the DDS method Output.
It realizes the flexibility and universality of signal generation, reduces the configuration requirements of the upper computer and the complexity of the lower computer structure, and improves portability and applicability.
Smart Images

Figure CN116378840B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of diesel engine ECU signal generation, and in particular to a crankshaft camshaft sensor signal generation method and system capable of customizing the number of sampling points. Background Art
[0002] With the rapid development of infrastructure construction in my country, such as transportation and energy, engineering vehicles are playing an increasingly important role in construction and energy development. The electronic injection system of diesel engines in engineering vehicles consists of three parts: sensors, ECU (Electronic Control Unit, ECU) and actuators. The main function of ECU is to receive various sensor signals in the vehicle and analyze these signals. The analyzed instructions are transmitted to the corresponding actuators of the vehicle. The actuators are responsible for the execution of the instructions, among which the crankshaft and camshaft sensor signals are the most complex. The engine structures of different brands and models are different, and the corresponding crankshaft and camshaft signal disks are constructed differently, so the types of crankshaft and camshaft sensor signals received in ECU are also different.
[0003] The crankshaft and camshaft synchronization signals are a set of synchronization signals. The two can be used together to determine the current position of the automobile cylinder, so as to cooperate with the ECU to control the injector to inject fuel. Therefore, the simulation of the crankshaft and camshaft sensor synchronization signals can facilitate the functional debugging of the ECU. At present, there are two main simulation methods for crankshaft and camshaft signals on the market, namely virtual instrument simulation and hardware circuit simulation. In terms of virtual instrument simulation, the existing technology uses module encapsulation to define local unit signals, and uses graphical interface development tools to splice each part of the signal in sequence, which is simple to operate. However, the accuracy of the simulation signal depends on the defined local signal unit, and the scalability of the signal is also reduced due to the modular structure. When using virtual instrument simulation, the cache space and system requirements are high, and PC is mostly used as the host computer, which has poor portability; hardware circuit simulation refers to the use of circuits to directly generate analog signals. Different circuits are required for different waveforms. Therefore, different types of waveforms will be spliced together. Several circuits will be applied, so more circuit components will need to be applied, resulting in very complex hardware circuits, time-consuming and troublesome wiring, and it is not universal for the various types of crankshaft and camshaft signals in ECU. Summary of the invention
[0004] In view of this, the present invention provides a crankshaft and camshaft sensor signal generation method and system with customizable sampling points, which is used for crankshaft and camshaft sensor signal simulation in an engine electronic control unit. The configuration requirements of the upper computer used are low, and the lower computer used has a simple structure and simple wiring. The present invention has the characteristics of good portability and universality.
[0005] The technical solution adopted by the embodiment of the present invention to solve the technical problem is:
[0006] A crankshaft camshaft sensor signal generation method with customizable sampling point number, comprising:
[0007] Step S1, the host computer loads the common parameters and the EECU excitation signal characteristic parameters in the EECU excitation signal configuration file, and packages the EECU excitation signal characteristic parameters and the common parameters and sends them to the slave computer, wherein the EECU excitation signal characteristic parameters include crankshaft signal parameters and camshaft signal parameters;
[0008] Step S2, the lower computer receives the common parameters and the EECU excitation signal characteristic parameters;
[0009] Step S3: The MCU of the lower computer calculates the total number of sampling points N required to generate waveform data according to the common parameters. total , and the total number of sampling points N total Adding the common parameters;
[0010] Step S4, the MCU of the lower computer generates an EECU excitation signal based on the EECU excitation signal characteristic parameter and the common parameter, wherein the EECU excitation signal includes a crankshaft sensor signal and a camshaft sensor signal, and both the crankshaft sensor signal and the camshaft sensor signal are obtained by segmented simulation;
[0011] Step S5, the FPGA of the lower computer performs clock domain synchronization processing on the crankshaft sensor signal and the camshaft sensor signal in the EECU excitation signal, and outputs the EECU excitation signal after the synchronous clock domain processing to the DAC based on the DDS method.
[0012] Preferably, the common parameters include the maximum value V of the M-bit DAC max , DDS sampling rate F S , signal generation frequency F out , the size of the component storage space S used to store waveform signal data total 、Number of channels C n , each sampling point requires bit B, and step S3 includes:
[0013] Step S31, according to V max Calculate the phase accumulator bit number n and the total number of sampling points N total ,in:
[0014] N total =2 n
[0015] The phase accumulator bit number n is calculated using calculation method 1 or calculation method 2:
[0016] The first calculation method is based on the sampling rate F s and the signal generation frequency F out Calculate the independent variable M1, which represents the minimum number of points required to simulate a complete waveform in each channel, and n is a positive integer:
[0017]
[0018] log2M1-1 <n≤log2M1
[0019] The second calculation method is based on the resource size S total , the number of channels C n Each sampling point needs B bits to be calculated, and n is a positive integer:
[0020]
[0021] Step S32, adding the common parameters to the EECU excitation signal configuration file.
[0022] Preferably, the step S4 of generating the EECU excitation signal based on the EECU excitation signal configuration file comprises:
[0023] Step S41, according to the crankshaft signal parameters, the crankshaft sensor signal in the EECU excitation signal is simulated in sections, wherein the crankshaft signal parameters include the total number of crankshaft teeth G total 、Number of missing teeth on crankshaft G miss , crankshaft number of revolutions R, crankshaft signal type S crank , crankshaft signal inversion F crank , Crankshaft waveform Hall type missing tooth waveform segment indication signal L h , crankshaft waveform magnetoelectric missing tooth waveform segment indication signal L m ;
[0024] Step S42, simulating the camshaft sensor signal in the EECU excitation signal in sections according to the camshaft signal parameters in the EECU excitation signal configuration file;
[0025] The EECU excitation signal is a combination of the crankshaft sensor signal and the camshaft sensor signal.
[0026] Preferably, the step S41 of simulating the crankshaft sensor signal in the EECU excitation signal in sections includes:
[0027] Step S411, calculating the number of crankshaft waveform supplementary points according to the crankshaft signal parameters and the common parameters;
[0028] Step S412, performing a segmented simulation of the crankshaft sensor signal according to the number of crankshaft waveform filling points, wherein the segmented simulation of the crankshaft sensor signal includes a normal tooth waveform segment simulation and a missing tooth waveform segment simulation;
[0029] Step S413, performing crankshaft waveform splicing according to the segmented simulation result obtained in step S412 to obtain the crankshaft sensor signal;
[0030] The step S411 includes:
[0031] Step S411a, calculating the required number of crankshaft signal cycles T according to the crankshaft signal parameters and the common parameters total , the number of waveform data points N in each crankshaft cycle crank 、Number of normal tooth periods N normal , missing tooth period multiple T miss :
[0032] T total =G total ×R
[0033]
[0034] N normal =G total -G miss -1
[0035] T miss =G miss +1
[0036] Step S411b, calculating the number of crankshaft waveform supplementary points, where:
[0037] When the crankshaft sensor signal is a Hall signal type or a magnetoelectric missing tooth signal type, the crankshaft waveform supplementary point number includes P Q11 , P Q12 :
[0038] P lessy =N total -N crank ×T total
[0039]
[0040] P Q12 =P lessy -P Q11 ×R
[0041] Among them, the P Q11 is the number of points required to be filled after the normal tooth segment and the missing tooth segment are spliced. Q12is the number of points required to be filled after the entire crankshaft signal is spliced. When the crankshaft sensor signal is a Hall signal type or a magnetoelectric signal type with missing teeth, the number of sampling points for generating crankshaft waveform data is compared with N total The number of missing points is P lessy ;
[0042] When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, the crankshaft waveform supplementary point number includes P Q21 , P Q22 , P Q23 :
[0043]
[0044]
[0045]
[0046] P Q23 =P lessn -(P Q21 ×N normal +P Q22 )×R
[0047] Among them, the P Q21 is the number of points to be filled after each normal tooth cycle, the P Q22 is the number of points to be filled after the missing tooth segment, the P Q23 is the number of points required to be filled after the entire crankshaft signal is spliced. When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, the number of sampling points for generating crankshaft waveform data is compared with N total The number of missing points is P lessn ;
[0048] The step S412 includes:
[0049] Step S412a, performing normal tooth waveform segment simulation to obtain a crankshaft normal tooth waveform signal, wherein:
[0050] When the crankshaft sensor signal is a Hall signal type, that is, S crank =0, using the M-bit DAC maximum value V max The normal tooth waveform segment is simulated with the minimum digital input value 0 to generate a Hall type crankshaft normal tooth waveform signal normalWave1Squ(x), the space size of the signal normalWave1Squ(x) is N crank ×N normal The value range of the independent variable x in the signal normalWave1Squ(x) is [0, N crank ×N normal], the signal normalWave1Squ(x) is composed of N normal The number of sampling points is N crank square wave, when F crank = 0,
[0051]
[0052] When F crank =1,
[0053]
[0054] When the crankshaft sensor signal is a magnetoelectric missing tooth signal type, that is, S crank =1 and L m = 0, a sine waveform is used to simulate the normal tooth waveform segment to generate a magnetoelectric normal tooth crankshaft signal normalWave21Sin(x), the spatial size of the signal normalWave21Sin(x) is N crank ×N normal The value range of the independent variable x in the signal normalWave21Sin(x) is [0, N crank ×N normal ]; when F crank = 0, the signal normalWave21Sin(x) is composed of N normal The total number of points is N crank The sine wave sin1 is composed of a sine wave with the first half opening downward and the second half opening upward; when F crank =1, the signal normalWave21Sin(x) is composed of N normal The total number of points is N crank The sine wave sin2 is composed of the sine wave sin1, wherein the sine wave sin2 is obtained by shifting the phase of the sine wave sin1 by 180°;
[0055] normalWave21Sin(x)=sin1,x∈[0,N crank ×N normal ]
[0056] normalWave21Sin(x)=sin2,x∈[0,N crank ×N normal ]
[0057] When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, that is, S crank =1 and L m= 0, a sine wave is used to simulate the normal tooth waveform segment to generate a magnetoelectric normal tooth crankshaft signal normalWave22Sin(x), the spatial size of the signal normalWave22Sin(x) is (N crank +P Q21 )×N normal The value range of the independent variable x in the signal normalWave22Sin(x) is [0, (N crank +P Q21 )×N normal ]; when F crank = 0, the signal normalWave22Sin(x) is composed of N normal The total number of points is N crank +P Q21 The waveform sinWaveCrank1 is composed of the sine wave sin1 and P Q21 Value V max / 2 Composition:
[0058]
[0059] When F crank =1, the signal normalWave22Sin(x) is composed of N normal The total number of points is N crank +P Q21 The waveform sinWaveCrank2 is composed of the sine wave sin2 and P Q21 Value V max / 2 Composition:
[0060]
[0061] Step S412b, performing a missing tooth waveform segment simulation to obtain a crankshaft missing tooth waveform signal, wherein:
[0062] When the crankshaft sensor signal is a Hall signal type, the value V is used max The missing tooth part is simulated with the minimum digital input value 0 to generate a Hall type missing tooth crankshaft signal quechiHall(x), the spatial size of the signal quechiHall(x) is N crank ×T miss +P Q11 The value range of the independent variable x in the signal quechiHall(x) is [0, N crank ×T miss +P Q11 ]:
[0063]
[0064] When the crankshaft sensor signal is a magnetoelectric missing tooth signal type, a sine wave and the value V max / 2 pairs of missing teeth are simulated to generate a magnetoelectric missing tooth crankshaft signal quechiMagnetic1(x), the spatial size of the signal quechiMagnetic1(x) is N crank ×T miss +P Q11 The value range of the independent variable x in the signal quechiMagnetic1(x) is [0, N crank ×T miss +P Q11 ], where the period length is N crank The sine wave at N crank -N crank / 2 position is split to obtain the left half sine wave and the right half sine wave; when F crank = 0, the signal quechiMagnetic1(x) is composed of the left half sine wave sinLeftCrank1, the right half sine wave sinRightCrank1 and the value V max / 2, the left half sine wave sinLeftCrank1 and the right half sine wave sinRightCrank1 are obtained by splitting the sine wave sin1, and the space size of the left half sine wave sinLeftCrank1 is N crank -N crank / 2, the spatial size of the right half sine wave sinRightCrank1 is N crank / 2:
[0065]
[0066] When F crank =1, the signal quechiMagnetic1(x) is composed of the left half sine wave sinLeftCrank2, the right half sine wave sinRightCrank2 and the value V max / 2, the left half sine wave sinLeftCrank2 and the right half sine wave sinRightCrank2 are obtained by splitting the sine wave sin2, and the space size of the left half sine wave sinLeftCrank2 is N crank / 2, the spatial size of the right half sine wave sinRightCrank2 is N crank -N crank / 2:
[0067]
[0068] When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, a sine wave and the value V max / 2 pairs of missing teeth are simulated to generate a magnetoelectric missing tooth crankshaft signal quechiMagnetic2(x), the spatial size of the signal quechiMagnetic2(x) is N crank / 2*2+P Q22 The value range of the independent variable x in the signal quechiMagnetic2(x) is [0, N crank / 2*2+P Q22 ]; when F crank = 0, the signal quechiMagnetic2(x) is composed of two sine waves sinWaveCrank_Half and P Q22 Value V max / 2, the spatial size of the sine wave sinWaveCrank_Half is N crank / 2, the frequency is twice that of sin1, and the value range of the independent variable x in the sine wave sinWaveCrank_Half is [0,N crank / 2*2]:
[0069]
[0070] When F crank =1, the signal quechiMagnetic2(x) is composed of two sine waves sinWaveCrank_Half_ant and P Q22 Value V max / 2, the spatial size of the sine wave sinWaveCrank_Half_ant is N crank / 2, the frequency is twice that of sin2, and the value range of the independent variable x in the sine wave sinWaveCrank_Half is [0,N crank / 2*2]:
[0071]
[0072] The step S413 includes:
[0073] When the crankshaft sensor signal is of Hall type, the Hall type normal tooth crankshaft signal normalWave1Squ(x) and the Hall type missing tooth crankshaft signal quechiHall(x) are spliced to obtain a Hall type crankshaft signal crankHallSec, and R crankHallSec signals are spliced in sequence and the number of supplementary points P is added at the end. Q12, get the crankshaft sensor signal crankHall of Hall signal type, where R is the number of crankshaft turns, P Q12 The value is the minimum DAC input value 0;
[0074] When the crankshaft sensor signal is a magnetoelectric missing tooth signal type, the magnetoelectric normal tooth crankshaft signal normalWave21Sin(x) and the magnetoelectric missing tooth crankshaft signal quechiMagnetic1(x) are spliced to obtain a magnetoelectric crankshaft signal crankMagneticSec1, and R of the signals crankMagneticSec1 are spliced in sequence and the number of fill points P is added at the end. Q12 , get the crankshaft sensor signal crankMagnetic1 of the magnetoelectric type with missing teeth, where P 12 The value is the middle value of the DAC input value
[0075] When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, the magnetoelectric normal tooth crankshaft signal normalWave22Sin(x) and the magnetoelectric missing tooth crankshaft signal quechiMagnetic2(x) are spliced to obtain a magnetoelectric crankshaft signal crankMagneticSec2, and R of the crankMagneticSec2 signals are spliced in sequence and the number of fill points P is added at the end. 23 , and obtain the crankshaft sensor signal crankMagnetic2 of the magnetoelectric type without missing teeth.
[0076] Preferably, the camshaft signal parameters include the period μ of a camshaft protrusion, the starting offset S offset , Gear Position I num , Gear distance I dis 、Number of camshaft lobed pulses B cam The step S42 of simulating the camshaft sensor signal in the EECU excitation signal in sections includes:
[0077] Step S421, calculating the number of camshaft waveform supplement points according to the camshaft signal parameters and the common parameters;
[0078] Step S422, simulating the camshaft sensor signal in sections;
[0079] Step S423, performing camshaft waveform splicing according to the segmented simulation result obtained in step S422 to obtain the camshaft sensor signal;
[0080] The step S421 includes:
[0081] Step S421a, calculating the number of waveform data points N in each cycle of the camshaft according to the camshaft signal parameters and the common parameters cam 、N is the general segment cycle number sec , the number of complete general waveform segments on the left side of the camshaft tooth position I left , the number of complete general waveform segments on the right side of the camshaft tooth position I right ;
[0082]
[0083]
[0084]
[0085]
[0086] Step S421b, calculating the number of camshaft waveform supplement points, the number of camshaft waveform supplement points includes P 11 , P 22 ,in:
[0087] P less2 =N total -N cam ×T total
[0088]
[0089] P 22 =P less2 -P 11 *(B cam -1)
[0090] Among them, the number of supplementary points P 11 is the number of points to be filled after the initial offset segment and the general segment. 22 is the number of points to be filled after the gear shaping stage, and the number of sampling points for generating the camshaft waveform data is compared with the N total The number of missing points is P less2 ;
[0091] Let T cam1 =μ, T cam21 =N sec -S offset -T cam1 , T cam22 =S offset , T cam3 =N sec -T cam1 , T cam4 =N sec -2×T cam1 -Tcam5 , T cam5 =I dis , the step S422 comprises:
[0092] Step S422a, performing a start offset segment simulation to obtain a first camshaft start offset segment waveform signal and a second camshaft start offset segment waveform signal, wherein:
[0093] When the camshaft sensor signal is of Hall type, the square wave squCam and the minimum digital input value 0 are used to simulate the starting offset segment, and the Hall type first camshaft starting offset segment waveform signal startOffsetWave11(x) and the Hall type second camshaft starting offset segment waveform signal startOffsetWave12(x) are obtained, wherein the period of the square wave squCam is μ, the duty cycle is 50%, and the first half is V max , the second half takes a value of 0, and the spatial size of the signal startOffsetWave11(x) is N cam ×(N sec -S offset )+P 11 The value range of the independent variable x in the signal startOffsetWave11(x) is [0, N cam ×(N sec -S offset )+P 11 ]:
[0094]
[0095] The spatial size of the signal startOffsetWave12(x) is S offset The value range of the independent variable x in the signal startOffsetWave12(x) is [0, S offset ]:
[0096] startOffsetWave12(x)=0,x∈[0,S offset ]
[0097] When the camshaft sensor signal is a magnetoelectric signal, the intermediate value V of the DAC digital input value is used. max / 2 and a sine wave sinCam with a period of μ to simulate the starting offset segment, and obtain the magnetoelectric first camshaft starting offset segment waveform signal startOffsetWave21(x) and the magnetoelectric second camshaft starting offset segment waveform signal startOffsetWave22(x), wherein the spatial size of the signal startOffsetWave21(x) is Ncam *(N sec -S offset )+P 11 The value range of the independent variable x in the signal startOffsetWave21(x) is [0, N cam *(N sec -S offset )+P 11 ]:
[0098]
[0099] The spatial size of the signal startOffsetWave22(x) is S offset The value range of the independent variable x in the signal startOffsetWave22(x) is [0, S offset ]:
[0100]
[0101] Step S422b, perform general segment simulation to obtain a general segment waveform signal of the camshaft, wherein:
[0102] When the camshaft sensor signal is a Hall-type signal, a square wave squCam and the minimum digital input value 0 are used to perform a general segment simulation to obtain a Hall-type camshaft general segment waveform signal normalWave1(x), wherein the spatial size of the signal normalWave1(x) is N cam *N sec +P 11 The value range of the independent variable x in the signal normalWave1(x) is [0,N cam *N sec +P 11 ]:
[0103]
[0104] When the camshaft sensor signal is a magnetoelectric signal, the intermediate value V of the DAC digital input value is used. max / 2 and the sine wave sinCam are used to perform a general segment simulation to obtain a general segment waveform signal normalWave2(x) of the magnetoelectric camshaft. The spatial size of the signal normalWave2(x) is N cam *N sec +P 11 The value range of the independent variable x in the signal normalWave2(x) is [0, N cam *N sec +P 11 ]:
[0105]
[0106] Step S422c, perform gear shaping segment simulation to obtain a camshaft gear shaping segment waveform signal, wherein:
[0107] When the camshaft sensor signal is a Hall signal type, the square wave squCam and the minimum digital input value 0 are used to simulate the gear segment to obtain a Hall camshaft gear segment waveform signal InsertWave1(x). The spatial size of the signal InsertWave1(x) is N. cam *N sec +P 22 , the value range of the independent variable x in the signal InsertWave1(x) is [0, N cam *N sec +P 22 ]:
[0108]
[0109] When the camshaft sensor signal is a magnetoelectric signal, the intermediate value V of the DAC digital input value is used. max / 2 and the sine wave sinCam are used to simulate the gear segment, and the magnetoelectric camshaft gear segment waveform signal InsertWave2(x) is obtained, wherein the spatial size of the signal InsertWave2(x) is N cam *N sec +P 22 The value range of the independent variable x in the signal InsertWave2(x) is [0, N cam *N sec +P 22 ]:
[0110]
[0111] The step S423 includes:
[0112] When the type of the camshaft sensor signal is a Hall type signal type, the Hall type first camshaft starting offset waveform signal startOffsetWave11(x), I left The Hall camshaft normal waveform signal normalWave1(x), the Hall camshaft insert gear waveform signal InsertWave1(x), I rightThe Hall type camshaft normal waveform signal normalWave1(x) and the Hall type second camshaft starting offset waveform signal startOffsetWave12(x) are used to obtain a camshaft sensor signal camHall of the Hall type signal type;
[0113] When the type of the camshaft sensor signal is a magnetoelectric signal type, the magnetoelectric first camshaft starting offset waveform signal startOffsetWave21(x), I left The normal waveform signal of the magnetoelectric camshaft normalWave2(x), the inserting gear waveform signal of the magnetoelectric camshaft InsertWave2(x), I right The normal waveform signal normalWave2(x) of the magnetoelectric camshaft and the start offset waveform signal startOffsetWave22(x) of the magnetoelectric second camshaft are used to obtain a camshaft sensor signal camMagnetic of a magnetoelectric signal type.
[0114] The present invention also provides a crankshaft camshaft sensor signal generating system with a customizable sampling point number, comprising:
[0115] The upper computer is used to load the common parameters and the EECU excitation signal characteristic parameters in the EECU excitation signal configuration file, and package the EECU excitation signal characteristic parameters and the common parameters and send them to the lower computer, wherein the EECU excitation signal characteristic parameters include crankshaft signal parameters and camshaft signal parameters;
[0116] The lower computer is used to receive the common parameters and the EECU excitation signal characteristic parameters;
[0117] The MCU of the lower computer is used to calculate the total number of sampling points N required to generate waveform data according to the common parameters. total , and the total number of sampling points N total Adding the common parameters;
[0118] The MCU of the lower computer is used to generate an EECU excitation signal based on the EECU excitation signal characteristic parameter and the common parameter, wherein the EECU excitation signal includes a crankshaft sensor signal and a camshaft sensor signal, and both the crankshaft sensor signal and the camshaft sensor signal are obtained by segmented simulation;
[0119] The FPGA of the lower computer is used to perform clock domain synchronization processing on the crankshaft sensor signal and the camshaft sensor signal in the EECU excitation signal, and output the EECU excitation signal after the synchronous clock domain processing to the DAC based on the DDS method.
[0120] Preferably, the common parameters include the maximum value V of the M-bit DAC max , DDS sampling rate F S , signal generation frequency F out , the size of the component storage space S used to store waveform signal data total 、Number of channels C n Each sampling point requires bit B, and the MCU of the lower computer includes:
[0121] Calculation module for V max Calculate the phase accumulator bit number n and the total number of sampling points N total ,in:
[0122] N total =2 n
[0123] The phase accumulator bit number n is calculated using calculation method 1 or calculation method 2:
[0124] The first calculation method is based on the sampling rate F s and the signal generation frequency F out Calculate the independent variable M1, which represents the minimum number of points required to simulate a complete waveform in each channel, and n is a positive integer:
[0125]
[0126] log2M1-1 <n≤log2M1
[0127] The second calculation method is based on the resource size S total , the number of channels C n Each sampling point needs B bits to be calculated, and n is a positive integer:
[0128]
[0129] An adding module is used to add the common parameters to the EECU excitation signal configuration file.
[0130] Preferably, the MCU of the lower computer also includes:
[0131] The crankshaft sensor signal generation module is used to simulate the crankshaft sensor signal in the EECU excitation signal in sections according to the crankshaft signal parameters in the EECU excitation signal configuration file, wherein the crankshaft signal parameters include the total number of crankshaft teeth G total 、Number of missing teeth on crankshaft G miss , crankshaft number of revolutions R, crankshaft signal type S crank , crankshaft signal inversion F crank, Crankshaft waveform Hall type missing tooth waveform segment indication signal L h , crankshaft waveform magnetoelectric missing tooth waveform segment indication signal L m ;
[0132] A camshaft sensor signal generating module, used for simulating the camshaft sensor signal in the EECU excitation signal in sections according to the camshaft signal parameters in the EECU excitation signal configuration file;
[0133] The EECU excitation signal is a combination of the crankshaft sensor signal and the camshaft sensor signal.
[0134] Preferably, the crankshaft sensor signal generating module comprises:
[0135] A crankshaft waveform supplementary point number calculation unit, used to calculate the crankshaft waveform supplementary point number according to the crankshaft signal parameter and the common parameter;
[0136] A crankshaft sensor signal segmented simulation unit, used for performing segmented simulation of the crankshaft sensor signal according to the crankshaft waveform filling point number, wherein the segmented simulation of the crankshaft sensor signal includes a normal tooth waveform segment simulation and a missing tooth waveform segment simulation;
[0137] A crankshaft sensor signal splicing unit, used for splicing crankshaft waveforms according to the segmented simulation results to obtain the crankshaft sensor signal;
[0138] Crankshaft waveform supplementary point calculation unit:
[0139] According to the crankshaft signal parameters and the common parameters, the required number of cycles T of the crankshaft signal is calculated. total , the number of waveform data points N in each crankshaft cycle crank 、Number of normal tooth periods N normal , missing tooth period multiple T miss :
[0140] T total =G total ×R
[0141]
[0142] N normal =G total -G miss -1
[0143] T miss =G miss +1
[0144] Calculate the number of crankshaft waveform supplementary points, where:
[0145] When the crankshaft sensor signal is a Hall signal type or a magnetoelectric missing tooth signal type, the crankshaft waveform supplementary point number includes P Q11 , P Q12 :
[0146] P lessy =N total -N crank ×T total
[0147]
[0148] P Q12 =P lessy -P Q11 ×R
[0149] Among them, the P Q11 is the number of points required to be filled after the normal tooth segment and the missing tooth segment are spliced. Q12 is the number of points required to be filled after the entire crankshaft signal is spliced. When the crankshaft sensor signal is a Hall signal type or a magnetoelectric signal type with missing teeth, the number of sampling points for generating crankshaft waveform data is compared with N total The number of missing points is P lessy ;
[0150] When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, the crankshaft waveform supplementary point number includes P Q21 , P Q22 , P Q23 :
[0151]
[0152]
[0153]
[0154] P Q23 =P lessn -(P Q21 ×N normal +P Q22 )×R
[0155] Among them, the P Q21 is the number of points to be filled after each normal tooth cycle, the P Q22 is the number of points to be filled after the missing tooth segment, the P Q23 is the number of points required to be filled after the entire crankshaft signal is spliced. When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, the number of sampling points for generating crankshaft waveform data is compared with N total The number of missing points is P lessn ;
[0156] The crankshaft sensor signal segment simulation unit includes a normal tooth waveform segment simulation unit and a missing tooth waveform segment simulation unit, wherein:
[0157] The normal tooth waveform segment simulation unit is used to simulate the normal tooth waveform segment to obtain the crankshaft normal tooth waveform signal, wherein:
[0158] When the crankshaft sensor signal is a Hall signal type, that is, S crank =0, using the M-bit DAC maximum value V max The normal tooth waveform segment is simulated with the minimum digital input value 0 to generate a Hall type crankshaft normal tooth waveform signal normalWave1Squ(x), the space size of the signal normalWave1Squ(x) is N crank ×N normal The value range of the independent variable x in the signal normalWave1Squ(x) is [0, N crank ×N normal ], the signal normalWave1Squ(x) is composed of N normal The number of sampling points is N crank square wave, when F crank = 0,
[0159]
[0160] When F crank =1,
[0161]
[0162] When the crankshaft sensor signal is a magnetoelectric missing tooth signal type, that is, S crank =1 and L m = 0, a sine waveform is used to simulate the normal tooth waveform segment to generate a magnetoelectric normal tooth crankshaft signal normalWave21Sin(x), the spatial size of the signal normalWave21Sin(x) is N crank ×N normal The value range of the independent variable x in the signal normalWave21Sin(x) is [0, N crank ×N normal ]; when F crank = 0, the signal normalWave21Sin(x) is composed of N normal The total number of points is N crank The sine wave sin1 is composed of a sine wave with the first half opening downward and the second half opening upward; when F crank =1, the signal normalWave21Sin(x) is composed of Nnormal The total number of points is N crank The sine wave sin2 is composed of the sine wave sin1, wherein the sine wave sin2 is obtained by shifting the phase of the sine wave sin1 by 180°;
[0163] normalWave21Sin(x)=sin1,x∈[0,N crank ×N normal ]
[0164] normalWave21Sin(x)=sin2,x∈[0,N crank ×N normal ]
[0165] When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, that is, S crank =1 and L m = 0, a sine wave is used to simulate the normal tooth waveform segment to generate a magnetoelectric normal tooth crankshaft signal normalWave22Sin(x), the spatial size of the signal normalWave22Sin(x) is (N crank +P Q21 )×N normal The value range of the independent variable x in the signal normalWave22Sin(x) is [0, (N crank +P Q21 )×N normal ]; when F crank = 0, the signal normalWave22Sin(x) is composed of N normal The total number of points is N crank +P Q21 The waveform sinWaveCrank1 is composed of the sine wave sin1 and P Q21 Value V max / 2 Composition:
[0166]
[0167] When F crank =1, the signal normalWave22Sin(x) is composed of N normal The total number of points is N crank +P Q21 The waveform sinWaveCrank2 is composed of the sine wave sin2 and P Q21 Value V max / 2 Composition:
[0168]
[0169] The missing tooth waveform segment simulation unit is used to simulate the missing tooth waveform segment to obtain a crankshaft missing tooth waveform signal, wherein:
[0170] When the crankshaft sensor signal is a Hall signal type, the value V is used max The missing tooth part is simulated with the minimum digital input value 0 to generate a Hall type missing tooth crankshaft signal quechiHall(x), the spatial size of the signal quechiHall(x) is N crank ×T miss +P Q11 The value range of the independent variable x in the signal quechiHall(x) is [0, N crank ×T miss +P Q11 ]:
[0171]
[0172] When the crankshaft sensor signal is a magnetoelectric missing tooth signal type, a sine wave and the value V max / 2 pairs of missing teeth are simulated to generate a magnetoelectric missing tooth crankshaft signal quechiMagnetic1(x), the spatial size of the signal quechiMagnetic1(x) is N crank ×T miss +P Q11 The value range of the independent variable x in the signal quechiMagnetic1(x) is [0, N crank ×T miss +P Q11 ], where the period length is N crank The sine wave at N crank -N crank / 2 position is split to obtain the left half sine wave and the right half sine wave; when F crank = 0, the signal quechiMagnetic1(x) is composed of the left half sine wave sinLeftCrank1, the right half sine wave sinRightCrank1 and the value V max / 2, the left half sine wave sinLeftCrank1 and the right half sine wave sinRightCrank1 are obtained by splitting the sine wave sin1, and the space size of the left half sine wave sinLeftCrank1 is N crank -N crank / 2, the spatial size of the right half sine wave sinRightCrank1 is N crank / 2:
[0173]
[0174] When F crank =1, the signal quechiMagnetic1(x) is composed of the left half sine wave sinLeftCrank2, the right half sine wave sinRightCrank2 and the value V max / 2, the left half sine wave sinLeftCrank2 and the right half sine wave sinRightCrank2 are obtained by splitting the sine wave sin2, and the space size of the left half sine wave sinLeftCrank2 is N crank / 2, the spatial size of the right half sine wave sinRightCrank2 is N crank -N crank / 2:
[0175]
[0176] When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, a sine wave and the value V max / 2 pairs of missing teeth are simulated to generate a magnetoelectric missing tooth crankshaft signal quechiMagnetic2(x), the spatial size of the signal quechiMagnetic2(x) is N crank / 2*2+P Q22 The value range of the independent variable x in the signal quechiMagnetic2(x) is [0, N crank / 2*2+P Q22 ]; when F crank = 0, the signal quechiMagnetic2(x) is composed of two sine waves sinWaveCrank_Half and P Q22 Value V max / 2, the spatial size of the sine wave sinWaveCrank_Half is N crank / 2, the frequency is twice that of sin1, and the value range of the independent variable x in the sine wave sinWaveCrank_Half is [0,N crank / 2*2]:
[0177]
[0178] When F crank =1, the signal quechiMagnetic2(x) is composed of two sine waves sinWaveCrank_Half_ant and P Q22 Value V max / 2, the spatial size of the sine wave sinWaveCrank_Half_ant is N crank / 2, the frequency is twice that of sin1, and the value range of the independent variable x in the sine wave sinWaveCrank_Half is [0,N crank / 2*2]:
[0179]
[0180] The crankshaft sensor signal splicing unit comprises:
[0181] When the crankshaft sensor signal is of Hall type, the Hall type normal tooth crankshaft signal normalWave1Squ(x) and the Hall type missing tooth crankshaft signal quechiHall(x) are spliced to obtain a Hall type crankshaft signal crankHallSec, and R crankHallSec signals are spliced in sequence and the number of supplementary points P is added at the end. Q12 , get the crankshaft sensor signal crankHall of Hall signal type, where R is the number of crankshaft turns, P Q12 The value is the minimum DAC input value 0;
[0182] The Hall type crankshaft signal splicing unit, when the crankshaft sensor signal is a magnetoelectric missing tooth signal type, splices the magnetoelectric normal tooth crankshaft signal normalWave21Sin(x) and the magnetoelectric missing tooth crankshaft signal quechiMagnetic1(x) to obtain a magnetoelectric crankshaft signal crankMagneticSec1, splices R of the signals crankMagneticSec1 in sequence and adds the number of fill points P at the end Q12 , get the crankshaft sensor signal crankMagnetic1 of the magnetoelectric type with missing teeth, where P 12 The value is the middle value of the DAC input value
[0183] The magnetoelectric crankshaft signal splicing unit, when the crankshaft sensor signal is a magnetoelectric signal type without missing teeth, splices the magnetoelectric normal tooth crankshaft signal normalWave22Sin(x) and the magnetoelectric missing tooth crankshaft signal quechiMagnetic2(x) to obtain a magnetoelectric crankshaft signal crankMagneticSec2, splices R of the signals crankMagneticSec2 in sequence and adds the number of fill points P at the end 23 , and obtain the crankshaft sensor signal crankMagnetic2 of the magnetoelectric type without missing teeth.
[0184] Preferably, the camshaft signal parameters include the period μ of a camshaft protrusion, the starting offset S offset, Gear Position I num , Gear distance I dis 、Number of camshaft lobed pulses B cam , the camshaft signal parameter generating module comprises:
[0185] A camshaft waveform supplement point number calculation unit, used to calculate the camshaft waveform supplement point number according to the camshaft signal parameters and the common parameters;
[0186] A camshaft sensor signal segmented simulation unit, used for segmented simulation of the camshaft sensor signal;
[0187] A camshaft sensor signal splicing unit, used for splicing camshaft waveforms to obtain the camshaft sensor signal;
[0188] The camshaft waveform supplementary point number calculation unit:
[0189] According to the camshaft signal parameters and the common parameters, the number of waveform data points N in each cycle of the camshaft is calculated. cam 、N is the general segment cycle number sec , the number of complete general waveform segments on the left side of the camshaft tooth position I left , the number of complete general waveform segments on the right side of the camshaft tooth position I right ;
[0190]
[0191]
[0192]
[0193]
[0194] Calculate the number of camshaft waveform supplement points, which includes P 11 , P 22 ,in:
[0195] P less2 =N total -N cam ×T total
[0196]
[0197] P 22 =P less2 -P 11 *(B cam -1)
[0198] Among them, the number of supplementary points P 11is the number of points to be filled after the initial offset segment and the general segment. 22 is the number of points to be filled after the gear shaping stage, and the number of sampling points for generating the camshaft waveform data is compared with the N total The number of missing points is P less2 ;
[0199] Let T cam1 =μ, T cam21 =N sec -S offset -T cam1 , T cam22 =S offset , T cam3 =N sec -T cam1 , T cam4 =N sec -2×T cam1 -T cam5 , T cam5 =I dis The camshaft sensor signal segment simulation unit includes a starting offset segment simulation unit, a general segment simulation unit and a gear insertion segment simulation unit, wherein:
[0200] The starting offset segment simulation unit is used to perform starting offset segment simulation to obtain a first camshaft starting offset segment waveform signal and a second camshaft starting offset segment waveform signal, wherein:
[0201] When the camshaft sensor signal is of Hall type, the square wave squCam and the minimum digital input value 0 are used to simulate the starting offset segment, and the Hall type first camshaft starting offset segment waveform signal startOffsetWave11(x) and the Hall type second camshaft starting offset segment waveform signal startOffsetWave12(x) are obtained, wherein the period of the square wave squCam is μ, the duty cycle is 50%, and the first half is V max , the second half takes a value of 0, and the spatial size of the signal startOffsetWave11(x) is N cam *(N sec -S offset )+P 11 The value range of the independent variable x in the signal startOffsetWave11(x) is [0, N cam *(N sec -S offset )+P 11 ]:
[0202]
[0203] The spatial size of the signal startOffsetWave12(x) is S offset The value range of the independent variable x in the signal startOffsetWave12(x) is [0, S offset ]:
[0204] startOffsetWave12(x)=0,x∈[0,S offset ]
[0205] When the camshaft sensor signal is a magnetoelectric signal, the intermediate value V of the DAC digital input value is used. max / 2 and a sine wave sinCam with a period of μ to simulate the starting offset segment, and obtain the magnetoelectric first camshaft starting offset segment waveform signal startOffsetWave21(x) and the magnetoelectric second camshaft starting offset segment waveform signal startOffsetWave22(x), wherein the spatial size of the signal startOffsetWave21(x) is N cam *(N sec -S offset )+P 11 The value range of the independent variable x in the signal startOffsetWave21(x) is [0, N cam *(N sec -S offset )+P 11 ]:
[0206]
[0207] The spatial size of the signal startOffsetWave22(x) is S offset The value range of the independent variable x in the signal startOffsetWave22(x) is [0, S offset ]:
[0208]
[0209] The general segment simulation unit is used to perform general segment simulation to obtain a general segment waveform signal of the camshaft, wherein:
[0210] When the camshaft sensor signal is a Hall-type signal, a square wave squCam and the minimum digital input value 0 are used to perform a general segment simulation to obtain a Hall-type camshaft general segment waveform signal normalWave1(x), wherein the spatial size of the signal normalWave1(x) is N cam *N sec +P 11The value range of the independent variable x in the signal normalWave1(x) is [0,N cam *N sec +P 11 ]:
[0211]
[0212] When the camshaft sensor signal is a magnetoelectric signal, the intermediate value V of the DAC digital input value is used. max / 2 and the sine wave sinCam are used to perform a general segment simulation to obtain a general segment waveform signal normalWave2(x) of the magnetoelectric camshaft. The spatial size of the signal normalWave2(x) is N cam *N sec +P 11 The value range of the independent variable x in the signal normalWave2(x) is [0, N cam *N sec +P 11 ]:
[0213]
[0214] The gear-shaping segment simulation unit is used to perform gear-shaping segment simulation to obtain a camshaft gear-shaping segment waveform signal, wherein:
[0215] When the camshaft sensor signal is a Hall signal type, the square wave squCam and the minimum digital input value 0 are used to simulate the gear segment to obtain a Hall camshaft gear segment waveform signal InsertWave1(x). The spatial size of the signal InsertWave1(x) is N. cam *N sec +P 22 , the value range of the independent variable x in the signal InsertWave1(x) is [0, N cam *N sec +P 22 ]:
[0216]
[0217] When the camshaft sensor signal is a magnetoelectric signal, the intermediate value V of the DAC digital input value is used. max / 2 and the sine wave sinCam are used to simulate the gear segment, and the magnetoelectric camshaft gear segment waveform signal InsertWave2(x) is obtained, wherein the spatial size of the signal InsertWave2(x) is N cam *N sec +P 22The value range of the independent variable x in the signal InsertWave2(x) is [0, N cam *N sec +P 22 ]:
[0218]
[0219] The camshaft sensor signal splicing unit comprises:
[0220] The Hall-type camshaft signal splicing unit, when the type of the camshaft sensor signal is a Hall-type signal type, sequentially splices the Hall-type first camshaft starting offset waveform signal startOffsetWave11(x), I left The Hall camshaft normal waveform signal normalWave1(x), the Hall camshaft insert gear waveform signal InsertWave1(x), I right The Hall type camshaft normal waveform signal normalWave1(x) and the Hall type second camshaft starting offset waveform signal startOffsetWave12(x) are used to obtain a camshaft sensor signal camHall of the Hall type signal type;
[0221] The magnetoelectric camshaft signal splicing unit, when the type of the camshaft sensor signal is a magnetoelectric signal type, sequentially splices the magnetoelectric first camshaft starting offset segment waveform signal startOffsetWave21(x), I left The normal waveform signal of the magnetoelectric camshaft normalWave2(x), the inserting gear waveform signal of the magnetoelectric camshaft InsertWave2(x), I right The normal waveform signal normalWave2(x) of the magnetoelectric camshaft and the start offset waveform signal startOffsetWave22(x) of the magnetoelectric second camshaft are used to obtain a camshaft sensor signal camMagnetic of a magnetoelectric signal type.
[0222] It can be seen from the above technical solution that in the crankshaft camshaft sensor signal generation method with customizable sampling points provided in the embodiment of the present invention, first, the host computer loads the EECU excitation signal characteristic parameters and stores them in the EECU excitation signal configuration file, and the EECU excitation signal characteristic parameters include crankshaft signal parameters and camshaft signal parameters; then, the host computer loads the common parameters, and calculates the total number of sampling points N required to generate waveform data according to the common parameters. total , and the total number of sampling points N totalAdding common parameters; the upper computer sends the EECU excitation signal configuration file to the lower computer; the MCU of the lower computer reads the EECU excitation signal configuration file and loads the EECU excitation signal characteristic parameters and common parameters; the MCU generates the EECU excitation signal based on the EECU excitation signal characteristic parameters and common parameters; the EECU excitation signal is sent to the FPGA, and the FPGA performs synchronous clock domain processing on the EECU excitation signal and stores it in the RAM. The configuration requirements of the upper computer used in the present invention are low, and the lower computer used has a simple structure and simple wiring, and has the characteristics of good portability and universality. BRIEF DESCRIPTION OF THE DRAWINGS
[0223] Figure 1 The present invention is a flow chart of a crankshaft and camshaft sensor signal generating method with customizable sampling points.
[0224] Figure 2 Schematic diagram of segmented simulation of crankshaft sensor signal according to an embodiment of the present invention.
[0225] Figure 3 It is a schematic diagram of segmented simulation of a camshaft sensor signal according to an embodiment of the present invention.
[0226] Figure 4 It is a schematic diagram of a normal crankshaft tooth segment simulation according to an embodiment of the present invention.
[0227] Figure 5 It is a schematic diagram of a simulation of a crankshaft tooth-missing section according to an embodiment of the present invention.
[0228] Figure 6 It is a schematic diagram of crankshaft signal simulation according to an embodiment of the present invention.
[0229] Figure 7 It is a schematic diagram of a non-flip crankshaft Hall signal according to an embodiment of the present invention.
[0230] Figure 8 It is a schematic diagram of a magnetoelectric missing tooth signal of a non-reversal crankshaft according to an embodiment of the present invention.
[0231] Fig. 9 It is a schematic diagram of a non-reversal crankshaft magnetoelectric non-missing tooth signal according to an embodiment of the present invention.
[0232] Fig.10 It is a schematic diagram of the camshaft starting offset segment signal according to an embodiment of the present invention.
[0233] Fig.11 It is a schematic diagram of the signals of the general section and the tooth section of the camshaft of the present invention embodiment.
[0234] Fig.12 It is a schematic diagram of a Hall signal of a non-flip camshaft according to an embodiment of the present invention.
[0235] Fig.13It is a schematic diagram of the magnetoelectric signal of the non-flip camshaft according to an embodiment of the present invention.
[0236] Fig.14 This is an example of configuration file settings according to an embodiment of the present invention.
[0237] Fig.15 Schematic diagram of a crankshaft and camshaft according to an embodiment of the present invention. DETAILED DESCRIPTION
[0238] The technical scheme and technical effects of the present invention are further elaborated in detail below in conjunction with the accompanying drawings of the present invention.
[0239] The present invention provides a crankshaft and camshaft sensor signal generation method with customizable sampling points, which is used for crankshaft and camshaft sensor signal simulation in an engine electronic control unit, wherein the sampling points are customized according to the characteristic parameters of the EECU excitation signal and the common parameters, and has the characteristics of dynamically adjustable sampling points and simple and flexible parameter configuration. Figure 1 As shown, the method implementation steps of the present invention include:
[0240] Step S1, the host computer loads the common parameters and the EECU excitation signal characteristic parameters in the EECU excitation signal configuration file, packages the EECU excitation signal characteristic parameters and the common parameters and sends them to the slave computer, where the EECU excitation signal characteristic parameters include crankshaft signal parameters and camshaft signal parameters;
[0241] Step S2, the lower computer receives the common parameters and the characteristic parameters of the EECU excitation signal;
[0242] Step S3: The MCU of the lower computer calculates the total number of sampling points N required to generate waveform data based on the common parameters. total , and the total number of sampling points N total Add public parameters;
[0243] Step S4, the MCU of the lower computer generates an EECU excitation signal based on the EECU excitation signal characteristic parameters and common parameters, the EECU excitation signal includes a crankshaft sensor signal and a camshaft sensor signal, and the crankshaft sensor signal and the camshaft sensor signal are both obtained through segmented simulation;
[0244] In step S5, the FPGA of the lower computer performs clock domain synchronization processing on the crankshaft sensor signal and the camshaft sensor signal in the EECU excitation signal, and outputs the EECU excitation signal after the synchronous clock domain processing to the DAC based on the DDS method.
[0245] Here, the host computer is used to generate parameters, load parameters and send control commands. It does not need to have the computing power and cache storage space to carry the simulation software. Therefore, the host computer can be a computer, a laptop, a mobile phone or a dedicated simple mobile terminal. The lower computer is an actuator with a circuit board that integrates an MCU, FPGA, DAC, a filter circuit, an operational amplifier circuit, etc. The lower computer is used to generate crankshaft and camshaft sensor signals. The circuit board can also integrate memory for external memory of the MCU and FPGA.
[0246] Among them, the common parameters include the maximum value of the M-bit DAC V max , DDS sampling rate F S , signal frequency F out , the size of the component storage space S used to store waveform signal data total 、Number of channels C n Each sampling point requires B bits. Here, define S total This is due to the consideration of the storage capacity of the FPGA in the lower computer during signal processing. total The storage capacity of the FPGA cannot be exceeded (or when the FPGA is connected to an external memory, S total The storage capacity of the FPGA and external memory cannot be exceeded). The number of sampling points is calculated when the storage resource size is determined, so that the signal generation can be effectively realized under the condition of limited storage resources.
[0247] Step S3 calculates the total number of sampling points N required to generate waveform data based on the common parameters. total include:
[0248] Step S31, according to V max Calculate the number of phase accumulator bits n and the total number of sampling points N total ; The number of bits n of the phase accumulator is calculated using method 1 or method 2:
[0249] Calculation method 1 is based on the DDS sampling rate F s and signal generation frequency F out Calculate the independent variable M1, which represents the minimum number of points required to simulate a complete waveform in each channel. n is a positive integer, as shown in formulas (1)-(3):
[0250]
[0251] log2M1-1 <n≤log2M1 (2)
[0252] N total =2 n (3)
[0253] The second calculation method is that the user inputs the size of the component storage space S used to store the waveform signal data total , the number of channels C is set in view of the scalability of the later project n Each sampling point requires B bits to be calculated. The system calculates the maximum value of the phase accumulator n based on the above input parameters of the user. n is a positive integer, as shown in formula (4):
[0254]
[0255] Step S32, adding common parameters to the EECU excitation signal configuration file.
[0256] As can be seen from the above, the user sets the storage space size by inputting the value of the phase accumulator n within the value range, and then the total number of sampling points Ntotal required for the waveform data can be calculated; in step S21, two methods for determining the customized sampling points are provided. The first method is that the user inputs the sampling rate and signal generation frequency of the DDS, and the present invention uses this to calculate the number of sampling points N required for the waveform signal of a channel. total , the user can calculate the number of sampling points N total Further calculate the required resource size; the second is that the user enters the size of the component storage space S currently used to store waveform signal data total , the number of channels C is set in view of the scalability of the later project n Each sampling point requires B bits, and the present invention uses this to calculate the total number of sampling points N that best meets the above constraints. total In practical applications, the number of sampling points N total The larger the value, the closer the generated waveform is to the actual waveform.
[0257] Step S4 generates the EECU excitation signal based on the EECU excitation signal configuration file, including:
[0258] Step S41, according to the crankshaft signal parameters in the EECU excitation signal configuration file, the crankshaft sensor signal in the EECU excitation signal is simulated in sections, and the crankshaft signal parameters include the total number of crankshaft teeth G total 、Number of missing teeth on crankshaft G miss , crankshaft number of revolutions R, crankshaft signal type S crank , crankshaft signal inversion F crank , Crankshaft waveform Hall type missing tooth waveform segment indication signal L h , crankshaft waveform magnetoelectric missing tooth waveform segment indication signal L m ;
[0259] Step S42, simulating the camshaft sensor signal in the EECU excitation signal in sections according to the camshaft signal parameters in the EECU excitation signal configuration file;
[0260] Step S43: the EECU excitation signal is a combination of the crankshaft sensor signal and the camshaft sensor signal.
[0261] Furthermore, step S41 simulates the crankshaft sensor signal in the EECU excitation signal in sections, including:
[0262] Step S411, calculating the number of crankshaft waveform supplementary points according to the crankshaft signal parameters and the common parameters;
[0263] Step S412, performing a segmented simulation of the crankshaft sensor signal according to the number of crankshaft waveform filling points, the segmented simulation of the crankshaft sensor signal including a normal tooth waveform segment simulation and a missing tooth waveform segment simulation;
[0264] Step S413, performing crankshaft waveform splicing according to the segmented simulation results to obtain a crankshaft sensor signal;
[0265] In the present invention, the crankshaft signal parameters include the total number of crankshaft teeth G total 、Number of missing teeth on crankshaft G miss , crankshaft number of revolutions R, crankshaft signal type S crank , crankshaft signal inversion F crank , Crankshaft waveform Hall type missing tooth waveform segment indication signal L h , crankshaft waveform magnetoelectric missing tooth waveform segment indication signal L m Here, S crank =0 means the signal type is Hall type, S crank =1 represents the magnetoelectric type, L h =0 represents Hall type without missing teeth, L h =1 means that the Hall type has missing teeth, L m =0 represents magneto-electric type without missing teeth, L m =1 means the magnetoelectric type has missing teeth. The camshaft and crankshaft shapes can be referred to Fig.15 shown.
[0266] Step S411 of calculating the number of crankshaft waveform supplementary points includes:
[0267] Step S411a, calculating the number of cycles T required for a complete crankshaft signal according to the crankshaft signal parameters and common parameters total , the number of waveform data points N in each crankshaft cycle crank 、Number of normal tooth periods N normal , missing tooth period multiple T miss , as shown in formulas (5)-(8):
[0268] T total =G total ×R (5)
[0269]
[0270] N normal =G total -G miss -1 (7)
[0271] T miss =G miss +1 (8)
[0272] Since the number of waveform data points N in each crankshaft cycle in formula (6) crank The rounding operation is performed, so when using this parameter to simulate the crankshaft sensor signal, it may not be possible to generate N completely. total Since the crankshaft signal is divided into two types: Hall signal and magnetoelectric signal, and the missing teeth part in the magnetoelectric signal is divided into two types: missing teeth and no missing teeth, step S411b generates the crankshaft waveform filling points according to the situation:
[0273] When the crankshaft sensor signal type is a Hall signal type or a magnetoelectric signal type with missing teeth, the crankshaft waveform supplementary points include P Q11 , P Q12 :
[0274] P lessy =N total -N crank ×T total (9)
[0275]
[0276] P Q12 =P lessy -P Q11 ×R (11)
[0277] Among them, P Q11 P is the number of points required to fill in after the normal tooth segment and the missing tooth segment are spliced together. Q12 is the number of points required to be filled after the entire crankshaft signal is spliced. When the crankshaft sensor signal is a Hall signal type or a magnetoelectric signal type with missing teeth, the number of sampling points for generating crankshaft waveform data is compared to N total The number of missing points is P lessy ;
[0278] When the crankshaft sensor signal type is a magnetoelectric signal without missing teeth, the crankshaft waveform supplementary points include P Q21 , P Q22 , P Q23 :
[0279]
[0280]
[0281]
[0282] P Q23 =P lessn -(P Q21 ×N normal +P Q22 )×R (15)
[0283] Among them, P Q21 is the number of points to be filled after each normal tooth cycle, P Q22 is the number of points to be filled after the missing tooth segment, P Q23 is the number of points required to be filled after the entire crankshaft signal is spliced. When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, the number of sampling points for generating crankshaft waveform data is compared to N total The number of missing points is P lessn ;
[0284] Step S412 includes:
[0285] Step S412a, performing normal tooth waveform segment simulation to obtain a crankshaft normal tooth waveform signal, wherein:
[0286] When the crankshaft sensor signal is a Hall signal type, that is, S crank =0, using the M-bit DAC maximum value V max The normal tooth waveform segment is simulated with the minimum digital input value 0 to generate the Hall-type crankshaft normal tooth waveform signal normalWave1Squ(x). The spatial size of the signal normalWave1Squ(x) is N crank ×N normal , the value range of the independent variable x in the signal normalWave1Squ(x) is [0, N crank ×N normal ], the signal normalWave1Squ(x) is composed of N normal The number of sampling points is N crank The square wave composition, N crank is a square wave cycle;
[0287] When F crank = 0, normalWave1Squ(x) can be obtained by N normal The number of sampling points is N crank The first N square waves are composed of crank / 2 sampling point value is V max , after N crank -N crank / 2 sampling points have a value of 0:
[0288]
[0289] When F crank = 1, normalWave1Squ(x) can be obtained by N normal The number of sampling points is N crank The first N square waves are composed of crank / 2 sampling points have a value of 0, and then N crank -N crank / 2 sampling point value is V max :
[0290]
[0291] Here, since the computer automatically performs the rounding operation during the execution process, and The value of may be different, therefore, in the present invention, It is not the same expression. If necessary, you can add a floor symbol for each interval point value;
[0292] When the crankshaft sensor signal is a magnetoelectric signal with missing teeth, that is, S crank =1 and L m = 0, a sine waveform is used to simulate the normal tooth waveform segment, and a magnetoelectric normal tooth crankshaft signal normalWave21Sin(x) is generated. The spatial size of the signal normalWave21Sin(x) is N crank ×N normal , the value range of the independent variable x in the signal normalWave21Sin(x) is [0, N crank ×N normal ];
[0293] When F crank = 0, the signal normalWave21Sin(x) is N normal The total number of points is N crank The sine wave sin1 is composed of a sine wave with the first half opening downward and the second half opening upward. crank is the length of a sine wave cycle; when F crank = 1, the signal normalWave21Sin(x) is N normal The total number of points is N crank Here, the sine wave sin2 is obtained by shifting the phase of the sine wave sin1 by 180°.
[0294] normalWave21Sin(x)=sin1,x∈[0,Ncrank ×N normal ] (18)
[0295] normalWave21Sin(x)=sin2,x∈[0,N crank ×N normal ] (19)
[0296] When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, that is, S crank =1 and L m = 0, a sine wave is used to simulate the normal tooth waveform segment to generate a magnetoelectric normal tooth crankshaft signal normalWave22Sin(x). The spatial size of the signal normalWave22Sin(x) is (N crank +P Q21 )×N normal , the value range of the independent variable x in the signal normalWave22Sin(x) is [0, (N crank +P Q21 )×N normal ];
[0297] When F crank = 0, the signal normalWave22Sin(x) is N normal The total number of points is N crank +P Q21 The waveform sinWaveCrank1 is composed of the sine wave sin1 and P Q21 Value V max / 2 Composition:
[0298]
[0299] When F crank = 1, the signal normalWave22Sin(x) is N normal The total number of points is N crank +P Q21 The waveform sinWaveCrank2 is composed of the sine wave sin2 and P Q21 Value V max / 2 Composition:
[0300]
[0301] The normal tooth part of the crankshaft is simulated as follows Figure 4 shown.
[0302] Step S412b, performing a missing tooth waveform segment simulation to obtain a crankshaft missing tooth waveform signal, wherein:
[0303] When the crankshaft sensor signal is a Hall signal type, the value V max The missing tooth part is simulated with the minimum digital input value 0 to generate the Hall-type missing tooth crankshaft signal quechiHall(x). The spatial size of the signal quechiHall(x) is N crank ×T miss +P Q11 , the value range of the independent variable x in the signal quechiHall(x) is [0, N crank ×T miss +P Q11 ]:
[0304]
[0305] When the crankshaft sensor signal is a magnetoelectric type with missing teeth signal type, a sine wave and value V max / 2 pairs of missing teeth are simulated to generate a magnetoelectric missing tooth crankshaft signal quechiMagnetic1(x). The spatial size of the signal quechiMagnetic1(x) is N crank ×T miss +P Q11 , the value range of the independent variable x in the signal quechiMagnetic1(x) is [0, N crank ×T miss +P Q11 ], here, a cycle length is N crank The sine wave at N crank -N crank / 2 position is split into a left half sine wave and a right half sine wave, and the space size of the left half sine wave is N crank -N crank / 2, the spatial size of the right half sine wave sinRightCrank1 is N crank / 2;
[0306] When F crank = 0, the aforementioned sine wave sin1 is used for simulation, and the signal quechiMagnetic1(x) is composed of the left half sine wave sinLeftCrank1, the right half sine wave sinRightCrank1 and the value V max / 2, the spatial size of the left half sine wave sinLeftCrank1 is N crank -N crank / 2, the spatial size of the right half sine wave sinRightCrank1 is N crank / 2, the single cycle formula is shown in formulas (23)-(24):
[0307]
[0308] Therefore, in N crank ×T miss +P Q11 In the space, assign sinLeftCrank1 to interval, assign sinRightCrank1 to interval, quechiMagnetic1(x) is expressed as formula (25):
[0309]
[0310] When F crank = 1, the aforementioned sine wave sin2 is used for simulation, and the signal quechiMagnetic1(x) is composed of the left half sine wave sinLeftCrank2, the right half sine wave sinRightCrank2 and the value V max / 2, the spatial size of the left half sine wave sinLeftCrank2 is N crank -N crank / 2, the spatial size of the right half sine wave sinRightCrank2 is N crank / 2, the single cycle formula is shown in formulas (26)-(27):
[0311]
[0312] Therefore, in N crank ×T miss +P Q11 In the space, assign sinLeftCrank2 to interval, assign sinRightCrank2 to interval, quechiMagnetic1(x) is expressed as formula (28):
[0313]
[0314] When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, a sine wave and a value V max / 2 pairs of missing teeth are simulated to generate a magnetoelectric missing tooth crankshaft signal quechiMagnetic2(x). The spatial size of the signal quechiMagnetic2(x) is N crank / 2*2+P Q22 , the value range of the independent variable x in the signal quechiMagnetic2(x) is [0, N crank / 2*2+P Q22 ];
[0315] When F crank= 0, the signal quechiMagnetic2(x) consists of two single-cycle lengths of N crank / 2 sine wave sinWaveCrank_Half and P Q22 Value V max / 2, the spatial size of the sine wave sinWaveCrank_Half is N crank / 2, the frequency is twice that of sin1, and the value range of the independent variable x in the sine wave sinWaveCrank_Half is [0,N crank / 2*2]:
[0316]
[0317] When F crank = 1, the signal quechiMagnetic2(x) consists of two single-cycle lengths of N crank / 2 sine wave sinWaveCrank_Half_ant and P Q22 Value V max / 2, the spatial size of the sine wave sinWaveCrank_Half_ant is N crank / 2, the frequency is twice that of sin2, and the value range of the independent variable x in the sine wave sinWaveCrank_Half_ant is [0,N crank / 2*2]:
[0318]
[0319] The missing tooth part of the crankshaft is simulated as follows Figure 5 As shown, here, the sine wave sinWaveCrank_Half can be 1 / 2×sin1, and the sine wave sinWaveCrank_Half_ant can be 1 / 2×sin2.
[0320] Step S413 includes:
[0321] When the crankshaft sensor signal type is a Hall signal type, the Hall normal tooth crankshaft signal normalWave1Squ(x) and the Hall missing tooth crankshaft signal quechiHall(x) are spliced to obtain the Hall crankshaft signal crankHallSec, such as Figure 6 As shown in (a), R signals crankHallSec are concatenated in sequence and the number of padding points P is added at the end. Q12 , get the crankshaft sensor signal crankHall of Hall signal type, where R is the number of crankshaft turns, P Q12 The value is the minimum DAC input value 0, such as Figure 7 As shown;
[0322] When the crankshaft sensor signal is a magnetoelectric type with missing teeth signal type, the magnetoelectric normal tooth crankshaft signal normalWave21Sin(x) and the magnetoelectric missing tooth crankshaft signal quechiMagnetic1(x) are spliced to obtain a magnetoelectric crankshaft signal crankMagneticSec1, such as Figure 6 As shown in (b), R signals crankMagneticSec1 are concatenated in sequence and the number of padding points P is added at the end. Q12 , get the crankshaft sensor signal crankMagnetic1 of the magnetoelectric type with missing teeth, where P 12 The value is the middle value of the DAC input value like Figure 8 As shown;
[0323] When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, the magnetoelectric normal tooth crankshaft signal normalWave22Sin(x) and the magnetoelectric missing tooth crankshaft signal quechiMagnetic2(x) are concatenated to obtain a magnetoelectric crankshaft signal crankMagneticSec2, such as Figure 6 As shown in (c), R signals crankMagneticSec2 are concatenated in sequence and the number of padding points P is added at the end. 23 , get the crankshaft sensor signal crankMagnetic2 of the magnetoelectric type without missing teeth, such as Fig. 9 shown.
[0324] In the present invention, the camshaft signal parameters include the period μ of a camshaft protrusion, the starting offset S offset , Gear Position I num , Gear distance I dis 、Number of camshaft lobed pulses B cam The camshaft signal parameters include the camshaft bulge period μ, the starting offset S offset , Gear Position I num , Gear distance I dis 、Number of camshaft lobed pulses B cam Step S42 simulates the camshaft sensor signal in the EECU excitation signal in sections, including:
[0325] Step S421, calculating the number of camshaft waveform supplement points according to the camshaft signal parameters and the common parameters;
[0326] Step S422, simulating camshaft sensor signals in sections;
[0327] Step S423, splicing the camshaft waveforms to obtain a camshaft sensor signal;
[0328] The specific implementation of step S421 includes:
[0329] Step S421a, calculating the number of waveform data points N in each cycle of the camshaft according to the camshaft signal parameters and common parameters cam 、N is the general segment cycle number sec , the number of complete general waveform segments on the left side of the camshaft tooth position I left , the number of complete general waveform segments on the right side of the camshaft tooth position I right , as shown in formulas (31)-(34);
[0330]
[0331]
[0332]
[0333]
[0334] Since the number of waveform data points N in each cycle of the camshaft in the above formula cam The rounding operation is performed. When this parameter is used to simulate the camshaft sensor signal, N may not be fully generated. total In the case of a large number of sampling points, it is necessary to perform point filling operation.
[0335] Step S421b, calculate the number of camshaft waveform supplement points, the camshaft waveform supplement points include P 11 , P 22 ,in:
[0336] P less2 =N total -N cam ×T total (35)
[0337]
[0338] P 22 =P less2 -P 11 *(B cam -1) (37)
[0339] Among them, the number of supplementary points P 11 The number of points to be filled after the initial offset segment and the general segment, the number of points to be filled P 22 is the number of points to be filled after the gear shaping stage, and the number of sampling points for generating camshaft waveform data is compared with N total The number of missing points is P less2 ;
[0340] Next, the camshaft sensor signal is simulated. The camshaft sensor signal adopts a segmented simulation method, which is divided into two starting offset segments, a general segment and a gear segment. The number of cycles of the first starting offset segment is T cam21 +T cam1 , the number of cycles of the second starting offset segment is T cam22 , the period of a general segment is T cam3 +T cam1 , the number of cycles of the gear shaping section is T cam4 +2*T cam1 +T cam5 .
[0341] Let T cam1 =μ, T cam21 =N sec -S offset -T cam1 , T cam22 =S offset , T cam3 =N sec -T cam1 , T cam4 =N sec -2×T cam1 -T cam5 , T cam5 =I dis :
[0342] Step S422 includes:
[0343] Step S422a, performing a start offset segment simulation to obtain a first camshaft start offset segment waveform signal and a second camshaft start offset segment waveform signal, wherein:
[0344] When the camshaft sensor signal type is Hall signal type, such as Fig.10 As shown in the left and right figures, the square wave squCam and the minimum digital input value 0 are used to simulate the starting offset segment, and the Hall-type first camshaft starting offset segment waveform signal startOffsetWave11(x) and the Hall-type second camshaft starting offset segment waveform signal startOffsetWave12(x) are obtained, where the period of the square wave squCam is μ, the duty cycle is 50%, and the first half is V max , the second half takes the value 0, and the spatial size of the signal startOffsetWave11(x) is N cam *(N sec -S offset )+P 11 , the value range of the independent variable x in the signal startOffsetWave11(x) is [0, N cam *(N sec -Soffset )+P 11 ]:
[0345]
[0346] The spatial size of the signal startOffsetWave12(x) is S offset , the value range of the independent variable x in the signal startOffsetWave12(x) is [0, S offset ]:
[0347] startOffsetWave12(x)=0,x∈[0,S offset ] (39)
[0348] When the camshaft sensor signal is a magnetoelectric signal, the middle value V of the DAC digital input value is used. max / 2 and a sine wave sinCam with a period of μ are used to simulate the starting offset segment, and the magnetoelectric first camshaft starting offset segment waveform signal startOffsetWave21(x) and the magnetoelectric second camshaft starting offset segment waveform signal startOffsetWave22(x) are obtained, where the spatial size of the signal startOffsetWave21(x) is N cam *(N sec -S offset )+P 11 , the value range of the independent variable x in the signal startOffsetWave21(x) is [0, N cam *(N sec -S offset )+P 11 ]:
[0349]
[0350] The spatial size of the signal startOffsetWave22(x) is S offset , the value range of the independent variable x in the signal startOffsetWave22(x) is [0, S offset ]:
[0351]
[0352] Step S422b, perform general segment simulation to obtain a general segment waveform signal of the camshaft, wherein:
[0353] When the camshaft sensor signal type is Hall signal type, such as Fig.11As shown in the middle left figure, the square wave squCam and the minimum digital input value 0 are used to perform the general segment simulation to obtain the Hall camshaft general segment waveform signal normalWave1(x), where the spatial size of the signal normalWave1(x) is N cam *N sec +P 11 , the value range of the independent variable x in the signal normalWave1(x) is [0,N cam *N sec +P 11 ]:
[0354]
[0355] When the camshaft sensor signal is a magnetoelectric signal, the middle value V of the DAC digital input value is used. max / 2 and the sine wave sinCam are used to simulate the general segment to obtain the general segment waveform signal normalWave2(x) of the magnetoelectric camshaft. The spatial size of the signal normalWave2(x) is N cam *N sec +P 11 , the value range of the independent variable x in the signal normalWave2(x) is [0, N cam *N sec +P 11 ]:
[0356]
[0357] Step S422c, perform gear shaping segment simulation to obtain a camshaft gear shaping segment waveform signal, wherein:
[0358] When the camshaft sensor signal type is Hall signal type, such as Fig.11 As shown in the middle right figure, the square wave squCam and the minimum digital input value 0 are used to simulate the gear segment, and the waveform signal InsertWave1(x) of the Hall camshaft gear segment is obtained. The spatial size of the signal InsertWave1(x) is N cam *N sec +P 22 , the value range of the independent variable x in the signal InsertWave1(x) is [0, N cam *N sec +P 22 ]:
[0359]
[0360] When the camshaft sensor signal is a magnetoelectric signal, the middle value V of the DAC digital input value is used. max / 2 and the sine wave sinCam are used to simulate the gear segment, and the magnetoelectric camshaft gear segment waveform signal InsertWave2(x) is obtained, where the spatial size of the signal InsertWave2(x) is N cam *N sec +P 22 , the value range of the independent variable x in the signal InsertWave2(x) is [0, N cam *N sec +P 22 ]:
[0361]
[0362] Step S423 includes:
[0363] When the camshaft sensor signal type is a Hall signal type, the Hall type first camshaft starting offset waveform signal startOffsetWave11(x), I left The Hall camshaft normal waveform signal normalWave1(x), the Hall camshaft insert gear waveform signal InsertWave1(x), I right The Hall-type camshaft normal waveform signal normalWave1(x) and the Hall-type second camshaft starting offset waveform signal startOffsetWave12(x) are used to obtain the Hall-type signal type camshaft sensor signal camHall, such as Fig.12 As shown;
[0364] When the camshaft sensor signal type is a magnetoelectric signal type, the magnetoelectric first camshaft starting offset waveform signal startOffsetWave21(x), I left The normal waveform signal of the magnetoelectric camshaft segment is normalWave2(x), the inserting waveform signal of the magnetoelectric camshaft segment is InsertWave2(x), and the right The normal waveform signal of the magnetoelectric camshaft normalWave2(x) and the start offset waveform signal of the second magnetoelectric camshaft startOffsetWave22(x) are used to obtain the camshaft sensor signal camMagnetic of the magnetoelectric signal type, such as Fig.13 shown.
[0365] Finally, the present invention adopts digital circuit method for simulation, and the sampling rate depends more on the selected hardware conditions. The direct digital frequency synthesis method (DDS, Direct Digital Frequency Synthesis) is used in FPGA to realize waveform generation, and its generation formula is F out =Fs / 2 n *F word , where F out is the output frequency, F s is the sampling rate, 2 n is the sampling depth of the signal to store a complete cycle, n is the number of bits of the phase accumulator, and F word is the frequency control word. Generally, the sampling rate F s The number of bits of the phase accumulator is fixed, and the frequency of the generated signal can be adjusted by modifying the frequency control word.
[0366] It can be seen from the above technical scheme that the method for generating crankshaft and camshaft signals provided in the embodiment of the present invention is set to modify the characteristic parameters of the ECU crankshaft and camshaft signals to generate different types of crankshaft signals and camshaft signals, and simulates the characteristics of each part of the signal through a segmented simulation method. The parameter configuration is flexible, the simulation structure is simple, and it has the characteristics of good expansibility and universality, and can be applicable to the simulation of various ECU crankshaft and camshaft sensor signals.
[0367] Below, the crankshaft and camshaft sensor signal generation is implemented by taking the Isuzu 6WG1 engine as an example, and the technical solution of the present invention is further elaborated in detail in combination with the accompanying drawings of the present invention.
[0368] (1) Store the ECU crankshaft and camshaft sensor signal characteristic parameters in the ECU signal configuration file. The parameter contents are shown in Table 1 and Table 2, and the configuration file is shown in Fig.14 ;
[0369] (2) Based on the sampling point calculation method in the invention content, the second method is used to determine the sampling point number: first, the space resource size available for storage is 423936 bits, the number of channels is 4, and each sampling point requires 16 bits; secondly, the maximum value of n is 12 calculated by the above formula; finally, n=12 is set, and the total number of sampling points N can be calculated. total is 4096.
[0370] (3) The host computer reads the ECU signal configuration file and sends the parameters in the configuration file combined with the common parameters to the MCU;
[0371] (4) MCU loads the ECU crankshaft and camshaft sensor signal characteristic parameters and common parameters. The characteristic parameters include the crankshaft signal type S crank , crankshaft number of revolutions R, crankshaft signal inversion F crank 、Total number of crankshaft teeth G total 、Number of missing teeth on crankshaft G miss , Crankshaft waveform Hall type missing tooth waveform segment indication signal L h , Crankshaft waveform Hall type missing tooth waveform segment indication signal L m , Camshaft signal type Scam , Camshaft inversion signal F cam , Number of cam pulses in the camshaft cycle (excluding gear shaping) B cam , the period of a camshaft bulge μ, the camshaft starting offset Soffset, the camshaft toothing position I num , Camshaft toothing distance I dis , common parameters include DAC maximum digital input value V max , the total number of sampling points N required to generate waveform data total .
[0372] (5) The MCU performs segmented simulation on the ECU crankshaft camshaft sensor signal based on the ECU crankshaft camshaft sensor signal configuration file to generate the ECU crankshaft camshaft sensor signal. The specific process of the segmented simulation of the crankshaft camshaft sensor signal refers to the aforementioned steps S41 and S42.
[0373] (6) The generated ECU crankshaft and camshaft sensor signals are sent to the FPGA. In this example, the serial port is used for data transmission. The FPGA receives the data and processes it in the synchronous clock domain before storing it in the RAM.
[0374] (7) The DDS method is used in FPGA to generate the ECU crankshaft camshaft sensor signal output via DAC.
[0375]
[0376] Table 1
[0377]
[0378] Table 2
[0379] Furthermore, the present invention also provides a crankshaft camshaft sensor signal generation system with a customizable sampling point number, which can be used to implement Figure 1-3 The method shown, the system comprises:
[0380] The upper computer is used to load the common parameters and the EECU excitation signal characteristic parameters in the EECU excitation signal configuration file, and package the EECU excitation signal characteristic parameters and the common parameters and send them to the lower computer. The EECU excitation signal characteristic parameters include crankshaft signal parameters and camshaft signal parameters.
[0381] The lower computer is used to receive the common parameters and the characteristic parameters of the EECU excitation signal;
[0382] The MCU of the lower computer is used to calculate the total number of sampling points N required to generate waveform data based on the common parameters. total , and the total number of sampling points N total Add public parameters;
[0383] The MCU of the lower computer is used to generate an EECU excitation signal based on the characteristic parameters and common parameters of the EECU excitation signal. The EECU excitation signal includes a crankshaft sensor signal and a camshaft sensor signal. The crankshaft sensor signal and the camshaft sensor signal are both obtained through segmented simulation.
[0384] The FPGA of the lower computer is used to perform clock domain synchronization processing on the crankshaft sensor signal and the camshaft sensor signal in the EECU excitation signal, and output the EECU excitation signal after the synchronous clock domain processing to the DAC based on the DDS method.
[0385] Here, the host computer is used to generate parameters, load parameters and send control commands. It does not need to have the computing power and cache storage space to carry the simulation software. Therefore, the host computer can be a computer, PC, mobile phone or a dedicated simple mobile terminal. The lower computer is an actuator with a circuit board that integrates MCU, FPGA, DAC, filter circuit, operational amplifier circuit, etc. The lower computer is used to generate crankshaft camshaft sensor signals.
[0386] Common parameters include the M-bit DAC maximum value V max , DDS sampling rate F S , signal frequency F out , the size of the component storage space S used to store waveform signal data total 、Number of channels C n , Each sampling point requires bit B, and the MCU of the lower computer includes:
[0387] Calculation module for V max Calculate the number of phase accumulator bits n and the total number of sampling points N total , where N total The calculation method of the phase accumulator bit number n is as mentioned in the above step S2;
[0388] The MCU of the lower computer also includes:
[0389] The crankshaft sensor signal generation module is used to simulate the crankshaft sensor signal in the EECU excitation signal in sections according to the crankshaft signal parameters in the EECU excitation signal configuration file. The crankshaft signal parameters include the total number of crankshaft teeth G total 、Number of missing teeth on crankshaft G miss , crankshaft number of revolutions R, crankshaft signal type S crank , crankshaft signal inversion F crank , Crankshaft waveform Hall type missing tooth waveform segment indication signal L h , crankshaft waveform magnetoelectric missing tooth waveform segment indication signal L m ;
[0390] A camshaft sensor signal generation module is used to simulate the camshaft sensor signal in the EECU excitation signal in sections according to the camshaft signal parameters in the EECU excitation signal configuration file;
[0391] The EECU excitation signal is a combination of the crankshaft sensor signal and the camshaft sensor signal.
[0392] The crankshaft sensor signal generation module includes:
[0393] A crankshaft waveform supplementary point number calculation unit, used to calculate the crankshaft waveform supplementary point number according to the crankshaft signal parameters and common parameters;
[0394] The crankshaft sensor signal segmented simulation unit is used to perform segmented simulation of the crankshaft sensor signal according to the number of crankshaft waveform filling points. The segmented simulation of the crankshaft sensor signal includes normal tooth waveform segment simulation and missing tooth waveform segment simulation.
[0395] A crankshaft sensor signal splicing unit, used for splicing crankshaft waveforms according to segmented simulation results to obtain crankshaft sensor signals;
[0396] The crankshaft waveform supplementary point number calculation unit is specifically used for:
[0397] According to the crankshaft signal parameters and common parameters, calculate the required number of crankshaft signal cycles T total , the number of waveform data points N in each crankshaft cycle crank 、Number of normal tooth periods N normal , missing tooth period multiple T miss , the calculation method refers to the aforementioned step S411a;
[0398] Calculate the number of crankshaft waveform supplementary points, where:
[0399] When the crankshaft sensor signal type is a Hall signal type or a magnetoelectric signal type with missing teeth, the crankshaft waveform supplementary points include P Q11 , P Q12 , P Q11 P is the number of points required to fill in after the normal tooth segment and the missing tooth segment are spliced together. Q12 The number of points required to be filled after the entire crankshaft signal is spliced, and the calculation method is referred to the aforementioned step S411b;
[0400] When the crankshaft sensor signal type is a magnetoelectric signal without missing teeth, the crankshaft waveform supplementary points include P Q21 , P Q22 , P Q23 , P Q21 is the number of points to be filled after each normal tooth cycle, P Q22 is the number of points to be filled after the missing tooth segment, P Q23The number of points to be filled after the entire crankshaft signal is spliced is calculated by referring to the aforementioned step S411b;
[0401] The crankshaft sensor signal segment simulation unit includes a normal tooth waveform segment simulation unit and a missing tooth waveform segment simulation unit, wherein:
[0402] The normal tooth waveform segment simulation unit is used to simulate the normal tooth waveform segment to obtain the crankshaft normal tooth waveform signal, wherein:
[0403] When the crankshaft sensor signal is a Hall signal type, that is, S crank =0, using the M-bit DAC maximum value V max The normal tooth waveform segment is simulated with the minimum digital input value 0 to generate the Hall-type crankshaft normal tooth waveform signal normalWave1Squ(x). The spatial size of the signal normalWave1Squ(x) is N crank ×N normal , the value range of the independent variable x in the signal normalWave1Squ(x) is [0, N crank ×N normal ], the signal normalWave1Squ(x) is composed of N normal The number of sampling points is N crank square wave, when F crank = 0,
[0404]
[0405] When F crank =1,
[0406]
[0407] When the crankshaft sensor signal is a magnetoelectric signal with missing teeth, that is, S crank =1 and L m = 0, a sine waveform is used to simulate the normal tooth waveform segment, and a magnetoelectric normal tooth crankshaft signal normalWave21Sin(x) is generated. The spatial size of the signal normalWave21Sin(x) is N crank ×N normal , the value range of the independent variable x in the signal normalWave21Sin(x) is [0, N crank ×N normal ]; when F crank = 0, the signal normalWave21Sin(x) is N normal The total number of points is N crank The sine wave sin1 is composed of a sine wave with the first half opening downward and the second half opening upward. crank= 1, the signal normalWave21Sin(x) is N normal The total number of points is N crank The sine wave sin2 is composed of the sine wave sin1, which is obtained by shifting the phase of the sine wave sin1 by 180°;
[0408] normalWave21Sin(x)=sin1,x∈[0,N crank ×N normal ]
[0409] normalWave21Sin(x)=sin2,x∈[0,N crank ×N normal ]
[0410] When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, that is, S crank =1 and L m = 0, a sine wave is used to simulate the normal tooth waveform segment to generate a magnetoelectric normal tooth crankshaft signal normalWave22Sin(x). The spatial size of the signal normalWave22Sin(x) is (N crank +P Q21 )×N normal , the value range of the independent variable x in the signal normalWave22Sin(x) is [0, (N crank +P Q21 )×N normal ]; when F crank = 0, the signal normalWave22Sin(x) is N normal The total number of points is N crank +P Q21 The waveform sinWaveCrank1 is composed of the sine wave sin1 and P Q21 Value V max / 2 Composition:
[0411]
[0412] When F crank = 1, the signal normalWave22Sin(x) is N normal The total number of points is N crank +P Q21 The waveform sinWaveCrank2 is composed of the sine wave sin2 and P Q21 Value V max / 2 Composition:
[0413]
[0414] The missing tooth waveform segment simulation unit is used to simulate the missing tooth waveform segment to obtain the crankshaft missing tooth waveform signal, wherein:
[0415] When the crankshaft sensor signal is a Hall signal type, the value V max The missing tooth part is simulated with the minimum digital input value 0 to generate the Hall-type missing tooth crankshaft signal quechiHall(x). The spatial size of the signal quechiHall(x) is N crank ×T miss +P Q11 , the value range of the independent variable x in the signal quechiHall(x) is [0, N crank ×T miss +P Q11 ]:
[0416]
[0417] When the crankshaft sensor signal is a magnetoelectric type with missing teeth signal type, a sine wave and value V max / 2 pairs of missing teeth are simulated to generate a magnetoelectric missing tooth crankshaft signal quechiMagnetic1(x). The spatial size of the signal quechiMagnetic1(x) is N crank ×T miss +P Q11 , the value range of the independent variable x in the signal quechiMagnetic1(x) is [0, N crank ×T miss +P Q11 ], where the period length is N crank The sine wave at N crank -N crank / 2 position is split to obtain the left half sine wave and the right half sine wave; when F crank = 0, the signal quechiMagnetic1(x) is composed of the left half sine wave sinLeftCrank1, the right half sine wave sinRightCrank1 and the value V max / 2, the left half sine wave sinLeftCrank1 and the right half sine wave sinRightCrank1 are obtained by splitting the sine wave sin1, and the space size of the left half sine wave sinLeftCrank1 is N crank -N crank / 2, the spatial size of the right half sine wave sinRightCrank1 is N crank / 2:
[0418]
[0419] When F crank= 1, the signal quechiMagnetic1(x) is composed of the left half sine wave sinLeftCrank2, the right half sine wave sinRightCrank2 and the value V max / 2, the left half sine wave sinLeftCrank2 and the right half sine wave sinRightCrank2 are obtained by splitting the sine wave sin2, and the space size of the left half sine wave sinLeftCrank2 is N crank / 2, the spatial size of the right half sine wave sinRightCrank2 is N crank -N crank / 2:
[0420]
[0421] When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, a sine wave and a value V max / 2 pairs of missing teeth are simulated to generate a magnetoelectric missing tooth crankshaft signal quechiMagnetic2(x). The spatial size of the signal quechiMagnetic2(x) is N crank / 2*2+P Q22 , the value range of the independent variable x in the signal quechiMagnetic2(x) is [0, N crank / 2*2+P Q22 ]; when F crank = 0, the signal quechiMagnetic2(x) consists of two sine waves sinWaveCrank_Half and P Q22 Value V max / 2, the spatial size of the sine wave sinWaveCrank_Half is N crank / 2, the frequency is twice that of sin1, and the value range of the independent variable x in the sine wave sinWaveCrank_Half is [0,N crank / 2*2]:
[0422]
[0423] When F crank = 1, the signal quechiMagnetic2(x) consists of two sine waves sinWaveCrank_Half_ant and P Q22 Value V max / 2, the spatial size of the sine wave sinWaveCrank_Half_ant is N crank / 2, the frequency is twice that of sin1, and the value range of the independent variable x in the sine wave sinWaveCrank_Half is [0,N crank / 2*2]:
[0424]
[0425] The crankshaft sensor signal splicing unit includes:
[0426] When the crankshaft sensor signal type is a Hall signal type, splice the Hall normal tooth crankshaft signal normalWave1Squ(x) and the Hall missing tooth crankshaft signal quechiHall(x) to obtain a Hall crankshaft signal crankHallSec, splice R signals crankHallSec in sequence and add the number of padding points P at the end Q12 , get the crankshaft sensor signal crankHall of Hall signal type, where R is the number of crankshaft turns, P Q12 The value is the minimum DAC input value 0;
[0427] The Hall type crankshaft signal splicing unit, when the crankshaft sensor signal is a magnetoelectric type with missing teeth signal type, splices the magnetoelectric normal tooth crankshaft signal normalWave21Sin(x) and the magnetoelectric missing tooth crankshaft signal quechiMagnetic1(x) to obtain a magnetoelectric crankshaft signal crankMagneticSec1, splices R signals crankMagneticSec1 in sequence and adds the number of fill points P at the end Q12 , get the crankshaft sensor signal crankMagnetic1 of the magnetoelectric type with missing teeth, where P 12 The value is the middle value of the DAC input value
[0428] The magnetoelectric crankshaft signal splicing unit, when the crankshaft sensor signal is a magnetoelectric signal type without missing teeth, splices the magnetoelectric normal tooth crankshaft signal normalWave22Sin(x) and the magnetoelectric missing tooth crankshaft signal quechiMagnetic2(x) to obtain a magnetoelectric crankshaft signal crankMagneticSec2, splices R signals crankMagneticSec2 in sequence and adds the number of fill points P at the end 23 , and obtain the crankshaft sensor signal crankMagnetic2 of the magnetoelectric type without missing teeth.
[0429] The camshaft signal parameters include the camshaft protrusion period μ, the starting offset S offset , Gear Position I num , Gear distance I dis 、Number of camshaft lobed pulses B cam , the camshaft signal parameter generation module includes:
[0430] A camshaft waveform supplement point number calculation unit, used for calculating the camshaft waveform supplement point number according to the camshaft signal parameters and common parameters;
[0431] Camshaft sensor signal segmented simulation unit, used for segmented simulation of camshaft sensor signals;
[0432] A camshaft sensor signal splicing unit, used for splicing camshaft waveforms to obtain camshaft sensor signals;
[0433] Camshaft waveform compensation point calculation unit:
[0434] According to the camshaft signal parameters and common parameters, calculate the number of waveform data points N in each cycle of the camshaft cam 、N is the general segment cycle number sec , the number of complete general waveform segments on the left side of the camshaft tooth position I left , the number of complete general waveform segments on the right side of the camshaft tooth position I right , the calculation formula refers to the aforementioned step S421a;
[0435] Calculate the number of camshaft waveform supplement points, which includes P 11 , P 22 , fill in the number of points P 11 The number of points to be filled after the initial offset segment and the general segment, the number of points to be filled P 22 is the number of points to be supplemented after the gear shaping stage, and the calculation formula is as in the aforementioned step S421b;
[0436] Let T cam1 =μ, T cam21 =N sec -S offset -T cam1 , T cam22 =S offset , T cam3 =N sec -T cam1 , T cam4 =N sec -2×T cam1 -T cam5 , T cam5 =I dis The camshaft sensor signal segment simulation unit includes a starting offset segment simulation unit, a general segment simulation unit and a gear insertion segment simulation unit, wherein:
[0437] The starting offset segment simulation unit is used to perform starting offset segment simulation to obtain a first camshaft starting offset segment waveform signal and a second camshaft starting offset segment waveform signal, wherein:
[0438] When the camshaft sensor signal type is a Hall signal type, the square wave squCam and the minimum digital input value 0 are used to simulate the starting offset segment, and the Hall-type first camshaft starting offset segment waveform signal startOffsetWave11(x) and the Hall-type second camshaft starting offset segment waveform signal startOffsetWave12(x) are obtained, wherein the period of the square wave squCam is μ, the duty cycle is 50%, and the first half is V max , the second half takes the value 0, and the spatial size of the signal startOffsetWave11(x) is N cam *(N sec -S offset )+P 11 , the value range of the independent variable x in the signal startOffsetWave11(x) is [0, N cam *(N sec -S offset )+P 11 ]:
[0439]
[0440] The spatial size of the signal startOffsetWave12(x) is S offset , the value range of the independent variable x in the signal startOffsetWave12(x) is [0, S offset ]:
[0441] startOffsetWave12(x)=0,x∈[0,S offset ]
[0442] When the camshaft sensor signal is a magnetoelectric signal, the middle value V of the DAC digital input value is used. max / 2 and a sine wave sinCam with a period of μ are used to simulate the starting offset segment, and the magnetoelectric first camshaft starting offset segment waveform signal startOffsetWave21(x) and the magnetoelectric second camshaft starting offset segment waveform signal startOffsetWave22(x) are obtained, where the spatial size of the signal startOffsetWave21(x) is N cam *(N sec -S offset )+P 11 , the value range of the independent variable x in the signal startOffsetWave21(x) is [0, N cam *(N sec -S offset )+P 11 ]:
[0443]
[0444] The spatial size of the signal startOffsetWave22(x) is S offset , the value range of the independent variable x in the signal startOffsetWave22(x) is [0, S offset ]:
[0445]
[0446] The general segment simulation unit is used to perform general segment simulation to obtain the general segment waveform signal of the camshaft, where:
[0447] When the camshaft sensor signal type is a Hall signal type, the square wave squCam and the minimum digital input value 0 are used for general segment simulation to obtain the Hall camshaft general segment waveform signal normalWave1(x), where the spatial size of the signal normalWave1(x) is N cam *N sec +P 11 , the value range of the independent variable x in the signal normalWave1(x) is [0,N cam *N sec +P 11 ]:
[0448]
[0449] When the camshaft sensor signal is a magnetoelectric signal, the middle value V of the DAC digital input value is used. max / 2 and the sine wave sinCam are used to simulate the general segment to obtain the general segment waveform signal normalWave2(x) of the magnetoelectric camshaft. The spatial size of the signal normalWave2(x) is N cam *N sec +P 11 , the value range of the independent variable x in the signal normalWave2(x) is [0, N cam *N sec +P 11 ]:
[0450]
[0451] The gear shaping section simulation unit is used to simulate the gear shaping section and obtain the camshaft gear shaping section waveform signal, where:
[0452] When the camshaft sensor signal type is a Hall signal type, the square wave squCam and the minimum digital input value 0 are used to simulate the gear segment to obtain the Hall camshaft gear segment waveform signal InsertWave1(x). The spatial size of the signal InsertWave1(x) is N cam *N sec +P 22 , the value range of the independent variable x in the signal InsertWave1(x) is [0, N cam *N sec +P 22 ]:
[0453]
[0454] When the camshaft sensor signal is a magnetoelectric signal, the middle value V of the DAC digital input value is used. max / 2 and the sine wave sinCam are used to simulate the gear segment, and the magnetoelectric camshaft gear segment waveform signal InsertWave2(x) is obtained, where the spatial size of the signal InsertWave2(x) is N cam *N sec +P 22 , the value range of the independent variable x in the signal InsertWave2(x) is [0, N cam *N sec +P 22 ]:
[0455]
[0456] The camshaft sensor signal splicing unit includes:
[0457] The Hall-type camshaft signal splicing unit, when the type of the camshaft sensor signal is the Hall-type signal type, sequentially splices the Hall-type first camshaft starting offset waveform signal startOffsetWave11(x), I left The Hall camshaft normal waveform signal normalWave1(x), the Hall camshaft insert gear waveform signal InsertWave1(x), I right A Hall type camshaft normal waveform signal normalWave1(x) and a Hall type second camshaft starting offset waveform signal startOffsetWave12(x) are obtained to obtain a Hall type signal type camshaft sensor signal camHall;
[0458] The magnetoelectric camshaft signal splicing unit, when the type of the camshaft sensor signal is a magnetoelectric signal type, sequentially splices the magnetoelectric first camshaft starting offset segment waveform signal startOffsetWave21(x), Ileft The normal waveform signal of the magnetoelectric camshaft segment is normalWave2(x), the inserting waveform signal of the magnetoelectric camshaft segment is InsertWave2(x), and the right A magnetoelectric camshaft normal segment waveform signal normalWave2(x) and a magnetoelectric second camshaft starting offset segment waveform signal startOffsetWave22(x) are obtained to obtain a magnetoelectric signal type camshaft sensor signal camMagnetic.
[0459] The crankshaft and camshaft signal generation method and system provided in the embodiment of the present invention can support the setting and modification of characteristic parameters of the ECU crankshaft and camshaft signals to generate different types of crankshaft signals and camshaft signals, simulate the characteristics of each part of the signal through segmented simulation, have flexible parameter configuration, simple simulation structure, good expansibility and universality, and can be applicable to the simulation of various ECU crankshaft and camshaft sensor signals.
[0460] What is disclosed above is only a preferred embodiment of the present invention, which certainly cannot be used to limit the scope of rights of the present invention. A person skilled in the art can understand that all or part of the processes of the above embodiments and equivalent changes made according to the claims of the present invention still fall within the scope of the invention.
Claims
1. A crankshaft camshaft sensor signal generation method with customizable sampling points, characterized in that: include: Step S1, the host computer loads the common parameters and the EECU excitation signal characteristic parameters in the EECU excitation signal configuration file, and packages the EECU excitation signal characteristic parameters and the common parameters and sends them to the slave computer, wherein the EECU excitation signal characteristic parameters include crankshaft signal parameters and camshaft signal parameters; Step S2, the lower computer receives the common parameters and the EECU excitation signal characteristic parameters; Step S3: The MCU of the lower computer calculates the total number of sampling points N required to generate waveform data according to the common parameters. total , and the total number of sampling points N total Adding the common parameters; Step S4, the MCU of the lower computer generates an EECU excitation signal based on the EECU excitation signal characteristic parameter and the common parameter, wherein the EECU excitation signal includes a crankshaft sensor signal and a camshaft sensor signal, and both the crankshaft sensor signal and the camshaft sensor signal are obtained by segmented simulation; Step S5, the FPGA of the lower computer performs clock domain synchronization processing on the crankshaft sensor signal and the camshaft sensor signal in the EECU excitation signal, and outputs the EECU excitation signal after the synchronous clock domain processing to the DAC based on the DDS method.
2. The crankshaft and camshaft sensor signal generating method with customizable sampling points as claimed in claim 1, characterized in that: The common parameters include the maximum value V of the M-bit DAC max , DDS sampling rate F s , signal frequency F out , the size of the component storage space S used to store waveform signal data total 、Number of channels C n , each sampling point requires bit B, and step S3 includes: Step S31, according to V max Calculate the phase accumulator bit number n and the total number of sampling points N total ,in: N total =2 n The phase accumulator bit number n is calculated using calculation method 1 or calculation method 2: The first calculation method is based on the sampling rate F s and the signal generation frequency F out Calculate the independent variable M1, which represents the minimum number of points required to simulate a complete waveform in each channel, and n is a positive integer: log2M1-1 <n≤log2M1 The second calculation method is based on S total , the number of channels C n Each sampling point needs B bits to be calculated, and n is a positive integer: Step S32, adding the common parameters to the EECU excitation signal configuration file.
3. The crankshaft and camshaft sensor signal generating method with customizable sampling points as claimed in claim 2, characterized in that: The step S4 generates the EECU excitation signal based on the EECU excitation signal configuration file, including: Step S41, according to the crankshaft signal parameters, the crankshaft sensor signal in the EECU excitation signal is simulated in sections, wherein the crankshaft signal parameters include the total number of crankshaft teeth G total 、Number of missing teeth on crankshaft G miss , crankshaft number of revolutions R, crankshaft signal type S crank , crankshaft signal inversion F crank , Crankshaft waveform Hall type missing tooth waveform segment indication signal L h , crankshaft waveform magnetoelectric missing tooth waveform segment indication signal L m ; Step S42, simulating the camshaft sensor signal in the EECU excitation signal in sections according to the camshaft signal parameters in the EECU excitation signal configuration file; The EECU excitation signal is a combination of the crankshaft sensor signal and the camshaft sensor signal.
4. The crankshaft and camshaft sensor signal generation method with customizable sampling points as claimed in claim 3, characterized in that: The step S41 of simulating the crankshaft sensor signal in the EECU excitation signal in sections includes: Step S411, calculating the number of crankshaft waveform supplementary points according to the crankshaft signal parameters and the common parameters; Step S412, performing a segmented simulation of the crankshaft sensor signal according to the crankshaft waveform filling point number, wherein the segmented simulation of the crankshaft sensor signal includes a normal tooth waveform segment simulation and a missing tooth waveform segment simulation; Step S413, performing crankshaft waveform splicing according to the segmented simulation result obtained in step S412 to obtain the crankshaft sensor signal; The step S411 includes: Step S411a, calculating the required number of crankshaft signal cycles T according to the crankshaft signal parameters and the common parameters total , the number of waveform data points N in each crankshaft cycle crank 、Number of normal tooth periods N normal , missing tooth period multiple T miss : T total =G total ×R N normal =G total -G miss -1 T miss =G miss +1 Step S411b, calculating the number of crankshaft waveform supplementary points, where: When the crankshaft sensor signal is a Hall signal type or a magnetoelectric missing tooth signal type, the crankshaft waveform supplementary point number includes P Q11 , P Q12 : P lessy =N total -N crank ×T total P Q12 =P lessy -P Q11 ×R Among them, the P Q11 is the number of points required to be filled after the normal tooth segment and the missing tooth segment are spliced. Q12 is the number of points required to be filled after the entire crankshaft signal is spliced. When the crankshaft sensor signal is a Hall signal type or a magnetoelectric signal type with missing teeth, the number of sampling points for generating crankshaft waveform data is compared with N total The number of missing points is P lessy ; When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, the crankshaft waveform supplementary point number includes P Q21 , P Q22 , P Q23 : P Q23 =P lessn -(P Q21 ×N normal +P Q22 )×R Among them, the P Q21 is the number of points to be filled after each normal tooth cycle, the P Q22 is the number of points to be filled after the missing tooth segment, the P Q23 is the number of points required to be filled after the entire crankshaft signal is spliced. When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, the number of sampling points for generating crankshaft waveform data is compared with N total The number of missing points is P lessn ; The step S412 includes: Step S412a, performing normal tooth waveform segment simulation to obtain a crankshaft normal tooth waveform signal, wherein: When the crankshaft sensor signal is a Hall signal type, that is, S crank =0, using the M-bit DAC maximum value V max The normal tooth waveform segment is simulated with the minimum digital input value 0 to generate a Hall type crankshaft normal tooth waveform signal normalWave1Squ(x), the space size of the signal normalWave1Squ(x) is N crank ×N normal The value range of the independent variable x in the signal normalWave1Squ(x) is [0, N crank ×N normal ], the signal normalWave1Squ(x) is composed of N normal The number of sampling points is N crank square wave, when F crank = 0, When F crank =1, When the crankshaft sensor signal is a magnetoelectric missing tooth signal type, that is, S crank =1 and L m = 0, a sine waveform is used to simulate the normal tooth waveform segment to generate a magnetoelectric normal tooth crankshaft signal normalWave21Sin(x), the spatial size of the signal normalWave21Sin(x) is N crank ×N normal The value range of the independent variable x in the signal normalWave21Sin(x) is [0, N crank ×N normal ]; when F crank = 0, the signal normalWave21Sin(x) is composed of N normal The total number of points is N crank The sine wave sin1 is composed of a sine wave with the first half opening downward and the second half opening upward; when F crank =1, the signal normalWave21Sin(x) is composed of N normal The total number of points is N crank The sine wave sin2 is composed of the sine wave sin1, wherein the sine wave sin2 is obtained by shifting the phase of the sine wave sin1 by 180°; normalWave21Sin(x)=sin1,x∈[0,N crank ×N normal ] normalWave21Sin(x)=sin2,x∈[0,N crank ×N normal ] When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, that is, S crank =1 and L m = 0, a sine wave is used to simulate the normal tooth waveform segment to generate a magnetoelectric normal tooth crankshaft signal normalWave22Sin(x), the spatial size of the signal normalWave22Sin(x) is (N crank +P Q21 )×N normal The value range of the independent variable x in the signal normalWave22Sin(x) is [0, (N crank +P Q21 )×N normal ]; when F crank = 0, the signal normalWave22Sin(x) is composed of N normal The total number of points is N crank +P Q21 The waveform sinWaveCrank1 is composed of the sine wave sin1 and P Q21 Value V max / 2 Composition: When F crank =1, the signal normalWave22Sin(x) is composed of N normal The total number of points is N crank +P Q21 The waveform sinWaveCrank2 is composed of the sine wave sin2 and P Q21 Value V max / 2 Composition: Step S412b, performing a missing tooth waveform segment simulation to obtain a crankshaft missing tooth waveform signal, wherein: When the crankshaft sensor signal is a Hall signal type, the value V is used max The missing tooth part is simulated with the minimum digital input value 0 to generate a Hall type missing tooth crankshaft signal quechiHall(x), the spatial size of the signal quechiHall(x) is N crank ×T miss +P Q11 The value range of the independent variable x in the signal quechiHall(x) is [0, N crank ×T miss +P Q11 ]: When the crankshaft sensor signal is a magnetoelectric missing tooth signal type, a sine wave and the value V max / 2 pairs of missing teeth are simulated to generate a magnetoelectric missing tooth crankshaft signal quechiMagnetic1(x), the spatial size of the signal quechiMagnetic1(x) is N crank ×T miss +P Q11 The value range of the independent variable x in the signal quechiMagnetic1(x) is [0, N crank ×T miss +P Q11 ], where the period length is N crank The sine wave at N crank -N crank / 2 position is split to obtain the left half sine wave and the right half sine wave; when F crank = 0, the signal quechiMagnetic1(x) is composed of the left half sine wave sinLeftCrank1, the right half sine wave sinRightCrank1 and the value V max / 2, the left half sine wave sinLeftCrank1 and the right half sine wave sinRightCrank1 are obtained by splitting the sine wave sin1, and the space size of the left half sine wave sinLeftCrank1 is N crank -N crank / 2, the spatial size of the right half sine wave sinRightCrank1 is N crank / 2: When F crank =1, the signal quechiMagnetic1(x) is composed of the left half sine wave sinLeftCrank2, the right half sine wave sinRightCrank2 and the value V max / 2, the left half sine wave sinLeftCrank2 and the right half sine wave sinRightCrank2 are obtained by splitting the sine wave sin2, and the space size of the left half sine wave sinLeftCrank2 is N crank / 2, the spatial size of the right half sine wave sinRightCrank2 is N crank -N crank / 2: When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, a sine wave and the value V max / 2 pairs of missing teeth are simulated to generate a magnetoelectric missing tooth crankshaft signal quechiMagnetic2(x), the spatial size of the signal quechiMagnetic2(x) is N crank / 2*2+P Q22 The value range of the independent variable x in the signal quechiMagnetic2(x) is [0, N crank / 2*2+P Q22 ]; when F crank = 0, the signal quechiMagnetic2(x) is composed of two sine waves sinWaveCrank_Half and P Q22 Value V max / 2, the spatial size of the sine wave sinWaveCrank_Half is N crank / 2, the frequency is twice that of sin1, and the value range of the independent variable x in the sine wave sinWaveCrank_Half is [0,N crank / 2*2]: When F crank =1, the signal quechiMagnetic2(x) is composed of two sine waves sinWaveCrank_Half_ant and P Q22 Value V max / 2, the spatial size of the sine wave sinWaveCrank_Half_ant is N crank / 2, the frequency is twice that of sin2, and the value range of the independent variable x in the sine wave sinWaveCrank_Half is [0,N crank / 2*2]: The step S413 includes: When the crankshaft sensor signal is of Hall type, the Hall type normal tooth crankshaft signal normalWave1Squ(x) and the Hall type missing tooth crankshaft signal quechiHall(x) are spliced to obtain a Hall type crankshaft signal crankHallSec, and R crankHallSec signals are spliced in sequence and the number of supplementary points P is added at the end. Q12 , get the crankshaft sensor signal crankHall of Hall signal type, where R is the number of crankshaft turns, P Q12 The value is the minimum DAC input value 0; When the crankshaft sensor signal is a magnetoelectric missing tooth signal type, the magnetoelectric normal tooth crankshaft signal normalWave21Sin(x) and the magnetoelectric missing tooth crankshaft signal quechiMagnetic1(x) are spliced to obtain a magnetoelectric crankshaft signal crankMagneticSec1, and R of the signals crankMagneticSec1 are spliced in sequence and the number of fill points P is added at the end. Q12 , get the crankshaft sensor signal crankMagnetic1 of the magnetoelectric type with missing teeth, where P Q12 The value is the middle value of the DAC input value When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, the magnetoelectric normal tooth crankshaft signal normalWave22Sin(x) and the magnetoelectric missing tooth crankshaft signal quechiMagnetic2(x) are spliced to obtain a magnetoelectric crankshaft signal crankMagneticSec2, and R of the crankMagneticSec2 signals are spliced in sequence and the number of fill points P is added at the end. Q23 , and obtain the crankshaft sensor signal crankMagnetic2 of the magnetoelectric type without missing teeth.
5. The crankshaft and camshaft sensor signal generation method with customizable sampling points as claimed in claim 4, characterized in that: The camshaft signal parameters include the period μ of a camshaft protrusion, the starting offset S offset , Gear Position I num , Gear distance I dis 、Number of camshaft lobed pulses B cam The step S42 of simulating the camshaft sensor signal in the EECU excitation signal in sections includes: Step S421, calculating the number of camshaft waveform supplement points according to the camshaft signal parameters and the common parameters; Step S422, simulating the camshaft sensor signal in sections; Step S423, performing camshaft waveform splicing according to the segmented simulation result obtained in step S422 to obtain the camshaft sensor signal; The step S421 includes: Step S421a, calculating the number of waveform data points N in each cycle of the camshaft according to the camshaft signal parameters and the common parameters cam 、N is the general segment cycle number sec , the number of complete general waveform segments on the left side of the camshaft tooth position I left , the number of complete general waveform segments on the right side of the camshaft tooth position I right ; Step S421b, calculating the number of camshaft waveform supplement points, the number of camshaft waveform supplement points includes P 11 , P 22 ,in: P less2 =N total -N cam ×T total P 22 =P less2 -P 11 *(B cam -1) Among them, the number of supplementary points P 11 is the number of points to be filled after the initial offset segment and the general segment. 22 is the number of points to be filled after the gear shaping stage, and the number of sampling points for generating the camshaft waveform data is compared with the N total The number of missing points is P less2 ; The camshaft sensor signal adopts a segmented simulation method, which is divided into two starting offset segments, a general segment and a gear segment. The number of cycles of the first starting offset segment is T cam21 +T cam1 , the number of cycles of the second starting offset segment is T cam22 , the period of a general segment is T cam3 +T cam1 , the number of cycles of the gear shaping section is T cam4 +2*T cam1 +T cam5 ; Let T cam1 =μ, T cam21 =N sec -S offset -T cam1 , T cam22 =S offset , T cam3 =N sec -T cam1 , T cam4 =N sec -2×T cam1 -T cam5 , T cam5 =I dis , the step S422 comprises: Step S422a, performing a start offset segment simulation to obtain a first camshaft start offset segment waveform signal and a second camshaft start offset segment waveform signal, wherein: When the camshaft sensor signal is of Hall type, the square wave squCam and the minimum digital input value 0 are used to simulate the starting offset segment, and the Hall type first camshaft starting offset segment waveform signal startOffsetWave11(x) and the Hall type second camshaft starting offset segment waveform signal startOffsetWave12(x) are obtained, wherein the period of the square wave squCam is μ, the duty cycle is 50%, and the first half is V max , the second half takes a value of 0, and the spatial size of the signal startOffsetWave11(x) is N cam ×(N sec -S offset )+P 11 The value range of the independent variable x in the signal startOffsetWave11(x) is [0, N cam ×(N sec -S offset )+P 11 ]: The spatial size of the signal startOffsetWave12(x) is S offset The value range of the independent variable x in the signal startOffsetWave12(x) is [0, S offset ]: startOffsetWave12(x)=0,x∈[0,S offset ] When the camshaft sensor signal is a magnetoelectric signal, the intermediate value V of the DAC digital input value is used. max / 2 and a sine wave sinCam with a period of μ to simulate the starting offset segment, and obtain the magnetoelectric first camshaft starting offset segment waveform signal startOffsetWave21(x) and the magnetoelectric second camshaft starting offset segment waveform signal startOffsetWave22(x), wherein the spatial size of the signal startOffsetWave21(x) is N cam *(N sec -S offset )+P 11 The value range of the independent variable x in the signal startOffsetWave21(x) is [0, N cam *(N sec -S offset )+P 11 ]: The spatial size of the signal startOffsetWave22(x) is S offset The value range of the independent variable x in the signal startOffsetWave22(x) is [0, S offset ]: Step S422b, perform general segment simulation to obtain a general segment waveform signal of the camshaft, wherein: When the camshaft sensor signal is a Hall-type signal, a square wave squCam and the minimum digital input value 0 are used to perform a general segment simulation to obtain a Hall-type camshaft general segment waveform signal normalWave1(x), wherein the spatial size of the signal normalWave1(x) is N cam *N sec +P 11 The value range of the independent variable x in the signal normalWave1(x) is [0,N cam *N sec +P 11 ]: When the camshaft sensor signal is a magnetoelectric signal, the intermediate value V of the DAC digital input value is used. max / 2 and the sine wave sinCam are used to perform a general segment simulation to obtain a general segment waveform signal normalWave2(x) of the magnetoelectric camshaft. The spatial size of the signal normalWave2(x) is N cam *N sec +P 11 The value range of the independent variable x in the signal normalWave2(x) is [0, N cam *N sec +P 11 ]: Step S422c, perform gear shaping segment simulation to obtain a camshaft gear shaping segment waveform signal, wherein: When the camshaft sensor signal is a Hall signal type, the square wave squCam and the minimum digital input value 0 are used to simulate the gear segment to obtain a Hall camshaft gear segment waveform signal InsertWave1(x). The spatial size of the signal InsertWave1(x) is N. cam *N sec +P 22 , the value range of the independent variable x in the signal InsertWave1(x) is [0, N cam *N sec +P 22 ]: When the camshaft sensor signal is a magnetoelectric signal, the intermediate value V of the DAC digital input value is used. max / 2 and the sine wave sinCam are used to simulate the gear segment, and the magnetoelectric camshaft gear segment waveform signal InsertWave2(x) is obtained, wherein the spatial size of the signal InsertWave2(x) is N cam *N sec +P 22 The value range of the independent variable x in the signal InsertWave2(x) is [0, N cam *N sec +P 22 ]: The step S423 includes: When the type of the camshaft sensor signal is a Hall signal type, the Hall first camshaft starting offset segment waveform signal startOffsetWave11(x), I left The Hall camshaft normal waveform signal normalWave1(x), the Hall camshaft insert gear waveform signal InsertWave1(x), I right The Hall type camshaft normal segment waveform signal normalWave1(x) and the Hall type second camshaft starting offset segment waveform signal startOffsetWave12(x) are used to obtain a camshaft sensor signal camHall of the Hall type signal type; When the type of the camshaft sensor signal is a magnetoelectric signal type, the magnetoelectric first camshaft starting offset waveform signal startOffsetWave21(x), I left The normal waveform signal of the magnetoelectric camshaft normalWave2(x), the inserting gear waveform signal of the magnetoelectric camshaft InsertWave2(x), I right The normal waveform signal normalWave2(x) of the magnetoelectric camshaft and the start offset waveform signal startOffsetWave22(x) of the magnetoelectric second camshaft are used to obtain a camshaft sensor signal camMagnetic of a magnetoelectric signal type.
6. A crankshaft and camshaft sensor signal generating system with customizable sampling points, characterized in that: It includes: a host computer, which is used to load the common parameters and the EECU excitation signal characteristic parameters in the EECU excitation signal configuration file, and package the EECU excitation signal characteristic parameters and the common parameters and send them to the slave computer, wherein the EECU excitation signal characteristic parameters include crankshaft signal parameters and camshaft signal parameters; The lower computer is used to receive the common parameters and the EECU excitation signal characteristic parameters; The MCU of the lower computer is used to calculate the total number of sampling points N required to generate waveform data according to the common parameters. total , and the total number of sampling points N total Adding the common parameters; The MCU of the lower computer is used to generate an EECU excitation signal based on the EECU excitation signal characteristic parameters and the common parameters, and the EECU excitation signal includes a crankshaft sensor signal and a camshaft sensor signal, and the crankshaft sensor signal and the camshaft sensor signal are both obtained through segmented simulation; the FPGA of the lower computer is used to perform clock domain synchronization processing on the crankshaft sensor signal and the camshaft sensor signal in the EECU excitation signal, and output the EECU excitation signal after the synchronized clock domain processing to the DAC based on the DDS method.
7. The crankshaft and camshaft sensor signal generating system with customizable sampling points as claimed in claim 6, characterized in that: The common parameters include the maximum value V of the M-bit DAC max , DDS sampling rate F s , signal frequency F out , the size of the component storage space S used to store waveform signal data total 、Number of channels C n Each sampling point requires bit B, and the MCU of the lower computer includes: Calculation module for V max Calculate the phase accumulator bit number n and the total number of sampling points N total ,in: N total =2 n The phase accumulator bit number n is calculated using calculation method 1 or calculation method 2: The first calculation method is based on the sampling rate F s and the signal generation frequency F out Calculate the independent variable M1, which represents the minimum number of points required to simulate a complete waveform in each channel, and n is a positive integer: log2M1-1 <n≤log2M1 The second calculation method is based on S total , the number of channels C n Each sampling point needs B bits to be calculated, and n is a positive integer: An adding module is used to add the common parameters to the EECU excitation signal configuration file.
8. The crankshaft and camshaft sensor signal generating system with customizable sampling points as claimed in claim 7, characterized in that: The MCU of the lower computer also includes: The crankshaft sensor signal generation module is used to simulate the crankshaft sensor signal in the EECU excitation signal in sections according to the crankshaft signal parameters in the EECU excitation signal configuration file, wherein the crankshaft signal parameters include the total number of crankshaft teeth G total 、Number of missing teeth on crankshaft G miss , crankshaft number of revolutions R, crankshaft signal type S crank , crankshaft signal inversion F crank , Crankshaft waveform Hall type missing tooth waveform segment indication signal L h , crankshaft waveform magnetoelectric missing tooth waveform segment indication signal L m ; A camshaft sensor signal generation module is used to simulate the camshaft sensor signal in the EECU excitation signal in sections according to the camshaft signal parameters in the EECU excitation signal configuration file; the EECU excitation signal is a combination of the crankshaft sensor signal and the camshaft sensor signal.
9. The crankshaft and camshaft sensor signal generating system with customizable sampling points as claimed in claim 8, characterized in that: The crankshaft sensor signal generating module comprises: A crankshaft waveform supplementary point number calculation unit, used to calculate the crankshaft waveform supplementary point number according to the crankshaft signal parameter and the common parameter; A crankshaft sensor signal segmented simulation unit, used for performing segmented simulation of the crankshaft sensor signal according to the crankshaft waveform filling point number, wherein the segmented simulation of the crankshaft sensor signal includes a normal tooth waveform segment simulation and a missing tooth waveform segment simulation; A crankshaft sensor signal splicing unit, used for splicing crankshaft waveforms according to the segmented simulation results to obtain the crankshaft sensor signal; Crankshaft waveform supplementary point calculation unit: According to the crankshaft signal parameters and the common parameters, the required number of cycles T of the crankshaft signal is calculated. total , the number of waveform data points N in each crankshaft cycle crank 、Number of normal tooth periods N normal , missing tooth period multiple T miss : T total =G total ×R N normal =G total -G miss -1 T miss =G miss +1 Calculate the number of crankshaft waveform supplementary points, where: When the crankshaft sensor signal is a Hall signal type or a magnetoelectric missing tooth signal type, the crankshaft waveform supplementary point number includes P Q11 , P Q12 : P lessy =N total -N crank ×T total P Q12 =P lessy -P Q11 ×R Among them, the P Q11 is the number of points required to be filled after the normal tooth segment and the missing tooth segment are spliced. Q12 is the number of points required to be filled after the entire crankshaft signal is spliced. When the crankshaft sensor signal is a Hall signal type or a magnetoelectric signal type with missing teeth, the number of sampling points for generating crankshaft waveform data is compared with N total The number of missing points is P lessy ; When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, the crankshaft waveform supplementary point number includes P Q21 , P Q22 , P Q23 : P Q23 =P lessn -(P Q21 ×N normal +P Q22 )×R Among them, the P Q21 is the number of points to be filled after each normal tooth cycle, the P Q22 is the number of points to be filled after the missing tooth segment, the P Q23 is the number of points required to be filled after the entire crankshaft signal is spliced. When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, the number of sampling points for generating crankshaft waveform data is compared with N total The number of missing points is P lessn ; The crankshaft sensor signal segment simulation unit includes a normal tooth waveform segment simulation unit and a missing tooth waveform segment simulation unit, wherein: The normal tooth waveform segment simulation unit is used to simulate the normal tooth waveform segment to obtain the crankshaft normal tooth waveform signal, wherein: When the crankshaft sensor signal is a Hall signal type, that is, S crank =0, using the M-bit DAC maximum value V max The normal tooth waveform segment is simulated with the minimum digital input value 0 to generate a Hall type crankshaft normal tooth waveform signal normalWave1Squ(x), the space size of the signal normalWave1Squ(x) is N crank ×N normal The value range of the independent variable x in the signal normalWave1Squ(x) is [0, N crank ×N normal ], the signal normalWave1Squ(x) is composed of N normal The number of sampling points is N crank square wave, when F crank = 0, When F crank =1, When the crankshaft sensor signal is a magnetoelectric missing tooth signal type, that is, S crank =1 and L m = 0, a sine waveform is used to simulate the normal tooth waveform segment to generate a magnetoelectric normal tooth crankshaft signal normalWave21Sin(x), the spatial size of the signal normalWave21Sin(x) is N crank ×N normal The value range of the independent variable x in the signal normalWave21Sin(x) is [0, N crank ×N normal ]; when F crank = 0, the signal normalWave21Sin(x) is composed of N normal The total number of points is N crank The sine wave sin1 is composed of a sine wave with the first half opening downward and the second half opening upward; when F crank =1, the signal normalWave21Sin(x) is composed of N normal The total number of points is N crank The sine wave sin2 is composed of the sine wave sin1, wherein the sine wave sin2 is obtained by shifting the phase of the sine wave sin1 by 180°; normalWave21Sin(x)=sin1,x∈[0,N crank ×N normal ] normalWave21Sin(x)=sin2,x∈[0,N crank ×N normal ] When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, that is, S crank =1 and L m = 0, a sine wave is used to simulate the normal tooth waveform segment to generate a magnetoelectric normal tooth crankshaft signal normalWave22Sin(x), the spatial size of the signal normalWave22Sin(x) is (N crank +P Q21 )×N normal The value range of the independent variable x in the signal normalWave22Sin(x) is [0, (N crank +P Q21 )×N normal ]; when F crank = 0, the signal normalWave22Sin(x) is composed of N normal The total number of points is N crank +P Q21 The waveform sinWaveCrank1 is composed of the sine wave sin1 and P Q21 Value V max / 2 Composition: When F crank =1, the signal normalWave22Sin(x) is composed of N normal The total number of points is N crank +P Q21 The waveform sinWaveCrank2 is composed of the sine wave sin2 and P Q21 Value V max / 2 Composition: The missing tooth waveform segment simulation unit is used to simulate the missing tooth waveform segment to obtain a crankshaft missing tooth waveform signal, wherein: When the crankshaft sensor signal is a Hall signal type, the value V is used max The missing tooth part is simulated with the minimum digital input value 0 to generate a Hall type missing tooth crankshaft signal quechiHall(x), the spatial size of the signal quechiHall(x) is N crank ×T miss +P Q11 The value range of the independent variable x in the signal quechiHall(x) is [0, N crank ×T miss +P Q11 ]: When the crankshaft sensor signal is a magnetoelectric missing tooth signal type, a sine wave and the value V max / 2 pairs of missing teeth are simulated to generate a magnetoelectric missing tooth crankshaft signal quechiMagnetic1(x), the spatial size of the signal quechiMagnetic1(x) is N crank ×T miss +P Q11 The value range of the independent variable x in the signal quechiMagnetic1(x) is [0, N crank ×T miss +P Q11 ], where the period length is N crank The sine wave at N crank -N crank / 2 position is split to obtain the left half sine wave and the right half sine wave; when F crank = 0, the signal quechiMagnetic1(x) is composed of the left half sine wave sinLeftCrank1, the right half sine wave sinRightCrank1 and the value V max / 2, the left half sine wave sinLeftCrank1 and the right half sine wave sinRightCrank1 are obtained by splitting the sine wave sin1, and the space size of the left half sine wave sinLeftCrank1 is N crank -N crank / 2, the spatial size of the right half sine wave sinRightCrank1 is N crank / 2: When F crank =1, the signal quechiMagnetic1(x) is composed of the left half sine wave sinLeftCrank2, the right half sine wave sinRightCrank2 and the value V max / 2, the left half sine wave sinLeftCrank2 and the right half sine wave sinRightCrank2 are obtained by splitting the sine wave sin2, and the space size of the left half sine wave sinLeftCrank2 is N crank / 2, the spatial size of the right half sine wave sinRightCrank2 is N crank -N crank / 2: When the crankshaft sensor signal is a magnetoelectric signal without missing teeth, a sine wave and the value V max / 2 pairs of missing teeth are simulated to generate a magnetoelectric missing tooth crankshaft signal quechiMagnetic2(x), the spatial size of the signal quechiMagnetic2(x) is N crank / 2*2+P Q22 The value range of the independent variable x in the signal quechiMagnetic2(x) is [0, N crank / 2*2+P Q22 ]; when F crank = 0, the signal quechiMagnetic2(x) is composed of two sine waves sinWaveCrank_Half and P Q22 Value V max / 2, the spatial size of the sine wave sinWaveCrank_Half is N crank / 2, the frequency is twice that of sin1, and the value range of the independent variable x in the sine wave sinWaveCrank_Half is [0,N crank / 2*2]: When F crank =1, the signal quechiMagnetic2(x) is composed of two sine waves sinWaveCrank_Half_ant and P Q22 Value V max / 2, the spatial size of the sine wave sinWaveCrank_Half_ant is N crank / 2, the frequency is twice that of sin1, and the value range of the independent variable x in the sine wave sinWaveCrank_Half is [0,N crank / 2*2]: The crankshaft sensor signal splicing unit comprises: When the crankshaft sensor signal is of Hall type, the Hall type normal tooth crankshaft signal normalWave1Squ(x) and the Hall type missing tooth crankshaft signal quechiHall(x) are spliced to obtain a Hall type crankshaft signal crankHallSec, and R crankHallSec signals are spliced in sequence and the number of supplementary points P is added at the end. Q12 , get the crankshaft sensor signal crankHall of Hall signal type, where R is the number of crankshaft turns, P Q12 The value is the minimum DAC input value 0; The Hall type crankshaft signal splicing unit, when the crankshaft sensor signal is a magnetoelectric missing tooth signal type, splices the magnetoelectric normal tooth crankshaft signal normalWave21Sin(x) and the magnetoelectric missing tooth crankshaft signal quechiMagnetic1(x) to obtain a magnetoelectric crankshaft signal crankMagneticSec1, splices R of the signals crankMagneticSec1 in sequence and adds the number of fill points P at the end Q12 , get the crankshaft sensor signal crankMagnetic1 of the magnetoelectric type with missing teeth, where P Q12 The value is the middle value of the DAC input value The magnetoelectric crankshaft signal splicing unit, when the crankshaft sensor signal is a magnetoelectric signal type without missing teeth, splices the magnetoelectric normal tooth crankshaft signal normalWave22Sin(x) and the magnetoelectric missing tooth crankshaft signal quechiMagnetic2(x) to obtain a magnetoelectric crankshaft signal crankMagneticSec2, splices R of the signals crankMagneticSec2 in sequence and adds the number of fill points P at the end Q23 , and obtain the crankshaft sensor signal crankMagnetic2 of the magnetoelectric type without missing teeth.
10. The crankshaft and camshaft sensor signal generating system with customizable sampling points as claimed in claim 9, characterized in that: The camshaft signal parameters include the period μ of a camshaft protrusion, the starting offset S offset , Gear Position I num , Gear distance I dis 、Number of camshaft lobed pulses B cam , the camshaft signal parameter generating module comprises: A camshaft waveform supplement point number calculation unit, used to calculate the camshaft waveform supplement point number according to the camshaft signal parameters and the common parameters; A camshaft sensor signal segmented simulation unit, used for segmented simulation of the camshaft sensor signal; A camshaft sensor signal splicing unit, used for splicing camshaft waveforms to obtain the camshaft sensor signal; The camshaft waveform supplementary point number calculation unit: According to the camshaft signal parameters and the common parameters, the number of waveform data points N in each cycle of the camshaft is calculated. cam 、N is the general segment cycle number sec , the number of complete general waveform segments on the left side of the camshaft tooth position I left , the number of complete general waveform segments on the right side of the camshaft tooth position I right ; Calculate the number of camshaft waveform supplement points, which includes P 11 , P 22 ,in: P less2 =N total -N cam ×T total P 22 =P less2 -P 11 *(B cam -1) Among them, the number of supplementary points P 11 is the number of points to be filled after the initial offset segment and the general segment. 22 is the number of points to be filled after the gear shaping stage, and the number of sampling points for generating the camshaft waveform data is compared with the N total The number of missing points is P less2 ; The camshaft sensor signal adopts a segmented simulation method, which is divided into two starting offset segments, a general segment and a gear segment. The number of cycles of the first starting offset segment is T cam21 +T cam1 , the number of cycles of the second starting offset segment is T cam22 , the period of a general segment is T cam3 +T cam1 , the number of cycles of the gear shaping section is T cam4 +2*T cam1 +T cam5 ; Let T cam1 =μ, T cam21 =N sec -S offset -T cam1 , T cam22 =S offset , T cam3 =N sec -T cam1 , T cam4 =N sec -2×T cam1 -T cam5 , T cam5 =I dis The camshaft sensor signal segment simulation unit includes a starting offset segment simulation unit, a general segment simulation unit and a gear insertion segment simulation unit, wherein: The starting offset segment simulation unit is used to perform starting offset segment simulation to obtain a first camshaft starting offset segment waveform signal and a second camshaft starting offset segment waveform signal, wherein: When the camshaft sensor signal is of Hall type, the square wave squCam and the minimum digital input value 0 are used to simulate the starting offset segment, and the Hall type first camshaft starting offset segment waveform signal startOffsetWave11(x) and the Hall type second camshaft starting offset segment waveform signal startOffsetWave12(x) are obtained, wherein the period of the square wave squCam is μ, the duty cycle is 50%, and the first half is V max , the second half takes a value of 0, and the spatial size of the signal startOffsetWave11(x) is N cam *(N sec -S offset )+P 11 The value range of the independent variable x in the signal startOffsetWave11(x) is [0, N cam *(N sec -S offset )+P 11 ]: The spatial size of the signal startOffsetWave12(x) is S offset The value range of the independent variable x in the signal startOffsetWave12(x) is [0, S offset ]: startOffsetWave12(x)=0,x∈[0,S offset ] When the camshaft sensor signal is a magnetoelectric signal, the intermediate value V of the DAC digital input value is used. max / 2 and a sine wave sinCam with a period of μ to simulate the starting offset segment, and obtain the magnetoelectric first camshaft starting offset segment waveform signal startOffsetWave21(x) and the magnetoelectric second camshaft starting offset segment waveform signal startOffsetWave22(x), wherein the spatial size of the signal startOffsetWave21(x) is N cam *(N sec -S offset )+P 11 The value range of the independent variable x in the signal startOffsetWave21(x) is [0, N cam *(N sec -S offset )+P 11 ]: The spatial size of the signal startOffsetWave22(x) is S offset The value range of the independent variable x in the signal startOffsetWave22(x) is [0, S offset ]: The general segment simulation unit is used to perform general segment simulation to obtain a general segment waveform signal of the camshaft, wherein: When the camshaft sensor signal is a Hall-type signal, a square wave squCam and the minimum digital input value 0 are used to perform a general segment simulation to obtain a Hall-type camshaft general segment waveform signal normalWave1(x), wherein the spatial size of the signal normalWave1(x) is N cam *N sec +P 11 The value range of the independent variable x in the signal normalWave1(x) is [0,N cam *N sec +P 11 ]: When the camshaft sensor signal is a magnetoelectric signal, the intermediate value V of the DAC digital input value is used. max / 2 and the sine wave sinCam are used to perform a general segment simulation to obtain a general segment waveform signal normalWave2(x) of the magnetoelectric camshaft. The spatial size of the signal normalWave2(x) is N cam *N sec +P 11 The value range of the independent variable x in the signal normalWave2(x) is [0, N cam *N sec +P 11 ]: The gear-shaping segment simulation unit is used to perform gear-shaping segment simulation to obtain a camshaft gear-shaping segment waveform signal, wherein: When the camshaft sensor signal is a Hall signal type, the square wave squCam and the minimum digital input value 0 are used to simulate the gear segment to obtain a Hall camshaft gear segment waveform signal InsertWave1(x). The spatial size of the signal InsertWave1(x) is N. cam *N sec +P 22 , the value range of the independent variable x in the signal InsertWave1(x) is [0, N cam *N sec +P 22 ]: When the camshaft sensor signal is a magnetoelectric signal, the intermediate value V of the DAC digital input value is used. max / 2 and the sine wave sinCam are used to simulate the gear segment, and the magnetoelectric camshaft gear segment waveform signal InsertWave2(x) is obtained, wherein the spatial size of the signal InsertWave2(x) is N cam *N sec +P 22 The value range of the independent variable x in the signal InsertWave2(x) is [0, N cam *N sec +P 22 ]: The camshaft sensor signal splicing unit comprises: The Hall-type camshaft signal splicing unit, when the type of the camshaft sensor signal is a Hall-type signal type, sequentially splices the Hall-type first camshaft starting offset segment waveform signal startOffsetWave11(x), I left The Hall camshaft normal waveform signal normalWave1(x), the Hall camshaft insert gear waveform signal InsertWave1(x), I right The Hall type camshaft normal segment waveform signal normalWave1(x) and the Hall type second camshaft starting offset segment waveform signal startOffsetWave12(x) are used to obtain a camshaft sensor signal camHall of the Hall type signal type; The magnetoelectric camshaft signal splicing unit, when the type of the camshaft sensor signal is a magnetoelectric signal type, sequentially splices the magnetoelectric first camshaft starting offset segment waveform signal startOffsetWave21(x), I left The normal waveform signal of the magnetoelectric camshaft normalWave2(x), the inserting gear waveform signal of the magnetoelectric camshaft InsertWave2(x), I right The normal waveform signal normalWave2(x) of the magnetoelectric camshaft and the start offset waveform signal startOffsetWave22(x) of the magnetoelectric second camshaft are used to obtain a camshaft sensor signal camMagnetic of a magnetoelectric signal type.
