A vehicle-mounted real-time vibration acceleration and bus data acquisition and storage system and method
The vehicle-mounted real-time vibration acceleration and bus data acquisition system using the CH32V307 microcontroller and ZDSD64GLGEAG chip solves the problems of large size and high cost of existing equipment, realizes multi-channel real-time high-speed data acquisition and storage, and improves vehicle structural life prediction and driving comfort.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2026-03-20
AI Technical Summary
Existing vehicle vibration acceleration acquisition equipment is bulky, costly, cumbersome to operate, and difficult to simultaneously measure the stress distribution of the entire vehicle, resulting in data redundancy that cannot be used, affecting the lifespan of the vehicle structure and driving comfort.
The vehicle-mounted real-time vibration acceleration and bus data acquisition system, which uses the CH32V307 microcontroller and ZDSD64GLGEAG chip, achieves multi-channel real-time high-speed data acquisition and storage through the acquisition unit, data processing unit and storage unit, thereby reducing the size and cost of the equipment.
It achieves real-time high-speed vibration data acquisition through multiple channels, reduces system size and cost, enables long-term unattended data acquisition, and improves the accuracy of vehicle structure life prediction and driving comfort.
Smart Images

Figure CN118764335B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of vehicle data acquisition and storage, in particular to a real-time vehicle vibration acceleration and bus data acquisition and storage system and method under off-road conditions. BACKGROUND
[0002] The vehicle works in an environment with large vibration and impact for a long time, which can cause damage to the vehicle body structure. The mechanical structure components are in an alternating load environment for a long time, which can affect the service life of the machinery. Different structures can cause vibration fatigue under different conditions. In severe cases, the structure can be broken and the product can fail. In addition, the comfort of the driver, the noise, vibration and harshness (NVH) level of the vehicle are reduced. In order to prevent the vehicle from disintegrating when landing and causing huge economic losses, it is necessary to accurately record the size and duration of the vehicle vibration impact acceleration in order to predict the service life of the vehicle body structure.
[0003] At present, some researchers install multi-axis vibration acceleration sensors at different positions in the vehicle body, and analyze the impact and vibration data of the vehicle during air drop or travel by combining simulation. Large equipment needs to obtain vibration impact acceleration values at different positions, so multiple single-channel acceleration recorder devices need to be used at the same time. However, such devices are bulky, high in cost, and complicated to operate. In addition, the measured data is difficult to synchronize, which leads to the inability to obtain the stress distribution of the entire vehicle and the inability to utilize a large amount of redundant data information. SUMMARY
[0004] The purpose of the present application is to provide a real-time vehicle vibration acceleration and bus data acquisition and storage system and method, which can reduce the size and cost of the vehicle vibration acceleration and bus data acquisition device, and realize multi-channel real-time high-speed vibration data acquisition.
[0005] To achieve the above purpose, the present application provides the following solutions:
[0006] In a first aspect, the present application provides a real-time vehicle vibration acceleration and bus data acquisition and storage system, comprising: an acquisition unit, a data processing unit and a storage unit; the data processing unit is connected with the acquisition unit and the storage unit respectively;
[0007] The acquisition unit is used to acquire vibration voltage signals at different positions of the vehicle body;
[0008] The data processing unit uses a CH32V307 microcontroller as its core, converts the vibration voltage signal into a vibration acceleration value, communicates with the vehicle bus via a dual-channel CAN bus, receives bus data sent by each node of the vehicle, determines the vehicle driving log data based on the bus data, and stores the vibration acceleration value and the vehicle driving log data in the memory of the CH32V307 microcontroller.
[0009] The storage unit is used to write the vibration acceleration values and vehicle driving log data from the memory of the CH32V307 microcontroller into the ZDSD64GLGEAG chip.
[0010] Optionally, the acquisition unit includes a constant current power supply circuit, a DC blocking capacitor, an operational amplifier conditioning circuit, and multiple vibration sensors; the multiple vibration sensors are installed at different positions on the vehicle body; the constant current power supply circuit and the DC blocking capacitor are both connected to each vibration sensor; the operational amplifier conditioning circuit is connected to the DC blocking capacitor.
[0011] The constant current power supply circuit is used to provide constant current to each vibration sensor;
[0012] The DC blocking capacitor is used to couple AC signals and also acts as a high-pass filter to filter out low-frequency noise.
[0013] The operational amplifier conditioning circuit is used to adjust the voltage range of the voltage signal to obtain vibration voltage signals at different positions of the vehicle body.
[0014] Optionally, the operational amplifier conditioning circuit uses two OP07C chips to perform two-stage operational amplifier conditioning on the voltage signal.
[0015] Optionally, the acquisition unit further includes an attitude sensor; the attitude sensor is installed at the center of the vehicle body and is used to measure the attitude data of the entire vehicle; the data processing unit is also used to store the attitude data of the entire vehicle.
[0016] Optionally, the data processing unit is a CH32V307 microcontroller; the CH32V307 microcontroller is connected to the acquisition unit;
[0017] The CH32V307 microcontroller is used to convert the vibration voltage signal into a vibration voltage value, convert the vibration voltage value into a vibration acceleration value according to a preset vibration sensor characteristic curve, communicate with the vehicle bus using a dual-channel CAN bus, receive bus data sent by each node of the vehicle, determine the vehicle driving log data based on the bus data, and store the vibration acceleration value and the vehicle driving log data.
[0018] Optionally, the CH32V307 microcontroller adopts a double queue mode to sample and store the vibration acceleration values, and adopts a single queue mode to sample and store the bus data.
[0019] Optionally, the CH32V307 microcontroller communicates with the vehicle bus through a CA-IS3052G chip.
[0020] Optionally, the CH32V307 microcontroller is further configured to determine a vibration acceleration maximum value, a vibration duration, and a vibration energy size according to the vibration acceleration values in a vibration impact task, and determine a highest vehicle speed, a driving mileage, and a record date according to the bus data in a driving task.
[0021] Optionally, the storage unit writes the vibration acceleration values and the vehicle driving log data in a TXT file format from the memory of the CH32V307 microcontroller to the ZDSD64GLGEAG chip in an SDIO communication protocol and a FAT file format.
[0022] In a second aspect, the present application provides a vehicle-mounted real-time vibration acceleration and bus data acquisition and storage method, comprising:
[0023] determining a current task; the current task is a vibration impact task or a driving task;
[0024] if the current task is the vibration impact task, collecting vibration voltage signals at different positions of the vehicle body, converting the vibration voltage signals into vibration acceleration values, storing the vibration acceleration values in the memory of the CH32V307 microcontroller, and writing the vibration acceleration values in the memory of the CH32V307 microcontroller to the ZDSD64GLGEAG chip;
[0025] if the current task is the driving task, communicating with the vehicle bus in a double-channel CAN channel mode, receiving bus data sent by each node of the vehicle, determining vehicle driving log data according to the bus data, storing the vehicle driving log data in the memory of the CH32V307 microcontroller, and writing the vehicle driving log data in the memory of the CH32V307 microcontroller to the ZDSD64GLGEAG chip.
[0026] According to the specific embodiments of the present application, the following technical effects are disclosed:
[0027] This application provides a vehicle-mounted real-time vibration acceleration and bus data acquisition and storage system and method. The acquisition unit can simultaneously acquire vibration voltage signals from multiple locations on the vehicle body, enabling multi-channel real-time high-speed vibration data acquisition. The CH32V307 microcontroller and ZDSD64GLGEAG chip are used to process and store vibration acceleration values and bus data, reducing the overall system size and cost. Furthermore, the entire system can be directly installed on the vehicle without the need for personnel to accompany the user, allowing for long-term data acquisition. Attached Figure Description
[0028] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 This is an overall structural diagram of the vehicle-mounted real-time vibration acceleration and bus data acquisition and storage system provided in the embodiments of this application;
[0030] Figure 2 A schematic diagram of a constant current power supply circuit provided in an embodiment of this application;
[0031] Figure 3 A schematic diagram of the operational amplifier conditioning circuit provided in an embodiment of this application;
[0032] Figure 4 A schematic diagram of the operational amplifier power supply circuit provided in an embodiment of this application;
[0033] Figure 5 A flowchart illustrating the method for acquiring and storing vehicle-mounted real-time vibration acceleration and bus data provided in this application embodiment;
[0034] Figure 6 A schematic diagram illustrating the vibration data acquisition and storage process provided in an embodiment of this application;
[0035] Figure 7 This is a schematic diagram of the bus data acquisition and storage process provided in an embodiment of this application. Detailed Implementation
[0036] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0037] In order to make the above objects, features and advantages of the present application more apparent, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0038] As shown in Figure 1 The vehicle-mounted real-time vibration acceleration and bus data acquisition and storage system provided by the present application comprises an acquisition unit 1, a data processing unit 2 and a storage unit 3. The data processing unit 2 is connected with the acquisition unit 1 and the storage unit 3 respectively.
[0039] The acquisition unit 1 is used for acquiring vibration voltage signals at different positions of the vehicle body.
[0040] In an exemplary embodiment, the acquisition unit 1 comprises a constant current power supply circuit 11, a direct current blocking capacitor 13, an operational amplifier conditioning circuit 14 and a plurality of vibration sensors 12.
[0041] The plurality of vibration sensors 12 are installed at different positions of the vehicle body, including weak positions of the vehicle body and positions with large vibration impact. During measurement, the vibration sensors 12 are fixed together with the vehicle body, the base of the vibration sensor 12 generates the same vibration as the vehicle body, and outputs a current signal. The constant current power supply circuit 11 and the direct current blocking capacitor 13 are connected with each vibration sensor 12. The operational amplifier conditioning circuit 14 is connected with the direct current blocking capacitor 13.
[0042] The constant current power supply circuit 11 is used for providing constant current for each vibration sensor 12. The vibration sensor 12 needs a constant current source to work normally. In order to meet the requirement of 4.5mA constant current for the vibration sensor 12, an input voltage of 2V, a sampling resistor of 400Ω and a feedback resistor of 20kΩ are set, which is much larger than the sampling resistor, so that the constant current power supply circuit 11 keeps supplying power to the vibration sensor 12.
[0043] As shown in Figure 2 The constant current power supply circuit 11 comprises a single power supply operational amplifier circuit and a plurality of resistors. The voltage V0 at pin 6 of the first operational amplifier circuit is 2VI = VCC + V11, VCC = V0 - V11, wherein V11 = VL, and the voltage across the RS is VCC = V0 - VL. The current I2 at pin 3 of the first operational amplifier circuit is 0, so the current IL flowing through the vibration sensor 12 is IO = VL / RS. Wherein, VI is the input voltage of the first operational amplifier circuit, VCC is the power supply voltage, and V11 is the voltage at pin 6 of the first operational amplifier circuit.
[0044] The direct current blocking capacitor 13 is used for coupling the alternating current signal output by each vibration sensor 12, outputting a voltage signal, and simultaneously acting as a high-pass filter to filter out low-frequency noise and ensure signal purity. That is, the direct current blocking capacitor 13 couples the milliamperes-level current signal output by the vibration sensor 12 into a voltage signal.
[0045] The operational amplifier conditioning circuit 14 is used to adjust the voltage range of the voltage signal to obtain the vibration voltage signal at different positions of the vehicle body. Specifically, the operational amplifier conditioning circuit 14 scales down the voltage signal to the sampling voltage range allowed by the data processing unit 2.
[0046] In this embodiment, the operational amplifier conditioning circuit 14 uses two OP07C chips to perform two-stage operational amplifier conditioning on the voltage signal. The first-stage operational amplifier chip is powered by a 12V power supply to meet the IEPE bias voltage requirement of 8V and is used to adjust the accuracy of the vibration sensor 12 signal. The second-stage operational amplifier chip scales down the 5V-11V voltage output by the first-stage operational amplifier chip by 4 times to adjust it to within 1.25V-2.75V to meet the sampling port voltage requirement of the analog-to-digital conversion module 22.
[0047] After obtaining the voltage signal of the vibration sensor 12, it needs to be processed by the operational amplifier conditioning circuit 14, as shown in Figure 3 The operational amplifier conditioning circuit 14 includes a voltage follower circuit and an equal proportion operational amplifier circuit. The voltage follower circuit serves as a buffer and isolation, to some extent, avoiding signal loss due to high output impedance and low input impedance of the next stage. The equal proportion operational amplifier circuit can perform equal proportion operation on the signal, converting the voltage signal of the vibration sensor 12 to within the 0V-3.3V voltage range supported by the microcontroller.
[0048] The vibration acceleration signal is mainly concentrated below 100Hz, so the design of the circuit needs to avoid the influence of high-frequency signals on the collection as much as possible.
[0049] The operational amplifier conditioning circuit 14 needs to be powered, and the power supply circuit in this application selects a circuit that meets electromagnetic compatibility, as shown in Figure 4 The core device of the circuit is the power module URB2412YMD-10WR3. A common-mode choke coil of 4mH and a resistor of 4.7uF / 50V are added in front of the power module to filter out interference above 100Hz in the power supply circuit. When the common-mode current flows through, a same-direction magnetic field is generated inside the coil, increasing the inductance of the coil, which appears as high impedance, thereby producing strong damping effect and attenuating the common-mode interference current, to ensure the stability of the circuit power supply in the collection unit 1 and improve the electromagnetic compatibility of the system.
[0050] In this application, the collection unit 1 collects three-axis vibration acceleration signals at the same position, converts the voltage to the voltage range acceptable by the microcontroller through two-stage operational amplifier circuit, and transmits it to the analog-to-digital conversion module 22 of the data processing unit 2.
[0051] Further, the acquisition unit 1 further comprises a posture sensor 15. The posture sensor 15 is installed at a central position of the vehicle body, and is used to measure posture data of the whole vehicle. The data processing unit 2 is further used to store the posture data of the whole vehicle.
[0052] (II) The data processing unit 2 takes CH32V307 microcontroller 21 as the core, converts the vibration voltage signal into vibration acceleration value, adopts double CAN channel form to communicate with the vehicle bus 5, receives bus data sent by each node of the whole vehicle, determines whole vehicle driving log data according to the bus data, and stores the vibration acceleration value and the whole vehicle driving log data into the memory of the CH32V307 microcontroller 21.
[0053] In an exemplary embodiment, the data processing unit 2 is CH32V307 microcontroller 21. The CH32V307 microcontroller 21 has an analog-to-digital conversion module 22 therein. The CH32V307 microcontroller 21 is connected with the acquisition unit 1.
[0054] The CH32V307 microcontroller 21 is used to convert the vibration voltage signal into vibration voltage value, convert the vibration voltage value into vibration acceleration value according to a preset vibration sensor characteristic curve, adopt double CAN channel (first CAN channel 6 and second CAN channel 7) form to communicate with the vehicle bus 5, receive bus data sent by each node of the whole vehicle, determine whole vehicle driving log data according to the bus data, and store the vibration acceleration value and the whole vehicle driving log data. Specifically, the vibration acceleration value and the whole vehicle driving log data are stored into the memory data area of the CH32V307 microcontroller 21.
[0055] The CH32V307 microcontroller 21 reads the vibration voltage value from the analog-to-digital conversion module 22 and performs digital filtering processing; then converts the vibration voltage value into vibration acceleration data according to the vibration sensor characteristic curve, and stores the vibration acceleration data in the memory of the CH32V307 microcontroller 21.
[0056] In this embodiment, the CH32V307 microcontroller 21 communicates with the vehicle bus 5 through a CA-IS3052G chip.
[0057] Further, the CH32V307 microcontroller 21 is further used to determine vibration acceleration maximum value, vibration duration, and vibration energy size according to the vibration acceleration value in one vibration impact task, and determine highest vehicle speed, driving mileage, and record date according to the bus data in one driving task.
[0058] As a preferred embodiment, the CH32V307 microcontroller 21 adopts a double queue mode to sample and store the vibration acceleration values, and adopts a single queue mode to sample and store the bus data.
[0059] Since the vibration acceleration values are collected at a high frequency, a double queue mode is adopted for sampling and storage. The whole vehicle data is collected at a low frequency, and is not affected by the long write operation time, so a single queue mode is adopted for sampling and storage.
[0060] The application adopts a double queue mode to realize the data timing sampling function. The vibration acceleration values are read once every 1 ms through direct memory access (DMA) to convert the results and trigger the next analog-to-digital conversion. The sampling frequency is 1 KHz, and about 44 Byte of data is generated every millisecond. If the vibration duration is within 60 s, 2.52 MB of data is generated during the whole vibration process. In order to avoid data loss and the influence of long file writing operation time on data timing sampling, two 44*90 buffer areas are opened to alternately store the processed data. A characteristic curve is set for each sampling channel, and the AD count value corresponding to the vibration acceleration value can be obtained by curve table lookup.
[0061] Among them, each voltage signal is an unsigned character variable, each microcontroller collects 12 signals, the timestamp occupies 3 characters, and the data size generated every millisecond is 15 characters. The default vibration impact duration is less than 60 s. The attitude sensor 15 generates 2 frames of data each time, and the microcontroller records the data frame content each time. The data frame content occupies 8 characters in total, and the end of each millisecond collection flag occupies 1 character. Therefore, the data size generated by the vibration signal and the attitude sensor 15 every millisecond is 22 characters, i.e. 44 Byte. The total data size generated during vibration is: 22*1000*60=1320000 characters=2640000 Byte=2.52 MB.
[0062] The double queue refers to using two arrays for caching during collection. Since the long single data write operation time will affect sampling, two queues A and B are used for storage. When queue A performs a write operation, queue B performs a collection operation. Queue A and queue B perform vibration acceleration value collection and storage work, both of which are 44*90 in size, with 44*90 representing 90 ms of vibration acceleration values.
[0063] The vibration acceleration value collection starts in the timing interrupt, and the vibration acceleration value is first stored in queue A. After 90 ms, queue A is full and the write operation is executed. In the process of queue A write operation, the collected vibration acceleration value is stored in queue B. After queue A write operation is completed, the data in queue A is cleared and queue B is waiting for data storage. When queue B is full, the write operation is executed, and the collected vibration acceleration value is stored in queue A in turn.
[0064] The whole vehicle CAN communication circuit adopts a double-channel form for data backup, and is divided into a first bus and a second bus. A CH32V307 microcontroller 21 has two CAN channels: a first CAN channel 6 and a second CAN channel 7, which communicate with the whole vehicle bus 5 through CA-IS3052G and simultaneously collect data. The two CAN channels back up each other, and the bus state is judged according to the heartbeat frame. If the first bus fails, it is switched to the second bus. One of the CAN channels is also connected to the attitude sensor 15, which can collect the attitude data of the whole vehicle in the vibration environment.
[0065] The bus data storage adopts the interrupt collection and task screening mode. The data sent by all nodes on the whole vehicle bus 5 is collected and stored in the buffer array through the CAN interrupt. When the task is executed, the data in the buffer data is screened, and the non-repeated bus data in 500 ms is selected and written into the SD card at one time.
[0066] (Three) The storage unit 3 is used to write the vibration acceleration value and the whole vehicle driving log data in the memory of the CH32V307 microcontroller 21 into the ZDSD64GLGEAG chip.
[0067] Specifically, the storage unit 3 stores the vibration acceleration value in the non-volatile storage chip, that is, the storage unit 3 periodically reads the data in the memory, and stores the data in the txt document format into the external SDNANDFLASH memory by using the built-in Fats file system.
[0068] In one exemplary embodiment, the storage unit 3 writes the vibration acceleration value and the whole vehicle driving log data in the memory of the CH32V307 microcontroller 21 into the ZDSD64GLGEAG chip in the TXT file format according to the FAT file format and the SDIO communication protocol.
[0069] The storage unit 3 takes ZDSD64GLGEAG chip as the core, and writes the vibration acceleration values in the memory of the CH32V307 microcontroller 21 into the SD NANDFLASH chip in the TXT file format according to the FAT file format and the SDIO communication protocol. The external host computer 4 can read the previously stored vibration acceleration data file from the SD NANDFLASH chip through the USB bus according to the SDIO communication protocol.
[0070] The CH32V307 microcontroller 21 performs file opening, file continuation, file closing, file deletion and other operations on the SD card by calling the FAT file operation function.
[0071] The file includes a total attribute file and a data file. The total attribute file includes the capacity of the SD card, the number of records, the current file number, the recording duration, and the maximum vibration value, i.e., the vibration energy.
[0072] The file naming format is "(time of day) AA-BB-CC" format. "AA" represents the vibration impact acceleration value or the bus data; "BB" represents the number of records; and "CC" represents the number of data files under the "BB" records.
[0073] The CH32V307 microcontroller 21 in the application is deployed with software, and the software design adopts a multi-task multi-thread mode. There are five tasks in total. The data processing unit 2 is related to the first task, the second task and the fourth task; the storage unit 3 is related to the third task and the fifth task. The first task is responsible for processing and judging whether to record the vibration acceleration value or the CAN bus data of the whole vehicle. When the first task determines to record the vibration acceleration value, the second task and the third task will be executed. The second task is responsible for converting the vibration voltage value collected by the CH32V307 microcontroller 21 into the corresponding vibration acceleration value, and the third task is responsible for writing the vibration acceleration value into the SD card. When the first task determines to record the bus data, the fourth task and the fifth task will be executed. The fourth task is responsible for screening the bus data collected by the CH32V307 microcontroller 21, and the fifth task is responsible for writing the required bus data into the SD card.
[0074] In an exemplary embodiment, the vehicle-mounted real-time vibration acceleration and bus data acquisition and storage system includes four vibration sensors 12, one attitude sensor 15, a CH32V307 microcontroller 21 and a set of cables connected to the CH32V307 microcontroller 21.
[0075] The vehicle-mounted real-time vibration acceleration and bus data acquisition and storage system provided by the application is a controller box, which can work normally only by powering on the microcontroller, is convenient to replace, is easy to operate, can be directly installed on a vehicle, and does not need personnel to accompany and perform long-term data acquisition work. Meanwhile, the application uses CH32V307 and ZDSD64GLGEAG chips to realize acquisition and storage of vehicle-mounted multifunctional high-frequency vehicle vibration data and bus data, and has low cost.
[0076] As shown in Figure 5 The application also provides a vehicle-mounted real-time vibration acceleration and bus data acquisition and storage method based on the vehicle-mounted real-time vibration acceleration and bus data acquisition and storage system.
[0077] Step 101: determining a current task. The current task is a vibration impact task or a driving task.
[0078] When it is detected that the vibration acceleration value is greater than a set acceleration threshold value and there is no bus data, the vibration impact task is determined, and steps 102 to 105 are performed. When it is detected that the bus data engine speed and vehicle speed are greater than certain threshold values, respectively, the driving task is determined, and steps 106 to 109 are performed. No data acquisition and storage are performed in the remaining states.
[0079] Step 102: if the current task is the vibration impact task, vibration voltage signals at different positions of a vehicle body are acquired, and the vibration voltage signals are converted into vibration acceleration values.
[0080] Step 103: the vibration acceleration values are stored in the memory of the CH32V307 microcontroller 21.
[0081] Step 104: the maximum acceleration value, vibration duration, maximum energy and other parameters of the current vibration are calculated by using the vibration acceleration values acquired in real time, and are stored in the memory of the CH32V307 microcontroller 21.
[0082] Step 105: the vibration acceleration values in the memory of the CH32V307 microcontroller 21 are written into the ZDSD64GLGEAG chip.
[0083] The CH32V307 microcontroller 21 communicates with the SD card (specifically, a ZDSD64GLGEAG chip) through an SDIO protocol, and writes the original vibration data and vibration feature data into the SD card. The storage format of the original vibration data is shown in Table 1. Columns 1-3 of the vibration data timestamp are relative timestamps, recording the relative time of the vibration impact test. Columns 4-15 are the vibration data of the four vibration sensors 12, a total of 12 axial vibration data. Columns 16-21 are the data recorded by the attitude sensor 15, including accelerometer values and Euler angle data. Column 22 is an end symbol, indicating that 1 ms of data recording is complete.
[0084] Table 1: Storage format of original vibration data
[0085]
[0086] Step 106: If the current task is a driving task, a dual-channel CAN channel is used to communicate with the vehicle bus 5, and bus data sent by each node of the vehicle is received.
[0087] Step 107: The recorded bus data is screened.
[0088] Step 108: Vehicle driving log data is determined based on the bus data, and the vehicle driving log data is stored in the memory of the CH32V307 microcontroller 21.
[0089] The CH32V307 microcontroller 21 sets up a dual-channel CAN channel to connect with the vehicle bus 5. After each node of the vehicle sends data, the ID number and bus data are stored in the memory of the CH32V307 microcontroller 21 through a CAN interrupt.
[0090] Since the sending frequency of each node of the vehicle is different, repeatedly recording a frame of data multiple times is meaningless. Therefore, the present application selects 500 ms as a recording cycle. The bus data in the memory of the CH32V307 microcontroller 21 is screened to determine that each frame of data appears only once within 500 ms.
[0091] Further according to the vehicle communication protocol, the screened bus data is analyzed to obtain characteristic parameters such as this driving distance, maximum vehicle speed, and maximum engine speed, to form vehicle driving log data.
[0092] Step 109: The vehicle driving log data in the memory of the CH32V307 microcontroller 21 is written into the ZDSD64GLGEAG chip. Specifically, the CH32V307 microcontroller 21 writes the vehicle driving log data and the original bus data into the SD card (specifically, a ZDSD64GLGEAG chip). The storage format of the original bus data is shown in Table 2.
[0093] Table 2 original bus data storage format
[0094]
[0095] In an exemplary embodiment, the data acquisition part of the present application is divided into two categories: vibration acquisition and bus acquisition. The vibration acquisition is to input the voltage signal collected by the vibration sensor 12 into the microcontroller through the operational amplifier conditioning circuit 14. The bus acquisition is to collect the data information of each node of the vehicle through the CAN bus.
[0096] The vibration data acquisition and storage process is shown in Figure 6 The first thread is to acquire vibration data, which is executed in the timing interrupt. The analog-to-digital conversion module 22 of the microcontroller is configured as a regular conversion group single scan with 12-bit precision. The timer is configured to trigger the interrupt service function once every millisecond. After the initialization of each module is completed, the timer interrupt is enabled. The conversion result is read by DMA every 1 ms, and the next analog-to-digital conversion is triggered, achieving a sampling frequency of 1 KHz.
[0097] The vehicle-mounted real-time vibration acceleration and bus data acquisition and storage system provided by the present application needs to record 44 bytes of data every millisecond. The data of every millisecond is temporarily stored in the memory of the microcontroller. If the amount of data written into the SD NAND FLASH is too large, the writing time exceeds 1 ms, and the data writing may be interrupted by the timing interrupt during the writing process, which will affect the data writing. Therefore, in the timing interrupt, two arrays are selected to cache the data. Each array can record 3960 bytes of data, which is 90 ms of data in total. When one of the arrays is full, the writing task will be triggered, and the execution time of the writing task is less than 90 ms, thereby ensuring the effective recording of the data.
[0098] The second thread is to process and store the vibration data, which is executed in the task queue. After one of the arrays is full in the timing interrupt, the flag bit is set high, indicating that the data processing can be performed. According to the calibrated sensor characteristic curve, the vibration voltage value is converted into a vibration acceleration value, and the data stored in the array is updated. After the data processing is completed, the microcontroller uses the fats file operating system to call the f_open function to create a new txt document in the SD card, and changes the file name to the format of "(time of the day)ZD-BB-CC". "ZD" represents the vibration impact acceleration data; "BB" represents the number of records; and "CC" represents the data file under the "BB" record. The f_sync function is called to save the file, the f_write function is called to write the collected data information under the newly created document, and the f_close function is called to close the document to complete the data writing.
[0099] The collection and storage process of bus data is shown in Figure 7 The program is divided into two threads. The first thread is to acquire bus data, which is executed in the CAN interrupt. The bus data records the ID number, data and timestamp. The ID number occupies 1 character, and the escape character occupies 1 character. The data generated in each frame is 8 characters, and the total size is 10 bytes. After receiving the bus data, the microcontroller does not perform any processing and directly stores the data in the structure array.
[0100] The second thread is to process and store vibration data, which is executed in the task queue. The stored data in the structure is read, the ID number is filtered, the data with the same ID number is deleted, only one set of data for each ID number is retained, and the redundant data is cleared to form the structure array to be stored. The microcontroller uses the fats file operating system, calls the f_open function to create a new txt document in the SD card, and changes the file name to "(current time)XS-BB-CC" format, wherein "XS" represents the vehicle bus data; "BB" represents the number of records; "CC" represents the data file of the first group under the "BB" record. The f_syns function is called to save the file, the f_write function is called to write the collected data information under the newly created document, and the f_close function is called to close the document to complete the data writing.
[0101] The application can collect test data of multiple vibration sensors 12 and bus data at the same time, process the collected data, store the data in a large-capacity SD card, and realize offline storage of vibration acceleration data or bus data. The whole system has small size, low cost and simple operation, and can realize batch production. That is, the application can connect multiple vibration sensors 12, install the position according to user demand, operate simply, realize multi-channel real-time high-speed vibration data acquisition, and avoid the problems of complex process, high cost and the like in the prior art for collecting data parameters of vehicles in different working environments.
[0102] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.
[0103] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, databases or other media used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0104] The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a blockchain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0105] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combinations of the technical features do not exist contradictory, they should be considered as the scope of the present application.
[0106] The principles and implementation modes of the present application are described by applying specific examples herein, and the above-mentioned embodiments are only used to help understand the method and its core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range can be changed. In conclusion, the content of the present application should not be understood as a limitation.
Claims
1. A vehicle-mounted real-time vibration acceleration and bus data acquisition and storage system, characterized in that, The vehicle-mounted real-time vibration acceleration and bus data acquisition and storage system includes: an acquisition unit, a data processing unit, and a storage unit; the data processing unit is connected to the acquisition unit and the storage unit respectively. The acquisition unit is used to acquire vibration voltage signals at different locations on the vehicle body. The acquisition unit includes a constant current power supply circuit, a DC blocking capacitor, an operational amplifier conditioning circuit, and multiple vibration sensors. Multiple vibration sensors are installed at different locations on the vehicle body. The constant current power supply circuit and the DC blocking capacitor are connected to each vibration sensor. The operational amplifier conditioning circuit is connected to the DC blocking capacitor. The constant current power supply circuit provides a constant current to each vibration sensor. The DC blocking capacitor couples AC signals and also acts as a high-pass filter to filter out low-frequency noise. The operational amplifier conditioning circuit adjusts the voltage range of the voltage signal to obtain vibration voltage signals at different locations on the vehicle body. The voltage signal is conditioned by two OP07C chips using a two-stage operational amplifier. The first-stage operational amplifier is powered by a 12V supply to meet the 8V IEPE bias voltage requirement and is used to adjust the accuracy of the vibration sensor 12 signal. The second-stage operational amplifier reduces the 5V-11V output voltage of the first-stage operational amplifier by a factor of four to within the 1.25V-2.75V range to meet the sampling port voltage requirements of the analog-to-digital conversion module. The acquisition unit also includes an attitude sensor, which is installed at the center of the vehicle body and is used to measure the attitude data of the entire vehicle. The data processing unit is also used to store the attitude data of the entire vehicle. The data processing unit, based on a CH32V307 microcontroller, converts the vibration voltage signal into vibration acceleration values. It communicates with the vehicle bus via a dual-channel CAN bus, receives bus data from various vehicle nodes, determines vehicle driving log data based on the bus data, and stores the vibration acceleration values and vehicle driving log data in the CH32V307 microcontroller's memory. The CH32V307 microcontroller samples and stores the vibration acceleration values using a dual-queue method and samples and stores the bus data using a single-queue method. The vibration acceleration value is read and converted every 1ms via direct memory access, triggering the next analog-to-digital conversion. The sampling frequency is 1kHz. If the vibration duration is within 60s, the entire vibration process generates 2.52MB of data. Two 44MB memory blocks are allocated. The 90-degree buffer alternately stores and processes data, and sets a characteristic curve for each sampling channel. The vibration acceleration value corresponding to the AD count value is obtained by looking up the curve in a table. The dual-queue system uses two queues, A and B, for storage. When queue A is performing a write operation, queue B is performing a data acquisition operation. Both queues A and B perform 44 data acquisition and storage operations for vibration acceleration values. Size 90, 44 90 represents the vibration acceleration value over 90ms. In the timer interrupt, the vibration acceleration value is first stored in queue A. After 90ms, queue A is full and a write operation is performed. During the write operation in queue A, the collected vibration acceleration value is stored in queue B. After the write operation in queue A is completed, the data in queue A is cleared and queue B waits to be full. When queue B is full, a write operation is performed, and the collected vibration acceleration value is stored in queue A. This process is repeated. The vehicle's CAN communication circuit uses a dual-channel configuration for data backup, consisting of a first bus and a second bus. The CH32V307 microcontroller has two CAN channels: a first CAN channel and a second CAN channel. It communicates with the vehicle bus via a CA-IS3052G chip and simultaneously acquires data. The two CAN channels serve as backups for each other, and the bus status is determined based on heartbeat frames. If the first bus fails, the system switches to the second bus. One CAN channel is also connected to the attitude sensor. Bus data is stored using an interrupt acquisition and task filtering method. Data sent by all nodes on the vehicle bus is acquired via CAN interrupts and stored in a buffer array. During task execution, the data in the buffer is filtered, and non-repeating bus data within 500ms is selected and written to the SD card in one go. The CH32V307 microcontroller is also used to determine the maximum vibration acceleration, vibration duration, and vibration energy based on the vibration acceleration values in a vibration impact task; and to determine the maximum vehicle speed, mileage, and recording date based on the bus data in a driving task; the storage unit is used to write the vibration acceleration values and vehicle driving log data in the memory of the CH32V307 microcontroller into the ZDSD64GLGEAG chip in TXT file format according to the FAT file format and the SDIO communication protocol. The CH32V307 microcontroller is equipped with software designed in a multi-tasking, multi-threaded mode, comprising five tasks: the data processing unit involves the first, second, and fourth tasks; the storage unit involves the third and fifth tasks. The first task is responsible for processing and judging whether to record vibration acceleration values or vehicle CAN bus data. The second and third tasks will only execute when the first task determines that vibration acceleration values are to be recorded. The second task is responsible for converting the vibration voltage values collected by the CH32V307 microcontroller into corresponding vibration acceleration values. The third task is responsible for writing the vibration acceleration values to the SD card. The fourth and fifth tasks will only execute when the first task determines that bus data is to be recorded. The fourth task is responsible for filtering the bus data collected by the CH32V307 microcontroller. The fifth task is responsible for writing the required bus data to the SD card.
2. A method for acquiring and storing vehicle-mounted real-time vibration acceleration and bus data, applied to the vehicle-mounted real-time vibration acceleration and bus data acquisition and storage system as described in claim 1, characterized in that, The method for acquiring and storing real-time vehicle vibration acceleration and bus data includes: The current task is defined; the current task is either a vibration and impact task or a driving task. If the current task is a vibration and impact task, then the vibration voltage signal at different positions of the vehicle body is collected, the vibration voltage signal is converted into a vibration acceleration value, and the vibration acceleration value is stored in the memory of the CH32V307 microcontroller; the vibration acceleration value in the memory of the CH32V307 microcontroller is written into the ZDSD64GLGEAG chip. If the current task is a driving task, then a dual-channel CAN communication is used to communicate with the vehicle bus, receive bus data sent by each node of the vehicle, determine the vehicle driving log data based on the bus data, and store the vehicle driving log data in the memory of the CH32V307 microcontroller; then write the vehicle driving log data in the memory of the CH32V307 microcontroller into the ZDSD64GLGEAG chip.
Citation Information
Patent Citations
MEMS-based integrated scooter vibration data acquisition system
CN105632137A
Agricultural machinery vibration state multi-channel monitoring system based on acceleration sensor
CN113267248A
Vehicle-mounted data acquisition circuit and device
CN210119810U