Intelligent laser displacement sensor circuit system, configuration method thereof and sensor
The design of the intelligent laser displacement sensor circuit system realizes the intelligent switching of sensor interface logic, solves the problems of selection difficulties and high inventory costs caused by the single interface standard, simplifies wiring work and improves the versatility and ease of use of the product.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN CHEVEN TECH
- Filing Date
- 2026-01-20
- Publication Date
- 2026-06-05
AI Technical Summary
Existing laser displacement sensors have a single interface standard, which makes it difficult for users to select the right model, complicated to wire, and has high inventory costs. In addition, the existing compatibility methods are complicated to operate and can easily lead to equipment damage.
Design an intelligent laser displacement sensor circuit system, including a main control unit, a laser measurement component, and a reconfigurable interface module. The intelligent switching of the sensor interface logic is realized through a switch output drive unit and a dual-mode input detection unit, supporting NPN and PNP mode switching. The software control logic of the main control unit can be selected to adapt to the interface requirements of different industrial sites.
It enables flexible switching of sensor interfaces, simplifies field wiring, reduces inventory types and management costs for manufacturers and users, and improves product versatility and ease of use.
Smart Images

Figure CN122149327A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of industrial precision measurement and automation control technology, specifically to an intelligent laser displacement sensor circuit system, its configuration method, and the sensor itself. Background Technology
[0002] Laser displacement sensors, as high-precision non-contact measuring devices, are widely used in industrial automated production lines, robot positioning, quality inspection, and other scenarios. They emit laser light and receive the reflected light signal from the object being measured, using principles such as triangulation to accurately calculate the displacement or distance of the object.
[0003] In industrial control systems, sensors typically need to interact with programmable logic controllers (PLCs) or other host computers. However, existing industrial control interface standards are not unified, mainly consisting of two logic types: NPN (sinking, active low) and PNP (source, active high). Therefore, traditional laser displacement sensors are usually designed with a single output / input mode, meaning manufacturers need to produce and sell separate hardware models for NPN and PNP sensors.
[0004] The inventors discovered that this traditional hardware design approach has several drawbacks in practical applications: First, it significantly increases the complexity and error rate of sensor selection. If the sensor model purchased by the user is incompatible with the PLC interface (for example, the PLC only supports PNP input, but the user mistakenly purchased an NPN sensor), it often requires returns or replacements, or the addition of relays or other conversion circuits, leading to cumbersome wiring and reduced system reliability. Second, for equipment manufacturers and end-user factories, to meet different field requirements, they have to stock two types of sensors, significantly increasing inventory management costs and capital tied up. Furthermore, while some existing sensors attempt compatibility through external physical wiring, the operation is complex and prone to damage due to wiring errors. Summary of the Invention
[0005] The purpose of this application is to provide an intelligent laser displacement sensor circuit system, its configuration method, and the sensor itself, in order to solve the technical problems of existing laser displacement sensors having a single interface standard, which leads to difficulties in user selection, complex wiring, and high inventory costs.
[0006] In a first aspect, this application provides an intelligent laser displacement sensor circuit system, including a main control unit, and a laser measurement component and a reconfigurable interface module that are electrically connected to the main control unit respectively; The laser measurement component is used to emit a laser to the object under test and collect the reflected light signal, and convert the reflected light signal into an electrical signal as a measurement signal and transmit it to the main control unit. The reconfigurable interface module includes: A digital output driver unit, whose signal input terminal is connected to the main control unit, is used to respond to the mode configuration command issued by the main control unit and configure the electrical characteristics of the output port to NPN output mode or PNP output mode. A dual-mode input detection unit is connected between an external signal input port and the main control unit; the dual-mode input detection unit includes a first signal branch and a second signal branch connected in parallel, the first signal branch is configured to conduct a low-level active signal, and the second signal branch is configured to conduct a high-level active signal. The main control unit is configured to: calculate displacement data based on the measurement signal, and control the output state of the switch output drive unit according to the displacement data; and activate the state monitoring of the first signal branch when the mode configuration instruction is NPN output mode; and activate the state monitoring of the second signal branch when the mode configuration instruction is PNP output mode.
[0007] Secondly, this application provides a configuration method for the intelligent laser displacement sensor circuit system as described in the first aspect, comprising the following steps: Get the operating mode setting command; According to the operating mode setting instruction, a control signal is sent to the switch output drive unit to set the output port to NPN output mode or PNP output mode; According to the operating mode setting instruction, the judgment logic of the input signal is determined: if it is set to NPN output mode, the level state of the first signal branch in the dual-mode input detection unit is read as a valid input; if it is set to PNP mode, the level state of the second signal branch in the dual-mode input detection unit is read as a valid input.
[0008] Thirdly, this application provides an intelligent laser displacement sensor, comprising: case; Optical lens assembly installed within the housing; And a smart laser displacement sensor circuit system as described in the first aspect, disposed inside the housing.
[0009] The intelligent laser displacement sensor circuit system, configuration method, and sensor provided in this application have the following beneficial effects: By setting up a reconfigurable interface module and utilizing a main control unit for coordinated hardware and software control, this application achieves intelligent switching of sensor interface logic. Specifically, by using a switch output drive unit to respond to mode configuration instructions, the same output port can flexibly switch between NPN and PNP modes, breaking down the barriers of traditional hardware models. Simultaneously, in conjunction with the first signal branch (low-level conduction) and the second signal branch (high-level conduction) connected in parallel in the dual-mode input detection unit, and the control logic of the main control unit selectively activating the status monitoring of the corresponding branch according to the mode instructions, the sensor can adaptively accommodate NPN (ground-triggered) or PNP (power-triggered) input signals through the same external physical port. This design allows a single sensor to simultaneously meet the interface requirements of different industrial sites. Users do not need to select separate models for NPN or PNP standards, which not only simplifies on-site wiring and avoids the trouble of conversion due to standard incompatibility, but also significantly reduces the types of inventory and management costs for manufacturers and users, greatly improving the product's versatility and ease of use.
[0010] These or other aspects of this application will become more apparent in the following description of the embodiments. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 A schematic diagram of the intelligent laser displacement sensor circuit system provided in an embodiment of this application is shown.
[0013] Figure 2 A schematic diagram of the dual-mode input detection unit provided in an embodiment of this application is shown.
[0014] Figure 3 A schematic diagram of an RS485 communication unit provided in an embodiment of this application is shown.
[0015] Figure 4 This paper shows another schematic diagram of the intelligent laser displacement sensor circuit system provided in an embodiment of this application.
[0016] Figure 5 A flowchart illustrating the configuration method of the intelligent laser displacement sensor circuit system provided in an embodiment of this application is shown.
[0017] Figure 6 Another flowchart of the configuration method of the intelligent laser displacement sensor circuit system provided in the embodiments of this application is shown. Detailed Implementation
[0018] To enable those skilled in the art to better understand the solutions of this application, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0019] In the embodiments of this application, it should be noted that, in this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0020] Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0021] It should be noted that in the embodiments of this application, "connection" can be understood as electrical connection. The connection between two electrical components can be a direct or indirect connection between the two electrical components. For example, the connection between A and B can be a direct connection between A and B, or an indirect connection between A and B through one or more other electrical components.
[0022] This application provides an intelligent laser displacement sensor circuit system. Figure 1 A schematic diagram of the intelligent laser displacement sensor circuit system provided in an embodiment of this application is shown, as follows: Figure 1 As shown, it includes a main control unit, as well as a laser measurement component and a reconfigurable interface module that are electrically connected to the main control unit.
[0023] The laser measurement component emits a laser beam towards the object being measured and collects the reflected light signal, converting it into an electrical signal as a measurement signal, which is then transmitted to the main control unit. Optionally, the laser measurement component is built based on the principle of optical triangulation. Specifically, the laser measurement component based on the principle of optical triangulation consists of a semiconductor laser and a photoelectric conversion device. The laser beam emitted by the semiconductor laser illuminates the surface of the object being measured, resulting in diffuse reflection. The reflected light is converged by a receiving lens group and imaged onto the photosensitive surface of the photoelectric conversion device. This photoelectric conversion device converts the received light spot energy into an electrical signal, the so-called "measurement signal," which, at the physical level, is typically represented by an analog voltage signal output by a sensor or digitized light intensity distribution data after analog-to-digital conversion. By acquiring the position information of this light intensity distribution data on the photosensitive surface and combining it with preset optical path geometric parameters, the main control unit can calculate the physical distance to the object being measured.
[0024] The reconfigurable interface modules include: The digital output driver unit, with its signal input terminal connected to the main control unit, responds to mode configuration commands issued by the main control unit to configure the electrical characteristics of the output port to NPN or PNP output mode. Optionally, "configuration" here refers to changing the current control method of the output port to the external load. In industrial control, the NPN output mode typically corresponds to a "sink" characteristic, meaning that when the output is valid, the output port provides a low-impedance path to the common ground (GND), drawing load current; while the PNP output mode typically corresponds to a "source" characteristic, meaning that when the output is valid, the output port provides a low-impedance path to the power supply (VCC), outputting current to the load. In this embodiment, the main control unit sends commands to control the digital output driver unit to switch between the above two electrical characteristics to adapt to external receiving devices of different standards.
[0025] A dual-mode input detection unit is connected between the external signal input port and the main control unit. The dual-mode input detection unit includes a first signal branch and a second signal branch connected in parallel. The first signal branch is configured to conduct a low-level active signal, and the second signal branch is configured to conduct a high-level active signal. Optionally, the dual-mode input detection unit employs a dual-path parallel design at the physical level. Specifically, the first signal branch is constructed as a path sensitive to low-level signals; that is, when the level of the external input port is pulled low to meet a low-level logic threshold (e.g., ground), this branch is in a conducting state. The second signal branch is constructed as a path sensitive to high-level signals; that is, when the level of the external input port is pulled high to meet a high-level logic threshold (e.g., connected to the positive power supply), this branch is in a conducting state. Since these two branches are connected in parallel to the same external physical port, regardless of whether the external input signal is low-level triggered or high-level triggered, one of the corresponding branches can be turned on, thereby achieving physical compatibility with input signals of different polarities.
[0026] The main control unit is configured to: calculate displacement data based on measurement signals and control the output state of the switch output drive unit according to the displacement data; and activate state monitoring of the first signal branch when the mode configuration command is NPN output mode; and activate state monitoring of the second signal branch when the mode configuration command is PNP output mode. Optionally, calculating displacement data means that the main control unit runs a specific measurement algorithm based on the optical triangulation principle to process the measurement signal obtained from the laser measurement component, thereby obtaining a precise distance value, and determining whether the distance value meets the preset switching action conditions. "Activating state monitoring" is a software-level logic selection mechanism. Although the first and second signal branches may exist simultaneously or be affected by external interference physically, the main control unit selectively uses the state change of the first or second signal branch as a valid control input according to the currently set operating mode (NPN or PNP). For example, when set to NPN mode, the logic of the main control unit only responds to the conduction state of the first signal branch and ignores the state of the second signal branch. This hardware and software collaboration ensures the accuracy of logical judgments when the sensor reuses the same input port.
[0027] It is understood that the main control unit is the core of the circuit system's operation and control hub. In terms of specific hardware implementation, it is not limited to a particular chip model, but rather refers to any processing device with data processing and logic control capabilities. For example, the main control unit can be a microcontroller unit (MCU), which combines low power consumption with rich peripheral interfaces; it can also be a digital signal processor (DSP) to meet the needs of high-speed mathematical operations on image data (such as subpixel fitting); or it can be a combination of a field-programmable gate array (FPGA) and an MCU to achieve parallel signal processing. The main control unit typically integrates non-volatile memory (Flash) for storing control programs and algorithms, random access memory (RAM) for caching process data, and general-purpose input / output interfaces (GPIO), analog-to-digital converters (ADCs), and communication interfaces (such as UART, SPI, and I2C). Those skilled in the art can select an appropriate chip model to perform the mode configuration, signal detection, and logic control tasks of this application based on the specific requirements of the sensor sampling frequency, measurement accuracy, and cost in the actual application.
[0028] The intelligent laser displacement sensor circuit system provided in this application achieves intelligent switching of sensor interface logic by setting up a reconfigurable interface module and utilizing a main control unit for coordinated control of hardware and software. Specifically, by using a switch output drive unit to respond to mode configuration instructions, the same output port can flexibly switch between NPN and PNP modes, breaking the barriers of traditional hardware models. Simultaneously, in conjunction with the first signal branch (low-level conduction) and the second signal branch (high-level conduction) connected in parallel in the dual-mode input detection unit, and the control logic of the main control unit selectively activating the status monitoring of the corresponding branch according to the mode instructions, the sensor can adaptively accommodate NPN (ground-triggered) or PNP (power-triggered) input signals through the same external physical port. This design allows a single sensor to simultaneously meet the interface requirements of different industrial sites, eliminating the need for users to select separate models for NPN or PNP standards. This not only simplifies on-site wiring and avoids the trouble of conversion due to standard incompatibility, but also significantly reduces the types of inventory and management costs for manufacturers and users, greatly improving the product's versatility and ease of use.
[0029] In some embodiments, the intelligent laser displacement sensor circuit system provided in this application provides... The first signal branch includes a first electronic switching element. The control terminal of the first electronic switching element is connected to an external signal input port and is configured to conduct when a low-level signal is applied to the external signal input port. Optionally, the first electronic switching element refers to any controllable switching device with negative logic characteristics. Physically, it is designed to be sensitive to ground. When the external signal input port is pulled low (e.g., connected to 0V / GND), an effective trigger voltage difference is formed between the control terminal of the element and the reference potential, thereby putting the switch on. This configuration is designed to adapt to the "NPN sensor" or "sinking input" logic commonly used in industrial automation from the hardware level, ensuring that the system can recognize low-level trigger signals.
[0030] The second signal branch includes a second electronic switching element. The control terminal of this second electronic switching element is connected to an external signal input port and is configured to conduct when a high-level signal is applied to the external signal input port. The second electronic switching element generally refers to any controllable switching device with positive logic characteristics. Physically, it is designed to be power-sensitive. When the external signal input port is pulled high (e.g., connected to a 12V / 24V power supply), the control terminal of this element receives sufficient drive energy to turn the switch on. This configuration is designed to accommodate "PNP sensor" or "source-type input" logic in industrial environments, ensuring the system can recognize high-level trigger signals.
[0031] The signal output terminals of the first and second electronic switching elements are independently connected to two different general-purpose input / output interfaces of the main control unit. Optionally, independent connection means that the output signals of the two switching elements are physically isolated and do not share the same line for transmission to the main control unit. For example, the state change of the first switching element is transmitted to the first pin of the main control unit through line A, while the state change of the second switching element is transmitted to the second pin of the main control unit through line B. This is done to prevent hardware level conflicts (Short Circuit) or logic confusion between the two parallel signals. By maintaining the independence of the physical channels, the main control unit can rely entirely on software logic (based on a preset NPN or PNP mode) to determine which pin's data to read, thereby achieving software-defined input logic selection.
[0032] In some embodiments, the first electronic switching element is a PNP transistor and the second electronic switching element is an NPN transistor.
[0033] The first signal branch and the second signal branch are also connected in series with diodes; A transient voltage suppression diode is also connected between the external signal input port and ground to provide surge protection for the input signal. This embodiment demonstrates in detail how to ensure the stable operation of the core switching element (transistor) in an industrial environment through peripheral auxiliary circuitry.
[0034] Figure 2 A schematic diagram of the dual-mode input detection unit provided in an embodiment of this application is shown, as follows: Figure 2 As shown in the illustration, in a specific implementation, the first electronic switching element in the first signal branch is a PNP transistor Q1. Its base is connected to the external input port via a series current-limiting resistor R1 and a diode D1 acting as a unidirectional conduction element. The anode of diode D1 is connected to the base of transistor Q1, and the cathode is connected to the external input port, allowing current to flow only from the base to the external port (when the external signal is low), while preventing any potential high-level signal from flowing back into the base. The emitter is connected to power supply V3P0, and a bias resistor R2 (pull-up resistor) is connected between the emitter and base to stabilize the static operating point and prevent transistor D1 from being mis-conducted when there is no signal. The collector is connected to a pin of the main control unit via resistor R3, and a capacitor C1 is connected in parallel to ground to filter out interference signals. The pin of the main control unit is configured as a general purpose input (GPIO Input) for real-time acquisition of the conduction status of the first signal branch. Specifically, when a low level (valid signal) is applied to the external input port, causing the PNP transistor Q1 to conduct, the power supply voltage is applied to this pin through the emitter and collector, causing it to detect a high level. The main control unit can determine that there is a valid NPN logic input signal by reading the high level of this pin.
[0035] In the second signal branch, the second electronic switching element is an NPN transistor Q2. Its base is connected to the external input port via a series current-limiting resistor R4 and a diode D2. Diode D2 is a Zener diode, with its cathode connected to the external input port and its anode connected to the base of transistor Q2. This connection method utilizes the reverse breakdown characteristic of the Zener diode to achieve high-level detection and threshold filtering. When the external input port is connected to an industrial voltage higher than the regulated value (e.g., 24V), the Zener diode reverse-breaks and conducts, allowing current to flow from the outside into the base, driving the NPN transistor Q2 to conduct. When the external input voltage is low or floating, the Zener diode is in the off state, effectively isolating low-voltage noise interference. The emitter is directly grounded, and a pull-down resistor R5 is connected between the base and emitter. The collector is connected to another pin of the main control unit, and the collector is connected to the power supply via a pull-up resistor R6, with a filter capacitor C2 connected in parallel. When the NPN transistor Q2 is turned on, its collector is pulled low to ground. The main control unit determines the presence of a valid high-level input signal by reading this low level. Furthermore, as a preferred anti-interference measure, the cathode of the Zener diode is connected to ground via an input filter capacitor C3 to filter out high-frequency noise and glitches in the external input signal, preventing instantaneous voltage spikes from falsely triggering the Zener diode.
[0036] like Figure 2 As shown, a transient voltage suppressor diode (TVS) is also connected between the external signal input port and ground. The TVS can conduct within nanoseconds to clamp the surge voltage of the input port within a safe range, protecting the transistors and diodes in the subsequent stages from being damaged.
[0037] Through the aforementioned independent pin connections, the main control unit can physically distinguish signals from different branches. When the system operates in NPN output mode, the main control unit's software logic only activates the status monitoring of the first signal branch, ignoring the status of the second signal branch; and vice versa. This software selection mechanism based on physical pin isolation ensures the accuracy of dual-mode parallel detection.
[0038] Understandable, Figure 2 The resistors shown (e.g., current-limiting resistors connected in series with the base, bias resistors connected between the base and emitter, pull-up / pull-down resistors at the collector, etc.) and capacitors (e.g., filter capacitors connected in parallel with the input or output) are peripheral auxiliary devices provided to optimize circuit performance. These devices are mainly used to limit current, establish a stable static operating point, filter high-frequency noise interference, and eliminate signal jitter, thereby improving the electromagnetic compatibility and stability of the circuit in complex industrial environments. However, these passive devices are not essential core components for the first or second signal branch in the embodiments of this application to achieve the core logic conduction function. Those skilled in the art can adapt the specific connection positions, quantities, or parameter values of the above resistors and capacitors according to the signal quality requirements or cost control needs of the actual application scenario, without departing from the core technical concept of this application, or delete some non-critical auxiliary devices. For example, in a scenario with a relatively ideal signal environment, some filter capacitors can be omitted; or, the above resistors can be replaced by other active loads with constant current or voltage regulation functions. All these modifications based on the technical teachings of this application should be covered within the protection scope of this application.
[0039] In some embodiments, the intelligent laser displacement sensor circuit system provided in this application includes a digital output driver chip as the switching output driving unit. The digital output driver chip has an enable control pin and a polarity selection pin, which are respectively connected to the main control unit. Optionally, the digital output driver chip can be a highly integrated general-purpose digital sensor driver. Such chips integrate a push-pull output stage composed of high-side MOSFETs and low-side MOSFETs. Its specific control logic includes two parts: mode configuration and output control. In mode configuration, a GPIO pin of the main control unit is connected to the polarity selection pin of the chip (usually labeled NPN or SEL). When the main control unit sets this pin high, the chip's internal logic configures the output stage to NPN mode (activating low-side drive, outputting sink current); when set low, the chip is configured to PNP mode (activating high-side drive, outputting outflow current). This design simplifies the complex hardware bridge switching to a single GPIO level toggle, realizing true software-defined hardware. In output control, another GPIO pin of the main control unit is connected to the chip's enable control pin (usually labeled EN or IN). Based on the displacement result calculated by the laser measurement component, the main control unit determines whether the output port is in the on (active) or off state by controlling the high or low level of this pin.
[0040] The digital output driver chip also features a fault feedback pin connected to the input port of the main control unit. The main control unit monitors the level of the fault feedback pin to determine whether an overcurrent or short-circuit fault has occurred at the output port. Optionally, the fault feedback pin (usually marked NFAULT) is typically an open-drain output pin, connected to the logic power supply via a pull-up resistor in the circuit. Its operation relies on integrated overcurrent detection, overtemperature protection, and undervoltage lockout circuitry. Specifically, when an external short circuit occurs at the output port (e.g., short-circuited to ground in PNP mode, or short-circuited to the power supply in NPN mode) or the load current exceeds the chip's set safety threshold (e.g., exceeding 200mA), the internal protection circuitry is triggered. This automatically shuts down the output stage to protect the MOSFET from burnout and pulls the NFAULT pin low. The main control unit can monitor the NFAULT pin's status in real time via interrupts or polling. Once a low-level signal is detected, the main control unit immediately identifies it as an "output fault" and executes the protection procedure. For example, forcibly pulling the enable control pin (EN) low completely cuts off the output while simultaneously displaying an error code (such as "ERR-SHORT") on a human-machine interface (such as an OLED screen) to prompt the user to check the external wiring. This mechanism, combining hardware self-protection and software monitoring, greatly improves the survivability of sensors in harsh industrial environments.
[0041] It is understood that although the above embodiments focus on describing the logic control function of the digital output driver chip, in actual industrial circuit design, in order to meet the stringent electromagnetic compatibility (EMC) and power integrity requirements of industrial environments, the digital output driver chip also needs to work in conjunction with necessary peripheral auxiliary circuits. Specifically, the peripheral auxiliary circuits include, but are not limited to: decoupling capacitors connected next to the chip's power supply pins to filter out power supply ripple and ensure the stability of the chip's internal logic operation; pull-up resistors connected to the fault feedback pin (NFAULT) to match the logic level of the open-drain output; and a protection network set between the output port and ground, which may include varistors (RV), Zener diodes, or transient voltage suppressor diodes (TVS). Among them, the varistor or TVS is used to absorb the high voltage surge that the output port may suffer, and the Zener diode is used to clamp the output voltage. Those skilled in the art should understand that the specific selection, quantity, and connection method of these components such as resistors, capacitors, Zener diodes, and varistors are conventional engineering designs carried out to improve circuit robustness, and their presence or absence or changes in specific parameters should not affect the protection of the core driving logic in this application.
[0042] In some embodiments, the reconfigurable interface module of the intelligent laser displacement sensor circuit system provided in this application further includes an RS485 communication unit. Figure 3 A schematic diagram of an RS485 communication unit provided in an embodiment of this application is shown, as follows: Figure 3 As shown, the RS485 communication unit includes: The communication transceiver connects to an RS485 differential signal interface on its bus side and to the main control unit on its logic side. Optionally, the transceiver is a core device for level conversion and protocol physical layer adaptation. Specifically, the main control unit outputs single-ended logic level signals (e.g., the TX / RX signals of the UART protocol, with a voltage of 3.3V or 5V), while the RS485 bus in the industrial field transmits differential signals (i.e., logic is represented by the voltage difference between two lines A and B). The transceiver's function is to convert the logic signals from the main control unit into differential signals with common-mode interference immunity before sending them to the bus, and vice versa. This design allows sensors to be integrated into the bus network of a PLC or industrial computer, enabling remote data transmission and parameter configuration.
[0043] An impedance matching control circuit, comprising a series-connected terminating resistor and an analog switch assembly, is connected across the two signal lines of an RS485 differential signal interface. Optionally, the impedance matching control circuit is designed to address signal reflection issues in long-distance communication. In the RS485 communication standard, when the communication line is long, if the signal encounters an impedance discontinuity at the end of the line, reflected waves will be generated, leading to signal distortion or communication errors. To eliminate this reflection, a resistor matching the characteristic impedance of the cable (standard value 120 ohms) is typically connected in parallel between the A and B lines at the end of the bus. The analog switch assembly is an electronic device that uses semiconductor characteristics (such as MOSFET transmission gates) to achieve signal switching. It has no mechanical contacts, a long lifespan, and a small size. In this embodiment, a 120-ohm precision resistor is connected in series with a single-channel analog switch assembly and directly connected across the A and B lines of the RS485 interface. Compared to the traditional method of connecting resistors via DIP switches or external jumpers, this purely electronic structure eliminates the need to open the sensor housing, making it more suitable for industrial sensors.
[0044] The main control unit is connected to the control terminal of the analog switch assembly and is used to control the closing or opening of the analog switch assembly by sending level signals, thereby connecting or removing the terminating resistor. Optionally, this implements a "software-defined" terminating resistor. Specifically, a GPIO pin of the main control unit (e.g., defined as RS485_RL_ON_OFF) is connected to the enable pin of the analog switch assembly. Its operating logic is as follows: Access Mode: When the user sets the device as an "RS485 terminal" via the sensor menu or host computer command, the main control unit outputs a high level (or effective level) to the analog switch, closing the switch. At this time, a 120-ohm resistor is physically connected between lines A and B, serving to absorb signal reflection.
[0045] Removal Mode (Intermediate Node): When the device is in the middle of the bus, the main control unit outputs a low level (or an invalid level), and the analog switch is disconnected. At this time, the resistor is in an open-circuit state and does not affect the bus impedance. This design greatly simplifies on-site debugging; users do not need to consult the manual or disassemble the device to install DIP switches, but can simply complete network impedance matching with a click in the software menu.
[0046] Understandably, in practical circuit applications, communication transceivers usually require the use of conventional peripheral auxiliary circuits. These peripheral circuits may include, for example, power filtering devices, signal conditioning devices, and necessary interface protection devices. The specific selection and connection of these devices are conventional design practices well known to those skilled in the art, and therefore will not be elaborated upon here.
[0047] In some embodiments of the intelligent laser displacement sensor circuit system provided in this application, the laser measurement component includes: A blue laser driving circuit is used to drive a semiconductor laser with a wavelength in the range of 400nm to 500nm. Optionally, this embodiment preferably uses a blue laser diode with a center wavelength of 405nm or 450nm. In industrial scenarios, when measuring red-hot metal objects (such as continuously cast steel billets), the objects themselves emit a large amount of infrared and red light, which seriously interferes with the reception of red laser light. At the same time, red laser light is prone to transmission when measuring transparent or translucent objects (such as glass and resin), making it impossible to accurately focus on the surface. Blue laser light, on the other hand, has a short wavelength and concentrated energy, and its reflectivity on the surface of red-hot objects is higher than that of red light. It is also less susceptible to interference from the thermal radiation of the object itself. For transparent objects, blue light is also more likely to undergo diffuse reflection on the surface. The blue laser driving circuit adopts an automatic power control (APC) topology, which dynamically adjusts the driving current by monitoring the feedback current of the photodiode built into the laser, ensuring that the laser output power remains constant during long-term operation and does not drift with temperature.
[0048] A linear image sensor is used to receive reflected light spots after refraction by an optical system. Optionally, a linear image sensor typically employs a linear CMOS (Linear Complementary Metal Oxide Semiconductor) array. Unlike traditional dot-shaped photodiodes, a linear image sensor consists of hundreds or thousands of tiny photosensitive pixels arranged in a straight line (e.g., 1024 or 2048 pixels). Its operation is as follows: a laser beam illuminates the surface of the object being measured, forming a light spot. This light spot is then converged by a receiving lens group, forming a light energy distribution band of a certain width on the photosensitive surface of the CMOS sensor. Driven by a clock signal, the CMOS sensor sequentially outputs the light intensity voltage value received by each pixel, thus forming an analog waveform or digital sequence describing the intensity distribution of the light spot. The position of this waveform on the sensor array (peak position), according to the principle of triangulation, directly corresponds to the distance to the object being measured.
[0049] The main control unit stores a sub-pixel fitting algorithm to calculate the center coordinates of the light spot based on the light intensity distribution data output by the linear image sensor. Optionally, sub-pixel refers to measurement precision exceeding the physical pixel size of the sensor. Since the light spot often covers more than one pixel on the CMOS (typically 3-5 pixels), if only the position of the physical pixel with the highest light intensity is used as the measurement result, its accuracy will be limited to the pixel pitch level (e.g., tens of micrometers), which cannot meet the requirements for precise measurement. Therefore, the main control unit performs mathematical modeling and calculation on the light intensity distribution waveform output by the CMOS by running a sub-pixel fitting algorithm (e.g., the center of gravity method or Gaussian fitting). This algorithm can calculate the virtual coordinate position of the light spot energy center based on the light intensity ratio of several adjacent pixels. For example, although the physical pixels are the 500th and 501st, the algorithm can calculate that the center of the light spot is precisely located at "500.45". In this way, the measurement resolution can be increased to 1 / 10 or even 1 / 100 of the physical pixel size, thereby achieving micron-level measurement accuracy.
[0050] In some embodiments, Figure 4 Another schematic diagram of the intelligent laser displacement sensor circuit system provided in this application embodiment is shown, such as... Figure 4 As shown, it also includes a human-computer interaction unit and an analog output unit.
[0051] The human-machine interface unit includes a display module and input buttons. The main control unit is configured to provide a mode selection interface through the display module and to obtain mode configuration commands input by the user through the input buttons. Optionally, the display module preferably uses an OLED (Organic Light Emitting Diode) display screen. The specific operation logic is as follows: the main control unit renders a multi-level menu interface (UI) on the OLED screen. The user navigates using the input buttons on the panel (e.g., "SET", "UP", "DOWN" keys). When the user enters the "I / O Settings" menu and selects "NPN Mode" or "PNP Mode" and confirms, the main control unit immediately captures the command and triggers the GPIO level toggling logic of Embodiment 1, thereby completing the reconstruction of the hardware circuit. In addition, the display module can also be used to display the current measured distance value, the light-receiving waveform of the simulated light spot, and the current analog output value in real time, realizing visualized parameter configuration and debugging.
[0052] The analog output unit is connected to the main control unit, which includes a digital-to-analog converter (DAC) chip. The main control unit is configured to control the DAC chip to switch between current output mode and voltage output mode via a serial communication interface. The DAC chip is a programmable industrial DAC integrating multiple output stage drivers. The main control unit communicates with the chip via a high-speed serial communication interface (such as SPI or I2C bus). Traditional sensors typically require users to select between 4-20mA current output and 0-10V voltage output by using different combinations of external terminals or by opening the casing and adjusting jumper caps. In this embodiment, however, the main control unit only needs to write specific configuration code to the control register inside the DAC chip to control the internal multiplexer and operational amplifier circuits, dynamically changing the electrical characteristics of the output pins. Current output mode (4-20mA): Suitable for long-distance transmission, strong anti-interference capability, and signal does not attenuate with line resistance. Voltage output mode (0-10V / 0-5V): Suitable for short-distance, high-impedance load control systems, facilitating direct reading by the data acquisition card. With software switching, users can flexibly adjust the sensor output format according to the requirements of downstream data acquisition devices (such as the AD module of a PLC) without changing the physical wiring.
[0053] It is understandable that in actual circuit design, analog output units are usually equipped with necessary peripheral auxiliary circuits, such as power supply decoupling capacitors, output filter networks, and interface protection devices. These peripheral devices are mainly used to ensure power supply stability, filter noise, and provide electrostatic protection. They are conventional designs well known to those skilled in the art, and their specific selection and connection methods do not constitute a limitation on the core solution of this application, so they will not be described in detail here.
[0054] This application also provides a configuration method for an intelligent laser displacement sensor circuit system. Figure 5A flowchart illustrating the configuration method of the intelligent laser displacement sensor circuit system provided in an embodiment of this application is shown, such as... Figure 5 As shown, it includes the following steps: S100: Obtain the operating mode setting command. Optionally, this step is typically performed by the input interface of the main control unit. The "operating mode setting command" can originate from a menu option selected by the user through the human-machine interface unit (buttons and display screen), or from a remote configuration data packet received from the host computer via the RS485 interface. The main control unit parses the command to identify whether the user currently expects an interface mode of NPN (sinking logic) or PNP (source logic).
[0055] S200: Based on the operating mode setting instruction, send a control signal to the digital output driver unit to set the output port to NPN output mode or PNP output mode. Optionally, this is a step to reconfigure the output-side hardware. If the instruction indicates NPN mode, the main control unit controls the GPIO connected to the polarity selection pin of the driver chip to output a specific level (e.g., high level), causing its internal circuitry to switch to a current sinking structure to ground; if the instruction indicates PNP mode, it controls the GPIO to output the opposite level (e.g., low level), causing it to switch to a current outflow structure.
[0056] S300: Based on the operating mode setting instruction, determine the input signal judgment logic: if set to NPN output mode, read the level state of the first signal branch in the dual-mode input detection unit as a valid input; if set to PNP mode, read the level state of the second signal branch in the dual-mode input detection unit as a valid input. Optionally, this is a software-defined step for the input-side logic. The main control unit internally runs a conditional judgment program. When the system is configured in NPN mode, the program only reads data from the register address connected to the first signal branch (low-level sensitive path) and ignores the port state connected to the second signal branch; conversely, when configured in PNP mode, the program switches the read address and only processes the data from the second signal branch (high-level sensitive path). This logic shielding mechanism ensures that, in the case of hardware parallel connection, the system will not be misled by the floating level or noise of inactive branches.
[0057] In some embodiments, Figure 6 Another flowchart illustrating the configuration method of the intelligent laser displacement sensor circuit system provided in this application embodiment is shown, such as... Figure 6 As shown, it also includes the following steps: S400: Obtains the terminating resistor control command and controls the on / off state of the analog switch component connected to the RS485 bus according to the terminating resistor control command to achieve automatic matching of the terminating resistor. Optionally, this step implements software configuration of the communication impedance. When the main control unit receives the command to turn on the terminating resistor, it sends a valid drive signal to the enable terminal of the analog switch component through GPIO, closes the switch, and thus physically connects the matching resistor to the RS485 differential bus; when it receives the command to turn off, it cancels the drive signal and disconnects the resistor.
[0058] This application also provides an intelligent laser displacement sensor, including: case.
[0059] An optical lens assembly is installed within the housing. This assembly includes an emitting lens, a receiving lens, and a filter. The emitting lens, located in front of the laser, collimates the diverging light emitted by the laser diode into a parallel, narrow beam that illuminates the surface of the object being measured. The receiving lens, located in front of the linear image sensor, collects the diffusely reflected light from the object and focuses it onto the sensor's photosensitive surface. The filter is configured as a narrow-bandpass filter with a center wavelength matching the laser wavelength. This filter allows only specific wavelengths (e.g., 405nm ± 10nm) of blue light to pass through, while filtering out other wavelengths from ambient light (e.g., sunlight, factory lighting). This significantly improves the signal-to-noise ratio (SNR) at the optical physics level, and, combined with subsequent circuitry algorithms, ensures measurement stability under complex lighting conditions.
[0060] The system also includes an intelligent laser displacement sensor circuit, as described in the above embodiment, housed within the housing. This intelligent laser displacement sensor circuit is typically integrated onto one or more printed circuit boards (PCBs). For example, the portion carrying the image sensor and laser (optical board) is rigidly fixed to the reference surface of the housing to ensure the long-term stability and non-deformation of the optical triangulation structure (the angle between the transmitting and receiving axes); while the portion carrying the power supply, MCU, and interface circuitry (main control board) is flexibly arranged at the rear of the housing for easy connection to external cables. This modular layout ensures measurement accuracy while making full use of the compact space within the housing.
[0061] The intelligent laser displacement sensor provided in this application embodiment achieves intelligent switching of sensor interface logic by setting a reconfigurable interface module and utilizing a main control unit for coordinated hardware and software control. Specifically, by using a switch output drive unit to respond to mode configuration instructions, the same output port can flexibly switch between NPN and PNP modes, breaking the barriers of traditional hardware models. Simultaneously, in conjunction with the first signal branch (low-level conduction) and the second signal branch (high-level conduction) connected in parallel in the dual-mode input detection unit, and the control logic of the main control unit selectively activating the status monitoring of the corresponding branch according to the mode instructions, the sensor can adaptively accommodate NPN (ground-triggered) or PNP (power-triggered) input signals through the same external physical port. This design allows a single sensor to simultaneously meet the interface requirements of different industrial sites, eliminating the need for users to select separate models for NPN or PNP standards. This not only simplifies on-site wiring and avoids the trouble of conversion due to standard incompatibility, but also significantly reduces the types of inventory and management costs for manufacturers and users, greatly improving the product's versatility and ease of use.
[0062] The above description, in conjunction with specific embodiments, provides a further detailed explanation of this application and should not be construed as limiting the specific implementation of this application to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of this application, and all such modifications and substitutions should be considered within the scope of protection of this application.
Claims
1. A smart laser displacement sensor circuit system, characterized in that, It includes a main control unit, as well as a laser measurement component and a reconfigurable interface module that are electrically connected to the main control unit. The laser measurement component is used to emit a laser to the object under test and collect the reflected light signal, and convert the reflected light signal into an electrical signal as a measurement signal and transmit it to the main control unit. The reconfigurable interface module includes: A digital output driver unit, whose signal input terminal is connected to the main control unit, is used to respond to the mode configuration command issued by the main control unit and configure the electrical characteristics of the output port to NPN output mode or PNP output mode. A dual-mode input detection unit is connected between an external signal input port and the main control unit; the dual-mode input detection unit includes a first signal branch and a second signal branch connected in parallel, the first signal branch is configured to conduct a low-level active signal, and the second signal branch is configured to conduct a high-level active signal. The main control unit is configured to: calculate displacement data based on the measurement signal, and control the output state of the switch output drive unit according to the displacement data; and activate the state monitoring of the first signal branch when the mode configuration instruction is NPN output mode; and activate the state monitoring of the second signal branch when the mode configuration instruction is PNP output mode.
2. The intelligent laser displacement sensor circuit system according to claim 1, characterized in that, The first signal branch includes a first electronic switch element, the control terminal of which is connected to the external signal input port and is configured to be turned on when a low-level signal is received at the external signal input port. The second signal branch includes a second electronic switch element, the control terminal of which is connected to the external signal input port and is configured to be turned on when a high-level signal is received at the external signal input port. The signal output terminals of the first electronic switch element and the second electronic switch element are independently connected to two different general-purpose input / output interfaces of the main control unit.
3. The intelligent laser displacement sensor circuit system according to claim 2, characterized in that, The first electronic switching element is a PNP transistor, and the second electronic switching element is an NPN transistor; The first signal branch and the second signal branch are also connected in series with diodes; A transient voltage suppression diode is also connected between the external signal input port and ground to provide surge protection for the input signal.
4. The intelligent laser displacement sensor circuit system according to claim 1, characterized in that, The digital output driver unit includes a digital output driver chip; the digital output driver chip has an enable control pin and a polarity selection pin, which are respectively connected to the main control unit; the digital output driver chip also has a fault feedback pin, which is connected to the input port of the main control unit, and the main control unit determines whether an overcurrent or short circuit fault has occurred at the output port by monitoring the level state of the fault feedback pin.
5. The intelligent laser displacement sensor circuit system according to claim 1, characterized in that, The reconfigurable interface module further includes an RS485 communication unit, which includes: A communication transceiver, whose bus side is connected to an RS485 differential signal interface and whose logic side is connected to the main control unit; An impedance matching control circuit includes a terminating resistor and an analog switch assembly connected in series, the impedance matching control circuit being connected across the two signal lines of the RS485 differential signal interface. The main control unit is connected to the control terminal of the analog switch assembly and is used to control the closing or opening of the analog switch assembly by sending level signals, thereby connecting or removing the terminating resistor.
6. The intelligent laser displacement sensor circuit system according to claim 1, characterized in that, The laser measurement component includes: Blue laser driving circuit, used to drive semiconductor lasers with wavelengths in the range of 400nm to 500nm; A linear image sensor used to receive reflected light spots after refraction by an optical system; The main control unit stores a subpixel fitting algorithm, which is used to calculate the center coordinates of the light spot based on the light intensity distribution data output by the linear image sensor.
7. The intelligent laser displacement sensor circuit system according to claim 1, characterized in that, It also includes a human-computer interaction unit and an analog output unit; The human-computer interaction unit includes a display module and input buttons. The main control unit is configured to provide a mode selection interface through the display module and to obtain the mode configuration command input by the user through the input buttons. The analog output unit is connected to the main control unit, which includes a digital-to-analog converter chip. The main control unit is configured to control the digital-to-analog converter chip to switch between current output mode and voltage output mode via a serial communication interface.
8. A configuration method for an intelligent laser displacement sensor circuit system as described in any one of claims 1 to 7, characterized in that, Includes the following steps: Get the operating mode setting command; According to the operating mode setting instruction, a control signal is sent to the switch output drive unit to set the output port to NPN output mode or PNP output mode; According to the operating mode setting instruction, the judgment logic of the input signal is determined: if it is set to NPN output mode, the level state of the first signal branch in the dual-mode input detection unit is read as a valid input; if it is set to PNP mode, the level state of the second signal branch in the dual-mode input detection unit is read as a valid input.
9. The configuration method according to claim 8, characterized in that, It also includes the following steps: Obtain the terminating resistor control command, and control the on / off state of the analog switch assembly connected to the RS485 bus according to the terminating resistor control command to achieve automatic matching of the terminating resistor.
10. An intelligent laser displacement sensor, characterized in that, include: case; Optical lens assembly installed within the housing; And the intelligent laser displacement sensor circuit system as described in any one of claims 1 to 7, disposed inside the housing.