A single-interface-based multi-light-source control apparatus and method
Patent Information
- Application Number
- CN202610671633.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-15
- Publication Date
- 2026-08-18
AI Technical Summary
[0002]在工业相机现场图像采集过程中,图像采集装置核心包含工业相机模块与光源模块,如图1所示,常规接口仅设置相机通信接口、相机触发接口和单一光源接口,仅能实现单一路径的光源供电与控制
1.本发明提供的一种基于单接口的多光源控制装置,完全复用现有工业相机的标准相机接口,无需新增任何控制、通信、供电接口,无需改造原有图像采集设备的硬件与接口布局,可直接无缝对接市面上主流品牌的工业相机与图像采集装置,大幅降低设备改造成本,适配性极强;仅通过相机触发引脚Trig连接单根信号线,实现时序识别、光源控制指令的传输,无需额外布设通信总线,大幅简化工业现场的布线复杂度,降低安装、调试与后期维护成本,同时减少了线缆带来的信号干扰风险,提升系统稳定性。
Smart Images

Figure CN122602347A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial visual inspection technology, specifically to a multi-light source control device and method based on a single interface. Background Technology
[0002] In the process of on-site image acquisition using industrial cameras, the core of the image acquisition device includes an industrial camera module and a light source module, such as... Figure 1 As shown, the conventional interface only has a camera communication interface, a camera trigger interface, and a single light source interface, which can only realize the power supply and control of a single path of light source.
[0003] In industrial inspection scenarios, different inspection targets and environments have different requirements for the type of light source. For example, some inspection scenarios require infrared light sources, while others require white light sources. To achieve dual or multiple light source switching, the existing solution is to add additional light source interfaces and control interfaces. However, this solution not only increases the complexity of equipment wiring and the installation and maintenance costs in industrial sites, but also leads to a decrease in equipment integration compatibility due to interface expansion. It cannot adapt to the interface layout of existing conventional image acquisition devices, thus limiting the flexibility and adaptability of industrial vision inspection.
[0004] Therefore, there is an urgent need for a device and method that can achieve precise switching and control of dual or even multiple light sources without increasing the number of existing interfaces, adapting to the actual application needs of industrial sites. Summary of the Invention
[0005] This invention proposes a multi-light source control device and method based on a single interface, which can realize the precise switching and control of dual or even multiple light sources without increasing the number of existing interfaces. It also takes into account compatibility, convenience and control accuracy, and is suitable for the actual application needs of industrial sites.
[0006] A multi-light source control device based on a single interface is adapted to the camera interface of existing image acquisition devices without adding any new hardware interfaces. It includes a power supply module, an MCU logic processing module, a light source control module, and at least two light source units. The input terminal of the power module is electrically connected to the power supply pin VCC and the ground pin GND of the camera interface, and is used to convert the wide input voltage into a stable low-voltage DC voltage. The output terminal of the power module supplies power to the MCU logic processing module and the light source control module. The power supply terminal of the MCU logic processing module is electrically connected to the output terminal of the power supply module. The signal acquisition terminal of the MCU logic processing module is electrically connected to the trigger pin Trig of the camera interface. The control output terminal of the MCU logic processing module is electrically connected to the light source control module. The MCU logic processing module has a built-in non-volatile memory unit for storing a light source flag bit that represents the current working light source type. The input terminal of the light source control module is electrically connected to the control output terminal of the MCU logic processing module, the common terminal of the light source control module is electrically connected to the light source output pin LED+ of the camera interface, and the multiple output terminals of the light source control module are respectively electrically connected to the power supply terminals of each of the light source units.
[0007] Preferably, the light source control module includes a relay driving unit and a relay switching unit. The power supply terminal of the relay driving unit is electrically connected to the output terminal of the power supply module, the signal input terminal of the relay driving unit is electrically connected to the control output terminal of the MCU logic processing module, and the power output terminal of the relay driving unit is electrically connected to the relay switching unit. The relay switching unit uses a relay with an adapted number of contacts. The common terminal of the relay switching unit is electrically connected to the light source interface of the camera interface, and the multiple contact terminals of the relay switching unit are respectively electrically connected to the power supply terminals of each of the light source units. By opening or closing the relay contacts, the power supply path of different light source units is switched, thereby turning the corresponding light source on or off.
[0008] Preferably, the light source unit is provided with at least an infrared light source and a white light source, and also includes any one or more of an ultraviolet light source, a polarized light source, and a coaxial light source.
[0009] Preferably, the MCU logic processing module adopts an industrial-grade microcontroller with built-in flash memory as a non-volatile storage unit and reserves at least 3 general-purpose I / O ports, i.e., general-purpose input / output ports, for expanding the control of more light sources.
[0010] Preferably, the device interfaces with the camera interface and the light source unit via a dedicated interface, and the pins of the dedicated interface are compatible with the camera interface of existing image acquisition devices.
[0011] A multi-source control method based on a single interface, applied to the aforementioned multi-source control device based on a single interface, includes the following steps: S1. Initialize the light source state: After the device is powered on, the MCU logic processing module reads the light source flag bit stored in the flash memory, and outputs the corresponding control signal to the light source control module according to the light source flag bit. This drives the light source control module to switch the power supply path to the light source unit corresponding to the light source flag bit, maintain the power supply output of the light source, and complete the initialization. S2. Real-time acquisition timing: The MCU logic processing module acquires the electrical signal timing of the Trig trigger pin in real time through the Trig trigger pin of the camera interface, realizing single-wire communication with the camera trigger signal; S3. Timing type identification and judgment: The MCU logic processing module analyzes the acquired electrical signal timing and determines whether the electrical signal timing is the preset light source operation timing. If it is the light source operation timing, proceed to step S4; if it is not the light source operation timing, maintain the current output state of the light source and proceed to step S2. S4. Target Light Source Type Analysis: The MCU logic processing module analyzes the light source operation timing based on the preset timing characteristics and the correspondence between light source types to determine the required target light source type. S5. Light source state consistency comparison: Compare the target light source type obtained by parsing with the light source type corresponding to the light source flag bit stored in the current non-volatile memory unit; if the two are consistent, maintain the current output state of the light source and return to step S2; if the two are inconsistent, the MCU logic processing module outputs the corresponding light source switching control signal to the light source control module and proceeds to step S6. S6. Multi-light source switching control: After receiving the switching control signal from the MCU, the light source control module executes a contact switching action, disconnects the power supply path of the current working light source, and engages the power supply path corresponding to the target light source to complete the light source switching and realize the power supply output of the target light source. S7. Update the light source flag: After the light source switching is completed, the MCU logic processing module writes the light source flag corresponding to the target light source into its internal non-volatile storage unit, overwriting the original light source flag, completing the update of the light source status, and returns to step S2.
[0012] Preferably, in step S3, a conventional camera shooting trigger sequence and a light source operation sequence are preset. The conventional camera shooting trigger sequence and the light source operation sequence have distinguishable timing characteristics. The light source operation sequence is equipped with a dedicated start flag. The MCU logic processing module determines whether to enter the light source operation sequence by recognizing the start flag.
[0013] Preferably, in step S4, the timing feature is the number of edge changes of the trigger signal within a preset time window. The MCU logic processing module identifies the number of edge changes and establishes a one-to-one correspondence with each light source, thereby realizing the identification and control of multiple light sources.
[0014] Preferably, in step S2, the MCU logic processing module samples the trigger signal at a preset sampling frequency, wherein the sampling frequency meets the timing recognition accuracy requirements.
[0015] After adopting the above technical solution, the beneficial effects of the present invention are: 1. This invention provides a multi-light source control device based on a single interface, which completely reuses the standard camera interface of existing industrial cameras. It does not require any new control, communication, or power supply interfaces, nor does it require modification of the hardware and interface layout of the original image acquisition equipment. It can directly and seamlessly connect to mainstream industrial cameras and image acquisition devices on the market, greatly reducing equipment modification costs and exhibiting strong adaptability. It only connects a single signal line through the camera trigger pin Trig to realize timing recognition and transmission of light source control commands. It does not require additional communication bus deployment, greatly simplifying the wiring complexity in industrial sites, reducing installation, debugging, and subsequent maintenance costs, while also reducing the risk of signal interference from cables and improving system stability.
[0016] 2. The present invention provides a multi-light source control device based on a single interface, which physically isolates the dedicated light source operation timing from the conventional camera shooting trigger timing, thereby avoiding false triggering from the root. It has high timing recognition accuracy and fast light source switching response speed. It adopts relay hardware to switch the power supply path, which is suitable for the complex electromagnetic environment of industrial sites and has high reliability in long-term operation. The MCU has a built-in non-volatile memory unit to store the light source flag bit. The working state is not lost after the device is powered off, and it automatically restores the light source state to the last working state after power-on, without the need for repeated configuration, which greatly improves the operating efficiency in industrial sites.
[0017] 3. This invention provides a multi-light source control method based on a single interface. The single-interface multi-light source control device acquires and analyzes the light source operation timing sequence via a single line, determines the target light source type, compares it with the current light source flag, and automatically switches between two light sources. After switching, it updates the light source flag in the FLASH memory within the MCU logic processing module. This single-line timing acquisition and analysis enables automatic control of multiple light sources, eliminating the need for additional control software configuration or manual light source switching. It also features a power-off memory function for light source states—automatically restoring the light source state to its previous state after power-on, without requiring repeated parameter configuration, significantly improving operational efficiency in industrial settings. Furthermore, the single-line communication design greatly simplifies wiring complexity in industrial environments, reduces signal interference risks from cables, and lowers the manpower and material costs of installation, commissioning, and subsequent maintenance.
[0018] 4. The present invention provides a multi-source control method based on a single interface. By establishing the correspondence between time-series characteristic parameters and source types, it can be flexibly expanded to the identification and control of three or more sources without modifying the core control logic. The source type can be freely replaced according to the detection requirements, which can adapt to the diverse image acquisition needs of different industrial detection scenarios such as product appearance defect detection, barcode recognition, size measurement, and high-precision positioning. This solves the problem of fixed number of sources and limited adaptability of existing multi-source control methods.
[0019] 5. The present invention provides a multi-source control method based on a single interface. The control process is simple and orderly. From system initialization, timing acquisition, and type judgment to light source switching and state update, a complete closed-loop control is formed. The logic is rigorous and easy to implement. The core control relies on conventional industrial-grade MCU and relay components, without the need for complex hardware support. The control cost is low, and it can be applied in batches to various industrial machine vision inspection systems. The industrialization and promotion are easy, and it can achieve precise control of multiple light sources at a low cost, thereby improving the efficiency and quality of industrial inspection. Attached Figure Description
[0020] Figure 1 This is a block diagram of the interface and structure of a single-light source image acquisition device in the prior art; Figure 2 This is a block diagram showing the interface and structure of a multi-light source control device applied to an image acquisition device; Figure 3 This is a block diagram showing the interface and structure of a dual-light source control device applied to an image acquisition device; Figure 4 This is a structural block diagram of an embodiment of the present invention; Figure 5 This is a schematic diagram of the hardware circuit of the device according to an embodiment of the present invention; Figure 6 This is a flowchart illustrating a multi-source control method based on a single interface according to an embodiment of the present invention. Figure 7 This is a timing waveform diagram of an embodiment of the present invention. Detailed Implementation
[0021] The invention will now be further described with reference to the accompanying drawings.
[0022] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0023] like Figure 1-5As shown, a multi-light source control device based on a single interface is adapted to the standard camera interface of existing image acquisition devices without adding any new hardware interfaces. It includes a power supply module, an MCU logic processing module, a light source control module, and at least two light source units. The light source units include at least an infrared light source and a white light source, and can be expanded to any type of industrial vision light source such as an ultraviolet light source, a polarized light source, or a coaxial light source according to detection requirements.
[0024] The power module's input is electrically connected to the camera interface's power supply pin VCC and ground pin GND, converting a wide input voltage into a stable low-voltage DC voltage. Specifically, it converts a wide input voltage of 5V-12V into a stable low-voltage DC voltage of 3V. The power module's output powers the MCU logic processing module and the light source control module. The core of the power module uses an industrial-grade voltage regulator chip, supporting wide voltage input and adapting to the power supply specifications of most industrial cameras on the market. It also features soft-start and overcurrent protection functions to ensure power supply stability.
[0025] The power supply terminal of the MCU logic processing module is electrically connected to the output terminal of the power supply module. The signal acquisition terminal of the MCU logic processing module is electrically connected to the Trig pin of the camera interface. The control output terminal of the MCU logic processing module is electrically connected to the light source control module. The MCU logic processing module has a built-in non-volatile memory unit to store the light source flag bit that represents the current working light source type. The MCU logic processing module uses an industrial-grade microcontroller with built-in flash memory as its non-volatile memory unit and reserves at least three general-purpose I / O ports, which are general-purpose input / output ports for expanding the control of more light sources.
[0026] The input terminal of the light source control module is electrically connected to the control output terminal of the MCU logic processing module. The common terminal of the light source control module is electrically connected to the light source output pin LED+ of the camera interface. The multiple output terminals of the light source control module are electrically connected to the power supply terminals of each light source unit respectively.
[0027] The light source control module includes a relay drive unit and a relay switching unit. The power supply terminal of the relay drive unit is electrically connected to the output terminal of the power supply module, the signal input terminal of the relay drive unit is electrically connected to the control output terminal of the MCU logic processing module, and the power output terminal of the relay drive unit is electrically connected to the relay switching unit. The relay switching unit uses relays with an adaptable number of contacts. The common terminal of the relay switching unit is electrically connected to the light source interface of the camera interface, and the multiple contact terminals of the relay switching unit are respectively electrically connected to the power supply terminals of each light source unit. By opening or closing the relay contacts, the power supply path of different light source units is switched, thereby realizing the lighting and shutdown of the corresponding light source.
[0028] The device interfaces with the camera interface and light source unit via a dedicated interface, and the pins of the dedicated interface are compatible with the camera interface of existing image acquisition devices.
[0029] like Figure 3-5 As shown, this embodiment of the invention provides a dual-light source control device based on a single interface, which is compatible with the standard camera interface of existing image acquisition devices without adding any new hardware interfaces. It includes a power module, an MCU logic processing module, a light source control module, and two light source units. The two light source units include an infrared light source and a white light source. The positive terminal of the infrared light source is connected to pin 1 of CN2, and the negative terminal is connected to pin 2 of CN2. The positive terminal of the white light source is connected to pin 3 of CN2, and the negative terminal is connected to pin 2 of CN2. The two light sources share a common negative terminal, which further simplifies the wiring.
[0030] In one implementation, the device interfaces with an existing camera interface via the CN1 interface. Pin 1 of CN1 is connected to VCC, pin 2 to GND, pin 3 to TRIG, pin 4 to LED+, and pin 5 to LED-, which fully matches the interface definition of existing conventional industrial cameras. It interfaces with a multi-source light source unit via the CN2 interface. Pin 1 of CN2 is connected to LED1+, pin 2 to LED-, and pin 3 to LED2+, which can be expanded to correspond to more light sources and adapt to the needs of multi-source light source expansion.
[0031] In one implementation, the core of the power module uses an industrial-grade voltage regulator chip U1. In this embodiment, U1 is a TPS82130SILR voltage regulator chip. The VIN pin (pin 2) and EN pin (pin 1) of U1 are both connected to pin 1 (VCC) of CN1. The input voltage range is 5V-12V, compatible with the power supply specifications of most industrial cameras on the market. The EN pin (pin 1) of U1 is shorted to the VIN pin to achieve automatic power-on. The GND pin (pin 3) and EP pin of U1 are both connected to CN1. Pin 2 (GND); The SS / TR pin (pin 8) of U1 is grounded through capacitor C4 (3.3nF) to achieve soft start and avoid power-on shock; The FB pin (pin 6) of U1 is grounded through voltage divider resistors R1 (140kΩ) and R2 (51kΩ) to configure the output voltage to 3V; The VOUT pins (pins 4 and 5) of U1 are grounded through parallel capacitors C2 (22μF) and C3 (100nF) to achieve output filtering and stabilize the output 3V DC voltage to power the MCU logic processing module and the light source control module.
[0032] As one implementation method, the core of the MCU logic processing module adopts an industrial-grade microcontroller U4. In this embodiment of the invention, U4 is an STM32C011J6M6 microcontroller. The VDD / VDDA pin (pin 2) of U4 is connected to the 3V output terminal of the power supply module, and the VSS / VSSA pin (pin 3) of U4 is connected to GND. The PB7 / PC14 pin (pin 1) of U4 is connected to pin 3 (TRIG) of CN1 as a timing acquisition terminal to capture the timing of electrical signals on the TRIG line in real time. The PA11[PA9] / PA8 pin (pin 5) of U4 is used as a control output terminal to connect to the light source control module. At the same time, general-purpose input and output ports such as PA0 / PA1 / PA2 / PF2, PA12[PA10], PA13, PB6 / PA14 / PC15 are reserved to support the expansion of 3 or more light sources. U4 has a built-in 8KB FLASH memory unit to store the light source flag bit and realize the memory of the power-off state.
[0033] In one implementation, the core of the relay driving unit uses a relay driving chip U2. In this embodiment, U2 is selected as DRV8210DRLR. The VM pin (pin 5) of U2 is connected to a 3V power supply, and the GND pin (pin 3) and IN2 pin (pin 2) are both connected to GND. The IN1 pin (pin 1) of U2 is connected to the PA11[PA9] / PA8 pin (pin 5) of U4 to receive the control signal from the MCU. The OUT1 pin (pin 6) and OUT2 pin (pin 4) of U2 are respectively connected to the two ends of the coil of U3 to drive the relay coil to operate. The relay switching unit is relay U3. In this embodiment of the invention, U3 is an IM01GR relay. Pin 1 of U3 is connected to pin OUT2 (pin 4) of U2, pin 8 of U3 is connected to pin OUT1 (pin 6) of U2, normally closed contact pins 2 and 7 of U3 are connected to pin 1 of CN2 (LED1+, corresponding to the infrared light source), normally open contact pins 4 and 5 of U3 are connected to pin 3 of CN2 (LED2+, corresponding to the white light source), and pins 3 and 6 of U3 are connected to pin 1 of CN2 (LED+), thus realizing the switching of the power supply path between the two light sources. By replacing the multi-contact relay, the switching control of three or more light sources can be expanded. The relay driver chip receives the control signal from the MCU logic processing module and drives the relay contacts to close / open, realizing the switching of the power supply path between the infrared light source and the white light source, and completing the hardware control of the dual light source.
[0034] The light source unit includes an infrared light source and a white light source. The positive terminal of the infrared light source is connected to pin 1 of CN2, and the negative terminal is connected to pin 2 of CN2. The positive terminal of the white light source is connected to pin 3 of CN2, and the negative terminal is connected to pin 2 of CN2. The infrared light source and the white light source share the same negative terminal, which further simplifies the wiring.
[0035] A multi-source control method based on a single interface, applied to the aforementioned multi-source control device based on a single interface, includes the following steps: S1. Initialize the light source state: After the device is powered on, the MCU logic processing module reads the light source flag bit stored in the FLASH, and outputs the corresponding control signal to the light source control module according to the light source flag bit. This drives the light source control module to switch the power supply path to the light source unit corresponding to the light source flag bit, maintain the power supply output of the light source, and complete the initialization.
[0036] S2. Real-time acquisition timing: The MCU logic processing module acquires the electrical signal timing of the Trig pin in real time through the Trig pin of the camera interface, realizing single-wire communication with the camera trigger signal; the MCU logic processing module samples the Trig signal at a preset sampling frequency, and the sampling frequency meets the timing recognition accuracy requirements.
[0037] S3. Timing Type Identification and Judgment: The MCU logic processing module analyzes the acquired electrical signal timing and determines whether the electrical signal timing is a preset light source operation timing. If it is a light source operation timing, proceed to step S4; otherwise, maintain the current output state of the light source and proceed to step S2. The preset conventional camera shooting trigger timing and light source operation timing have distinguishable timing characteristics. The light source operation timing has a unique start flag. The MCU logic processing module identifies the start flag to determine whether to enter the light source operation timing.
[0038] S4. Target Light Source Type Analysis: The MCU logic processing module analyzes the light source operation timing based on the preset timing characteristics and the correspondence between light source types to determine the required target light source type. The timing characteristics are the number of edge changes of the Trig signal within the preset time window. The MCU logic processing module identifies the number of edge changes and establishes a one-to-one correspondence with each light source to realize the identification and control of multiple light sources.
[0039] S5. Light source state consistency comparison: Compare the target light source type obtained by parsing with the light source type corresponding to the light source flag bit stored in the current non-volatile memory unit; if the two are consistent, maintain the current output state of the light source and return to step S2; if the two are inconsistent, the MCU logic processing module outputs the corresponding light source switching control signal to the light source control module and proceeds to step S6.
[0040] S6. Multi-light source switching control: After receiving the switching control signal from the MCU, the light source control module executes a contact switching action, disconnects the power supply path of the current working light source, and engages the power supply path corresponding to the target light source to complete the light source switching and realize the power supply output of the target light source.
[0041] S7. Update the light source flag: After the light source switching is completed, the MCU logic processing module writes the light source flag corresponding to the target light source into its internal non-volatile storage unit, overwriting the original light source flag, completing the update of the light source status, and returns to step S2.
[0042] like Figure 6-7 As shown, a multi-source control method based on a single interface, applied to the multi-source control device based on a single interface provided in this embodiment of the invention, includes the following steps: S1. Initialize the light source state: After the device is powered on, U4 immediately reads the light source flag bit stored in its internal FLASH. If it is the light source flag bit corresponding to the infrared light source, U4 outputs a control signal to U2, driving the normally closed contact of U3 to close, and the infrared light source is connected to the LED+ and LED- circuits to keep it lit. If it is the light source flag bit corresponding to the white light source, U4 outputs a control signal to U2, driving the normally open contact of U3 to close, and the white light source is connected to the circuit to keep it lit. The power-on initialization is completed, and the automatic recovery from the power-off state is realized.
[0043] S2. Real-time timing acquisition: U4 acquires the electrical signal timing on the TRIG line in real time at the set sampling frequency through the PB7 / PC14 pin (pin 1), ensuring the accuracy of timing identification. Control commands are received through only this one TRIG line, without the need for additional communication lines.
[0044] S3. Timing Type Identification and Judgment: U4 analyzes the acquired timing signal to determine whether it is a preset light source operation timing sequence. In this embodiment of the invention, the preset conventional camera shooting trigger timing sequence is: a single pulse signal with a high level lasting 10ms, such as... Figure 7 As shown in the first curve; the starting flag of the preset light source operation sequence is: the TRIG signal is high for 50ms. When U4 detects that the TRIG signal is high for 50ms, it determines that the light source operation sequence has been entered. Otherwise, it is determined to be the normal shooting trigger sequence, and the current light source output state is maintained. Then, it returns to step S2 to continue the acquisition.
[0045] S4. Target Light Source Type Analysis: After determining the entry into the light source operation sequence, U4 detects the number of rising edges of the TRIG signal within a subsequent 40ms time window, and determines the target light source based on the number of rising edges. If one rising edge is detected within a 40ms time window, the corresponding target light source is light source number 1 (infrared light source). Figure 7 As shown in the second curve; If two rising edges are detected within a 40ms time window, the corresponding target light source is light source number 2 (white light source). Figure 7 As shown in the third curve; If three or more rising edges are detected, additional light sources such as No. 3 and No. 4 can be added to achieve multi-light source expansion. If there is no rising edge or other invalid conditions, the timing is determined to be invalid. The current light source state is maintained, and the process returns to step S2.
[0046] S5. Light source state consistency comparison: U4 compares the parsed target light source with the light source corresponding to the light source flag bit stored in the current FLASH: If the two are consistent, there is no need to switch. Maintain the current light source output and return to step S2 to continue collecting timing data. If the two are inconsistent, U4 outputs the corresponding switching control signal to U2 through the PA11 and PA12 pins to proceed to the next step.
[0047] S6. Multi-light source switching control: After receiving the control signal from the MCU, U2 outputs the corresponding drive current to drive the coil of U3 to disconnect the power supply path of the current light source, attract the contact corresponding to the target light source, connect the target light source to the LED+ and LED- power supply circuit, complete the light source switching, and realize the stable lighting of the target light source.
[0048] S7. Update the light source flag: After the light source switching is completed, U4 writes the light source flag corresponding to the target light source into the internal FLASH, overwriting the original flag, completing the update of the light source status, and returns to step S2 to continue to collect TRIG timing in real time, realizing the cyclic automatic control of multiple light sources.
[0049] This embodiment is merely a preferred implementation of the present invention and is not intended to limit the invention. Those skilled in the art can make reasonable adjustments within the technical solution of the present invention. For example, the start flag of the light source operation timing can be changed to a continuous low level, the timing characteristic can be changed to the number of falling edges, the timing parameters can be adjusted, the light source type can be changed to an ultraviolet light source, a polarized light source, or a coaxial light source, and the control of three or more light sources can be achieved by expanding the relay contacts and the MCU's I / O ports. All equivalent transformations and improvements made based on the technical solution of the present invention fall within the protection scope of the present invention.
Claims
1. A multi-light source control device based on a single interface, characterized in that, It adapts to the camera interface of existing image acquisition devices without adding any new hardware interfaces, including a power module, MCU logic processing module, light source control module and at least two light source units; The input terminal of the power module is electrically connected to the power supply pin and ground pin of the camera interface, and is used to convert the input wide voltage into a stable low-voltage DC voltage. The output terminal of the power module supplies power to the MCU logic processing module and the light source control module. The power supply terminal of the MCU logic processing module is electrically connected to the output terminal of the power supply module, the signal acquisition terminal of the MCU logic processing module is electrically connected to the trigger pin of the camera interface, the control output terminal of the MCU logic processing module is electrically connected to the light source control module, and the MCU logic processing module has a built-in non-volatile memory unit for storing a light source flag bit that represents the current working light source type. The input terminal of the light source control module is electrically connected to the control output terminal of the MCU logic processing module, the common terminal of the light source control module is electrically connected to the camera interface, and the multiple output terminals of the light source control module are respectively electrically connected to the power supply terminals of each of the light source units.
2. The multi-light source control device based on a single interface according to claim 1, characterized in that, The light source control module includes a relay driving unit and a relay switching unit. The power supply terminal of the relay driving unit is electrically connected to the output terminal of the power supply module. The signal input terminal of the relay driving unit is electrically connected to the control output terminal of the MCU logic processing module. The power output terminal of the relay driving unit is electrically connected to the relay switching unit. The relay switching unit uses a relay with an adapted number of contacts. The common terminal of the relay switching unit is electrically connected to the light source interface of the camera interface, and the multi-contact terminals of the relay switching unit are respectively electrically connected to the power supply terminals of each of the light source units.
3. The multi-light source control device based on a single interface according to claim 1, characterized in that, The light source unit is provided with at least an infrared light source and a white light source, and also includes any one or more of an ultraviolet light source, a polarized light source, and a coaxial light source.
4. The multi-light source control device based on a single interface according to claim 1, characterized in that, The MCU logic processing module adopts an industrial-grade microcontroller with built-in flash memory as a non-volatile storage unit and reserves at least three general-purpose input / output ports for expanding the control of more light sources.
5. The multi-light source control device based on a single interface according to claim 1, characterized in that, The device interfaces with the camera interface and the light source unit via a dedicated interface, and the pins of the dedicated interface are compatible with the camera interface of existing image acquisition devices.
6. A multi-source control method based on a single interface, characterized in that, The application of a multi-light source control device based on a single interface as described in any one of claims 1-5 includes the following steps: S1. Initialize the light source state: After the device is powered on, the MCU logic processing module reads the light source flag bit stored in the flash memory, and outputs the corresponding control signal to the light source control module according to the light source flag bit. This drives the light source control module to switch the power supply path to the light source unit corresponding to the light source flag bit, maintain the power supply output of the light source, and complete the initialization. S2. Real-time acquisition timing: The MCU logic processing module acquires the electrical signal timing of the trigger pin in real time through the trigger pin of the camera interface, realizing single-wire communication with the camera trigger signal; S3. Timing type identification and judgment: The MCU logic processing module analyzes the acquired electrical signal timing and determines whether the electrical signal timing is the preset light source operation timing. If it is the light source operation timing, proceed to step S4; if it is not the light source operation timing, maintain the current output state of the light source and proceed to step S2. S4. Target Light Source Type Analysis: The MCU logic processing module analyzes the light source operation timing based on the preset timing characteristics and the correspondence between light source types to determine the required target light source type. S5. Light source state consistency comparison: Compare the target light source type obtained by parsing with the light source type corresponding to the light source flag bit stored in the current non-volatile memory unit; if the two are consistent, maintain the current output state of the light source and return to step S2; if the two are inconsistent, the MCU logic processing module outputs the corresponding light source switching control signal to the light source control module and proceeds to step S6. S6. Multi-light source switching control: After receiving the switching control signal from the MCU, the light source control module executes a contact switching action, disconnects the power supply path of the current working light source, and engages the power supply path corresponding to the target light source to complete the light source switching and realize the power supply output of the target light source. S7. Update the light source flag: After the light source switching is completed, the MCU logic processing module writes the light source flag corresponding to the target light source into its internal non-volatile storage unit, overwriting the original light source flag, completing the update of the light source status, and returns to step S2.
7. The multi-light source control method based on a single interface according to claim 6, characterized in that, In step S3, a conventional camera shooting trigger sequence and a light source operation sequence are preset. The conventional camera shooting trigger sequence and the light source operation sequence have distinguishable timing characteristics. The light source operation sequence has a dedicated start flag. The MCU logic processing module determines whether to enter the light source operation sequence by recognizing the start flag.
8. The multi-source control method based on a single interface according to claim 6, characterized in that, In step S4, the timing feature is the number of edge changes of the trigger signal within a preset time window. The MCU logic processing module identifies the number of edge changes and establishes a one-to-one correspondence with each light source, thereby realizing the identification and control of multiple light sources.
9. The multi-source control method based on a single interface according to claim 6, characterized in that, In step S2, the MCU logic processing module samples the trigger signal at a preset sampling frequency, which meets the timing recognition accuracy requirements.