With the emergence of single-edge nibble transmission (SENT) signals in the field of automotive sensors, equipping major vehicle manufacturing companies with a set of well-functioning SENT signal acquisition systems has become an essential requirement. At present, we have designed a SENT signal acquisition system to satisfy this requirement and provide a practical option for companies. The acquisition system is based on the SENT J2716 communication protocol. A master control circuit with an STM8AF6213 microcontroller as the core is used to capture the sensor output signal and apply C language programming to realize the decoding of the signal. Finally, the data are processed, extracted, and preserved by the LabVIEW program to achieve the purpose of data visualization. In order to ensure the accuracy of the data, a double Cyclic Redundancy Check (CRC) checksum mode is incorporated into the system. After completion, the system was applied to several sets of SENT signal acquisition and testing experiments, and the experimental results all showed that the system operated normally and could meet the requirements of companies.
I. INTRODUCTION
With the increasing intelligence of the vehicle, the variety and quantity of in-vehicle sensors have been enriched,1,2 and the large amount of traditional sensors that output analog electrical signals has contributed to a significant growth in the workload of in-vehicle communication networks, while also leading to complex circuit wiring in vehicle control systems and an expansion of electronic elements space; the use of digital signals in in-vehicle sensors is gradually gaining attention. The Society of Automotive Engineers (SAE) has introduced the single-edge nibble transmission signal (SENT signal), which can be used as the output signal of new in-vehicle sensors to mitigate the issues mentioned above to a certain extent. In the process of sensor research and development, a new type of sensor based on the SENT protocol has become the priority of automotive sensor manufacturers in recent years. In the sensor development process, a specialized SENT signal acquisition system is required for performance testing, and in response to this actual market demand, it is essential to design a SENT signal acquisition system that satisfies industrial use standards.
The SENT signal, as a digital pulse signal, can be captured in a variety of ways. The pulse waveform of the SENT signal can be captured by a tabletop or virtual oscilloscope (OSC);3 however, the OSC is expensive and less portable, which does not correspond to the design demands. Microprocessors (MPUs) with an internally integrated SENT signal parsing module can also be used for the SENT signal capture, such as the RH850 and P1x series microcontrollers (MCU).4 However, since the MCU series is not designed specifically for SENT signal capturing, the price is relatively high, and other functions of the superfluous design will be unused, so it is not suitable as the first choice for specialized acquisition systems. Sensor output signal acquisition systems typically employ a combination of software and hardware.5,6 According to the feature that the falling edge of a pulse signal can trigger a timer to interrupt the response, the capture of SENT signals can also be achieved. Based on this principle, this paper designs a SENT signal acquisition system that is up to the standard for business use. The acquisition system fulfills the performance requirements of accuracy and stability, as well as being economical, practical, and portable while enabling data visualization and data export functions.7,8 The design utilizes an MCU as the main control circuit to capture the SENT signal, decodes the captured signal by C program language, then transmits the decoded data to the host computer through universal serial bus (USB) communication technology,9 further analyzes and processes it by combining with LabVIEW program to obtain the coded information carried in the SENT signal, and has the man–machine interaction function.10,11
II. OVERALL STRUCTURE OF THE ACQUISITION SYSTEM
The SENT signal acquisition system is divided into the analog circuit part responsible for signal acquisition and the LabVIEW program part for processing the signal. Therein, the signal acquisition part includes the main control circuit with the microcontroller as the core, the interface circuit for receiving signals, the USB to serial port circuit, the USB communicator port for supplying power and transmitting data, and the reserved port for backup power input. The signal treatment part is programmed by LabVIEW to realize, screen, and parse the received signals, and then display the real-time output SENT signals on the front screen through the visualization function. Meanwhile, the output data can be exported and stored to provide support for subsequent analysis. The overall structure of this acquisition system is shown in Fig. 1, which can achieve the design requirements in terms of both functionality and practicality.
III. SIGNAL ACQUISITION
A. SENT signal introduction
The SENT signal is a clock pulse signal, which transmits information by encoding data and pulse period; it does not require any start-up command in the transmission process; once the sensor is powered on, the signal transmitter starts to work and transmits information continuously in packets with a fixed structure. Figure 2 shows the actual output signal of a displacement sensor captured by the virtual OSC, and it can be seen that the output waveform of the SENT signal is a continuous pulse sequence. The SENT signal is measured in clock beats, and the developer can set a 1 tick time ts according to the demands of the target sensor, typically ranging from 3 to 10 µs. A complete SENT signal sequence is also called one frame of packets, as shown in Fig. 3. The synchronization pulse is used for time calibration and positioning; the state and data pulses carry the data information, each of which is 4 bit in size or 1 Nibble. The former constitutes the information DS for the slow channel, and the latter constitutes the information D1–D6 for the fast channel; the CRC pulse contains the redundancy checking information DCRC, which is applied to verify whether the six data pulses transmitted by the packet are correct or not; this acquisition system utilizes the two checksum methods in the SENT protocol for data transmission, adding a double CRC verification situated in the microcontroller program and LabVIEW program separately; the pause pulse is an optional segment.
B. Signal acquisition circuit
Under the comprehensive consideration of functional requirements and cost control, the STM8A series MCU is selected as the signal receiver, which is an automotive application type MCU produced by ST Microelectronics with two integrated timers that can respond to external interrupts and up to seven pins for external interrupt acquisition, which can be sufficient for regular testing in terms of quantity, and then use the CH340 series chip to establish USB communication with LabVIEW. The USB serial bus, as one of the communication standards for computer buses and peripheral devices, can greatly improve the adaptability of the acquisition system. The main control circuit is shown in Fig. 4. The system adopts a saturated design for the two timers TIM1 and TIM5 in STM8AF6213 and presets seven SENT signal capture interfaces, and the interface circuit is shown in the dotted box in Fig. 4. To ensure the stable operation of the sensor within the normal operating voltage, the circuit is additionally preset with a backup power input interface to prevent the USB supply voltage from failing to work for the sensor.
C. Signal decoding
1. MCU program
The decoding process of the SENT signal is done by the MCU program. Since the two timers TIM1 and TIM5 are configured for seven acquisition channels, it is required to realize the seven-way acquisition by cyclically switching each channel. The seven-way acquisition channels are not in a fully operational state at all times, and the program design is divided into two cases depending on whether there is sensor signal input or not. The program procedure is shown in Fig. 5: When there is an input signal, 23 interrupt responses are completed to enter a decoding program. Since the pause pulse of the previous frame and the synchronization pulse of the next frame are adjacent to each other and their beat sizes are 12–768 ticks and 56 ticks, respectively, there is a possibility that the pulse periods of the pause pulse and the synchronization pulse of adjacent frames are the same; thus, to avoid the packet extraction error caused by this special situation, the decoding program takes 21 pulse periods as one set of original data. When there is no input signal, the timer cannot capture any interrupt, enabling the internal timer TIM6 in STM8AF6213 as a timing clock and adding timeout judgment to avoid the channel being in an endless loop.
A flag bit for communication with LabVIEW is added before the data after decoding are complete so that the transmitted data can be interpreted by the upper computer. The naming rule of the flag bit is 71 + AA + acquisition channel number + 08, as shown in the data sequence in Fig. 6.
2. Decoding principle
Check Table I to obtain a set of data information sufficient to constitute a complete data packet: status pulse DS, six data pulses D1–D6, checksum pulse DCRC, of which the synchronization pulse and pause pulse do not carry the valid information of the sensor and are not analyzed. At this time, the set of data for the CRC checksum is ready; if the checksum passes, then output; if the checksum errors, then re-open the interrupt capture.
3. CRC checksum
uint8_t CRC4_Table[16] = {0, 13, 7, 10, 14, 3, 9, 4, 1, 12, 6, 11, 15, 2, 8, 5};
/* len: the length of array data */
uint8_t crc4_cal(uint8_t *data, uint8_t len)
{
uint8_t result = 0x03;
uint8_t tableNo = 0;
int i = 0;
for(; i < len; i++)
{
tableNo = result ^ data[i];
result = CRC4_Table[tableNo];
}
return result;
}
Table II gives seven frames of SENT signal packets output by a pressure sensor under atmospheric pressure operation. It can be seen that the array data consisting of D1–D6 obtain a theoretical value after the above CRC checksum procedure and compare it with the actual captured DCRC value to determine whether it is consistent, and if the result is in agreement, it means that the data frame is transmitted correctly.
CRC checksum instance.
Data packet . | D1 . | D2 . | D3 . | D4 . | D5 . | D6 . | DCRC . | CRC checksum . | T/F . |
---|---|---|---|---|---|---|---|---|---|
#1 | 0 | B | E | 1 | 4 | F | 6 | 6 | T |
#2 | 0 | B | 9 | 6 | 4 | F | F | F | T |
#3 | 0 | B | B | 4 | 4 | F | 9 | 9 | T |
#4 | 0 | B | D | 2 | 4 | F | 3 | 3 | T |
#5 | 0 | C | 0 | F | 3 | F | A | A | T |
#6 | 0 | B | A | 5 | 4 | F | A | A | T |
#7 | 0 | B | C | 3 | 4 | F | 0 | 0 | T |
Data packet . | D1 . | D2 . | D3 . | D4 . | D5 . | D6 . | DCRC . | CRC checksum . | T/F . |
---|---|---|---|---|---|---|---|---|---|
#1 | 0 | B | E | 1 | 4 | F | 6 | 6 | T |
#2 | 0 | B | 9 | 6 | 4 | F | F | F | T |
#3 | 0 | B | B | 4 | 4 | F | 9 | 9 | T |
#4 | 0 | B | D | 2 | 4 | F | 3 | 3 | T |
#5 | 0 | C | 0 | F | 3 | F | A | A | T |
#6 | 0 | B | A | 5 | 4 | F | A | A | T |
#7 | 0 | B | C | 3 | 4 | F | 0 | 0 | T |
4. Serial debugging
Considering the difference in output characteristics of different target sensors, the redundant design is adopted when writing the MCU program, allowing the upper computer to configure the corresponding parameters, such as the theoretical beat value ts and the number of channels open. Using the serial debugging tool, the debugging window is shown in Fig. 6. The adjustable parameters are written to the MCU via the “string input box,” and the writing rules are given in Table III.
Serial debugging tool parameter writing rules.
Number of string . | Name of string . | Input . | Writing rules . |
---|---|---|---|
#01 | Communication | 70 | Used for communication with microcontroller |
#02 | Communication | 55 | Used for communication with microcontroller |
#03 | Write/read | 01/02 | 01 for write, 02 for read |
#04 | Combination | 03 | Data combination |
#05 | Channel | 01–07 | Number of open channels: 1–7 |
#06 | Data | 06 | 6 data pulses |
#07 | Clock | 03–90 | Theoretical tick value ts |
Number of string . | Name of string . | Input . | Writing rules . |
---|---|---|---|
#01 | Communication | 70 | Used for communication with microcontroller |
#02 | Communication | 55 | Used for communication with microcontroller |
#03 | Write/read | 01/02 | 01 for write, 02 for read |
#04 | Combination | 03 | Data combination |
#05 | Channel | 01–07 | Number of open channels: 1–7 |
#06 | Data | 06 | 6 data pulses |
#07 | Clock | 03–90 | Theoretical tick value ts |
IV. SIGNAL PROCESSING
The decoding process is only done in the microcontroller for the acquired signal, and the output data are still not visualized enough to directly extract the output information of the sensor through the data sequence. After the configuration of the serial communication of the computer, the pre-processed data sequence is read by the VISA function of LabVIEW, and the data information carried in the SENT signal is displayed on the front panel in real time by a series of data visualization functions. The function “Write Delimited Spreadsheet.vi” is adopted to realize the real-time data storage.
A. Data import and screening
The “wait(ms).vi” function is applied to wait for the MCU to send a certain amount of data sequences before data processing, as shown in Fig. 7, to ensure that all channels have multiple frames of data packets when entering the parsing program as backup frames in case of verification errors to avoid unnecessary errors in the main program.
As shown in Fig. 7 (right), in the data sequence received by LabVIEW, there are invalid data and dropped packets of data. The causes and treatment methods for generating these two types of interfering data are as follows: The empty channels with no input signal are given a full 0 value and output normally in the MCU program. When all channels are placed in the open state, such invalid empty data columns will also be transmitted to the upper computer, and they will be excluded from the screening program. If only the data signal of the corresponding acquisition channel is set to be sent in the serial port configuration, there is no such situation (Fig. 7, left). The presence of dropped packet data is caused by the rapid data transfer frequency, and this type of interfering data is eliminated by the CRC checksum.
According to the communication rules established by the MCU program, the while loop function is utilized to compare the characters of the original data column one by one, positioning the flag bit, and extracting the corresponding channel's data information, as shown in Fig. 8. When the number of normally operating acquisition channels is greater than 1, it should wait until all channels have completed data screening before exporting and saving the data synchronously to accomplish the goal of having all channels output the same amount of data. If there is a channel that cannot output a valid value, it will immediately report an error and stop the program from running.
B. CRC checksum method
The theoretical CRC value is calculated using the modulo-two division method, and the calibration purpose is achieved by comparing it with the actual received DCRC value in the original data packet. The implementation process in the LabVIEW program is shown in Fig. 10.
C. Data processing
The information of the slow channel cannot be read out by a single-frame packet, which is directly outputted here without any processing and subsequently further analyzed by the exported data. The final data after processing are displayed in the “Sensor Output Signal” area on the front panel, which includes three main parts: the selection of the acquisition channel, the valid data packets, and the corresponding output information. The corresponding indicator lights up when the selected channel is working properly. The actual output sensor information includes slow channel data Ds, sensor output data S1, S2, and checksum data DCRC. The design of the front panel of the LabVIEW program is shown in Fig. 11.
V. TESTS AND RESULTS
To demonstrate the functionality of the SENT signal acquisition system, two sets of performance tests were performed on a pressure sensor to be used in an automotive engine (Fig. 12), both of which were conducted at ambient temperature (25 °C).
First, the accuracy of the acquisition system was tested. The pressure sensor has a linear pressure sensing range of −3 to 72 bars, and a pressurization test is performed on it, taking one test point every 10 bars in the pressure range of 0–70 bars for a total of seven pressure values. When the given test pressure in the pressurized equipment reaches the set value, the output data are recorded, and the sensor output value of one of the channels is shown in Fig. 13(a), and the output characteristic curve is plotted in Fig. 13(b). Without excluding the accuracy of the sensor, the trends of the two curves overlap completely, the sum of the two data captured at each pressure point is 4095, and the pressure calculated by the output property formula is the same. The pressure value calculated by the output property formula is also the same, so it can be seen that the data are correct and the collection system is free of misleading data and meets the requirements of this design.
Pressure sensor output curve–accuracy test: (a) acquisition system output data and (b) pressure sensor output property curve.
Pressure sensor output curve–accuracy test: (a) acquisition system output data and (b) pressure sensor output property curve.
Then, the stability of the system was tested. The sensor was installed in a stable environment with no additional pressure value applied, and its output signal was collected continuously for 15 days with the signal acquisition system and virtual oscilloscope designed in this paper. The output data of any one of the channels for 1 h continuously are shown in Fig. 14(a). Comparing the acquisition of the virtual oscilloscope in Fig. 14(b), the acquisition system was also stable and error-free during the work, and the acquisition error rate was 0. It is also seen that the stability requirements of the design are met.
Pressure sensor output curve–stability test: (a) acquisition system output data and (b) virtual oscilloscope output data.
Pressure sensor output curve–stability test: (a) acquisition system output data and (b) virtual oscilloscope output data.
VI. CONCLUSIONS
The SENT signal acquisition system designed in this paper adopts a combination of hardware circuits and software programs to satisfy the design requirements: (1) the SENT signal is captured by the MCU, which effectively controls the manufacturing cost; (2) the CRC checksum procedure is added to the MCU and LabVIEW programs, respectively, which reduces the false acquisition rate to 0 and realizes the accurate SENT signal acquisition; (3) a time delay function is invoked in the LabVIEW program to avoid system errors caused by transmission issues when data are processed, which ensures that the acquisition system can operate stably for a long period of time; (4) the USB communication makes the acquisition circuit adaptable to any computer for work, which improves portability; (5) the function of communication with the upper computer is added to the MCU program to support real-time adjustment of the corresponding sensor parameters, which enhances the reliability of the system; and (6) the LabVIEW program realizes the storage and export of data, which provides support for the subsequent analysis of the sensor performance.
After its completion, the acquisition system has been applied to a number of test items in the laboratory of a car company and has completed the acquisition tasks of a plurality of long-period experiments. The acquisition system works normally during the test, but there is still room to improve the sampling frequency, and the subsequent improvement work can start from the decoding procedure of the MCU to improve the efficiency of the acquisition system.
AUTHOR DECLARATIONS
Conflict of Interest
The authors have no conflicts to disclose.
Author Contributions
Fan Chen: Conceptualization (equal); Data curation (equal); Investigation (equal); Methodology (equal); Resources (equal); Software (equal); Validation (equal); Visualization (equal); Writing – original draft (equal); Writing – review & editing (equal). Ruting Xia: Formal analysis (equal); Funding acquisition (equal); Investigation (equal); Methodology (equal); Project administration (equal); Supervision (equal); Validation (equal).
DATA AVAILABILITY
The data that support the findings of this study are available from the corresponding author upon reasonable request.