CN117596106A - AK protocol wheel speed sensor decoding device and decoding method - Google Patents
AK protocol wheel speed sensor decoding device and decoding method Download PDFInfo
- Publication number
- CN117596106A CN117596106A CN202311520952.1A CN202311520952A CN117596106A CN 117596106 A CN117596106 A CN 117596106A CN 202311520952 A CN202311520952 A CN 202311520952A CN 117596106 A CN117596106 A CN 117596106A
- Authority
- CN
- China
- Prior art keywords
- edge
- data
- time stamp
- decoding
- speed
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L25/00—Baseband systems
- H04L25/02—Details ; arrangements for supplying electrical power along data transmission lines
- H04L25/05—Electric or magnetic storage of signals before transmitting or retransmitting for changing the transmission rate
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/0001—Systems modifying transmission characteristics according to link quality, e.g. power backoff
- H04L1/0002—Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission rate
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/0078—Avoidance of errors by organising the transmitted data in a format specifically designed to deal with errors, e.g. location
- H04L1/0079—Formats for control data
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L25/00—Baseband systems
- H04L25/38—Synchronous or start-stop systems, e.g. for Baudot code
- H04L25/40—Transmitting circuits; Receiving circuits
- H04L25/49—Transmitting circuits; Receiving circuits using code conversion at the transmitter; using predistortion; using insertion of idle bits for obtaining a desired frequency spectrum; using three or more amplitude levels ; Baseband coding techniques specific to data transmission systems
- H04L25/4917—Transmitting circuits; Receiving circuits using code conversion at the transmitter; using predistortion; using insertion of idle bits for obtaining a desired frequency spectrum; using three or more amplitude levels ; Baseband coding techniques specific to data transmission systems using multilevel codes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/26—Special purpose or proprietary protocols or architectures
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Power Engineering (AREA)
- Physics & Mathematics (AREA)
- Spectroscopy & Molecular Physics (AREA)
- Quality & Reliability (AREA)
- Computing Systems (AREA)
- Computer Security & Cryptography (AREA)
- Arrangements For Transmission Of Measured Signals (AREA)
Abstract
The invention relates to a decoding device and a decoding method of an AK protocol wheel speed sensor, wherein the decoding device comprises: the sensor interface module comprises a current sampling circuit for collecting a current signal returned by a wheel speed sensor and converting the current signal into a voltage signal, a first comparison circuit for comparing the voltage signal with a high-level threshold value and extracting a speed signal, and a window comparison circuit for simultaneously comparing the voltage signal with the high-level threshold value and a medium-level threshold value and extracting a data signal; and the decoding module is used for decoding the speed and the running state according to the speed signal and the data signal, and is connected with the sensor interface module. The invention supports decoding of the AK protocol in normal mode, static mode and high-speed mode, can be realized by using common electronic components and a microprocessor in an automobile electronic controller, has small device volume and low cost, and can be applied to the automobile electronic controller.
Description
Technical Field
The invention relates to the technical field of wheel speed sensors for vehicles, in particular to a decoding device and a decoding method for an AK protocol wheel speed sensor.
Background
Wheel speed sensors are vital components of modern automobiles, and the wheel speed information provided by the wheel speed sensors is generally applied to systems affecting the safety performance of automobiles, such as anti-lock braking systems (ABS), body electronic stability systems (ESC), and automobile dynamic control systems (VDC). At present, the intelligent wheel speed sensor with the data protocol and the verification function is more and more widely applied, such as the wheel speed sensor of an AK communication protocol. The AK-protocol wheel speed sensor has the following advantages: 1. the device has three states of forward rotation, reverse rotation and stalling; 2. the size of the installation air gap can be identified; 3. has a data parity check function.
The AK protocol transfers data by controlling the magnitude of a current, which is divided into high currents (I CCH ) Medium current (I) CCM ) And low current (I) CCL ) Three nominal values, one frame of AK signal contains speed pulse and data protocol bits, corresponding to the speed signal and data signal respectively, the speed pulse signal is high current (I CCH ) The class, data signal is medium current (I CCM ) The level is mainly three working modes. Referring to fig. 1, fig. 1 shows a waveform diagram of a normal mode signal. In the normal operation mode: when the sensor detects a zero crossing input signal, i.e. the magnetic induction intensity is 0, a speed pulse is output after a certain time delay (typically 70-121 us), and the time length of the speed pulse is tp (typically 50 us). The speed pulse is followed by data protocol bits, at most 9 bits, each bit having a time period tp, the data protocol for each bit being Manchester code (Manchester Encoding), each bit in the data having a rising edge and a falling edge, the rising edge representing a logic "1", i.e. the current is reduced from a low current (I CCL ) Is changed to medium current (I CCM ) The method comprises the steps of carrying out a first treatment on the surface of the The falling edge represents a logical "0", i.e. the current from which the current flows (I CCM ) Change to low current (I CCL ). Before the speed pulse there is a start bit of time tp/2 and the current corresponding to this bit must be a low current (I CCL ) After the start bit is sent and detected, other data bits are sent; there is also a ready bit after the speed pulse, of length tp/2, and theThe current corresponding to the bit must be a low current (I CCL ). Referring to fig. 2, fig. 2 shows a waveform of a still mode signal. In the absence of a speed pulse for more than 150ms, the high current of the speed pulse of the AK protocol (I CCH ) The class will be controlled by the medium current (I CCM ) The mode in the data protocol is changed to the rest mode by the level substitution. Referring to fig. 3, fig. 3 shows a waveform of a high-speed mode signal. In the high speed mode, 9 bits of data are truncated (7, 8 as shown in fig. 3) and cannot be completely transmitted.
In view of the complexity of the AK protocol described above, various types of automotive controllers that communicate with wheel speed sensors need to be equipped with circuitry/devices that can decode the AK protocol. The current decoding method mainly comprises the following two steps:
first, a power management chip (e.g., L9396 of a legal semiconductor) provided by a semiconductor manufacturer that integrates a wheel speed sensor interface supporting AK protocol decoding is employed. The wheel speed sensor interface provides power for the wheel speed sensor, and acquires and processes current signals of the wheel speed sensor, decodes the current signals into speed signals and data signals respectively, and transmits the speed signals and the data signals to a Microprocessor (MCU). The speed signal is usually a pulse signal, and the MCU can acquire the rotating speed by acquiring the interval between two pulses; the data signals typically interact with the MCU through a serial communication interface (e.g., SPI, IIC, etc.). The power management chip is usually developed aiming at the application of the traditional vehicle body electronic stabilizing system and the like, on one hand, the channels of the integrated wheel speed sensor are relatively more, and on the other hand, the high-low side driving and even the half-bridge driving are integrated, so that the power management chip has the defects of high cost, shortage of supply and the like. In applications like electro-mechanical brake caliper executing controllers (EMB), only one wheel speed sensor of AK protocol is usually connected, high-low side driving and half-bridge driving are not needed, and if the power management chip is used, the product cost is increased and the competitiveness is reduced.
Secondly, as proposed in the published patent CN115017095A 'current output type AK protocol wheel speed chip communication system and method', the communication with the current output type AK protocol wheel speed chip can be realized. And a Microprocessor (MCU) is used as a main control module, a control acquisition module (oscilloscope) acquires current signals output by the wheel speed sensor, the current signals are transmitted to an output processing module (computer) through a serial port, and finally AK signals are decoded through a Labview platform of the computer to acquire speed signals and state information. The method uses test computing equipment with larger volumes such as an oscilloscope and a computer, is only suitable for the test scene of the sensor, and is not suitable for the inside of an automobile electronic controller. Meanwhile, this reference decodes only the normal mode of the AK protocol, and does not decode the still mode and the high-speed mode.
Disclosure of Invention
In order to solve the problems, the invention provides a decoding device and a decoding method for an AK protocol wheel speed sensor, which support decoding of a normal mode, a static mode and a high-speed mode of an AK protocol, can be realized by using commonly used electronic components and a microprocessor in an automobile electronic controller, has small device volume and low cost, and can be applied to the automobile electronic controller.
The invention is realized mainly by the following scheme, an AK protocol wheel speed sensor decoding device comprises:
a sensor interface module, the sensor interface module comprising: the device comprises a current sampling circuit for collecting a current signal returned by a wheel speed sensor and converting the current signal into a voltage signal, a first comparison circuit for comparing the voltage signal with a high-grade threshold value and extracting a speed signal, and a window comparison circuit for simultaneously comparing the voltage signal with a high-grade threshold value and a medium-grade threshold value and extracting a data signal, wherein the current signal comprises three kinds of nominal currents of high, medium and low, the high-grade threshold value is set between the voltage signal corresponding to the high nominal current and the voltage signal corresponding to the nominal current, and the medium-grade threshold value is set between the voltage signal corresponding to the nominal current and the voltage signal corresponding to the low nominal current;
a decoding module coupled to the sensor interface module, the decoding module comprising: a cache module; the edge capturing module is used for acquiring speed edge timestamp information according to the speed signal and storing the speed edge timestamp information in the cache module; the rising edge capturing module is used for acquiring rising edge time stamp information of the data pulse according to the data signal and storing the rising edge time stamp information in the caching module; the falling edge capturing module is used for acquiring falling edge time stamp information of the data pulse according to the data signal and storing the falling edge time stamp information in the caching module; and the calculation module is used for performing speed decoding and running state decoding according to the speed edge timestamp information, the rising edge timestamp information and the falling edge timestamp information, and is connected with the cache module.
The decoding device of AK protocol wheel speed sensor of the invention is further improved in that: the window comparison circuit comprises a second comparison circuit and a third comparison circuit, the input end of the current sampling circuit is connected with the wheel speed sensor, the output end of the current sampling circuit is respectively connected with the positive electrode input end of the first comparison circuit, the negative electrode input end of the second comparison circuit and the positive electrode input end of the third comparison circuit, the high-level threshold is respectively connected with the negative electrode input end of the first comparison circuit and the positive electrode input end of the second comparison circuit, the medium-level threshold is connected with the negative electrode input end of the third comparison circuit, the output end of the first comparison circuit outputs the speed signal to the edge capturing module, and the output ends of the second comparison circuit and the third comparison circuit are connected in parallel and then output the data signal to the rising edge capturing module and the falling edge capturing module.
The decoding device of AK protocol wheel speed sensor of the invention is further improved in that: the high-level threshold is equal to the average value of the voltage signal corresponding to the high nominal current and the voltage signal corresponding to the nominal current, and the medium-level threshold is equal to the average value of the voltage signal corresponding to the nominal current and the voltage signal corresponding to the low nominal current.
The invention further improves the AK protocol wheel speed sensor decoding device, which is characterized in that the buffer module comprises a speed pulse storage space for storing the speed edge time stamp information, a data rising edge storage space for storing the data rising edge time stamp information and a data falling edge storage space for storing the data falling edge time stamp information, wherein the depth of the speed pulse storage space is satisfied with at least storing 4 edge time stamps, the depth of the data rising edge storage space is satisfied with at least storing 20 rising edge time stamps, and the depth of the data falling edge storage space is satisfied with at least storing 20 falling edge time stamps.
The AK protocol wheel speed sensor decoding device is further improved in that the sensor interface module further comprises a power supply module for supplying power to the wheel speed sensor and detecting and protecting faults of a power supply, and the power supply module can send out fault signals when faults are detected; the calculation module is provided with an input port for receiving the fault signal and a feedback port for feeding back the fault signal to a superior system.
The invention also provides a decoding method of the AK protocol wheel speed sensor, which comprises the following steps:
s1, providing an AK protocol wheel speed sensor decoding device according to any one of claims 1 to 6, and connecting a sensor interface module with a wheel speed sensor;
s2, acquiring rising edge time stamp information and falling edge time stamp information from a cache module by utilizing a calculation module, and splitting the rising edge time stamp information and the falling edge time stamp information into a time stamp array and an edge type array which are arranged in time sequence;
s3, acquiring speed edge timestamp information from the cache module by using a calculation module, and judging whether the speed edge timestamp information is not updated for more than 150ms or not:
if yes, determining that the operation mode is a static mode, and executing step S4;
if not, finding a current speed pulse and a next speed pulse from the speed edge timestamp information, solving the wheel speed based on the time difference between the current speed pulse and the next speed pulse, determining whether the operation mode is a normal mode or a high speed mode, outputting a falling edge timestamp of the current speed pulse, and executing step S5;
s4, finding a current time stamp from the time stamp array, calculating the time difference between the current time stamp and the next time stamp, and judging whether the time difference is equal to the speed pulse width or not:
if yes, outputting the next time stamp as a falling edge time stamp of the speed pulse, and then executing step S5;
if not, taking the next time stamp as a new current time stamp, and returning to the step S4;
s5, finding a first timestamp positioned after the output falling edge timestamp from the timestamp array, and judging whether the edge type corresponding to the first timestamp is a rising edge or not:
if yes, decoding the data information of the first time stamp and the subsequent time stamps by utilizing a Manchester code decoding flow;
if not, the data is wrong, and decoding is finished.
The invention further improves the decoding method of the AK protocol wheel speed sensor, which is characterized in that the method for finding the current speed pulse and the next speed pulse from the speed edge timestamp information comprises the following steps:
s31, finding a current edge time stamp from the speed edge time stamp information;
s32, calculating a difference value between the current edge time stamp and the next edge time stamp, and judging whether the difference value is equal to the speed pulse width or not:
if yes, the upper edge time stamp is the falling edge of the current speed pulse, the current edge time stamp is the rising edge of the next speed pulse, and the next edge time stamp is the falling edge of the next speed pulse;
if not, the next edge time stamp is taken as the current edge time stamp, and then the step S32 is returned.
The invention further improves the AK protocol wheel speed sensor decoding method, which is characterized in that the method for determining whether the operation mode is a normal mode or a high-speed mode based on the time difference between the current speed pulse and the next speed pulse comprises the following steps:
s33, calculating the time difference between the falling edge of the current speed pulse and the falling edge of the next speed pulse, and comparing the time difference with a duration threshold value, wherein the duration threshold value is equal to the duration of one complete period when the operation mode is the normal mode:
if the time difference is not smaller than the duration threshold, judging that the running mode is a normal mode;
and if the time difference is smaller than the time length threshold value, judging that the running mode is a high-speed mode.
The invention further improves the AK protocol wheel speed sensor decoding method, which is characterized in that the method for decoding data information by utilizing Manchester code decoding flow for the first time stamp and each subsequent time stamp comprises the following steps:
s51, calculating a time difference between the first time stamp and the output falling edge time stamp, and comparing the time difference with tp and tp/2, wherein tp is expressed as a time length of one data bit:
if the time difference is equal to tp, further judging whether the edge type corresponding to the first timestamp is a rising edge:
if yes, the value of the data 0 bit is 1;
if not, the value of the data 0 bit is invalid, and decoding is finished;
if the time difference is equal to tp/2, further judging whether the edge type corresponding to the first timestamp is a falling edge or not:
if yes, the value of the data 0 bit is 0;
if not, the value of the data 0 bit is invalid, and decoding is finished;
if the time difference is equal to other values, the value of the data 0 bit is invalid, and decoding is finished;
s52, calculating a time difference between the second time stamp and the first time stamp, and comparing the time difference with tp and tp/2:
if the time difference is equal to tp, further judging whether the edge type corresponding to the second time stamp is different from the edge type of the first time stamp:
if so, the value of the data 1 bit is opposite to the value of the data 0 bit;
if not, the value of the data 1 bit is invalid, and decoding is finished;
if the time difference is equal to tp/2, further judging whether the edge type corresponding to the second timestamp is the same as the edge type of the first timestamp:
if so, the value of the data 1 bit is the same as the value of the data 0 bit;
if not, the value of the data 1 bit is invalid, and decoding is finished;
if the time difference is equal to other values, the value of the data 1 bit is invalid, and decoding is finished;
and S53, sequentially repeating the step S52 until all data bits in a complete period are decoded.
The invention realizes the design of the sensor interface module by adding the common power supply module and the operational amplifier circuit, effectively converts the current signal of the AK protocol into the speed signal and the data signal of the CMOS level, can realize the decoding of the normal mode, the static mode and the high-speed mode, occupies small volume of a circuit board, can be integrated into the existing automobile electronic controller, and is particularly suitable for being applied to the application of an electronic mechanical brake caliper execution controller (EMB) and the like. In addition, the invention can multiplex the microprocessor in the electronic controller, does not increase the cost, and has lower cost for the added power supply module and the operational amplifier circuit.
Drawings
Fig. 1 shows a schematic diagram of signal waveforms of AK protocol normal mode.
Fig. 2 shows a schematic diagram of signal waveforms of an AK protocol rest mode.
Fig. 3 shows a schematic diagram of signal waveforms of AK protocol high-speed mode.
Fig. 4 shows a system frame diagram of the decoding apparatus of the present invention.
Fig. 5 shows a functional block diagram of a sensor interface module in the decoding device of the present invention.
Fig. 6 shows a schematic block diagram of a decoding module in the decoding device of the present invention.
Fig. 7 shows a flow chart of speed decoding in the decoding method of the present invention.
Fig. 8 shows a flow chart of operation mode judgment in the decoding method of the present invention.
Fig. 9 shows a time stamp array and edge type array storage schematic in the decoding method of the present invention.
Fig. 10 shows a decoding flow chart of the normal mode and the high-speed mode in the decoding method of the present invention.
Fig. 11 shows a flow chart of the decoding of the still mode in the decoding method of the present invention.
Fig. 12 shows a decoding flow chart of data 0 bits in the decoding method of the present invention.
Fig. 13 shows a decoding flow chart of other data bits in the decoding method of the present invention.
Detailed Description
In order to solve the problems that the current AK protocol decoding mode has high cost and low competitiveness or can not support decoding of all working modes, the invention provides a decoding device and a decoding method of an AK protocol wheel speed sensor. The following describes the decoding device and decoding method of the AK protocol wheel speed sensor with reference to the accompanying drawings in a specific embodiment.
Referring to fig. 4 to 6, an AK protocol wheel speed sensor decoding apparatus includes:
sensor interface module 2 as shown in fig. 5, the sensor interface module 2 includes: current sampling circuit 22 for collecting and converting a current signal 42 returned from wheel speed sensor 1 into a voltage signal, and method for comparing the voltage signal with I CCH A first comparison circuit 23 for comparing the threshold value 26, i.e. the high level threshold value, and extracting the speed signal 52 for simultaneously comparing the voltage signal with I CCH Threshold 26 and I CCM The threshold 27 (i.e., the medium level threshold) is compared and a window comparison circuit of the data signal 53 is extracted. The window comparison circuit comprises a second comparison circuit 24 and a third comparison circuit 25, the input end of the current sampling circuit 22 is connected with a current signal 42 returned by the wheel speed sensor 1, and the output end of the current sampling circuit 22 is respectively connected with the positive electrode input end of the first comparison circuit 23, the negative electrode input end of the second comparison circuit 24 and the positive electrode input end of the third comparison circuit 25The I is CCH The threshold 26 is connected to the negative input terminal of the first comparator 23 and the positive input terminal of the second comparator 24, respectively, the I CCM The threshold 27 is connected to the negative input terminal of the third comparing circuit 25, the output terminal of the first comparing circuit 23 outputs the speed signal 52, and the output terminals of the second comparing circuit 24 and the third comparing circuit 25 are connected in parallel and then output the data signal 53. Wherein the current signal 42 comprises three nominal currents, high, medium and low, typically 28 milliamp, 15 milliamp, 7 milliamp, the I CCH The threshold 26 is set to be between the voltage signal corresponding to the high nominal current and the voltage signal corresponding to the nominal current, I CCM The threshold 27 is set to be between the voltage signal corresponding to the nominal current and the voltage signal corresponding to the low nominal current. In order to accurately extract the speed signal 52 and the data signal 53 from the current signal 42 and to improve the anti-jamming capability, a deviation of plus or minus 20% of each nominal current of the current signal 42 is generally allowed, so that the current signal is set to I CCH Threshold 26 and I CCM At threshold 27, a margin should be left. Therefore, recommended setting I CCH The threshold 26 is equal to the average value of the voltage signal corresponding to the high nominal current and the voltage signal corresponding to the nominal current, I CCM The threshold 27 is equal to the average of the voltage signal corresponding to the nominal current and the voltage signal corresponding to the low nominal current.
And further includes a decoding module 3 connected to the sensor interface module 2, as shown in fig. 6, the decoding module 3 includes: a buffer module 34, the buffer module 34 including a speed pulse storage space 342, a data rising edge storage space 343, and a data falling edge storage space 344; an edge capture module 31 for acquiring the speed edge timestamp information 36 from the speed signal 52 and storing in the speed pulse storage space 342; a rising edge capture module 32 for acquiring rising edge timestamp information 37 of a data pulse from the data signal 53 and storing in the data rising edge storage space 343; a falling edge capture module 33 for acquiring falling edge timestamp information 38 of a data pulse from the data signal 53 and storing in the data falling edge storage space 344; and a calculation module 35 for performing speed decoding and running state decoding according to the speed edge timestamp information 36, the rising edge timestamp information 37 and the falling edge timestamp information 38, the calculation module 35 being connected to the buffer module 34. Based on the characteristics of AK protocol, in order to achieve decoding of one complete cycle, the speed pulse storage space 342 should be able to store at least two speed pulses, so the storage depth is set to be not less than 4 (i.e. not less than 4 speed edge time stamps can be stored), while the data rising edge storage space 343 and the data falling edge storage space 344 should be able to store at least one complete set of data bits, and for the normal mode, one set of data bits includes 9 data bits, while considering the rest mode, 1 data bit is needed to replace the speed pulse, so the storage depth of the data rising edge storage space and the data falling edge storage space is set to be not less than 20 (i.e. not less than 20 rising edge time stamps and 20 falling edge time stamps can be stored respectively). Preferably, in order to realize the transportation of each timestamp and save the operation resources as much as possible, in this embodiment, the DMA controller 341 is selectively disposed in the buffer module 34, and the DMA controller 341 is utilized to realize the transportation of each timestamp to the corresponding storage space for storage, so that the calculation module 35 is not required to participate in the control, and the operation resources are saved.
This embodiment is illustrated by I CCH Threshold 26 and I CCM The setting of the threshold 27 and the combination of the three comparison circuits can effectively convert the current signal 42 of the AK protocol into the speed signal 52 and the data signal 53 of the CMOS level, is convenient for realizing the decoding of the normal mode, the static mode and the high-speed mode, occupies small volume of a circuit board, can be integrated into the existing automobile electronic controller, and is particularly suitable for being applied to the application of an electronic mechanical brake caliper execution controller (EMB) and the like. In addition, the functions required by each module in the decoding module 3 are basically all provided in a general vehicle Microprocessor (MCU), so that the MCU resources of the existing vehicle electronic controller can be reused, the cost is not increased, and the added sensor interface module 2 can be realized by adopting a simple circuit, and the cost is low.
As a preferred embodiment, as shown in fig. 5, the sensor interface module 2 further includes a power supply module 21 for providing power 41 to the wheel speed sensor and performing fault detection and protection on the power, where the power supply module 21 may be a separate power supply module, and the fault detection and protection includes overvoltage, undervoltage, overcurrent, and the like. The power supply module 21 is adapted to issue a fault signal 51 upon detection of a fault. As further shown in fig. 6, the calculation module 35 is provided with an input port for receiving the fault signal 51 and a feedback port for feeding back the fault signal to a superordinate system. The calculation module 35 decodes the wheel speed and the running state of the wheel speed sensor through the speed and data timestamp information obtained from the buffer module 34, and simultaneously combines the fault signal 51 output by the sensor interface module 2 to realize fault processing, and if necessary, the fault information can be reported to a previous system.
A decoding method of AK protocol wheel speed sensor includes the steps:
step S1, providing the AK protocol wheel speed sensor decoding device, and connecting a sensor interface module with the wheel speed sensor.
And S2, acquiring rising edge time stamp information and falling edge time stamp information from the cache module by utilizing a calculation module, and splitting the rising edge time stamp information and the falling edge time stamp information into a time stamp array and an edge type array which are arranged in time sequence. Taking the example that the storage depth of the data rising edge storage space and the data falling edge storage space is 20, referring to fig. 9, the timestamp array includes 40 timestamps stored in time sequence, and the edge type array correspondingly stores edge types. Such as: a "rising edge timestamp" is split into a time portion and an edge type portion, the time portion is stored in a designated sequence number position in the timestamp array according to the time sequence, and the edge type of the corresponding sequence number position in the edge type array is the "rising edge".
Step S3, acquiring speed edge timestamp information from the cache module by using the calculation module, and judging whether the speed edge timestamp information is more than 150ms and not updated: if yes, determining that the operation mode is a static mode, and executing step S4; if not, the current speed pulse and the next speed pulse are found from the speed edge timestamp information, the wheel speed is obtained based on the time difference between the current speed pulse and the next speed pulse, whether the operation mode is the normal mode or the high speed mode is determined, then the falling edge timestamp of the current speed pulse is output, and the step S5 is executed.
Step S4, finding the current time stamp from the time stamp array, calculating the time difference between the current time stamp and the next time stamp, and judging whether the time difference is equal to the speed pulse width or not: if yes, outputting the next time stamp as a falling edge time stamp of the speed pulse, and then executing step S5; if not, the next time stamp is taken as a new current time stamp, and the step S4 is returned.
Step S5, a first time stamp positioned behind the output falling edge time stamp is found from the time stamp array, and whether the edge type corresponding to the first time stamp is a rising edge or not is judged: if yes, decoding the data information of the first time stamp and the subsequent time stamps by utilizing a Manchester code decoding flow; if not, the data is wrong, and decoding is finished.
The following describes various decoding processes with reference to the accompanying drawings, taking the example that the storage depth of the speed pulse storage space is set to 4, and the storage depths of the data rising edge storage space and the data falling edge storage space are set to 20.
Referring to fig. 7, fig. 7 shows a speed decoding flow chart. The method for finding the current speed pulse and the next speed pulse from the speed edge timestamp information comprises the following steps:
step S31, starting to search from the first edge time stamp in the speed edge time stamp information, namely setting the current sequence number to be 1, and taking the first edge time stamp as the current sequence number edge time stamp.
And S32, adding 1 to the current sequence number, finding the edge time stamp of the next sequence number, calculating the difference between the edge time stamp of the current sequence number and the edge time stamp of the next sequence number, and judging whether the difference is equal to the speed pulse width.
If so, the current sequence number edge time stamp and the next sequence number edge time stamp are respectively corresponding to the rising edge and the falling edge of one speed pulse, that is, the last sequence number edge time stamp is the falling edge of the current speed pulse, the current sequence number edge time stamp is the rising edge of the next speed pulse, and the next sequence number edge time stamp is the falling edge of the next speed pulse. The time difference between the falling edge of the current speed pulse and the falling edge of the next speed pulse is the time difference between the current speed pulse and the next speed pulse. In order to remove the fault information, it is first determined whether the current sequence number is smaller than 4 after the difference is determined to be equal to the speed pulse width, if it is smaller than 4, the time difference calculation is performed, and if it is not smaller than 4, the speed pulse fault is described. Because the storage depth of the speed pulse storage space is 4, if the current sequence number is not less than 4, the current sequence number is the last edge time stamp, the possibility of the next edge time stamp does not exist, and the storage space does not have the required speed pulse information.
If not, the process returns to step S32, and the current sequence number is continuously added with 1, and the next edge time stamp is used as the current edge time stamp, so that the calculation and judgment are continuously performed. It should be noted that, in order to remove the fault information, before returning to step S32, it should be first determined whether the current sequence number is greater than 3, if not, returning to step S32, if yes, indicating that the last edge time stamp has been queried, and that the required speed pulse information is not in the storage space.
The above information is returned to output for subsequent decoding, for example, the wheel speed of the wheel speed sensor can be obtained based on the time difference between the current speed pulse and the next speed pulse, and whether the wheel speed sensor operates in the normal mode or the high speed mode can be determined based on the difference between the data bit numbers of the normal mode and the high speed mode in the AK protocol and the time difference.
Referring to fig. 8, fig. 8 shows a flow chart of operation mode determination in the decoding method of the present invention. When the speed information is not updated within 150ms, the mode is considered to be a static mode, and when the speed information is updated, the mode is considered to be a normal mode or a high-speed mode. And the method for determining whether the operation mode is the normal mode or the high speed mode based on the time difference between the current speed pulse and the next speed pulse is as follows:
step S33, calculating the time difference between the falling edge of the current speed pulse and the falling edge of the next speed pulse (i.e. the time difference between two adjacent speed pulses), and comparing the time difference with a duration threshold, wherein the duration threshold is equal to the duration of one complete cycle when the operation mode is the normal mode, in this embodiment, the frequency is used to reflect the duration, and when the frequency is less than 1818Hz, as shown in table 1, the corresponding duration can satisfy 1 speed pulse and 9 data bits of information, that is, can satisfy one complete cycle, and therefore, the duration threshold is set to be equal to 1818Hz:
if the time difference is not smaller than the duration threshold (i.e. the frequency corresponding to the time difference is smaller than 1818 Hz), judging that the running mode is a normal mode;
if the time difference is smaller than the duration threshold (i.e. the frequency corresponding to the time difference is not smaller than 1818 Hz), the operation mode is judged to be a high-speed mode, and because the data bit is truncated in the high-speed mode, part of the data bits cannot be transmitted, the duration is relatively short, and the corresponding frequency is relatively large.
TABLE 1 data information bit Length versus frequency
Frequency (Hz) corresponding to the time difference of the velocity pulses | Length (bits) of data information |
<1818 | 9 |
<2000 | 8 |
<2222 | 7 |
<2500 | 6 |
<2857 | 5 |
<3333 | 4 |
<4000 | 3 |
<5000 | 2 |
The speed signal can be obtained for both the normal mode and the high speed mode, so that the falling edge time stamp of the speed pulse can be directly obtained based on the method. In decoding the data signal, the flow of fig. 10 may be referred to. Adding 1 to the current sequence number in the time stamp array, and then judging whether the current time stamp is larger than the falling edge time stamp of the speed pulse:
if yes, further judging whether the corresponding edge type in the edge type array is a rising edge: if yes, the data 0 bit of the timestamp corresponding to the data signal is described, and then the data 0 bit and the following data bits can be decoded according to the Manchester code by calculating the time difference between the current timestamp and the falling edge timestamp of the speed pulse; if not, the data error is described.
If not, further judging whether the storage sequence number is larger than 36: if the data is larger than 36, the data is executed until the last data bit, and the time stamp array has no complete data information and is in data error; if not, returning to continue searching for the next sequence number.
For still mode, the key to decoding is to search for an alternate speed pulse to find the data information for Manchester code decoding. The rest mode is inserted with a separation between two speed pulses of more than 150ms, so that the alternative speed pulse is characterized by a time difference from the time stamp of the preceding pulse edge of more than 150ms. Referring specifically to fig. 11, fig. 11 shows a flow chart of the decoding in the still mode in the decoding method of the present invention. Firstly, starting from the first timestamp of the timestamp array, setting the current sequence number to be 1, adding 1 to the current sequence number, and judging whether the time difference between the current sequence number timestamp and the last sequence number timestamp is greater than 150ms:
if not, returning to the continuous serial number and adding 1 for judgment.
If yes, further judging whether the time difference between the current sequence number time stamp and the next sequence number time stamp is the speed pulse width: if not, returning to the continuous serial number and adding 1 for judgment; if yes, the current sequence number timestamp is the rising edge timestamp of the substitution pulse, the next sequence number timestamp is the falling edge timestamp of the substitution speed pulse, the falling edge timestamp of the substitution speed pulse is output, then the data 0 bit is found out as in the normal mode and the high-speed mode, and the Manchester code is utilized for decoding the data 0 bit and the following data bits.
The decoding of the Manchester code includes decoding of data 0 bits and decoding of other data bits:
referring to fig. 12, fig. 12 shows a decoding flow chart of data 0 bits in the decoding method of the present invention. Step S51, calculating the time difference between the first timestamp (i.e. the first timestamp located after the falling edge timestamp of the speed pulse in the data timestamp array) and the output falling edge timestamp (i.e. the falling edge timestamp of the speed pulse), and comparing the time difference with tp and tp/2, where tp is represented as the time length of one data bit, and can be matched with the time length shown in fig. 1-3:
if the time difference is equal to tp, further determining whether the edge type corresponding to the first timestamp is a rising edge:
if so, the value of the data 0 bit is 1.
If not, the value of the data 0 bit is invalid, and decoding is finished.
If the time difference is equal to tp/2, further determining whether the edge type corresponding to the first timestamp is a falling edge:
if so, the value of the data 0 bit is 0.
If not, the value of the data 0 bit is invalid, and decoding is finished.
If the time difference is equal to other values, the value of the data 0 bit is invalid, and decoding is finished.
With further reference to fig. 13, fig. 13 shows a decoding flow chart of other data bits in the decoding method of the present invention. After decoding the value of data 0, step S52 continues to calculate the time difference between the second time stamp (i.e. the time stamp of the following data 1 bit of data 0) and the first time stamp (i.e. the time stamp of the preceding data 0 bit), and compares the time difference with tp and tp/2:
if the time difference is equal to tp, further determining whether the edge type corresponding to the second timestamp is different from the edge type of the first timestamp:
if so, the value of data 1 bit is opposite to the value of data 0 bit.
If not, the value of the data 1 bit is invalid, and decoding is finished.
If the time difference is equal to tp/2, further determining whether the edge type corresponding to the second timestamp is the same as the edge type of the first timestamp:
if so, the value of data 1 bit is the same as the value of data 0 bit.
If not, the value of the data 1 bit is invalid, and decoding is finished.
If the time difference is equal to other values, the value of 1 bit of the data is invalid, and decoding is finished.
Step S53, repeat step S52, decode the value of the next data bit according to the value of the previous data bit and the time stamp of the previous data bit in sequence until all data bits in a complete period are decoded. And if invalid data bits appear in the whole decoding process, the data information is considered invalid, and the decoding is terminated.
In conclusion, the decoding device provided by the invention can be used for decoding the wheel speed of the AK protocol wheel speed sensor and the states of three operation modes.
The present invention has been described in detail with reference to the embodiments of the drawings, and those skilled in the art can make various modifications to the invention based on the above description. Accordingly, certain details of the illustrated embodiments are not to be taken as limiting the invention, which is defined by the appended claims.
Claims (9)
1. An AK protocol wheel speed sensor decoding device, comprising:
a sensor interface module, the sensor interface module comprising: the device comprises a current sampling circuit for collecting a current signal returned by a wheel speed sensor and converting the current signal into a voltage signal, a first comparison circuit for comparing the voltage signal with a high-grade threshold value and extracting a speed signal, and a window comparison circuit for simultaneously comparing the voltage signal with a high-grade threshold value and a medium-grade threshold value and extracting a data signal, wherein the current signal comprises three kinds of nominal currents of high, medium and low, the high-grade threshold value is set between the voltage signal corresponding to the high nominal current and the voltage signal corresponding to the nominal current, and the medium-grade threshold value is set between the voltage signal corresponding to the nominal current and the voltage signal corresponding to the low nominal current;
a decoding module coupled to the sensor interface module, the decoding module comprising: a cache module; the edge capturing module is used for acquiring speed edge timestamp information according to the speed signal and storing the speed edge timestamp information in the cache module; the rising edge capturing module is used for acquiring rising edge time stamp information of the data pulse according to the data signal and storing the rising edge time stamp information in the caching module; the falling edge capturing module is used for acquiring falling edge time stamp information of the data pulse according to the data signal and storing the falling edge time stamp information in the caching module; and the calculation module is used for performing speed decoding and running state decoding according to the speed edge timestamp information, the rising edge timestamp information and the falling edge timestamp information, and is connected with the cache module.
2. The AK protocol wheel speed sensor decoding apparatus as defined in claim 1, wherein: the window comparison circuit comprises a second comparison circuit and a third comparison circuit, the input end of the current sampling circuit is connected with the wheel speed sensor, the output end of the current sampling circuit is respectively connected with the positive electrode input end of the first comparison circuit, the negative electrode input end of the second comparison circuit and the positive electrode input end of the third comparison circuit, the high-level threshold is respectively connected with the negative electrode input end of the first comparison circuit and the positive electrode input end of the second comparison circuit, the medium-level threshold is connected with the negative electrode input end of the third comparison circuit, the output end of the first comparison circuit outputs the speed signal to the edge capturing module, and the output ends of the second comparison circuit and the third comparison circuit are connected in parallel and then output the data signal to the rising edge capturing module and the falling edge capturing module.
3. The AK protocol wheel speed sensor decoding apparatus as defined in claim 1, wherein: the high-level threshold is equal to the average value of the voltage signal corresponding to the high nominal current and the voltage signal corresponding to the nominal current, and the medium-level threshold is equal to the average value of the voltage signal corresponding to the nominal current and the voltage signal corresponding to the low nominal current.
4. The AK protocol wheel speed sensor decoding apparatus of claim 1, wherein the buffer module comprises a speed pulse storage space for storing the speed edge timestamp information, a data rising edge storage space for storing the data rising edge timestamp information, and a data falling edge storage space for storing the data falling edge timestamp information, the depth of the speed pulse storage space being sufficient to store at least 4 edge timestamps, the depth of the data rising edge storage space being sufficient to store at least 20 rising edge timestamps, the depth of the data falling edge storage space being sufficient to store at least 20 falling edge timestamps.
5. The AK protocol wheel speed sensor decoding apparatus of claim 1 wherein said sensor interface module further comprises a power module for providing power to the wheel speed sensor and for fault detection and protection of the power source, said power module being adapted to signal a fault upon detection of a fault; the calculation module is provided with an input port for receiving the fault signal and a feedback port for feeding back the fault signal to a superior system.
6. The AK protocol wheel speed sensor decoding method is characterized by comprising the following steps:
s1, providing an AK protocol wheel speed sensor decoding device according to any one of claims 1 to 5, and connecting a sensor interface module with a wheel speed sensor;
s2, acquiring rising edge time stamp information and falling edge time stamp information from a cache module by utilizing a calculation module, and splitting the rising edge time stamp information and the falling edge time stamp information into a time stamp array and an edge type array which are arranged in time sequence;
s3, acquiring speed edge timestamp information from the cache module by using a calculation module, and judging whether the speed edge timestamp information is not updated for more than 150ms or not:
if yes, determining that the operation mode is a static mode, and executing step S4;
if not, finding a current speed pulse and a next speed pulse from the speed edge timestamp information, solving the wheel speed based on the time difference between the current speed pulse and the next speed pulse, determining whether the operation mode is a normal mode or a high speed mode, outputting a falling edge timestamp of the current speed pulse, and executing step S5;
s4, finding a current time stamp from the time stamp array, calculating the time difference between the current time stamp and the next time stamp, and judging whether the time difference is equal to the speed pulse width or not:
if yes, outputting the next time stamp as a falling edge time stamp of the speed pulse, and then executing step S5;
if not, taking the next time stamp as a new current time stamp, and returning to the step S4;
s5, finding a first timestamp positioned after the output falling edge timestamp from the timestamp array, and judging whether the edge type corresponding to the first timestamp is a rising edge or not:
if yes, decoding the data information of the first time stamp and the subsequent time stamps by utilizing a Manchester code decoding flow;
if not, the data is wrong, and decoding is finished.
7. The AK protocol wheel speed sensor decoding method as set forth in claim 6, wherein the method of finding the current speed pulse and the next speed pulse from the speed edge timestamp information is:
s31, finding a current edge time stamp from the speed edge time stamp information;
s32, calculating a difference value between the current edge time stamp and the next edge time stamp, and judging whether the difference value is equal to the speed pulse width or not:
if yes, the upper edge time stamp is the falling edge of the current speed pulse, the current edge time stamp is the rising edge of the next speed pulse, and the next edge time stamp is the falling edge of the next speed pulse;
if not, the next edge time stamp is taken as the current edge time stamp, and then the step S32 is returned.
8. The AK protocol wheel speed sensor decoding method as in claim 7 wherein the method of determining whether the operation mode is the normal mode or the high speed mode based on the time difference of the current speed pulse and the next speed pulse is:
s33, calculating the time difference between the falling edge of the current speed pulse and the falling edge of the next speed pulse, and comparing the time difference with a duration threshold value, wherein the duration threshold value is equal to the duration of one complete period when the operation mode is the normal mode:
if the time difference is not smaller than the duration threshold, judging that the running mode is a normal mode;
and if the time difference is smaller than the time length threshold value, judging that the running mode is a high-speed mode.
9. The AK protocol wheel speed sensor decoding method as set forth in claim 6, wherein the method for decoding data information for the first and subsequent time stamps using a manchester code decoding process comprises:
s51, calculating a time difference between the first time stamp and the output falling edge time stamp, and comparing the time difference with tp and tp/2, wherein tp is expressed as a time length of one data bit:
if the time difference is equal to tp, further judging whether the edge type corresponding to the first timestamp is a rising edge:
if yes, the value of the data 0 bit is 1;
if not, the value of the data 0 bit is invalid, and decoding is finished;
if the time difference is equal to tp/2, further judging whether the edge type corresponding to the first timestamp is a falling edge or not:
if yes, the value of the data 0 bit is 0;
if not, the value of the data 0 bit is invalid, and decoding is finished;
if the time difference is equal to other values, the value of the data 0 bit is invalid, and decoding is finished;
s52, calculating a time difference between the second time stamp and the first time stamp, and comparing the time difference with tp and tp/2:
if the time difference is equal to tp, further judging whether the edge type corresponding to the second time stamp is different from the edge type of the first time stamp:
if so, the value of the data 1 bit is opposite to the value of the data 0 bit;
if not, the value of the data 1 bit is invalid, and decoding is finished;
if the time difference is equal to tp/2, further judging whether the edge type corresponding to the second timestamp is the same as the edge type of the first timestamp:
if so, the value of the data 1 bit is the same as the value of the data 0 bit;
if not, the value of the data 1 bit is invalid, and decoding is finished;
if the time difference is equal to other values, the value of the data 1 bit is invalid, and decoding is finished;
and S53, sequentially repeating the step S52 until all data bits in a complete period are decoded.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311520952.1A CN117596106A (en) | 2023-11-15 | 2023-11-15 | AK protocol wheel speed sensor decoding device and decoding method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311520952.1A CN117596106A (en) | 2023-11-15 | 2023-11-15 | AK protocol wheel speed sensor decoding device and decoding method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117596106A true CN117596106A (en) | 2024-02-23 |
Family
ID=89917422
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311520952.1A Pending CN117596106A (en) | 2023-11-15 | 2023-11-15 | AK protocol wheel speed sensor decoding device and decoding method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117596106A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US12107672B1 (en) * | 2023-09-21 | 2024-10-01 | Shanghai Leekr Technology Co.Ltd. | Protocol data bit parsing method and device for AK protocol wheel speed sensor |
CN119269832A (en) * | 2024-10-24 | 2025-01-07 | 上海拿森汽车电子有限公司 | Wheel speed determination method, system and vehicle |
-
2023
- 2023-11-15 CN CN202311520952.1A patent/CN117596106A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US12107672B1 (en) * | 2023-09-21 | 2024-10-01 | Shanghai Leekr Technology Co.Ltd. | Protocol data bit parsing method and device for AK protocol wheel speed sensor |
CN119269832A (en) * | 2024-10-24 | 2025-01-07 | 上海拿森汽车电子有限公司 | Wheel speed determination method, system and vehicle |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN117596106A (en) | AK protocol wheel speed sensor decoding device and decoding method | |
US11520600B2 (en) | Controller area network transceiver and controller | |
US20090243815A1 (en) | Electronic Communication Devices and Methods | |
CN112519592B (en) | Vehicle wheel speed control method and device and electric vehicle | |
ATE335641T1 (en) | MONITORING SYSTEM, VEHICLE MONITORING DEVICE, MONITORING METHOD, MONITORING PROGRAM, COMPUTER READABLE RECORDING MEDIUM CONTAINING THE SAME | |
US9193340B2 (en) | Wheel speed sensor interface, operation method thereof, and electronic control system including the same | |
US5477472A (en) | Dual hysteresis method of generating square waves from non-uniform cyclical signals | |
CN107449451B (en) | Sensor device | |
CN105717462B (en) | For establishing the method for being directed to the functional diagnosis of decompression static state DC-DC electric pressure converter | |
CN112118083A (en) | Single-wire half-duplex communication method, communication device and equipment | |
US9647680B2 (en) | Walsh encoding for peripheral sensor interface 5 | |
CN115097248B (en) | Electric oil pump fault detection method and device for new energy automobile | |
KR100721385B1 (en) | Error detection control method of vehicle controller | |
CN113395327B (en) | Data processing method, device, electronic equipment and medium | |
CN117749180B (en) | Safety identification method and system for key signals | |
KR102168227B1 (en) | Monitoring system and method for digital cluster output audio | |
CN111246087B (en) | Motor vehicle video controller, motor vehicle video control system and method | |
CN119582811A (en) | PWM signal detection method and device, program product, and medium | |
KR20230133519A (en) | Processing device of wheel speed sensor signal according to ECU switching | |
JP2624120B2 (en) | Monitoring data replacement circuit | |
CN118311295A (en) | Direction identification method and device based on discrete circuit AK protocol wheel speed sensor | |
CN113928329A (en) | Electronic device and operation method thereof | |
CN117311323A (en) | Fault code coding and cyclic transmitting system and method | |
KR100985101B1 (en) | Wheel speed sensor protection circuit of car | |
CN112162895A (en) | An abnormal state detection method, apparatus, system, equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |