A wheel odometer calibration system and method based on FPGA
The FPGA component generates and counts the square wave signals with advanced phases, which solves the problem of difficulty in evaluating the accuracy before calibration in the prior art, and achieves efficient and low-cost odometer accuracy verification.
Patent Information
- Application Number
- CN202211327354.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-27
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2042-10-27
AI Technical Summary
It is difficult to accurately and effectively evaluate and verify the accuracy of existing odometers before calibration of inertial navigation devices, resulting in low calibration accuracy or failure.
Using a wheeled odometer verification system based on FPGA, the square wave generator, square wave phase detection module and counting module in the FPGA component generate and count square wave signals with advanced phases, and use the upper computer to display the count value to judge the working status of the odometer.
Accurate verification of odometer accuracy is achieved, external hardware circuits are saved, cost and volume are reduced, and verification speed is improved.
Smart Images

Figure CN115615462B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of wheel odometer equipment, and in particular to a wheel odometer calibration system and method based on FPGA. Background Art
[0002] An odometer is a device that uses data from a mobile sensor to estimate the change in an object's position over time. During use, the device can be used for the initial calibration of an inertial navigation system. To calibrate an inertial navigation system using an odometer, its own accuracy must first meet certain requirements.
[0003] Existing odometers typically use wheel encoders to provide basic pose estimation, capable of providing high-precision speed and position changes in a short period of time. The basic operating principle is that the odometer wheel encoder collects information about the forward position of the wheel. Each rotation of the wheel generates a corresponding pulse signal. Forward rotation generates two in-phase square wave signals, while reverse rotation generates two anti-phase square wave signals. The odometer processes these two square wave signals and outputs a forward signal to calculate speed and position information.
[0004] However, as the running distance or the running time of the wheel encoder increases, the output signal of the odometer will produce accumulated errors. When the odometer is used for the initial calibration of the inertial navigation unit, the accumulated errors will cause the calibration accuracy of the inertial navigation unit to be low, and in severe cases, it will lead to the failure of the calibration task. Therefore, before using the odometer to calibrate the inertial navigation unit, it is very necessary to first evaluate and verify the accuracy of the odometer. However, there is currently no relevant odometer accuracy verification system and verification method. Summary of the Invention
[0005] In view of the above-mentioned deficiencies in the prior art, the technical problem to be solved by the present invention is: to provide an FPGA-based wheel odometer calibration system and method, which solves the problem in the prior art that it is difficult to accurately and effectively evaluate and calibrate the accuracy of the wheel odometer before using the odometer to calibrate the inertial navigation device.
[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0007] A wheel odometer calibration system based on FPGA includes a host computer, an FPGA component, and an odometer to be calibrated, wherein the FPGA component includes a serial port module, a square wave generator module, a square wave phase detection module, and a counting module; the input end of the odometer is connected to the square wave generator module, and the output end thereof is connected to the counting module; wherein,
[0008] The serial port module is connected to the host computer and is used for communicating with the host computer;
[0009] The square wave generator module is connected to the serial port module and is used to generate and output two original square waves of corresponding frequency and phase according to the control signal sent by the host computer through the serial port module;
[0010] The square wave phase detection module is connected to the square wave generator module, and is used to receive two original square wave signals, determine the phase lead relationship between the two original square waves, and then output the square wave signal with the phase lead;
[0011] The counting module is connected to the square wave phase detection module and the odometer to be verified, and is used to count the leading phase square wave signals output by the square wave phase detection module and the odometer to be verified respectively, and upload the count values to the host computer through the serial port module;
[0012] The host computer is used to send a control signal for generating the original square wave, and to display the count values of the original square wave, the square wave signal with an advanced phase output by the square wave phase detection module, and the square wave signal with an advanced phase output by the odometer.
[0013] Based on the above verification system, the present invention also provides a wheel odometer verification method based on FPGA, which uses the above verification system and includes the following steps:
[0014] 1) Sending preset control signals to the FPGA component through the host computer;
[0015] 2) After receiving the control signal, the square wave generator module of the FPGA component generates two original square waves of corresponding frequency and phase, and outputs the original square waves to the odometer to be verified and the square wave phase detection module respectively;
[0016] 3) The odometer and square wave phase detection modules process the original square wave respectively to generate a phase-advanced square wave signal and output it to the counting module;
[0017] 4) The counting module counts the phase-advanced square wave signals sent by the odometer and the square wave phase detection module respectively, and uploads the count values of the phase-advanced square wave signals output by the square wave phase detection module and the phase-advanced square wave signals output by the odometer to the host computer;
[0018] 5) After receiving the count value uploaded by the counting module, the host computer displays the count value and the count value of the original square wave;
[0019] 6) Observe whether the count values displayed on the host computer are consistent. If the count values are consistent, the odometer is working properly. If the count value of the advanced phase square wave signal output by the odometer is inconsistent with the count value of the original square wave signal, the odometer is not working properly.
[0020] As an optimization, in step 2), the square wave generator module receives the control signal sent by the host computer through the serial port, uses the internal IP core to generate a RAM memory for storing the verified control signal data packet, and after decoding and reading the data packet in the RAM, generates two original square waves of corresponding frequency and phase according to the frequency size and phase advance data, and outputs them to the odometer and square wave phase detection module.
[0021] As an optimization, in step 3), the square wave phase detection module processes the original square wave to generate an advanced phase square wave signal, including setting the two original square waves as a and b, first starting counting with the rising edge of a as the reference, and ending counting when the rising edge of b arrives, and the time is recorded as T3; then starting counting with the rising edge of b as the reference, and ending counting when the rising edge of a arrives, and the time is recorded as T4; comparing T3 and T4, when T3 is greater than T4, the phase of a leads b, and a is output as the advanced phase square wave signal; conversely, the phase of b leads a, and b is output as the advanced phase square wave signal.
[0022] Compared with the prior art, this application has the following beneficial effects:
[0023] The present invention simulates the operation of an odometer using only an FPGA component and generates a corresponding square wave signal as the odometer input. Comparing the count values of the two output pulse signals from the odometer and the FPGA component simulating the odometer allows for verification of odometer accuracy, without the need for additional peripheral function generators and frequency modulation circuits. By utilizing an FPGA design, the present invention only requires the FPGA to generate the frequency generator and phase detector, thus eliminating external hardware circuitry and reducing costs. Furthermore, the system is compact, the peripheral circuitry is simplified, and program verification is accelerated. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 This is a functional block diagram of the verification device of the present invention;
[0025] Figure 2 This is a phase detection principle diagram of the square wave phase detection module of the present invention;
[0026] Figure 3 This is a diagram showing the principle of phase difference calculation in the present invention. DETAILED DESCRIPTION
[0027] The present invention will be described in further detail below with reference to the accompanying drawings.
[0028] Specific implementation: see Figure 1-Figure 3 ,
[0029] A wheel odometer calibration system based on FPGA includes a host computer, FPGA components, and an odometer. The present invention uses Xilinx's XC6SLX9 FPGA, which has high computing speed and rich logic units. The present invention uses the corresponding hardware modules generated within the FPGA to process signals. The internal modules are specifically as follows, including:
[0030] The timer module, after dividing the clock frequency of the IP core within the FPGA, adopts a counter form. The number of counts in the counter is determined based on the divided clock frequency and the desired timing time. The timing time is calculated after the clock signal outputs a counted number of cycles. The counting module in the present invention counts according to the counter form of the timer module to count the number of square wave pulses within a certain time period. The counting module is connected to the serial port module and the square wave phase detection module respectively, and is used to count the leading phase square wave signal output by the square wave phase detection module, and upload the count value to the host computer through the serial port module.
[0031] The serial port module is connected to the host computer and is used to communicate with the host computer, receive the control message signal sent by the host computer and upload the square wave counting cycle count value after verification.
[0032] The square wave generator module is connected to the serial port module and is used to generate and output two original square waves of corresponding frequency and phase according to the control message signal sent by the host computer through the serial port module. Specifically, a counter is used to count the clock edges, and the total number of counts is the square wave period / clock period; half of the total number of counts is a high-level output, and the other half is a low-level output to generate a periodic square wave. In the present invention, the problem of wheeled vehicle odometer encoder verification is solved by a design scheme of FPGA+Labview architecture. The host computer designed with Labview provides square wave counting function and simulates square wave instruction issuance, and FPGA generates the original square waves a and b of the simulated wheel encoder. If the wheel rotates forward, a simulated square wave with a phase ahead of b will be generated. If the wheel reverses, a simulated square wave with b phase ahead of a will be generated. The FPGA will simulate the odometer through the square wave phase detection module to output the phase-leading square wave signal.
[0033] The square wave phase detection module is connected to the square wave generator module, and is used to receive and identify the phases of the two original square waves and output a square wave signal with a leading phase.
[0034] The input end of the odometer is connected to the square wave generator module, and the output end is connected to the counting module, which is used to receive and process the original square wave output by the square wave generator module and then output a square wave signal with an advanced phase, and after being counted by the counting module, it is uploaded to the host computer;
[0035] The host computer is used to send a control message signal for generating the original square wave, and to display the count values of the original square wave, the advanced phase square wave signal output by the square wave phase detection module, and the advanced phase square wave signal output by the odometer. The working status of the odometer can be judged by observing the count values displayed by the host computer.
[0036] Based on the above verification device, the present invention also provides a wheel odometer verification method based on FPGA, which uses the above verification device and includes the following steps:
[0037] 1) Sending preset control message signals to the FPGA component through the host computer;
[0038] 2) After receiving the control message signal, the FPGA component's square wave generator module generates two original square waves of corresponding frequency and phase, and outputs these original square waves to the odometer and square wave phase detector modules, respectively. Specifically, the square wave generator module receives the control message signal from the host computer via the serial port, uses its internal IP core to generate RAM memory for storing the verified control message signal data packets, and after decoding and reading the data packets in the RAM, generates two original square waves a and b of corresponding frequency and phase based on the frequency and phase advance data, and outputs them to the odometer and square wave phase detector modules.
[0039] 3) The odometer and square wave phase detection modules process the original square wave to generate an advanced phase square wave signal and output it to the counting module. Figure 2 As shown, the square wave phase detection module processes the original square wave to generate a phase-advancing square wave signal. This involves first starting counting based on the rising edge of a and ending when the rising edge of b arrives, with time recorded as T3. Then, counting starts again based on the rising edge of b and ends when the rising edge of a arrives, with time recorded as T4. T3 and T4 are compared. If T3 is greater than T4, a leads b in phase, and a is output as the phase-advancing square wave signal C. Otherwise, b leads a in phase, and b is output as the phase-advancing square wave signal C. The odometer outputs the phase-advancing square wave signal after processing, which is counted as A or B.
[0040] 4) The technical module counts the advanced phase square wave signals sent by the odometer and the square wave phase detection module according to the control instructions of the host computer, and uploads the count value to the host computer.
[0041] 5) After receiving the count value uploaded by the counting module, the host computer displays it and the original square wave count value. By observing whether the count values displayed by the host computer are consistent, the odometer's operating status can be determined. Specifically, after the host computer sends a start counting signal, the FPGA component counts the rising edges of the original leading phase square waves a and b, the rising edges of the simulated odometer square wave signal c after phase detection, and the rising edges of square waves A or B output by the odometer. Upon receiving the end counting signal, the previous square wave count ends. The FPGA outputs the square wave count value to the host computer through the serial port module for display. Observing whether the odometer count value and the FPGA simulated odometer count value are consistent or match indicates whether the odometer is operating properly. The difference between the count values can also be used to assess the odometer's cumulative error range, facilitating subsequent determination of whether the odometer can be used to calibrate the inertial navigation system. If the error exceeds a certain range, the odometer can be replaced with a more accurate odometer for calibration, or the error obtained by the calibration device can be used to compensate for the error during subsequent inertial navigation system calibration.
[0042] If you want to know, the phase difference time can also be calculated by observing the phase difference, such as Figure 3 As shown, performing XOR on square waves with phase differences produces a waveform with a phase difference between the two square waves, based on the result of identical values being 0 and different values being 1. t1 and t2 can be derived by counting the rising or falling edge times. That is, when the rising edge of the pulse arrives, the counter is turned on; when the following falling edge arrives, the counter value is read. The ratio of t1 to t2 is the phase difference of the square waves.
[0043] The present invention simulates the operation of an odometer solely through the use of an FPGA component, generating a corresponding square wave signal as the odometer input. By comparing the count values of the odometer and the two pulse signals output by the FPGA component simulating the odometer, odometer accuracy can be verified without the need for additional peripheral function generators and frequency modulation circuits. Compared to existing measurement devices, the present invention utilizes an FPGA design, requiring only the FPGA to generate the frequency generator and phase detector. This eliminates external hardware circuitry, reduces costs, and offers a compact size, simplified peripheral circuitry, and faster program verification.
[0044] Although the embodiments of the present invention have been shown and described, it is apparent to those skilled in the art that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and basis of the present invention. The scope of the present invention is defined by the appended claims and their equivalents. Therefore, the embodiments of the present invention are merely illustrative examples of the present invention. No matter from which point of view, the embodiments of the present invention do not constitute a limitation on the present invention.
Claims
1. A wheel odometer calibration method based on FPGA, characterized in that: A verification system is used, which includes a host computer, an FPGA component and an odometer to be verified, wherein the FPGA component includes a serial port module, a square wave generator module, a square wave phase detection module and a counting module; the input end of the odometer is connected to the square wave generator module, and the output end thereof is connected to the counting module; wherein, The serial port module is connected to the host computer and is used for communicating with the host computer; The square wave generator module is connected to the serial port module and is used to generate and output two original square waves of corresponding frequency and phase according to the control signal sent by the host computer through the serial port module; The square wave phase detection module is connected to the square wave generator module, and is used to receive two original square wave signals, determine the phase lead relationship between the two original square waves, and then output the square wave signal with the phase lead; The counting module is connected to the square wave phase detection module and the odometer to be verified, and is used to count the leading phase square wave signals output by the square wave phase detection module and the odometer to be verified respectively, and upload the count values to the host computer through the serial port module; The host computer is used to send a control signal for generating the original square wave, and to display the count values of the original square wave, the square wave signal with an advanced phase output by the square wave phase detection module, and the square wave signal with an advanced phase output by the odometer; Specifically, the following steps are included: 1) Sending preset control signals to the FPGA component through the host computer; 2) After receiving the control signal, the square wave generator module of the FPGA component generates two original square waves of corresponding frequency and phase, and outputs the original square waves to the odometer and square wave phase detection module to be verified. The square wave generator module receives the control signal from the host computer through the serial port, uses the internal IP core to generate RAM memory for storing the verified control signal data packet, and after decoding and reading the data packet in the RAM, generates two original square waves of corresponding frequency and phase based on the frequency and phase advance data, and outputs them to the odometer and square wave phase detection module. 3) The odometer and square wave phase detection modules respectively process the original square waves to generate phase-advanced square wave signals, which are output to the counting module. The square wave phase detection module generates the phase-advanced square wave signal after processing the original square waves, including setting two original square waves as a and b, first starting counting with the rising edge of a as the reference, and ending counting when the rising edge of b arrives, with the time recorded as T3; then starting counting with the rising edge of b as the reference, and ending counting when the rising edge of a arrives, with the time recorded as T4; comparing T3 and T4. If T3 is greater than T4, the phase of a leads b, and a is output as the phase-advanced square wave signal; otherwise, the phase of b leads a, and b is output as the phase-advanced square wave signal; 4) The counting module counts the phase-advanced square wave signals sent by the odometer and the square wave phase detection module respectively, and uploads the count values of the phase-advanced square wave signals output by the square wave phase detection module and the phase-advanced square wave signals output by the odometer to the host computer; 5) After receiving the count value uploaded by the counting module, the host computer displays the count value and the count value of the original square wave; 6) Observe whether the count values displayed on the host computer are consistent. If the count values are consistent, the odometer is working properly. If the count value of the advanced phase square wave signal output by the odometer is inconsistent with the count value of the original square wave signal, the odometer is not working properly.