An infrared transmission probe measurement system and method based on a single-chip microcomputer

By using a microcontroller-based infrared transmission probe system, the problems of communication reliability and synchronization accuracy of wireless probes in industrial fields have been solved. It achieves efficient and stable status identification and transmission, adapts to complex electromagnetic environments, extends battery life, and reduces system power consumption.

CN122238754APending Publication Date: 2026-06-19SHENZHEN BOSHI PRECISION MASCH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN BOSHI PRECISION MASCH CO LTD
Filing Date
2026-04-13
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing wireless probe systems are susceptible to frequency band congestion in industrial settings, resulting in insufficient communication reliability, transmission delays, limited synchronization accuracy, weak anti-interference capabilities, high power consumption, a lack of deep control mechanisms, and a tendency to cause signal pollution in complex electromagnetic environments, making it difficult to achieve high-precision and high-stability measurements.

Method used

An infrared transmission probe system based on a microcontroller is adopted, including a transmitting unit and a receiving unit. It utilizes an infrared wake-up module, a probe detection module, a carrier modulation module, and an envelope detection module. Through ASK modulation and self-calibration functions, it can accurately identify and transmit status data and has the ability to monitor link health and isolate faults.

Benefits of technology

It improves the system's anti-interference capability and communication stability, reduces transmission delay, enhances the synchronization and identification accuracy of measurement triggering, extends battery life, reduces wireless signal pollution, improves transmission distance and efficiency, and realizes the linkage output of status indication and alarm functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122238754A_ABST
    Figure CN122238754A_ABST
Patent Text Reader

Abstract

This invention discloses a microcontroller-based infrared transmission probe measurement system and method. The system includes a transmitting unit and a receiving unit; the transmitting unit detects the resistance change between the probe electrodes, generates status data, and transmits an infrared measurement signal after ASK carrier modulation; the receiving unit receives the infrared measurement signal, amplifies, detects, and shapes it to identify the trigger state, reset state, and low battery alarm state, and outputs the corresponding results. This solution features low power consumption, low latency, and strong anti-interference capability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of measurement and detection technology, specifically to a measurement system and method for an infrared transmission probe based on a microcontroller. Background Technology

[0002] In CNC machine tools, automated machining equipment, online inspection devices, and high-speed displacement detection scenarios, it is typically necessary to use probes or probe mechanisms to monitor the contact, position, or triggering states of workpieces, fixtures, tools, or measured components in real time, and transmit the detection results to the control system for position calibration, action interlocking, measurement compensation, or abnormal alarms. To reduce wiring complexity and accommodate installation requirements on rotating or moving parts, existing technologies often employ wireless probe systems to complete the status transmission between the transmitter and receiver.

[0003] However, in industrial environments, Wi-Fi, Bluetooth, and other wireless devices often operate simultaneously. Concurrent communication from multiple devices can easily lead to frequency congestion, signal contention, and packet loss, thus affecting the timely and accurate transmission of trigger status by the probe system. Especially in industrial scenarios involving high-speed dynamic measurement, high-precision trigger detection, and complex electromagnetic environments, traditional wireless transmission methods have significant limitations in terms of latency, synchronization accuracy, anti-interference capability, and stability.

[0004] Inadequacy of existing technology : 1. Existing wireless probe systems are susceptible to congestion in industrial wireless frequency bands, resulting in insufficient communication reliability; 2. Existing wireless transmission methods have inherent latency, which is not conducive to ultra-high-speed dynamic measurement; 3. Existing wireless probes have limited synchronization accuracy, making it difficult to balance high precision and high stability; 4. When multiple devices are online simultaneously, it can easily cause spatial wireless signal pollution and affect the communication of surrounding devices; 5. Existing probe systems still lack sufficient anti-interference capabilities in complex electromagnetic environments; 6. The existing system has high standby power consumption, which is not conducive to extending battery life and long-term standby use; 7. Existing infrared or wireless probe systems typically only focus on basic transceiver functions and lack deep control mechanisms for drift, false acquisition, and abnormal links; 8. Existing status recognition methods are mostly simple pulse width recognition or ordinary code recognition, lacking the ability to acquire highly reliable synchronous signals and reject illegal signals; 9. Existing probe systems generally lack link health monitoring, fault isolation, and safety interlock output mechanisms; Therefore, existing technologies have shortcomings and need further improvement. Summary of the Invention

[0005] To address the problems existing in the prior art, this invention provides an infrared transmission probe measurement system and method based on a microcontroller.

[0006] To achieve the above objectives, the specific solution of the present invention is as follows: This invention provides an infrared transmission probe measurement system based on a microcontroller, comprising a transmitting unit and a receiving unit; The transmitting unit includes a transmitting system unit, a transmitting power supply module, a probe detection module, an infrared wake-up module, a carrier modulation module, an infrared driving module, and a first status indication module; The receiving unit includes a receiving system unit, a receiving power supply module, an input / output module, an infrared trigger module, an infrared receiving module, an envelope detection module, and a second status indication module. The infrared trigger module is used to send an infrared wake-up signal when the receiving system unit detects an external wake-up condition, and to send an infrared power-off signal when the receiving system unit detects a power-off condition. The infrared wake-up module is used to receive the infrared wake-up signal or the infrared power-off signal, and convert the received infrared signal into a square wave control signal input to the transmitting system unit. The transmitting system unit controls the transmitting unit to exit the sleep mode or enter the sleep mode according to the pulse width of the square wave control signal. The probe detection module is used to detect the resistance change between the probe electrodes and output the corresponding level status signal to the transmission system unit. The carrier modulation module is used to receive the carrier signal and status data output by the transmitting system unit, and output the modulated signal to the infrared driving module after carrier modulation of the status data. The infrared driving module is used to transmit infrared measurement signals according to the modulation signal; The infrared receiving module is used to receive the infrared measurement signal and output the received electrical signal to the envelope detection module; The envelope detection module is used to amplify, detect and shape the received electrical signal, and output a square wave signal with pulse width representing different state data to the receiving system unit. The receiving system unit is used to identify the trigger state, reset state, and low battery alarm state based on the square wave signal, and control the input / output module to output the corresponding state result signal; the state result signal includes a trigger valid signal, a reset invalid signal, and a low battery alarm signal.

[0007] Furthermore, the infrared wake-up module includes a silicon photoelectric receiver, a synchronization signal amplifier, a detector controller, a reference voltage regulator, and a voltage comparison output circuit; The silicon photoelectric receiver is used to generate an induced electrical signal when it receives the infrared wake-up signal or the infrared power-off signal. The synchronization signal amplifier is used to amplify the induced electrical signal. The detector controller is used to perform detection processing on the amplified signal. The voltage comparison output circuit is used to shape the detected signal into a square wave control signal based on the reference voltage provided by the reference voltage regulator.

[0008] Furthermore, the probe detection module includes a detection voltage input circuit, two probe electrodes connected to the probe mechanism under test, a voltage filtering hysteresis circuit, a voltage comparator, a reference voltage regulator, and a level output circuit; The detection voltage input circuit is used to apply a detection voltage to the two probe electrodes; When an external force causes a change in the distance between the two probe electrodes, the equivalent resistance between the two probe electrodes changes, which in turn causes a change in the detection voltage between the probe electrodes. The voltage filtering hysteresis circuit is used to filter and hysteresis the changed detection voltage. The voltage comparator is used to compare the processed detection voltage with the reference voltage output by the reference voltage regulator. The level output circuit is used to output the corresponding high-level or low-level status signal to the transmitting system unit. The output voltage of the reference voltage regulator is adjustable to adjust the probe detection sensitivity.

[0009] Furthermore, the carrier modulation module is an amplitude shift keying (ASK) modulation module. The transmitting system unit generates a 16MHz carrier signal and generates state data corresponding to the probe state. The ASK modulation module modulates the state data onto the carrier signal to form a high-frequency envelope modulation signal. The infrared driving module drives the infrared transmitter to transmit infrared measurement signals based on the high-frequency envelope modulation signal. The status data includes at least trigger data, reset data, and low battery alarm data; The receiving system unit distinguishes and identifies the trigger data, reset data, and low battery alarm data based on the pulse width of the square wave signal output by the envelope detection module.

[0010] Furthermore, the transmitting system unit is configured to: after the transmitting unit switches from sleep mode to working mode, send status information including a communication status identifier and / or the current battery voltage level; send trigger data when the level output of the probe detection module changes from low level to high level; send reset data when the level output of the probe detection module changes from high level to low level; and send low battery alarm data when the battery voltage of the transmitting power module is detected to be lower than a preset threshold. The receiving system unit is configured to: control the input / output module to output a valid status signal when the trigger data is received; control the input / output module to output an invalid status signal when the reset data is received; and control the input / output module to output a low battery alarm signal when the low battery alarm data is received.

[0011] Furthermore, the system also includes a self-calibration function unit, which is located in the transmitting unit and / or receiving unit and is used to realize temperature acquisition, calibration frame generation, parameter correction and calibration parameter storage. The transmitting unit is used to collect a first temperature value near the infrared driving module, and the receiving unit is used to collect a second temperature value near the envelope detection module, or select to collect either the first temperature value or the second temperature value according to the system configuration. The calibration frame generation unit is used to send a calibration frame before the status data in the first two communication cycles after the transmitting unit exits the sleep mode each time. The calibration frame includes at least a fixed-width preamble pulse segment, a fixed-duration carrier segment, and a dual calibration pulse segment with a preset interval. The receiving system unit is used to measure the pulse width deviation of the preamble pulse segment, the interval deviation of the dual calibration pulse segment, and the received peak amplitude corresponding to the calibration frame. Combined with the first temperature value and / or the second temperature value, it calls the corresponding correction parameters from the calibration parameter storage unit to correct the decision threshold of the envelope detection module, the center value of the pulse width identification window of the status data, and the trigger timestamp compensation value. The correction step value of the decision threshold is 2mV to 10mV, the correction step value of the center value of the pulse width recognition window is 0.5μs to 2μs, and the correction step value of the trigger timestamp compensation value is 1μs to 5μs.

[0012] Furthermore, before sending trigger data, reset data, or low battery alarm data, the carrier modulation module first sends a pseudo-random synchronization preamble. The pseudo-random synchronization preamble is formed by ASK modulation of the carrier signal using a pseudo-random sequence with a length of 31 bits or 63 bits pre-stored in the transmission system unit, and the symbol width of the pseudo-random sequence is 4μs to 16μs. The receiving system unit further includes a sliding correlation detection unit and a code phase stability determination unit; The sliding correlation detection unit is used to perform bit-by-bit sliding correlation operation on the shaped signal output by the envelope detection module and the locally pre-stored same sequence template. When the correlation peak value is greater than 4 to 8 times the average background noise value, it is determined that an effective pseudo-random synchronization preamble has been captured. The code phase stability determination unit is used to determine whether the position deviation of the correlation peak of the effective pseudo-random synchronization preamble of two adjacent frames is no greater than 2 code symbols. Only when this condition is met will the receiving system unit decode the subsequent status field. The status field includes at least a trigger status code, a reset status code, and a low battery alarm status code, and the status field also includes a verification field for verifying the consistency of the decoding result. The transmitting system unit is also configured to transmit health detection frames at a transmission period of 10ms to 50ms. The health detection frame includes at least the transmitter battery voltage level, the probe detection module comparison threshold level, the infrared drive module drive current level, and the transmitter fault flag. The receiving system unit is configured to count multiple consecutive health detection frames and set a link fault flag when any of the following occurs: three or more consecutive health detection frames are lost, the check field of the health detection frame is incorrect, the received peak amplitude is lower than a preset threshold for 50 ms for 5 consecutive ms, or the position deviation of the relevant peak of the pseudo-random synchronization preamble exceeds the allowable range. The input / output module is configured to not maintain the most recently valid trigger output state when the link fault flag is set, but to forcibly switch to the safe invalid state and output an independent link fault alarm signal at the same time. Furthermore, the receiving system unit will only switch the input / output module to the trigger valid state when the following conditions are met simultaneously: the trigger status code verification is passed, the most recent health detection frame is valid, and the count of illegal code patterns in the most recent 3 frames of received data is not greater than 1; if any condition is not met, the input / output module remains in the invalid state.

[0013] This invention also provides a measurement method for an infrared transmission probe based on a microcontroller, which, based on the above system, includes the following steps: S1. The receiving unit detects the external wake-up conditions and sends an infrared wake-up signal to the transmitting unit through the infrared trigger module; S2. The infrared wake-up module of the transmitting unit receives the infrared wake-up signal and converts it into a square wave control signal. The transmitting system unit controls the transmitting unit to exit the sleep mode according to the pulse width of the square wave control signal. S3. The probe detection module detects the resistance change between the two probe electrodes, and outputs the corresponding level status signal to the transmitting system unit after filtering, hysteresis and comparison. S4. The transmitting system unit generates corresponding status data according to the level status signal, and outputs the carrier signal and the status data to the carrier modulation module. The carrier modulation module performs ASK modulation on the status data and then transmits the infrared measurement signal through the infrared driving module. S5. The receiving unit receives the infrared measurement signal through the infrared receiving module, and outputs a square wave signal after amplification, detection and shaping by the envelope detection module. The receiving system unit identifies the corresponding state according to the signal pulse width and controls the input / output module to output the corresponding state result signal. The state result signal includes a trigger valid signal, a reset invalid signal and a low battery alarm signal.

[0014] Furthermore, in step S2, the square wave control signal includes at least a start square wave and a shutdown square wave, and the transmitting system unit distinguishes between the start command and the shutdown command by detecting the pulse width of the square wave control signal; When the command is recognized as a start command, the transmitter unit exits hibernation mode and enters working mode; When the power-off command is detected, the transmitting system unit shuts off the power supply to the probe detection module, carrier modulation module, and infrared drive module before entering sleep mode.

[0015] Furthermore, in step S3, the probe detection module sets the probe trigger threshold by adjusting the output voltage of the reference voltage regulator; When the detected voltage after filtering and hysteresis processing is lower than the trigger threshold, a high level is output as the trigger state. When the detected voltage after filtering and hysteresis processing is higher than the trigger threshold, a low level is output as a reset state. The method further includes: when the transmitting system unit detects that the battery voltage is lower than a preset threshold, generating low battery alarm data and sending it to the receiving unit through the carrier modulation module and the infrared drive module; after recognizing the low battery alarm data, the receiving system unit controls the low battery alarm interface of the input / output module to output an alarm signal; and when the transmitting unit is in a standby non-triggered state, the first state indication module outputs a standby indication, and when the transmitting unit is in a triggered transmission state, the first state indication module outputs a trigger indication to characterize the current working state of the transmitting unit.

[0016] The technical solution of this invention has the following characteristics: Beneficial effects : 1. It helps reduce system standby power consumption and extend battery life; 2. It helps improve anti-interference capabilities and communication stability; 3. It helps reduce transmission delay and meets the requirements of high-speed dynamic measurement; 4. It helps improve the synchronization of measurement triggering and the accuracy of identification; 5. It helps reduce wireless signal pollution in industrial settings and improves system applicability; 6. It helps to improve transmission distance and transmission efficiency; 7. It facilitates the linkage output of status indication and alarm functions; 8. It helps improve the consistency of identification under different temperatures and installation conditions; 9. It helps improve the reliability of synchronous capture and reduce the probability of false triggering and false identification; 10. It helps improve the visibility of link health and the output security under abnormal operating conditions; 11. It helps improve the long-term reliability and resistance to malfunctions of the system. Attached Figure Description

[0017] Figure 1 This is a system block diagram of the present invention; Figure 2 This is a schematic diagram of the structure of the transmitting unit of the present invention; Figure 3 This is a schematic diagram of the receiving unit of the present invention; Figure 4 It is a system signal, calibration, and safety logic diagram. Detailed Implementation

[0018] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention. It should also be noted that, for ease of description, only the parts related to the present invention are shown in the accompanying drawings, and not all of them.

[0019] Example 1: This embodiment provides a microcontroller-based infrared transmission probe measurement system, including a transmitting unit and a receiving unit. The transmitting unit includes a transmitting system unit, a transmitting power supply module, a probe detection module, an infrared wake-up module, a carrier modulation module, an infrared driving module, and a first status indication module. The receiving unit includes a receiving system unit, a receiving power supply module, an input / output module, an infrared trigger module, an infrared receiving module, an envelope detection module, and a second status indication module. The transmitting unit is installed on one side of the probe body or probe mechanism, and the receiving unit is installed on a machine tool body, control cabinet, or fixedly connected to the controlled equipment. The infrared optical path between the transmitting and receiving units is accessible. The overall system structure, infrared wake-up structure, probe detection structure, and infrared transmitting / receiving structure are consistent with those shown in the aforementioned figures.

[0020] In this embodiment, the transmitting power module uses a 3.6V lithium battery as its power source. After low-dropout voltage regulation, it provides a 3.3V operating voltage to the transmitting system unit, probe detection module, carrier modulation module, and infrared drive module. The receiving power module uses a 24V DC power input from the device side. After step-down conversion, it outputs 5V and 3.3V. The 5V is used for the input / output module, and the 3.3V is used for the receiving system unit, infrared trigger module, infrared receiving module, and envelope detection module. When the transmitting unit is in sleep mode, only the infrared wake-up module is powered on. The transmitting system unit, probe detection module, carrier modulation module, and infrared drive module are all powered off or in a low-power shutdown state. The receiving unit is kept powered on at all times to receive external wake-up commands and trigger infrared wake-up at any time.

[0021] I. Specific Structure of the Transmission Unit The transmitting system unit employs a low-power microcontroller, which has at least one external interrupt input, one analog-to-digital sampling input, one timer carrier output port, and one data output port. The output of the infrared wake-up module is connected to the external interrupt input, and the output of the probe detection module is connected to the analog-to-digital sampling input or the digital input. The microcontroller's carrier output and data output are both connected to the carrier modulation module, and the output of the carrier modulation module is connected to the infrared driver module. The first status indication module includes a green indicator light, a red indicator light, and a blue indicator light. The green indicator light indicates standby / online status, the red indicator light indicates trigger status, and the blue indicator light indicates low battery alarm status.

[0022] The infrared wake-up module includes a silicon photoelectric receiver, a synchronization signal amplifier, a detector controller, a reference voltage regulator, and a voltage comparison output circuit. The silicon photoelectric receiver preferably uses a silicon photovoltaic cell or silicon photodiode sensitive to the near-infrared band, with a preferred receiving wavelength range of 850nm to 950nm. The synchronization signal amplifier amplifies the weak voltage signal generated by the silicon photoelectric receiver. The detector controller extracts the envelope of the external infrared trigger signal. The voltage comparison output circuit shapes the envelope signal into a square wave control signal and sends it to the microcontroller's external interrupt terminal. To reliably distinguish between start and shutdown commands, this embodiment uses different pulse widths to represent different control commands: an 8ms pulse width represents the start command, and a 16ms pulse width represents the shutdown command, with an allowable error of ±1ms. The microcontroller executes the power-on wake-up process upon receiving an 8ms pulse width square wave control signal and executes the shutdown sleep process upon receiving a 16ms pulse width square wave control signal. The aforementioned pulse widths are only a set of implementable parameters, ensuring that wake-up and shutdown commands are distinguishable in the time domain and are not confused with measurement data pulses.

[0023] The probe detection module includes a detection voltage input circuit, two probe electrodes, a voltage filtering hysteresis circuit, a voltage comparator, a reference voltage regulator, and a level output circuit. The detection voltage input circuit applies a stable detection voltage between the two probe electrodes; in this embodiment, the detection voltage is 1.20V. A 100kΩ current-limiting resistor is connected in series with the detection voltage input circuit to limit the probe current and improve stability. The two probe electrodes are linked to the probe mechanical mechanism. In the untriggered state, the two probe electrodes maintain a first distance. When the probe is subjected to an external force, the relative position between the two probe electrodes changes, thereby changing the equivalent resistance between the probe electrodes and consequently changing the voltage at the probe detection node. The voltage filtering hysteresis circuit preferably consists of an RC filter network composed of a 10kΩ resistor and a 0.1μF capacitor, with a time constant of approximately 1ms, used to suppress mechanical jitter and transient spikes. The hysteresis threshold is preferably set to 50mV to prevent the comparator from repeatedly flipping near the critical voltage.

[0024] To maintain clear logical relationships, in this embodiment, the non-inverting input of the voltage comparator is connected to the output of the reference voltage regulator, and the inverting input is connected to the probe detection voltage output after RC filtering and hysteresis processing. The reference voltage regulator outputs an adjustable reference voltage, set to 0.80V in this embodiment, with an adjustment range of 0.60V to 1.00V to adapt to probe mechanisms with different structures and sensitivity requirements. When the probe detection voltage is below 0.80V, the voltage comparator outputs a high level, defined as the trigger state; when the probe detection voltage is above or equal to 0.80V, the voltage comparator outputs a low level, defined as the reset state. With this setting, the microcontroller only needs to detect the high / low level changes at the comparator output to obtain a stable trigger / reset state.

[0025] The carrier modulation module employs ASK modulation. The transmitting system unit outputs a 16MHz carrier signal via a timer and a status data control signal via a data output terminal. The ASK modulator activates the carrier when the status data is valid and deactivates it when the status data is invalid, thus forming an infrared modulated signal with a 16MHz carrier. The infrared driving module includes a driving transistor and an infrared emitting device, preferably a high-speed infrared LED with a center wavelength of 940nm. To improve instantaneous luminous intensity, the infrared driving module preferably uses a pulse driving method, with a peak driving current set to 80mA–150mA; in this embodiment, 100mA is used, and the transmit pulse duty cycle is no greater than 50%.

[0026] II. Specific Structure of the Receiving Unit The receiving system unit also uses a microcontroller. The infrared trigger module is connected to the control output of the receiving system unit, used to transmit an infrared wake-up signal or an infrared power-off signal according to a preset pulse width; the infrared receiving module is connected to the input of the envelope detector module, and the output of the envelope detector module is connected to the input of the receiving system unit; the input / output module is connected to the control output of the receiving system unit, used to output a valid trigger signal, an invalid reset signal, and a low battery alarm signal to external devices; the second status indicator module is used to display the power supply, online, and alarm status of the receiving unit. The infrared trigger module and infrared receiving module in the receiving unit can be equipped with independent optical components, or they can use separate transmitting and receiving channels arranged in the same housing to avoid self-oscillation crosstalk.

[0027] The infrared trigger module uses a 940nm infrared emitting device to send start or shutdown pulses under the control of the receiving system unit. The start pulse width is 8ms, and the shutdown pulse width is 16ms, with rise times of both the leading and trailing edges less than 50μs to ensure that the infrared wake-up module of the transmitting unit can accurately identify the pulse width. To avoid false wake-ups due to environmental interference, the external wake-up input signal must remain valid for at least 50ms before the receiving system unit issues a wake-up command; and before the receiving system unit issues a shutdown command, the dual conditions of "valid external wake-up input signal and receipt of a status communication signal from the transmitting unit within the last 200ms" must be met. This configuration prevents the accidental issuance of shutdown commands when the transmitting unit is not online.

[0028] The infrared receiving module includes a silicon photonics sensor and a signal amplifier. After receiving a 16MHz infrared modulated signal from the transmitting unit, the silicon photonics sensor generates a weak current signal, which is then amplified in multiple stages by the signal amplifier. In this embodiment, the signal amplifier includes a single-stage transimpedance amplifier circuit and a two-stage voltage amplifier circuit, with a preferred total gain of 60dB to 80dB; in this embodiment, it is approximately 70dB. The envelope detection module includes a bandpass selection network, a detection circuit, a shaping and comparison circuit, and a reference voltage source. The bandpass center frequency is set to 16MHz to prioritize the transmission of the target carrier frequency band signal and suppress low-frequency ambient noise. The detection circuit extracts the modulation envelope; the shaping and comparison circuit converts the detected envelope signal into a digital square wave; the receiving system unit identifies different states by detecting the high-level duration of the digital square wave.

[0029] III. Status Data Format and Decoding Rules To enable the system to reliably distinguish between the three states of trigger, reset, and low battery alarm, this embodiment employs a "fixed carrier frequency + different pulse width status packets" method to transmit status data. Specifically, the transmitting system unit outputs the following three status packets based on a 16MHz carrier: 1. Trigger status packet: Continuously outputs a 2.0ms 16MHz modulated infrared pulse; 2. Reset status packet: Continuously outputs a 16MHz modulated infrared pulse for 4.0ms; 3. Low battery alarm status packet: Continuously outputs a 16MHz modulated infrared pulse for 6.0ms.

[0030] To improve reception reliability, each status packet is transmitted three times consecutively, with a 1.0 ms interval between each transmission. The receiving system unit times the square wave pulses output by the envelope detection module. If a pulse width of 1.5 ms to 2.5 ms is detected, it is identified as a trigger state; if a pulse width of 3.5 ms to 4.5 ms is detected, it is identified as a reset state; and if a pulse width of 5.5 ms to 6.5 ms is detected, it is identified as a low battery alarm state. The receiving system unit only updates the output state of the input / output module when at least two out of three consecutive receptions of the same type of status packet are identified consistently. This configuration effectively reduces the impact of ambient light interference, single-shot errors, and momentary obstruction on the decision results and improves the recognition stability of different status data.

[0031] IV. System Operation Steps 1. Hibernation / Standby Procedure The transmitting unit is initially in sleep mode, with only the infrared wake-up module remaining active. At this time, all first-state indicator modules are off, or only the ultra-low power standby indicator remains active. The receiving unit remains powered on, awaiting external wake-up input.

[0032] 2. Wake-up and startup steps When the receiving system unit detects that the external wake-up input signal in the input / output module is valid and lasts for more than 50ms, it controls the infrared trigger module to send an 8ms start pulse. Upon receiving this start pulse, the infrared wake-up module of the transmitting unit outputs a square wave control signal to the external interrupt terminal of the transmitting system unit. The transmitting system unit then powers on the probe detection module, carrier modulation module, and infrared drive module, and completes initialization. After initialization, the transmitting system unit controls the green indicator light to flash at a frequency of 1Hz and simultaneously sends a communication status packet to notify the receiving unit that the transmitting unit is online. This process is consistent with the "receiving side infrared trigger—transmitting side infrared wake-up—system exits sleep" flow corresponding to the attached diagram.

[0033] 3. Probe detection steps The transmitting system unit reads the output status of the probe detection module at a period of 100μs. When not triggered, the probe detection voltage is higher than or equal to 0.80V, and the voltage comparator outputs a low level. When the probe is subjected to external force, causing a change in the relative position of the two probe electrodes, the voltage at the probe detection node drops. After RC filtering and hysteresis processing, when the probe detection voltage is lower than 0.80V, the voltage comparator flips to output a high level. To eliminate mechanical contact jitter, the transmitting system unit only determines a valid trigger when a high level is detected for three consecutive sampling cycles; and only determines a valid reset when a low level is detected for three consecutive sampling cycles.

[0034] 4. Trigger the transmission step When the transmitting system unit determines that the probe has switched from the reset state to the triggered state, it immediately generates a trigger state packet, controls the ASK modulator to output a 16MHz modulated signal lasting 2.0ms, and transmits it via the infrared drive module; this trigger state packet is sent three times consecutively, with an interval of 1.0ms between each transmission. Simultaneously, the green indicator light turns off, and the red indicator light remains on. After receiving the aforementioned infrared modulated signal, the infrared receiving module of the receiving unit amplifies, performs envelope detection and shaping, and outputs a corresponding 2.0ms square wave pulse to the receiving system unit. Upon recognizing the trigger state, the receiving system unit controls the trigger output terminal of the input / output module to output a valid level.

[0035] 5. Reset Transmission Steps When the transmitting system unit determines that the probe has switched from the triggered state to the reset state, it immediately generates a reset state packet, controls the ASK modulator to output a 16MHz modulated signal for 4.0ms, and transmits it via the infrared drive module; this reset state packet is also sent three times consecutively, with an interval of 1.0ms between each transmission. Simultaneously, the red indicator light goes out, and the green indicator light resumes flashing at a frequency of 1Hz. After the receiving unit identifies the 4.0ms square wave pulse output by the envelope detector module as a reset state, it controls the trigger output terminal of the input / output module to return to an invalid level.

[0036] 6. Low battery alarm procedure The transmitting system unit samples the battery voltage of the transmitting power module every 1 second. In this embodiment, a low battery state is determined when the battery voltage is lower than the low battery alarm threshold; if a 3.6V battery is used, the low battery alarm threshold can be set to 3.00V. After determining a low battery state, the transmitting system unit immediately generates a 6.0ms low battery alarm status packet and sends it three times consecutively, with an interval of 1.0ms between each packet, while simultaneously controlling the blue indicator light to flash at a frequency of 2Hz. After the receiving system unit recognizes the low battery alarm status packet, it controls the low battery alarm output terminal of the input / output module to output a valid signal and drives the alarm indicator light in the second status indication module to light up or flash.

[0037] 7. Shutdown and hibernation steps When the receiving system unit detects that the external wake-up input signal is valid again, and confirms that it has received a communication status packet or any valid status packet from the transmitting unit within the last 200ms, it controls the infrared trigger module to send a 16ms power-off pulse. Upon receiving this 16ms power-off pulse, the infrared wake-up module of the transmitting unit outputs a corresponding square wave control signal to the transmitting system unit. The transmitting system unit then performs the following operations: stops probe detection sampling; disables the ASK modulator; disables the infrared drive module; extinguishes the red, green, and blue indicator lights; saves the current status flag; cuts off power to all circuits except the infrared wake-up module; and finally re-enters sleep mode. This significantly reduces standby power consumption and extends battery life.

[0038] V. Installation Conditions In this embodiment, the working distance between the transmitting unit and the receiving unit is preferably 0.2m to 3m, and the optical axis angle between the infrared transmitter of the transmitting unit and the infrared receiver of the receiving unit is preferably no greater than 20°. When applied to machine tool probe scenarios, the transmitting unit can be installed on one side of the rotating or moving probe, and the receiving unit can be installed on the fixed end of the machine tool. To improve the resistance to ambient light, a narrow-band filter window is preferably provided on the outside of the infrared receiving module, and a light-shielding cavity is provided inside the receiver housing. The reference voltage of the probe detection module can be calibrated according to the actual trigger displacement or contact pressure of the probe mechanism: first, record the detection voltage in the non-triggered state, and then record the detection voltage under the target trigger force. The reference voltage is set between the two with a hysteresis margin of 50mV to 100mV. This ensures stable triggering and resetting under different probe structures.

[0039] Example 2: I. System Overall Structure The microcontroller-based infrared transmission probe measurement system in this embodiment includes a transmitting unit 100 and a receiving unit 200.

[0040] The transmitting unit 100 includes: a transmitting power supply module 110, a transmitting system unit 120, a probe detection module 130, an infrared wake-up module 140, a carrier modulation module 150, an infrared driving module 160, a first status indication module 170, and a self-calibration module 180.

[0041] The receiving unit 200 includes: a receiving power module 210, a receiving system unit 220, an input / output module 230, an infrared trigger module 240, an infrared receiving module 250, an envelope detection module 260, a second status indication module 270, and a synchronization acquisition and safety interlocking module 280.

[0042] in: 1. The self-calibration module 180 includes a first temperature acquisition unit 181, a calibration frame generation unit 182, and a transmitter parameter register unit 183; 2. The synchronous acquisition and safety interlock module 280 includes a second temperature acquisition unit 281, a sliding correlation detection unit 282, a code phase stability determination unit 283, a parameter correction unit 284, a calibration parameter storage unit 285, a health detection statistics unit 286, an illegal code counting unit 287, and a safety interlock control unit 288.

[0043] The transmitting unit 100 is mounted on the moving end of the probe body or probe mechanism, and the receiving unit 200 is mounted on the fixed end of the machine tool, control cabinet, or equipment base. The working distance between the transmitting unit 100 and the receiving unit 200 is preferably 0.3m to 2.5m, the optical axis angle is preferably no greater than 15°, and the maximum allowable deviation angle is no greater than 20°. To reduce the influence of ambient light, a narrowband filter with a center wavelength of 940nm and a half-peak width of no more than 50nm is placed in front of the infrared receiving module 250. This embodiment 2 further refines the key modules and their collaborative relationships based on the system structure.

[0044] II. Power Supply and Basic Electronic Structure The transmitting power module 110 uses a lithium-ion battery or lithium-manganese battery with a rated voltage of 3.6V, and outputs a 3.3V main power supply through a low-dropout regulator. In sleep mode, only the infrared wake-up module 140 and the first temperature acquisition unit 181 remain powered on; the transmitting system unit 120, probe detection module 130, carrier modulation module 150, infrared drive module 160, and first status indication module 170 are all in a power-off or low-power off state. The static current of the transmitting unit 100 in sleep mode is preferably no greater than 25μA.

[0045] The receiving power module 210 adopts a 24V industrial DC input, which is isolated and stepped down to output 5V and 3.3V. The 5V is used for the input / output module 230, and the 3.3V is used for the receiving system unit 220, the infrared trigger module 240, the infrared receiving module 250, the envelope detector module 260, and the synchronization acquisition and safety interlock module 280. The receiving unit 200 is kept under constant power.

[0046] Both the transmitting system unit 120 and the receiving system unit 220 use low-power microcontrollers. The transmitting system unit 120 has at least one external interrupt input, one timer carrier output, one data modulation output, one ADC sampling input, and one non-volatile memory interface. The receiving system unit 220 has at least one high-speed acquisition input, one correlation operation interface, one output control terminal, and one non-volatile memory interface.

[0047] III. Infrared Wake-up and Power-Off Control Structure The infrared wake-up module 140 includes a silicon photoelectric receiver 141, a first-stage transimpedance amplifier 142, a second-stage voltage amplifier 143, a detection and shaping circuit 144, and a pulse width recognition output circuit 145. The infrared trigger module 240 includes a 940nm infrared emitter 241 and a drive and shaping circuit 242.

[0048] In this embodiment, the receiving system unit 220 outputs two types of control pulses: 1. Start-up pulse: Pulse width 8ms, allowable error ±0.5ms; 2. Power-off pulse: pulse width 16ms, allowable error ±0.5ms.

[0049] After receiving the aforementioned control pulse, the infrared wake-up module 140 outputs a shaped square wave to the external interrupt terminal of the transmitting system unit 120. The transmitting system unit 120 identifies the pulse according to the following rules: 1. When the measured pulse width is between 7.5ms and 8.5ms, it is identified as a start command; 2. When the measured pulse width is between 15.5ms and 16.5ms, it is identified as a power-off command; 3. All other pulse widths are considered invalid control pulses and discarded.

[0050] The infrared wake-up module generates a weak electromotive force by receiving infrared signals. After amplification, detection, comparison, and shaping, a square wave is obtained. The system unit obtains the start signal by detecting the pulse width. It also discloses that the receiving side sends a shutdown signal when the conditions are met, and the transmitting side shuts off the power supply to other units and enters sleep mode after receiving the signal. This embodiment 2 follows the basic logic and further quantifies the pulse width parameter.

[0051] IV. Probe Detection Structure and Parameters The probe detection module 130 includes a detection voltage input circuit 131, two probe electrodes 132, an RC filter circuit 133, a hysteresis comparison circuit 134, a reference voltage regulator 135, and a level output circuit 136.

[0052] The detection voltage input circuit 131 outputs a stable detection voltage of 1.20V and is connected in series with a 100kΩ current-limiting resistor. The two probe electrodes 132 are linked to the probe mechanical mechanism. When the probe is not subjected to external force, the two probe electrodes form a first equivalent resistance. When the probe head is subjected to force and displacement reaches the trigger threshold, the relative distance between the two probe electrodes changes, the equivalent resistance changes, and thus causes a change in the detection node voltage.

[0053] The RC filter circuit 133 consists of a 10kΩ resistor and a 0.1μF capacitor, with a time constant of approximately 1ms. The hysteresis comparator circuit 134 has a hysteresis width of 60mV. The reference voltage regulator 135 outputs an adjustable reference voltage; in this embodiment, the factory initial value is set to 0.82V, the adjustable range is 0.68V to 0.96V, and the adjustment resolution is 5mV.

[0054] To avoid logical ambiguity, this embodiment uniformly stipulates: 1. When the detected voltage after RC filtering and hysteresis processing is lower than the reference voltage, the level output circuit 136 outputs a high level, which is defined as the trigger state; 2. When the detected voltage after RC filtering and hysteresis processing is higher than or equal to the reference voltage, the level output circuit 136 outputs a low level, which is defined as the reset state.

[0055] The transmitting system unit 120 reads the state of the level output circuit 136 with a sampling period of 100μs; when three consecutive sampling periods are high, triggering is confirmed; when three consecutive sampling periods are low, reset is confirmed. This structure enables the probe detection module 130 to stably output high and low levels based on the voltage change caused by the resistance change between the two probe electrodes, after RC filtering, hysteresis, and comparison, and the sensitivity can be adjusted via a reference voltage.

[0056] V. Carrier Modulation and Infrared Emission Structure The carrier modulation module 150 adopts ASK modulation and includes a 16MHz carrier generator 151, a data gating circuit 152, and a modulation output buffer 153. The transmitting system unit 120 outputs a 16MHz carrier reference through a timer with a frequency error of no more than ±30ppm; at the same time, it outputs a data gating signal to the data gating circuit 152.

[0057] The infrared driving module 160 includes a constant current driver 161, an NPN switching transistor 162, and a 940nm infrared light-emitting diode 163. The peak driving current is set to 100mA, and the duty cycle is no more than 45%. The infrared emitting device uses a narrow-angle device with a half-power angle of no more than 12° to improve the effective transmission directivity and reduce stray reflections.

[0058] The infrared transmitting unit adopts a coordinated structure of carrier generation, ASK modulation, and power amplification drive. The transmitting system unit 120 is configured to generate a 16MHz carrier signal and generate data signals according to different states, which are sent to the ASK modulator to form a high-frequency envelope signal to control the infrared driver to output infrared signals. This embodiment 2 further adds preamble synchronization, health detection, and calibration frame mechanisms on this basis.

[0059] VI. Receiver Amplification, Detection and Digitization Structure The infrared receiving module 250 includes a silicon photonics sensor 251, a first-stage transimpedance amplifier 252, a second-stage voltage amplifier 253, and a bandpass preselection network 254. The envelope detection module 260 includes a bandpass network 261 with a center frequency of 16MHz, an envelope detector 262, a comparator and shaper 263, and a digital pulse output stage 264.

[0060] in: 1. The transimpedance of the first-stage transimpedance amplifier 252 is set to 220kΩ; 2. The total gain of the two-stage voltage amplifier 253 is 32dB; 3. The center frequency of the bandpass network 261 is 16MHz, and the bandwidth is set to ±0.8MHz; 4. The initial value of the static comparison threshold of the comparator 263 is set to 180mV, which can be automatically corrected by the parameter correction unit 284 in 2mV increments.

[0061] The receiving system unit 220 reads the pulse width, leading edge time and continuous pulse sequence information of the digital pulse output stage 264 through the high-speed capture input terminal, and inputs it into the sliding correlation detection unit 282 for subsequent synchronous identification.

[0062] VII. Self-calibration mechanism In this embodiment 2, a first temperature acquisition unit 181 and a second temperature acquisition unit 281 are respectively provided in the transmitting unit 100 and the receiving unit 200. The first temperature acquisition unit 181 is located near the infrared driving module 160 and is used to acquire the transmitting end temperature T1; the second temperature acquisition unit 281 is located near the envelope detection module 260 and is used to acquire the receiving end temperature T2. Both use digital temperature sensors with a sampling resolution of not less than 0.5℃ and a sampling period of 200ms.

[0063] 1. Calibration Frame Transmission Rules Each time the transmitting unit 100 switches from sleep mode to working mode, it first sends two consecutive calibration frames before officially sending the trigger status frame, reset status frame, or low battery alarm status frame. Each calibration frame consists of the following three fields: 1. Fixed preamble pulse segment: duration 1.000ms; 2. Fixed carrier segment: 16MHz carrier duration 0.500ms; 3. Dual calibration pulse segments: The first calibration pulse has a width of 0.200ms, the second calibration pulse has a width of 0.200ms, and the rising edge of the two pulses is 250μs apart.

[0064] The frame interval between two calibration frames is 1.000ms.

[0065] 2. Calibration parameter correction rules After receiving two calibration frames, the receiving system unit 220 measures the following: 1. The measured pulse width deviation ΔW of the fixed preamble pulse segment; 2. Rising edge interval deviation ΔI of the dual calibration pulse segment; 3. The peak envelope amplitude A corresponding to the fixed carrier segment; 4. The temperature T2 currently measured by the second temperature acquisition unit 281.

[0066] Simultaneously, the transmission system unit 120 carries the temperature T1 measured by the first temperature acquisition unit 181 in the first health detection frame. The parameter correction unit 284, based on T1, T2, ΔW, ΔI, and A, retrieves a pre-stored correction table from the calibration parameter storage unit 285 to correct the following parameters: 1. Compare the decision threshold of the shaper 263: adjust in increments of 2mV, with a correction range of ±20mV; 2. Status code pulse width recognition window center value: Adjusted in 0.5μs increments, with a correction range of ±4μs; 3. Trigger timestamp compensation value: Corrected in increments of 1μs, with a correction range of 0 to 8μs.

[0067] The corrected parameters remain valid during this wake-up cycle; if the continuous working time exceeds 10 minutes, the receiving system unit 220 will automatically request the transmitting unit 100 to send one incremental calibration frame to update the corrected parameters.

[0068] 8. Pseudo-random synchronization leader capture mechanism In this embodiment 2, each status frame is no longer composed of a single pulse width, but is composed of the following fields in sequence: 1. Pseudo-random synchronization preamble; 2. Status field; 3. Validate fields.

[0069] 1. Pseudo-random synchronization preamble The transmitting system unit 120 pre-stores four sets of 31-bit m-sequences, numbered P1, P2, P3, and P4. Upon each successful wake-up, the receiving system unit 220 specifies one of these preamble sequences in the initial control link for the current working cycle. Each symbol width is set to 8 μs, therefore the duration of the 31-bit preamble is 248 μs.

[0070] 2. Status fields and validation fields This embodiment defines three types of status fields: 1. Trigger status code: 10110011; 2. Reset status code: 01001101; 3. Low battery alarm status code: 11100010.

[0071] The width of each status code symbol is also set to 8μs. The check field uses a 4-bit CRC check value, with a generator polynomial of x^4 + x + 1. Therefore, the total length of the valid status code in each frame is: 31-bit preamble + 8-bit status + 4-bit check = 43 bits, and the total duration is 344μs.

[0072] 3. Reception and Synchronization Determination The sliding correlation detection unit 282 performs a bit-by-bit sliding correlation operation between the shaped signal output by the digital pulse output stage 264 and the currently specified local m-sequence template. Assuming the mean amplitude of the background noise is N, when the correlation peak value C satisfies C≥6N, a valid pseudo-random synchronization preamble is determined to have been captured.

[0073] The code phase stability determination unit 283 further compares the positions of the correlation peaks of the effective preamble segments of two adjacent frames. If the position deviation is no more than 2 symbols, i.e. no more than 16μs, the code phase is considered stable and subsequent state field decoding is allowed. If the deviation is greater than 2 symbols, the frame is discarded and counted in the illegal code counting unit 287.

[0074] To improve reliability, after detecting a state switch, the transmitting system unit 120 does not send one frame, but instead sends three consecutive frames of the same state, with an interval of 1.0 ms between adjacent frames. The receiving system unit 220 adopts a "2 out of 3" rule: the system state is only updated if at least two of the three consecutive frames pass the preamble acquisition, code phase stability determination, and CRC check.

[0075] IX. Health Detection Frame and Security Interlock Output Mechanism In this embodiment 2, the system further sets up periodic health detection frames and a fault-safe output mechanism to improve the visibility of link health, the ability to determine anomalies, and the security of output.

[0076] 1. Health detection frame format The transmission system unit 120 transmits health detection frames with a transmission period of 20ms. Each health detection frame includes: 1. Battery voltage level value Vb: 2 digits; 2. Compare the threshold value Th: 3 digits; 3. Infrared drive current level value Id: 2 digits; 4. Transmitter fault flag Ef: 1 bit; 5. Preamble: Employs the same 31-bit m-sequence preamble as the status frame; 6. Verification field: 4-bit CRC.

[0077] in: The battery voltage level value Vb is defined as follows: 00 indicates that the battery voltage is ≥3.30V; 01 indicates that 3.15V ≤ battery voltage < 3.30V; 10 indicates that the battery voltage is between 3.00V and 3.15V. 11 indicates that the battery voltage is <3.00V.

[0078] Compare the threshold value Th with the current output value of the reference voltage regulator 135, with each threshold coded in 5mV increments. The infrared drive current level value Id corresponds to one of four levels: 80mA, 90mA, 100mA, and 110mA. The transmitter fault flag Ef is set to 1 when a drive abnormality, temperature abnormality, or probe detection abnormality is detected.

[0079] 2. Link Failure Judgment Criteria The health detection statistics unit 286 performs statistics on the continuously received health detection frames. If any of the following conditions are met, the receiving system unit 220 sets the link fault flag Lf: 1. Three consecutive health check frames were lost; 2. CRC check failed for any health check frame; 3. The received peak amplitude is below 1.2 times the corrected threshold for 50 ms consecutively; 4. The positional deviation of the preamble correlation peak in two adjacent frames exceeds 2 symbols and occurs consecutively twice; 5. The illegal code counting unit 287 records more than 1 illegal code in the most recent 3 status frames.

[0080] 3. Safety interlock output rules The safety interlock control unit 288 only allows the input / output module 230 to set the trigger output to the active state when all three of the following conditions are met simultaneously: 1. The trigger status frame is established after preamble capture, code phase stability determination, and CRC check; 2. The most recent health check frame is valid; 3. The illegal code count in the last 3 frames is no greater than 1.

[0081] If any condition is not met, the input / output module 230 remains in an invalid state.

[0082] Once the link failure flag Lf is set, the receiving system unit 220 immediately performs the following actions: 1. Force the main trigger output to return to an invalid state; 2. Enable the fault alarm output; 3. The fault indicator light in the second status indicator module 270 flashes at a frequency of 4Hz; 4. Suspend receiving normal status frames until two consecutive valid health check frames are received before releasing the fault lock.

[0083] This definition avoids the unsafe state of "false triggering still maintaining effective output" caused by link attenuation, occasional reflections, strong ambient light, or interference from other infrared devices.

[0084] 10. Status Indicators and Low Battery Alarm The first status indicator module 170 includes a green indicator light 171, a red indicator light 172, and a blue indicator light 173. Its operating rules are as follows: 1. After the transmitting unit 100 is awakened and completes the transmission of two calibration frames, the green indicator light 171 flashes at 1Hz; 2. When entering the trigger state, the red indicator light 172 remains on, and the green indicator light 171 turns off; 3. When the battery voltage is below 3.00V, the blue indicator light 173 will flash at 2Hz; 4. After receiving the shutdown command and completing the power-off process, all three indicator lights will turn off.

[0085] The second status indication module 270 includes an online indicator, a low battery alarm indicator, and a fault alarm indicator. When the receiving system unit 220 identifies the low battery alarm status code and the CRC check passes, the low battery alarm indicator lights up, and the low battery alarm terminal of the input / output module 230 outputs a valid signal. In this embodiment 2, the transmitting end actively sends low battery alarm data and causes the blue indicator to flash at 2Hz when the battery voltage is below 3.00V, and the receiving side correspondingly outputs a valid low battery alarm interface signal.

[0086] XI. Power-off and Wake-up Procedure The receiving system unit 220 will only allow the infrared trigger module 240 to send a shutdown pulse if both of the following conditions are met simultaneously: 1. The external wake-up input signal becomes valid again and remains valid for at least 50ms; 2. At least one valid health check frame or status frame has been successfully received within the last 200ms.

[0087] After the above conditions are met, the receiving system unit 220 sends a 16ms shutdown pulse. Upon recognizing this as a shutdown command, the transmitting system unit 120 executes the following sequence: 1. Stop sending health check frames and status frames; 2. Save the current Th setting, Id setting, and the last temperature value; 3. Turn off the power supply to the probe detection module 130, carrier modulation module 150, infrared drive module 160 and first status indication module 170; 4. Only the infrared wake-up module 140 and the first temperature acquisition unit 181 are powered on; 5. Enter sleep mode.

[0088] 12. Complete Work Steps The complete working steps of this embodiment 2 are as follows: Step S201: Hibernation / Standby.

[0089] The transmitting unit 100 is in a sleep state, with only the infrared wake-up module 140 and the first temperature acquisition unit 181 powered on; the receiving unit 200 is powered on at all times.

[0090] Step S202: The receiving side issues a start command.

[0091] When the external wake-up input is valid for 50ms, the receiving system unit 220 controls the infrared trigger module 240 to send an 8ms start pulse.

[0092] Step S203: Wake up on the transmitting side.

[0093] After recognizing the start pulse, the transmitting system unit 120 is powered on and initialized, reads the T1 value of the first temperature acquisition unit 181, and turns on the probe detection module 130, the carrier modulation module 150 and the infrared drive module 160.

[0094] Step S204: Send calibration frame.

[0095] The transmitting system unit 120 continuously transmits two calibration frames; the receiving system unit 220 measures ΔW, ΔI, A and T2, and completes threshold, pulse width identification window and timestamp compensation correction.

[0096] Step S205: Enter online standby.

[0097] The green indicator light 171 flashes at 1Hz, and the transmission system unit 120 begins to send one health check frame every 20ms.

[0098] Step S206: Probe-triggered detection.

[0099] The probe detection module 130 detects the change in equivalent resistance between the two probe electrodes in real time. If it outputs a high level for three consecutive sampling cycles, it confirms the trigger state.

[0100] Step S207: Send a trigger status frame.

[0101] The transmitting system unit 120 continuously sends three trigger status frames, each containing a 31-bit pseudo-random synchronization preamble, an 8-bit trigger status code, and a 4-bit CRC checksum.

[0102] Step S208: Receiver-side synchronization acquisition and verification.

[0103] The sliding correlation detection unit 282 detects the leading correlation peak, and the code phase stability determination unit 283 confirms that the peak position deviation between two adjacent frames is no more than 2 code elements, and the CRC check passes. After the "3 out of 2" rule is met, the safety interlock control unit 288 checks that the most recent health detection frame is valid and the illegal code count of the most recent 3 frames is no more than 1. When all three conditions are met, the input / output module 230 outputs a valid trigger signal.

[0104] Step S209: Reset detection and reset output.

[0105] When the probe detection module 130 outputs a low level for three consecutive sampling cycles, the transmitting system unit 120 continuously sends three reset status frames; after the receiving system unit 220 confirms according to the same rules as in step S208, it restores the input / output module 230 to an invalid state.

[0106] Step S210: Low battery alarm.

[0107] When the battery voltage is below 3.00V, the transmitting system unit 120 continuously sends 3 low battery alarm status frames and controls the blue indicator light 173 to flash at 2Hz; the receiving system unit 220 identifies the low battery alarm signal and outputs it.

[0108] Step S211: Fault handling.

[0109] If three or more health check frames are lost consecutively, or if any of the following occurs: CRC error, peak amplitude being too low for 50ms consecutively, code phase being abnormal for consecutive periods, or too many illegal codes, the receiving system unit 220 will set the link fault flag Lf and force the main output to be invalid, while simultaneously outputting a fault alarm.

[0110] Step S212: Power off and put the device into hibernation mode.

[0111] When the receiving system unit 220 meets the shutdown conditions, it sends a 16ms shutdown pulse; after receiving the pulse, the transmitting system unit 120 shuts down the operating circuit and re-enters sleep mode.

[0112] The above description is only a preferred embodiment of the present invention and does not limit the patent scope of the present invention. All equivalent structural transformations made under the inventive concept of the present invention using the contents of the present invention specification and drawings, or direct / indirect applications in other related technical fields, are included within the protection scope of the present invention.

Claims

1. A single-chip microcomputer-based infrared transmission probe measurement system, characterized in that, Includes a transmitting unit and a receiving unit; The transmitting unit includes a transmitting system unit, a transmitting power supply module, a probe detection module, an infrared wake-up module, a carrier modulation module, an infrared driving module, and a first status indication module; The receiving unit includes a receiving system unit, a receiving power supply module, an input / output module, an infrared trigger module, an infrared receiving module, an envelope detection module, and a second status indication module. The infrared trigger module is used to send an infrared wake-up signal when the receiving system unit detects an external wake-up condition, and to send an infrared power-off signal when the receiving system unit detects a power-off condition. The infrared wake-up module is used to receive the infrared wake-up signal or the infrared power-off signal, and convert the received infrared signal into a square wave control signal input to the transmitting system unit. The transmitting system unit controls the transmitting unit to exit the sleep mode or enter the sleep mode according to the pulse width of the square wave control signal. The probe detection module is used to detect the resistance change between the probe electrodes and output the corresponding level status signal to the transmission system unit. The carrier modulation module is used to receive the carrier signal and status data output by the transmitting system unit, and output the modulated signal to the infrared driving module after carrier modulation of the status data. The infrared driving module is used to transmit infrared measurement signals according to the modulation signal; The infrared receiving module is used to receive the infrared measurement signal and output the received electrical signal to the envelope detection module; The envelope detection module is used to amplify, detect and shape the received electrical signal, and output a square wave signal with pulse width representing different state data to the receiving system unit. The receiving system unit is used to identify the trigger state, reset state, and low battery alarm state based on the square wave signal, and control the input / output module to output the corresponding state result signal; the state result signal includes a trigger valid signal, a reset invalid signal, and a low battery alarm signal.

2. The infrared transmission probe measurement system based on a microcontroller according to claim 1, characterized in that, The infrared wake-up module includes a silicon photoelectric receiver, a synchronization signal amplifier, a detector controller, a reference voltage regulator, and a voltage comparison output circuit. The silicon photoelectric receiver is used to generate an induced electrical signal when it receives the infrared wake-up signal or the infrared power-off signal. The synchronization signal amplifier is used to amplify the induced electrical signal. The detector controller is used to perform detection processing on the amplified signal. The voltage comparison output circuit is used to shape the detected signal into a square wave control signal based on the reference voltage provided by the reference voltage regulator.

3. The infrared transmission probe measurement system based on a single-chip microcomputer according to claim 1, characterized in that, The probe detection module includes a detection voltage input circuit, two probe electrodes connected to the probe mechanism under test, a voltage filtering hysteresis circuit, a voltage comparator, a reference voltage regulator, and a level output circuit. The detection voltage input circuit is used to apply a detection voltage to the two probe electrodes; When an external force causes a change in the distance between the two probe electrodes, the equivalent resistance between the two probe electrodes changes, which in turn causes a change in the detection voltage between the probe electrodes. The voltage filtering hysteresis circuit is used to filter and hysteresis the changed detection voltage. The voltage comparator is used to compare the processed detection voltage with the reference voltage output by the reference voltage regulator. The level output circuit is used to output the corresponding high-level or low-level status signal to the transmitting system unit. The output voltage of the reference voltage regulator is adjustable to adjust the probe detection sensitivity.

4. The infrared transmission probe measurement system based on a microcontroller according to claim 1, characterized in that, The carrier modulation module is an amplitude shift keying (ASK) modulation module. The transmitting system unit generates a 16MHz carrier signal and generates status data corresponding to the probe status. The ASK modulation module modulates the status data onto the carrier signal to form a high-frequency envelope modulation signal. The infrared driving module drives the infrared transmitter to transmit infrared measurement signals according to the high-frequency envelope modulation signal. The status data includes at least trigger data, reset data, and low battery alarm data; The receiving system unit distinguishes and identifies the trigger data, reset data, and low battery alarm data based on the pulse width of the square wave signal output by the envelope detection module.

5. The infrared transmission probe measurement system based on a microcontroller according to claim 4, characterized in that, The transmitting system unit is configured to: after the transmitting unit switches from sleep mode to working mode, send status information including a communication status identifier and / or the current battery voltage level; send trigger data when the level output of the probe detection module changes from low to high; send reset data when the level output of the probe detection module changes from high to low; and send low battery alarm data when the battery voltage of the transmitting power module is detected to be lower than a preset threshold. The receiving system unit is configured to: control the input / output module to output a valid status signal when the trigger data is received; control the input / output module to output an invalid status signal when the reset data is received; and control the input / output module to output a low battery alarm signal when the low battery alarm data is received.

6. The infrared transmission probe measurement system based on a single-chip microcomputer according to any one of claims 1 to 5, characterized in that, The system also includes a self-calibration function unit, which is located in the transmitting unit and / or receiving unit and is used to realize temperature acquisition, calibration frame generation, parameter correction and calibration parameter storage. The transmitting unit is used to collect a first temperature value near the infrared driving module, and the receiving unit is used to collect a second temperature value near the envelope detection module, or select to collect either the first temperature value or the second temperature value according to the system configuration. The calibration frame generation unit is used to send a calibration frame before the status data in the first two communication cycles after the transmitting unit exits the sleep mode each time. The calibration frame includes at least a fixed-width preamble pulse segment, a fixed-duration carrier segment, and a dual calibration pulse segment with a preset interval. The receiving system unit is used to measure the pulse width deviation of the preamble pulse segment, the interval deviation of the dual calibration pulse segment, and the received peak amplitude corresponding to the calibration frame. Combined with the first temperature value and / or the second temperature value, it calls the corresponding correction parameters from the calibration parameter storage unit to correct the decision threshold of the envelope detection module, the center value of the pulse width identification window of the status data, and the trigger timestamp compensation value. The correction step value of the decision threshold is 2mV to 10mV, the correction step value of the center value of the pulse width recognition window is 0.5μs to 2μs, and the correction step value of the trigger timestamp compensation value is 1μs to 5μs.

7. The infrared transmission probe measurement system based on a single-chip microcomputer according to claim 5, characterized in that, Before sending trigger data, reset data, or low battery alarm data, the carrier modulation module first sends a pseudo-random synchronization preamble. The pseudo-random synchronization preamble is formed by ASK modulation of the carrier signal with a pseudo-random sequence of length 31 or 63 bits pre-stored in the transmission system unit, and the symbol width of the pseudo-random sequence is 4μs to 16μs. The receiving system unit further includes a sliding correlation detection unit and a code phase stability determination unit; The sliding correlation detection unit is used to perform bit-by-bit sliding correlation operation on the shaped signal output by the envelope detection module and the locally pre-stored same sequence template. When the correlation peak value is greater than 4 to 8 times the average background noise value, it is determined that an effective pseudo-random synchronization preamble has been captured. The code phase stability determination unit is used to determine whether the position deviation of the correlation peak of the effective pseudo-random synchronization preamble of two adjacent frames is no greater than 2 code symbols. Only when this condition is met will the receiving system unit decode the subsequent status field. The status field includes at least a trigger status code, a reset status code, and a low battery alarm status code, and the status field also includes a verification field for verifying the consistency of the decoding result. The transmitting system unit is also configured to transmit health detection frames at a transmission period of 10ms to 50ms. The health detection frame includes at least the transmitter battery voltage level, the probe detection module comparison threshold level, the infrared drive module drive current level, and the transmitter fault flag. The receiving system unit is configured to count multiple consecutive health detection frames and set a link fault flag when any of the following occurs: three or more consecutive health detection frames are lost, the check field of the health detection frame is incorrect, the received peak amplitude is lower than a preset threshold for 50 ms for 5 consecutive ms, or the position deviation of the relevant peak of the pseudo-random synchronization preamble exceeds the allowable range. The input / output module is configured to not maintain the most recently valid trigger output state when the link fault flag is set, but to forcibly switch to the safe invalid state and output an independent link fault alarm signal at the same time. Furthermore, the receiving system unit will only switch the input / output module to the trigger valid state when the following conditions are met simultaneously: the trigger status code verification is passed, the most recent health detection frame is valid, and the count of illegal code patterns in the most recent 3 frames of received data is not greater than 1; if any condition is not met, the input / output module remains in the invalid state.

8. A measurement method for an infrared transmission probe based on a microcontroller, characterized in that, The system applied to any one of claims 1 to 7 comprises the following steps: S1. The receiving unit detects the external wake-up conditions and sends an infrared wake-up signal to the transmitting unit through the infrared trigger module; S2. The infrared wake-up module of the transmitting unit receives the infrared wake-up signal and converts it into a square wave control signal. The transmitting system unit controls the transmitting unit to exit the sleep mode according to the pulse width of the square wave control signal. S3. The probe detection module detects the resistance change between the two probe electrodes, and outputs the corresponding level status signal to the transmitting system unit after filtering, hysteresis and comparison. S4. The transmitting system unit generates corresponding status data according to the level status signal, and outputs the carrier signal and the status data to the carrier modulation module. The carrier modulation module performs ASK modulation on the status data and then transmits the infrared measurement signal through the infrared driving module. S5. The receiving unit receives the infrared measurement signal through the infrared receiving module, and outputs a square wave signal after amplification, detection and shaping by the envelope detection module. The receiving system unit identifies the corresponding state according to the signal pulse width and controls the input / output module to output the corresponding state result signal. The state result signal includes a trigger valid signal, a reset invalid signal and a low battery alarm signal.

9. The measurement method for an infrared transmission probe based on a microcontroller according to claim 8, characterized in that, In step S2, the square wave control signal includes at least a start square wave and a shutdown square wave. The transmitting system unit distinguishes between the start command and the shutdown command by detecting the pulse width of the square wave control signal. When the command is recognized as a start command, the transmitter unit exits hibernation mode and enters working mode; When the power-off command is detected, the transmitting system unit shuts off the power supply to the probe detection module, carrier modulation module, and infrared drive module before entering sleep mode.

10. The measurement method for an infrared transmission probe based on a single-chip microcomputer according to claim 8, characterized in that, In step S3, the probe detection module sets the probe trigger threshold by adjusting the output voltage of the reference voltage regulator; When the detected voltage after filtering and hysteresis processing is lower than the trigger threshold, a high level is output as the trigger state. When the detected voltage after filtering and hysteresis processing is higher than the trigger threshold, a low level is output as a reset state. The method further includes: when the transmitting system unit detects that the battery voltage is lower than a preset threshold, generating low battery alarm data and sending it to the receiving unit through the carrier modulation module and the infrared drive module; After the receiving system unit recognizes the low battery alarm data, it controls the low battery alarm interface of the input / output module to output an alarm signal; and when the transmitting unit is in a standby and non-triggered state, the first state indication module outputs a standby indication, and when the transmitting unit is in a triggered transmission state, the first state indication module outputs a trigger indication, so as to indicate the current working state of the transmitting unit.