Frequency multiplication type gear rotating speed detection method and system
By combining a magnetic sensing module and a microcontroller module, the continuous conversion of gear displacement changes into electrical signals and pulse frequency multiplication are achieved, solving the problem that the detection accuracy of Hall effect sensors is limited by the number of gear teeth, and providing a high-precision, low-cost speed detection solution.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WENZHOU YUBO ELECTRIC CO LTD
- Filing Date
- 2026-03-02
- Publication Date
- 2026-04-28
Smart Images

Figure CN121933755A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of gear speed detection technology, specifically relating to a frequency-doubling gear speed detection method and system. Background Technology
[0002] Gear speed sensors are widely used in speed detection and motion control systems in industrial automation, automotive electronics, aerospace, and other fields. Their basic working principle is to detect the changes in the tooth peaks and valleys of a rotating gear using a magnetic field-sensitive element. When the gear rotates, the periodic approach and departure of the teeth causes changes in the magnetic field inside the sensor, which in turn outputs an electrical signal proportional to the speed of the gear being measured. In existing technologies, most mainstream gear speed sensors use Hall effect elements as the sensing unit. A typical example is a shaft-end Hall speed sensor disclosed in Chinese patent application CN202110591522.3, which places the Hall element on the outer circumference of the gear and uses the Hall element to sense changes in the magnetic field during gear rotation, outputting a square wave signal corresponding to the number of gear teeth. In this type of sensor, each tooth peak corresponds to one pulse signal, and external devices can obtain the gear speed information by counting the pulse signals. Hall-effect gear speed sensors have advantages such as simple structure, low manufacturing cost, and non-contact measurement, and are widely used in conventional speed measurement applications.
[0003] However, the aforementioned Hall effect-based gear speed sensors have inherent technical limitations in practical applications. Since each gear tooth peak corresponds to only one output pulse signal, the sensor's measurement accuracy is directly limited by the physical number of teeth on the gear itself; that is, the number of pulses output by the sensor for each gear rotation equals the number of teeth. In applications with limited installation space, the overall size of the gear cannot be increased indefinitely, and the increase in the number of teeth is strictly limited by the mechanical structure. To improve measurement accuracy, the traditional approach is to increase the number of teeth by reducing the tooth pitch. This not only increases the difficulty and cost of gear processing but may also lead to a decrease in the gear's mechanical strength, affecting its long-term operational reliability. On the other hand, although photoelectric encoders or magnetic encoders can be used to replace Hall effect gear speed sensors to improve detection accuracy, the procurement cost of such equipment is significantly increased, and the detection element is highly sensitive to environmental factors such as oil and moisture in the field. The installation method is often a shaft-mounted structure, which cannot directly replace existing gear speed sensors and requires targeted modifications to the original mechanical installation structure, thus limiting its applicability in practical applications. Therefore, it is urgent to improve existing gear speed sensors to solve the technical problem that the number of pulses output per revolution of the sensor cannot be effectively increased without changing the physical structure of the gear or increasing the number of gear teeth, thus making it difficult to meet the requirements of high-precision speed measurement. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide a frequency-doubled gear speed detection method and system to solve the problems that the detection accuracy of existing Hall gear speed sensors is limited by the number of gear teeth, and that high-precision detection equipment has poor adaptability and high cost.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a frequency-doubling gear speed detection method. This method is applied to a gear speed sensor, which is configured with a magnetic detection module, a signal conditioning module, and a microcontroller module. The magnetic detection module includes two magnetically sensitive resistors parallel to each other and encapsulated on the same plane. The two magnetically sensitive resistors are connected in series to form a voltage divider circuit. The method includes: S100: The magnetic sensing module is used to detect the displacement change of the gear under test, so that the voltage dividing node potential of the voltage dividing circuit generates a continuously changing analog voltage signal with the tooth peak displacement of the gear under test. S200: The analog voltage signal is transmitted to the signal conditioning module, and the analog voltage signal is amplified and biased by the signal conditioning module to obtain a stable sampling voltage signal within a preset range and then transmitted to the microcontroller module. S300: The microcontroller module is used to continuously perform analog-to-digital conversion sampling on the sampled voltage signal to obtain the digital voltage sequence of the sampled voltage signal within the single-tooth peak detection cycle of the gear under test; S400: The microcontroller module compares the amplitude range of the digital voltage sequence according to the preset voltage division rules. When the voltage value is detected to cross the preset voltage division threshold, a pulse signal is generated, thereby realizing the output of multiple pulse signals within the single-tooth peak detection cycle. S500: The microcontroller module outputs a frequency-doubled pulse signal to complete the frequency-doubled detection of the rotational speed of the gear under test.
[0006] Preferably, step S100 includes: when the tooth crest of the gear under test passes through the detection area of the magnetic sensing module, the resistance value of the magnetic sensing resistor near the tooth crest changes continuously with the displacement of the gear under test, so that the voltage divider node outputs a sinusoidal positive half-cycle analog voltage signal that rises linearly from the reference voltage to the rated voltage, as the analog voltage signal.
[0007] Further, step S200 includes: the signal conditioning module amplifies and filters the analog voltage signal to eliminate noise interference in the analog voltage signal, outputs the sampled voltage signal with stable amplitude and continuous waveform, and transmits the sampled voltage signal to the analog-to-digital conversion sampling port of the microcontroller module.
[0008] Preferably, step S300 includes: the microcontroller performing continuous analog-to-digital conversion on the sampled voltage signal at a preset sampling frequency, converting the analog sampled voltage signal into digital voltage data, and integrating the voltage data according to a time sequence to obtain the digital voltage sequence of the gear under test within a single tooth peak detection cycle.
[0009] Furthermore, the preset sampling frequency is adapted to the rotational speed of the gear under test. The microcontroller module adjusts the preset sampling frequency according to the rotational speed of the gear under test. The higher the rotational speed, the higher the preset sampling frequency.
[0010] Preferably, the preset voltage division rule in step S400 is an equal-spacing amplitude division rule. The microcontroller module has multiple equal-spacing voltage division thresholds pre-stored. The microcontroller module compares the digital voltage sequence with the voltage division thresholds in real time and divides the voltage change range within the single-tooth peak detection cycle of the gear under test into multiple equal-spacing voltage division intervals.
[0011] Furthermore, in step S400, outputting multiple pulse signals within a single tooth peak detection cycle includes: the microcontroller module generates a pulse signal each time it detects that the voltage value of the digital voltage sequence enters a new voltage division interval, until all voltage division intervals within the single tooth peak detection cycle of the gear under test are detected, thereby generating multiple pulse signals within the single tooth peak detection cycle.
[0012] Preferably, step S500 includes: the microcontroller module integrates the multiple pulse signals obtained after frequency multiplication into a standard square wave pulse sequence in chronological order, and outputs the standard square wave pulse sequence to the outside through the signal output port of the microcontroller module, so that external devices can collect and calculate the rotational speed of the gear under test.
[0013] Furthermore, the method also includes a parameter adjustment step: the microcontroller receives an externally input parameter adjustment command, modifies the preset voltage division rule according to the parameter adjustment command, adjusts the number of voltage division intervals within the single-tooth peak detection cycle, thereby changing the number of pulses output within the single-tooth peak detection cycle.
[0014] Secondly, the present invention also provides a frequency-doubled gear speed detection system, which is used to implement the above-mentioned frequency-doubled gear speed detection method, the system comprising: The magnetic sensing module includes two magnetically sensitive resistors that are packaged in parallel on the same plane. The two magnetically sensitive resistors are connected in series to form a voltage divider circuit. The voltage divider circuit has a voltage divider node, which is used to output an analog voltage signal that changes continuously with the displacement of the gear being measured. The signal conditioning module has its input terminal electrically connected to the output terminal of the magnetic sensing module, and is used to amplify, bias, filter and condition the analog voltage signal and output a stable sampled voltage signal. The microcontroller module has an analog-to-digital conversion sampling port and a signal output port. The analog-to-digital conversion sampling port is electrically connected to the output terminal of the signal conditioning module. The microcontroller module has a built-in analog-to-digital conversion unit and a pulse generation unit. The analog-to-digital conversion unit is used to perform analog-to-digital conversion sampling on the sampled voltage signal and convert the analog voltage into a digital voltage sequence. The pulse generation unit is used to convert the digital voltage sequence into a frequency-multiplied pulse signal according to the preset voltage division rule. The output module has its input terminal electrically connected to the signal output port of the microcontroller module, and is used to output a frequency-doubled standard square wave pulse sequence. The power supply module is electrically connected to the magnetic sensing module, the signal conditioning module and the microcontroller module respectively, and is used to provide working power to each module.
[0015] The frequency-doubling gear speed detection method and system disclosed in this invention are based on the core principle of converting gear displacement changes into continuous analog voltage signals through the voltage divider circuit of the magnetic sensing module. After signal conditioning and analog-to-digital conversion, the pulse frequency is multiplied within a single tooth peak detection cycle by comparing the voltage range of the microcontroller module. An integrated detection system adapted to this method is also designed. Compared with existing technologies, this invention has significant advantages: it does not require changing the physical structure of the gear being tested, nor does it require increasing the number of teeth. By processing and calculating the electrical signal, it multiplies the number of pulses, fundamentally overcoming the limitation of Hall effect sensor detection accuracy by the gear's mechanical structure. The overall structure of the detection system is compatible with existing Hall effect gear speed sensors, allowing direct replacement of existing equipment without modification to the mechanical installation structure, significantly reducing the cost of upgrading to high-precision speed detection. Meanwhile, this invention uses a magnetically sensitive resistor as the detection element, which has stronger resistance to environmental interference such as oil and water vapor, making it suitable for complex industrial environments. Furthermore, the microcontroller module supports external parameter adjustment, allowing for flexible adjustment of the voltage division rules and frequency multiplication factor according to actual detection accuracy requirements, adapting to the speed detection needs of gears of different specifications. In addition, the detection system of this invention consists of a conventional magnetically sensitive element, a signal conditioning chip, and a microcontroller, with manufacturing costs far lower than photoelectric encoders and magnetic encoders. It achieves cost control while ensuring detection accuracy, combining practicality and economy, and can be widely applied in various gear speed detection scenarios such as industrial automation, automotive electronics, and aerospace. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a schematic diagram of the overall process of the frequency doubling gear speed detection method of the present invention; Figure 2 This is a schematic diagram of the module connection of the frequency doubling gear speed detection system of the present invention; Figure 3 This is a schematic diagram of the overall circuit principle of the frequency doubling gear speed detection system of the present invention; Figure 4 This is a schematic diagram showing the installation position and sensing relationship between the magnetic sensing module and the gear under test in this invention; Figure 5 This is a waveform diagram of the analog voltage signal output by the magnetic sensing module of the present invention as the gear displacement changes.
[0018] The following are the markings in the attached diagram: 1. Magnetic Sensing Module; 11. Magnetic Sensitive Resistor; 12. Voltage Divider Circuit; 13. Voltage Divider Node; 2. Signal Conditioning Module; 3. Microcontroller Module; 31. Analog-to-Digital Conversion Sampling Port; 32. Signal Output Port; 33. Analog-to-Digital Conversion Unit; 34. Pulse Generation Unit; 4. Output Module; 5. Power Supply Module. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0020] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting this invention.
[0021] Existing Hall effect gear speed sensors can only output a single pulse during a single tooth peak period, and their detection accuracy is limited by the number of gear teeth. High-precision encoders, on the other hand, suffer from high cost and poor adaptability, failing to meet the high-precision speed detection requirements in space-constrained environments. Therefore, to address these issues, this application provides a frequency-doubling gear speed detection method, such as... Figure 1 As shown: This method is applied to a gear speed sensor, which is equipped with a magnetic detection module, a signal conditioning module, and a microcontroller module. The magnetic detection module includes two parallel magnetic resistors packaged on the same plane. The two magnetic resistors are connected in series to form a voltage divider circuit. The method includes: S100: The magnetic sensing module detects the displacement change of the gear under test, so that the voltage dividing node potential of the voltage dividing circuit generates a continuously changing analog voltage signal with the tooth peak displacement of the gear under test. S200: Transmits the analog voltage signal to the signal conditioning module, which amplifies and biases the analog voltage signal to obtain a stable sampling voltage signal within the preset range and transmits it to the microcontroller module. S300: The microcontroller module performs continuous analog-to-digital conversion sampling of the sampled voltage signal to obtain the digital voltage sequence of the sampled voltage signal within the single-tooth peak detection cycle of the gear under test. S400: The microcontroller module compares the amplitude range of the digital voltage sequence according to the preset voltage division rules. When the detected voltage value crosses the preset voltage division threshold, a pulse signal is generated, so as to output multiple pulse signals within the single-tooth peak detection cycle. S500: The microcontroller module outputs a frequency-doubled pulse signal to complete the frequency-doubled detection of the gear speed under test.
[0022] The magnetic sensing module is the core of the entire detection method for signal acquisition. Its two internal magnetic susceptors are packaged in a planar parallel manner to ensure that they can synchronously sense the magnetic field changes caused by the gear rotation. Figure 4As shown, the magnetic sensing module is fitted onto the outer circumference of the gear being tested, accurately sensing the displacement changes of the tooth peaks. The series-connected voltage divider circuit converts the resistance change of the magnetically sensitive resistor into the potential change of the voltage divider node, realizing the conversion of magnetic signals into electrical signals. The signal conditioning module optimizes the analog voltage signal by amplifying and adjusting it to the preset range of the analog-to-digital converter in the microcontroller module, and by biasing and conditioning to ensure the linearity of the voltage signal and avoid signal distortion. The microcontroller module is the core of the entire method; its built-in analog-to-digital converter unit converts the analog sampled voltage signal into digital voltage data, ordered in time sequence. The integrated digital voltage sequence fully reflects the voltage change pattern within the single tooth peak detection cycle. The pulse generation unit generates and multiplies the pulses based on preset rules. Specifically, when the gear under test starts rotating, the magnetic detection module first senses the displacement change of the tooth peak and generates an analog voltage signal. After optimization by the signal conditioning module, the signal is transmitted to the microcontroller module. The microcontroller module performs analog-to-digital conversion and compares the digital voltage sequence in real time. A pulse is generated each time a voltage value crosses a preset threshold. Finally, multiple pulses are integrated into a standard square wave pulse sequence for output. External devices can calculate the gear speed by counting the multiplied pulses. The core logic of the entire method is to convert the mechanical displacement change of the gear into a continuous electrical signal change, and then multiply the number of pulses by dividing the electrical signal into intervals, thus overcoming the limitations of mechanical structure on detection accuracy.
[0023] This technical solution acquires continuous electrical signals through a magnetic sensing module, replacing the single-pulse output mode of Hall elements. Pulse frequency multiplication is achieved through voltage range comparison by a microcontroller module. This effectively increases the number of pulses per revolution of the sensor without requiring any modifications to the physical structure of the gear being measured or increasing the number of teeth, thus solving the core problem of the limited detection accuracy of existing Hall sensors due to the number of gear teeth. Furthermore, the entire method is based on conventional magnetic sensing elements, signal conditioning chips, and microcontrollers. The electrical connection structure of each module in the detection system is compatible with existing Hall gear speed sensors, allowing direct replacement of existing equipment without altering the mechanical installation structure. This significantly improves the practical application adaptability of the technical solution. Moreover, the magnetic sensing resistor used in the detection process has strong resistance to environmental interference, making it suitable for complex industrial application scenarios.
[0024] The present invention further proposes that step S100 includes: when the tooth peak of the gear under test passes through the detection area of the magnetic sensing module, the resistance value of the magnetic sensing resistor near the tooth peak changes continuously with the displacement of the gear under test, so that the voltage divider node outputs a sinusoidal positive half-cycle analog voltage signal that rises linearly from the reference voltage to the rated voltage, as the analog voltage signal.
[0025] Among them, the magnetoresistive resistor exhibits the magnetoresistive effect, and its resistance continuously changes with the intensity of the external magnetic field. As the gear tooth crest gradually approaches the detection area of the magnetoresistive detection module, the magnetic field intensity near the magnetoresistive resistor near the tooth crest gradually increases, resulting in a continuous linear increase in resistance. Since the two magnetoresistive resistors are connected in series to form a voltage divider circuit, the linear change in the resistance of one resistor directly leads to a linear change in the potential of the voltage divider node, ultimately outputting a sinusoidal positive half-cycle analog voltage signal from the reference voltage to the rated voltage, such as... Figure 5 As shown, the curves clearly demonstrate the continuous variation of phase A and phase B signals with gear displacement. This signal can accurately and continuously reflect the displacement variation of the tooth peak, providing a stable and effective signal basis for subsequent pulse frequency multiplication.
[0026] In one specific implementation, the two magnetoresistive elements of the magnetic sensing module are identical and are packaged in parallel on the same printed circuit board plane. The spacing between them is adapted to the tooth width of the gear, such as... Figure 4 As shown, the detection end of the magnetic sensing module is directly aligned with the tooth crest's movement trajectory. When the tooth crest passes through the detection area, the magnetic field strength of the magnetic susceptor near the tooth crest increases linearly from its initial value, and the resistance increases linearly in sync. The potential of the voltage divider node increases linearly from the reference voltage of 2.5V to the rated voltage of 5V, forming a standard sinusoidal positive half-cycle analog voltage signal. This signal is distortion-free and uninterrupted, and can completely reflect the displacement change of the tooth crest. As an alternative embodiment, those skilled in the art can also select magnetic susceptors of different specifications according to actual detection needs, and adjust the reference voltage and rated voltage range of the voltage divider circuit to adapt the analog voltage signal output by the voltage divider node to the gears under test with different rotational speeds and tooth widths. At the same time, the magnetic field induction effect can be optimized by adjusting the installation distance between the magnetic sensing module and the gear, ensuring the linearity and stability of the analog voltage signal.
[0027] The present invention further proposes that step S200 includes: the signal conditioning module amplifies and filters the analog voltage signal to eliminate noise interference in the analog voltage signal, outputs the sampled voltage signal with stable amplitude and continuous waveform, and transmits the sampled voltage signal to the analog-to-digital conversion sampling port of the microcontroller module.
[0028] The signal conditioning module mainly consists of operational amplifiers, filter capacitors, and voltage divider resistors, such as... Figure 3As shown, the operational amplifier amplifies the analog voltage signal, adjusting its amplitude to within the effective sampling range of the microcontroller module's analog-to-digital converter. The filter capacitor and voltage divider resistors form an RC filter circuit to filter and eliminate high-frequency noise and environmental interference in the analog voltage signal, ensuring a stable amplitude and continuous, glitch-free waveform for the output sampled voltage signal. The output of the signal conditioning module is directly electrically connected to the analog-to-digital converter's sampling port, using analog signal transmission to ensure real-time signal transmission and avoid distortion during signal conversion.
[0029] As a specific implementation method, the signal conditioning module uses a general-purpose operational amplifier to build the amplification circuit, such as... Figure 3 As shown, an LM358 operational amplifier is used as the signal conditioning core to proportionally amplify the 2.5V-5V analog voltage signal output from the magnetic sensing module. Simultaneously, a second-order RC low-pass filter circuit filters the amplified signal, with the filter cutoff frequency set according to the gear's maximum speed. This effectively filters electromagnetic interference and high-frequency noise in the industrial environment. The processed sampling voltage signal is input through the dedicated analog-to-digital converter sampling port of the microcontroller module. This port has high input impedance, preventing signal attenuation during transmission. Alternatively, those skilled in the art can use an integrated signal conditioning chip instead of the discrete component-based conditioning circuit. Integrated chips combine amplification, filtering, and biasing functions, further reducing circuit size and improving signal conditioning stability and consistency. Furthermore, depending on the application scenario, an overvoltage protection circuit can be added to prevent damage to the microcontroller module from instantaneous high-voltage signals, improving the overall reliability of the detection method.
[0030] The present invention further proposes that step S300 includes: the microcontroller module performs continuous analog-to-digital conversion on the sampled voltage signal at a preset sampling frequency, converts the analog sampled voltage signal into digital voltage data, and integrates the voltage data according to the time sequence to obtain the digital voltage sequence of the gear under test within the single tooth peak detection cycle.
[0031] The microcontroller module's analog-to-digital conversion unit is a built-in ADC module, featuring multi-channel operation and high sampling accuracy. Figure 3As shown, the microcontroller module uses an STM32F042K6T6 chip. Its built-in ADC module pins are electrically connected to the output of the signal conditioning module, enabling continuous analog-to-digital conversion of the sampled voltage signal at a preset sampling frequency. This converts the analog voltage signal into digital voltage data. Each sampling point's voltage data is timestamped. The microcontroller module integrates and sorts the voltage data from all sampling points in chronological order, forming a digital voltage sequence. This sequence accurately reflects the continuous variation of the sampled voltage signal within the single-peak detection period, providing a digital signal basis for subsequent voltage range comparison and pulse generation. The sampling accuracy of the analog-to-digital conversion is set according to the detection accuracy requirements, ensuring that the voltage data resolution meets the comparison requirements of the voltage division threshold.
[0032] In one specific implementation, the microcontroller module uses a 32-bit microcontroller. Its built-in 12-bit ADC conversion module continuously samples the voltage signal at a fixed preset sampling frequency. The sampling frequency is set according to the conventional rotational speed of the gear. The number of sampling points within a single tooth peak detection cycle is no less than 100. The analog voltage value of each sampling point is converted into a digital value of 0-4095. Then, the digital value is restored to the actual voltage value through software. All voltage values are stored in the microcontroller's storage unit in the order of sampling time, forming a complete digital voltage sequence. The stored voltage data can be retrieved in real time for subsequent amplitude range comparison. As an alternative embodiment, those skilled in the art can also use an external high-precision ADC chip to replace the built-in ADC conversion module of the microcontroller module. The external ADC chip has higher sampling accuracy and sampling frequency, which can further improve the resolution of the voltage data and is suitable for ultra-high precision rotational speed detection requirements. At the same time, the sampled voltage data can be directly transferred to the storage unit of the microcontroller module through DMA transfer, reducing the computational load of the microcontroller module and improving the response speed of the entire detection method.
[0033] The present invention further proposes that the preset sampling frequency is adapted to the rotational speed of the gear under test, and the microcontroller module adjusts the preset sampling frequency according to the rotational speed of the gear under test. The higher the rotational speed, the higher the preset sampling frequency.
[0034] The microcontroller module incorporates a speed recognition program. By analyzing the previously sampled digital voltage sequence, it identifies the real-time speed of the gear under test. Based on changes in speed, it automatically adjusts the preset sampling frequency of the analog-to-digital converter. Higher gear speeds result in shorter time for the tooth peak to pass through the detection area, leading to a higher preset sampling frequency. This ensures the number of sampling points within a single tooth peak detection cycle remains stable, preventing insufficient sampling points due to excessively high speeds (failing to fully reflect voltage changes) and excessive sampling points due to excessively low speeds (increasing the computational load on the microcontroller module). The sampling frequency is adjusted in a stepped manner, with multiple preset sampling frequency levels corresponding to different speed ranges.
[0035] As a specific implementation method, the microcontroller module pre-sets five speed ranges, each corresponding to a sampling frequency level. When the speed of the gear under test is detected to be in the low-speed range, the lowest sampling frequency level is used, with approximately 200 sampling points within a single tooth peak detection cycle. When the speed is detected to rise to the high-speed range, it automatically switches to the highest sampling frequency level, maintaining more than 100 sampling points within a single tooth peak detection cycle. The automatic switching between speed recognition and sampling frequency adjustment is achieved through software, requiring no manual intervention. The adjustment response time is less than 10ms, making it adaptable to sudden changes in gear speed.
[0036] The present invention further proposes that the preset voltage division rule in step S400 is an equal-spacing amplitude division rule, and the microcontroller module pre-stores multiple equal-spacing voltage division thresholds. The microcontroller module compares the digital voltage sequence with the voltage division thresholds in real time and divides the voltage change range within the single tooth peak detection cycle of the gear under test into multiple equal-spacing voltage division intervals.
[0037] The equidistant amplitude division rule refers to equally dividing the voltage variation range within the single-tooth peak detection period according to fixed voltage intervals. Each interval after division is a voltage division interval, and the critical value between two adjacent intervals is the voltage division threshold. This threshold is pre-stored in the microcontroller module's program and can be modified via external commands. The microcontroller module performs real-time point-by-point comparisons on the digital voltage sequence, comparing the voltage value of each sampling point with all voltage division thresholds to determine the voltage division interval to which the voltage value belongs. This completes the interval division of the entire digital voltage sequence. The division result clearly reflects the amplitude variation process of the voltage signal within the single-tooth peak detection period, providing a clear basis for pulse generation.
[0038] In one specific implementation, the voltage variation range within the single-tooth peak detection cycle is 2.5V-5V, with a preset voltage interval of 0.25V. This range is divided into 10 equally spaced voltage intervals, with corresponding voltage thresholds of 2.75V, 3.0V, 3.25V, 3.5V, 3.75V, 4.0V, 4.25V, 4.5V, and 4.75V. These thresholds are all pre-stored in the program storage area of the microcontroller module. The microcontroller module compares the voltage value of each sampling point in the digital voltage sequence with these thresholds in real time to determine the voltage interval to which each sampling point belongs, thus forming a complete interval division result. As an alternative embodiment, those skilled in the art can also adopt non-equidistant amplitude division rules according to actual detection accuracy requirements, setting smaller voltage intervals in intervals with faster voltage change rates and larger voltage intervals in intervals with slower voltage change rates, so that the density of pulse generation matches the voltage change rate, further improving detection accuracy. At the same time, the voltage division rules can be stored in the erasable and writable storage area of the microcontroller module, supporting remote modification by external devices via serial port, Bluetooth, etc., improving the convenience of the method.
[0039] This technical solution employs an equidistant amplitude division rule to divide the digital voltage sequence into intervals. This division method is simple and intuitive, requires minimal computation from the microcontroller module, and ensures real-time pulse generation, making it suitable for high-speed gear speed detection. Simultaneously, the equidistant division ensures a uniform number of pulses generated within a single tooth peak detection cycle, improving the accuracy of speed calculation. The voltage division threshold is pre-stored in the microcontroller module, allowing for easy modification. The number of intervals can be flexibly adjusted according to actual detection accuracy requirements, enabling frequency multiplication. Furthermore, the real-time point-by-point comparison method accurately captures voltage value changes across thresholds, avoiding missed or repeated pulse generation and further improving pulse generation accuracy.
[0040] The present invention further proposes that the step S400 of outputting multiple pulse signals within a single tooth peak detection cycle includes: the microcontroller module generates a pulse signal each time the voltage value of the digital voltage sequence enters a new voltage division interval, until the detection of all voltage division intervals within the single tooth peak detection cycle of the gear under test is completed, thereby generating multiple pulse signals within the single tooth peak detection cycle.
[0041] In the process of comparing digital voltage sequences across intervals, the microcontroller module tracks the voltage interval to which each voltage value belongs in real time. When it detects a voltage value crossing from the current interval to the next adjacent interval, it immediately generates a high-level pulse signal. The duration of this pulse signal is fixed to ensure ease of subsequent integration into a standard square wave pulse sequence. The microcontroller module continues to detect according to this rule until the peak leaves the detection area, completing the detection of all voltage intervals within a single peak detection cycle. The final number of pulses generated is equal to the number of voltage intervals, achieving pulse frequency multiplication within a single peak cycle, with the frequency multiplication factor consistent with the number of voltage intervals.
[0042] In one specific implementation, the voltage change range within the single-tooth peak detection cycle is divided into 10 equally spaced voltage intervals. The microcontroller generates the first pulse when the voltage value crosses from the 2.5V-2.75V interval to the 2.75V-3.0V interval, and the second pulse when it crosses to the 3.0V-3.25V interval, and so on, until the voltage value reaches 5V, completing the detection of all 10 intervals. Ultimately, 10 pulse signals are generated within the single-tooth peak detection cycle, achieving a 10-fold frequency multiplication compared to the single-pulse output of existing Hall effect sensors, effectively increasing the number of pulses per revolution. As an alternative embodiment, those skilled in the art can also set the pulse signal generation rule to generate a low-level pulse signal when the voltage value crosses a threshold, or adjust the duration of the pulse signal according to the actual external device requirements. Simultaneously, a pulse shaping circuit can be added after pulse generation to ensure that the amplitude and waveform of the pulse signal meet the acquisition requirements of the external device, avoiding recognition failure due to pulse signal distortion.
[0043] The present invention further proposes that step S500 includes: the microcontroller module integrates the multiple pulse signals obtained after frequency multiplication into a standard square wave pulse sequence in time order, and outputs the standard square wave pulse sequence to the outside through the signal output port of the microcontroller module for external devices to collect and calculate the rotational speed of the gear under test.
[0044] The microcontroller module arranges multiple pulse signals generated within a single tooth peak detection cycle according to their generation time sequence. Simultaneously, it shapes each pulse signal into a standard square wave pulse with a fixed high-level duration and a fixed low-level duration. These arranged standard square wave pulses form a continuous standard square wave pulse sequence, the frequency of which is proportional to the product of the gear speed and the frequency multiplication factor. For example... Figure 3As shown, the microcontroller module uses GPIO pins as signal output ports, and outputs the pulse sequence to the outside through a push-pull circuit composed of transistors. The signal output port is a push-pull output port, which can directly drive external pulse acquisition devices without the need for additional signal amplification circuits. The amplitude of the pulse sequence is a standard industrial level, which is compatible with conventional PLCs, frequency converters and other equipment.
[0045] In one specific implementation, the microcontroller module shapes each generated pulse signal into a standard square wave pulse with a high-level duration of 1ms and a low-level duration of 1ms. The 10 pulse signals are arranged into a continuous square wave pulse sequence according to the generation time sequence and output to the outside through the GPIO port of the microcontroller module. The output level is a standard 5V TTL level. The external PLC device collects the pulse sequence, counts the total number of pulses per unit time, and then divides it by the frequency multiplier to obtain the actual number of tooth peak pulses. Finally, it calculates the real-time rotational speed of the gear by combining it with the number of teeth of the gear.
[0046] This technical solution integrates multiple pulse signals into a standard square wave pulse sequence, improving compatibility with external devices. Conventional industrial control equipment can directly acquire this pulse sequence without the need for customized acquisition modules, reducing the overall application cost of the detection solution. Simultaneously, the time-sequential pulse sequence accurately reflects gear speed changes. External devices can calculate the gear speed simply by counting pulses; the calculation method is simple and intuitive, with high real-time performance. The standard square wave pulse signal has strong anti-interference capabilities and is less prone to distortion during transmission in industrial settings, improving the accuracy of speed detection. Furthermore, the microcontroller module's signal output port is push-pull, providing strong driving capability and allowing direct driving of external devices, simplifying hardware connections.
[0047] The present invention further proposes that the method also includes a parameter adjustment step: the microcontroller module receives an externally input parameter adjustment command, modifies the preset voltage division rule according to the parameter adjustment command, adjusts the number of voltage division intervals divided within the single-tooth peak detection cycle, thereby changing the number of pulses output within the single-tooth peak detection cycle.
[0048] The microcontroller module has a reserved interface for external parameter adjustment. It can receive external parameter adjustment commands via serial port, network port, buttons, etc. These commands include the required number of voltage division intervals or voltage division thresholds. Based on these commands, the microcontroller module modifies its internally stored voltage division rules, adjusting the number of voltage division intervals. Increasing the number of intervals increases the number of pulses output within a single-tooth peak detection cycle, improves the frequency multiplication factor, and enhances detection accuracy. Conversely, decreasing the number of intervals reduces the number of pulses, lowers the frequency multiplication factor, and reduces the computational load on the microcontroller module. After the parameter adjustment command is executed, the new voltage division rules take effect immediately without requiring a system restart, enabling real-time adjustment of detection accuracy.
[0049] In one specific implementation, the microcontroller module reserves an RS232 serial port as a parameter adjustment interface. An external computer sends parameter adjustment commands to the microcontroller module through serial port debugging software. When the command "number of intervals 20" is sent, the microcontroller module re-divides the voltage variation range of 2.5V-5V into 20 equally spaced voltage intervals, with the voltage interval becoming 0.125V. The number of pulse outputs within the single-tooth peak detection cycle becomes 20, and the frequency multiplication factor is increased to 20 times. When the command "number of intervals 5" is sent, the voltage interval becomes 0.5V, the number of pulse outputs becomes 5, the frequency multiplication factor decreases to 5 times, and the command execution response time is less than 5ms, realizing real-time adjustment of detection accuracy.
[0050] As an alternative embodiment, those skilled in the art can also set physical buttons on the detection system as parameter adjustment interfaces, and adjust the number of voltage division intervals through combination operations of the buttons. This is suitable for on-site adjustment scenarios without a computer. At the same time, an LCD display module can be added to display parameters such as the current frequency multiplication factor and sampling frequency in real time, which is convenient for on-site debugging and maintenance. In addition, the permission for parameter adjustment can be encrypted to prevent unauthorized personnel from making mistakes and improve the security of the method.
[0051] The present invention further proposes a frequency-doubling gear speed detection system, which is used to implement the above-mentioned frequency-doubling gear speed detection method, such as... Figure 2 As shown, the system includes: a magnetic sensing module comprising two parallel magnetic sensing resistors packaged in the same plane, the two magnetic sensing resistors being connected in series to form a voltage divider circuit, the voltage divider circuit having a voltage divider node, the voltage divider node being used to output an analog voltage signal that continuously varies with the displacement of the gear under test; a signal conditioning module, the input terminal of which is electrically connected to the output terminal of the magnetic sensing module, for amplifying, biasing, filtering, and conditioning the analog voltage signal and outputting a stable sampled voltage signal; and a microcontroller module having an analog-to-digital conversion sampling port and a signal output port, the analog-to-digital conversion sampling port being electrically connected to the output terminal of the signal conditioning module. The microcontroller module includes an analog-to-digital converter (ADC) and a pulse generation unit. The ADC is used to perform analog-to-digital conversion sampling on the sampled voltage signal and convert the analog voltage into a digital voltage sequence. The pulse generation unit is used to convert the digital voltage sequence into a frequency-multiplied pulse signal according to the preset voltage division rule. An output module, whose input terminal is electrically connected to the signal output port of the microcontroller module, is used to output a frequency-multiplied standard square wave pulse sequence. A power supply module is electrically connected to the magnetic sensing module, the signal conditioning module, and the microcontroller module, respectively, to provide operating power to each module.
[0052] The system comprises several modules: a magnetic sensing module (for signal acquisition), a microcontroller module (for signal optimization), and a power supply module. The magnetic sensing module consists of two parallel-encapsulated magnetic sensors connected in series to form a voltage divider circuit, converting the magnetic signal to an electrical signal. The signal conditioning module amplifies, biases, and filters the analog voltage signal to ensure signal quality. The microcontroller module is the core computing and control unit, with built-in analog-to-digital converters (ADCs) and pulse generation units performing ADC conversion and pulse frequency multiplication, respectively. Its ADC sampling port and signal output port provide electrical connections to other modules. The output module shapes and drives the frequency-multiplied pulse signal, ensuring the output standard square wave pulse sequence is compatible with external devices. The power supply module converts external power into the required operating voltage for each module, ensuring stable operation. All modules use standardized circuit connections for easy assembly, debugging, and maintenance. The overall system size is comparable to existing Hall effect gear speed sensors, allowing for direct replacement of existing equipment.
[0053] As a specific implementation, the magnetic sensing module uses two identical magnetically sensitive resistors, parallelly packaged on a PCB board, and connected in series to form a voltage divider circuit; the signal conditioning module uses an LM358 operational amplifier to build amplification, biasing, and filtering circuits; the microcontroller module uses an STM32F042K6T6 microcontroller, whose built-in ADC conversion unit serves as the analog-to-digital conversion unit, and the pulse generation logic written in the software program serves as the pulse generation unit; such as Figure 3 As shown, the output module uses a push-pull amplifier circuit built with transistors to drive the pulse signal. The power supply module uses an LM78L05 voltage regulator chip to convert the external 12V power supply to a 5V operating voltage to power each module. Each module is electrically connected by soldering. The entire system is encapsulated in a metal shell and has good electromagnetic interference resistance.
[0054] This technical solution provides a complete detection system adapted to the frequency-doubled gear speed detection method. Each module has a clearly defined function and works collaboratively to achieve frequency-doubled gear speed detection. The system's hardware structure is compatible with existing Hall effect gear speed sensors, allowing direct replacement of existing equipment without modification to the mechanical installation structure, significantly improving the system's practical application adaptability. Furthermore, the system is composed of conventional industrial components, resulting in manufacturing costs far lower than photoelectric encoders and magnetic encoders. This ensures both detection accuracy and cost control. Each module adopts a standardized design, facilitating assembly, debugging, and maintenance, making it suitable for industrial production and applications. In addition, the system has strong resistance to environmental interference, making it suitable for various complex field scenarios such as industrial automation and automotive electronics. It also supports external parameter adjustment, allowing for flexible adjustment of detection accuracy according to actual needs, combining practicality and flexibility.
[0055] The overall working principle of the frequency-doubling gear speed detection method and system of the present invention is as follows: the power supply module provides a stable power supply to the magnetic sensing module, signal conditioning module, and microcontroller module. When the gear under test starts to rotate, as... Figure 4 As shown, the two magnetic susceptors in the magnetic sensing module sense the displacement change of the tooth peak. Due to the magnetoresistive effect, the resistance of the magnetic susceptor near the tooth peak changes linearly. The voltage divider node of the series voltage divider circuit outputs a sinusoidal positive half-cycle analog voltage signal from the reference voltage to the rated voltage. After this analog voltage signal is transmitted to the signal conditioning module, it is amplified, biased, and filtered to eliminate noise interference and form a stable sampling voltage signal, which is then transmitted to the analog-to-digital conversion sampling port of the microcontroller module. The microcontroller module performs continuous analog-to-digital conversion on the sampling voltage signal at a sampling frequency adapted to the gear speed, converting the analog signal into digital voltage data and integrating it into a digital voltage sequence according to the time sequence. The microcontroller module, according to the preset equidistant voltage division rule, compares the digital voltage sequence with the pre-stored voltage... Real-time comparison is performed by dividing the voltage range into multiple voltage intervals. When a voltage value is detected to cross the threshold and enter a new interval, a pulse signal is generated. Multiple pulse signals are generated within a single tooth peak detection cycle to achieve frequency doubling. The microcontroller integrates multiple pulse signals into a standard square wave pulse sequence in chronological order and transmits it to the output module through the signal output port. The output module drives the pulse sequence and outputs it externally. External devices acquire this pulse sequence, count the total number of pulses per unit time, and calculate the real-time rotational speed of the gear under test by combining the frequency doubling factor. At the same time, the microcontroller can receive external parameter adjustment commands to modify the voltage division rules and adjust the number of voltage intervals, realizing flexible adjustment of the frequency doubling factor to adapt to different detection accuracy requirements.
[0056] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A frequency-doubled gear speed detection method, characterized in that, The method is applied to a gear speed sensor, which is configured with a magnetic detection module, a signal conditioning module, and a microcontroller module. The magnetic detection module includes two magnetically sensitive resistors packaged in parallel on the same plane. The two magnetically sensitive resistors are connected in series to form a voltage divider circuit. The method includes: S100: The magnetic sensing module is used to detect the displacement change of the gear under test, so that the voltage dividing node potential of the voltage dividing circuit generates a continuously changing analog voltage signal with the tooth peak displacement of the gear under test. S200: The analog voltage signal is transmitted to the signal conditioning module, and the analog voltage signal is amplified and biased by the signal conditioning module to obtain a stable sampling voltage signal within a preset range and then transmitted to the microcontroller module. S300: The microcontroller module is used to continuously perform analog-to-digital conversion sampling on the sampled voltage signal to obtain the digital voltage sequence of the sampled voltage signal within the single-tooth peak detection cycle of the gear under test; S400: The microcontroller module compares the amplitude range of the digital voltage sequence according to the preset voltage division rules. When the voltage value is detected to cross the preset voltage division threshold, a pulse signal is generated, thereby realizing the output of multiple pulse signals within the single-tooth peak detection cycle. S500: The microcontroller module outputs a frequency-doubled pulse signal to complete the frequency-doubled detection of the rotational speed of the gear under test.
2. The frequency-doubling gear speed detection method according to claim 1, characterized in that, Step S100 includes: when the tooth crest of the gear under test passes through the detection area of the magnetic sensing module, the resistance value of the magnetic sensing resistor near the tooth crest changes continuously with the displacement of the gear under test, so that the voltage divider node outputs a sinusoidal positive half-cycle analog voltage signal that rises linearly from the reference voltage to the rated voltage, as the analog voltage signal.
3. The frequency-doubling gear speed detection method according to claim 1, characterized in that, Step S200 includes: the signal conditioning module amplifies and filters the analog voltage signal to eliminate noise interference in the analog voltage signal, outputs the sampled voltage signal with stable amplitude and continuous waveform, and transmits the sampled voltage signal to the analog-to-digital conversion sampling port of the microcontroller module.
4. The frequency-doubling gear speed detection method according to claim 1, characterized in that, Step S300 includes: the microcontroller module performs continuous analog-to-digital conversion on the sampled voltage signal at a preset sampling frequency, converting the analog sampled voltage signal into digital voltage data, and integrating the voltage data according to a time sequence to obtain the digital voltage sequence of the gear under test within a single tooth peak detection cycle.
5. The frequency-doubling gear speed detection method according to claim 4, characterized in that, The preset sampling frequency is adapted to the rotational speed of the gear under test. The microcontroller module adjusts the preset sampling frequency according to the rotational speed of the gear under test. The higher the rotational speed, the higher the preset sampling frequency.
6. The frequency-doubling gear speed detection method according to claim 1, characterized in that, The preset voltage division rule in step S400 is an equal-spacing amplitude division rule. The microcontroller module has multiple equal-spacing voltage division thresholds pre-stored. The microcontroller module compares the digital voltage sequence with the voltage division thresholds in real time and divides the voltage change range within the single-tooth peak detection cycle of the gear under test into multiple equal-spacing voltage division intervals.
7. The frequency-doubling gear speed detection method according to claim 6, characterized in that, The step S400 of outputting multiple pulse signals within a single tooth peak detection cycle includes: the microcontroller module generates a pulse signal each time the voltage value of the digital voltage sequence enters a new voltage division interval, until all voltage division intervals within the single tooth peak detection cycle of the gear under test are detected, thereby generating multiple pulse signals within the single tooth peak detection cycle.
8. The frequency-doubling gear speed detection method according to claim 1, characterized in that, Step S500 includes: the microcontroller module integrates the multiple pulse signals obtained after frequency multiplication into a standard square wave pulse sequence in chronological order, and outputs the standard square wave pulse sequence to the outside through the signal output port of the microcontroller module, so that external devices can collect and calculate the rotational speed of the gear under test.
9. The frequency-doubling gear speed detection method according to claim 1, characterized in that, The method further includes a parameter adjustment step: the microcontroller receives an externally input parameter adjustment command, modifies the preset voltage division rule according to the parameter adjustment command, adjusts the number of voltage division intervals within the single-tooth peak detection cycle, thereby changing the number of pulses output within the single-tooth peak detection cycle.
10. A frequency-doubling gear speed detection system, characterized in that, The system is used to implement the frequency-doubling gear speed detection method according to any one of claims 1 to 9, and the system comprises: The magnetic sensing module includes two magnetically sensitive resistors that are packaged in parallel on the same plane. The two magnetically sensitive resistors are connected in series to form a voltage divider circuit. The voltage divider circuit has a voltage divider node, which is used to output an analog voltage signal that changes continuously with the displacement of the gear being measured. The signal conditioning module has its input terminal electrically connected to the output terminal of the magnetic sensing module, and is used to amplify, bias, filter and condition the analog voltage signal and output a stable sampled voltage signal. The microcontroller module has an analog-to-digital conversion sampling port and a signal output port. The analog-to-digital conversion sampling port is electrically connected to the output terminal of the signal conditioning module. The microcontroller module has a built-in analog-to-digital conversion unit and a pulse generation unit. The analog-to-digital conversion unit is used to perform analog-to-digital conversion sampling on the sampled voltage signal and convert the analog voltage into a digital voltage sequence. The pulse generation unit is used to convert the digital voltage sequence into a frequency-multiplied pulse signal according to the preset voltage division rule. The output module has its input terminal electrically connected to the signal output port of the microcontroller module, and is used to output a frequency-doubled standard square wave pulse sequence. The power supply module is electrically connected to the magnetic sensing module, the signal conditioning module and the microcontroller module respectively, and is used to provide working power to each module.
Citation Information
Patent Citations
A frequency doubling method for shaft end Hall speed sensor
CN113325192B