A programmable machine vision light source control system and method
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 东莞康视达自动化科技有限公司
- Filing Date
- 2023-09-18
- Publication Date
- 2026-08-07
AI Technical Summary
调试起来较为困难,灵活性低,且每次切换都需要一定时间,生产检测效率较低
[0025]本发明适用于在对同一工件进行不同参数检测时,需要采用不同的光源组合进行拍摄的情况,通过预先设置好光源状态后,只需要发出触发信号即可,不需要每一次都进行设置,降低了控制难度,减少了设置所需的时间,提供了生成效率;本发明采用了可编程控制器,在对各个参数设定好之后运行时不需要程序干预,控制效率高,稳定性好。
Smart Images

Figure CN117202461B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of machine vision, and particularly relates to a programmable machine vision light source control system and method. Background Technology
[0002] In the field of machine vision, conventional light source controllers have relatively simple functions. Each input trigger signal outputs a light source control signal with fixed brightness or fixed pulse width, and one trigger signal can only control one light source channel.
[0003] This means that conventional light source controllers typically require software communication or button input for switching between light sources in frequent brightness changes or multi-light source collaboration detection tasks. This is difficult to debug, lacks flexibility, and each switch takes time, resulting in low production detection efficiency. Furthermore, conventional controllers require program processing during triggering, leading to software delays and difficulty in ensuring consistency across trigger channels, making them unsuitable for applications requiring high control precision. Summary of the Invention
[0004] The main objective of this invention is to provide a programmable machine vision light source control system to solve the above-mentioned technical problems.
[0005] To achieve the above objectives, the technical solution adopted by this invention is: a programmable machine vision light source control system, comprising:
[0006] The programmable controller has multiple trigger input channels, multiple light source drive channels, and multiple camera drive channels. The multiple trigger input channels are used to receive trigger signals, each light source drive channel is electrically connected to a light source, and each camera drive channel is electrically connected to a camera.
[0007] The trigger channel allocation module is used to pair the trigger input channel with the light source driving channel and the camera driving channel respectively. Each trigger input channel can be matched with one or more light source driving channels, and each trigger input channel is matched with only one camera driving channel.
[0008] The light source status setting module is used to set the light source status of each light source and the status number corresponding to the light source status. The light source status includes the on-time of the light source.
[0009] The trigger module is used to receive the trigger signal from the trigger input channel and the status number set by the light source status setting module, and output the status number.
[0010] The light source pulse width modulation module is used to receive the status sequence number output by the trigger module and the light source status set by the light source status setting module, and output the corresponding light source status to the light source according to the status sequence number received from the trigger module.
[0011] Preferably, the triggering module includes a single-step triggering module, which is used to output a status number after receiving a trigger signal from the trigger input channel. When the trigger input channel has multiple status numbers, the status numbers are increased sequentially according to the triggering order of the received trigger signals, until the largest status number is output and then the system returns to the smallest status number.
[0012] Preferably, the triggering module further includes a continuous triggering module, which is used to output all the status numbers in ascending order after receiving a trigger signal from the trigger input channel.
[0013] Preferably, it further includes a light source delay module, which is used to receive the status sequence number output by the trigger module and send the status sequence number to the light source pulse width modulation module after a delay as needed.
[0014] Preferably, it also includes a camera delay module and a camera pulse width modulation module. The camera delay module is used to receive the status sequence number sent by the trigger module and send the status sequence number to the camera pulse width modulation module after a delay as needed. The camera pulse width modulation module sends a working signal to the camera.
[0015] Preferably, it also includes the idle feedback module, which is used to obtain the status information of whether the light source delay module, the light source pulse width modulation module, the camera delay module and the camera pulse width modulation module are idle. When the status information is busy, the trigger module will no longer output the status number after receiving the trigger signal.
[0016] The present invention also provides a programmable machine vision light source control method, which employs the above-mentioned control system and is characterized by comprising the following steps:
[0017] Step 1: According to actual needs, use the trigger channel allocation module to pair the trigger input channel with the light source drive channel and the camera drive channel;
[0018] Step 2: As needed, use the light source status setting module to set the light source status and the corresponding status number for each light source status, and send the status number to the trigger module and the status number and light source status to the light source pulse modulation module.
[0019] Step 3: The trigger signal is input to the trigger module through the trigger input channel;
[0020] Step 4: The trigger module sends a status sequence number to the light source pulse modulation module corresponding to the trigger input channel. The light source pulse modulation module sends a pulse signal corresponding to the status sequence number to the light source according to the received status sequence number.
[0021] Preferably, when performing step three, it is necessary to first select either the single-step trigger module or the continuous trigger module;
[0022] When the single-step trigger module is selected, in step four, the single-step trigger module outputs a status number to the light source pulse modulation module corresponding to the trigger input channel for each trigger signal received. Furthermore, when multiple trigger signals are input, the status number gradually increases according to the order of the trigger signal input until it reaches the maximum status number, then returns to the minimum status number; and / or,
[0023] When the continuous trigger module is selected, in step four, each time the continuous trigger module receives a trigger signal, it outputs all the status numbers to the corresponding light source pulse width modulation module in ascending order.
[0024] Compared with the prior art, the present invention has the following beneficial effects:
[0025] This invention is applicable to situations where different combinations of light sources are needed to photograph the same workpiece when different parameters are being detected. By pre-setting the light source state, only a trigger signal needs to be issued, eliminating the need for setting it every time. This reduces control difficulty, reduces the time required for setting, and improves production efficiency. This invention uses a programmable controller, which does not require program intervention after each parameter is set, resulting in high control efficiency and good stability. Attached Figure Description
[0026] Figure 1 This is a schematic diagram of a preferred embodiment of the present invention. Detailed Implementation
[0027] The following description is intended to disclose the invention and enable those skilled in the art to implement it. The preferred embodiments described below are merely examples, and other obvious variations will occur to those skilled in the art.
[0028] like Figure 1 As shown, a programmable machine vision light source control system includes a programmable controller, a trigger channel allocation module, a light source state setting module, a filtering module, a trigger module, a light source delay module, a camera delay module, a light source pulse width modulation module, a camera pulse width modulation module, and an idle feedback module.
[0029] The programmable controller has multiple trigger input channels, multiple camera drive channels, and multiple light source drive channels. Each trigger input channel is connected to a corresponding camera drive channel and light source drive channel. Each camera drive channel drives one camera, and each light source drive channel drives one light source. For ease of description, two trigger input channels are designated as Trigger Input Channel 1 and Trigger Input Channel 2; two camera drive channels are designated as Camera Drive Channel 1 and Camera Drive Channel 2; and eight light source drive channels are designated as Light Source Drive Channels 1-8.
[0030] The trigger channel allocation module is used to pair trigger input channels with camera drive channels and light source drive channels, respectively. Each trigger input channel corresponds one-to-one with a camera drive channel; that is, one trigger channel controls one camera. Each trigger input channel can be paired with multiple light source drive channels, meaning one trigger channel can control multiple light sources. A light source can only be paired with one trigger input channel. For ease of description, trigger input channel 1 is paired with camera drive channel 1, trigger input channel 2 is paired with camera drive channel 2, trigger input channel 1 is paired with light source drive channels 1-4, and trigger input channel 2 is paired with light source drive channels 6-8.
[0031] The light source status setting module is used to set the light source status of each light source and the status number of each light source status. The light source status includes the time the light source is turned on. Each light source can be set with multiple light source statuses. Each light source status corresponds to a status number according to the order in which they are set. When there is only one light source status, the status number is 1. When there are multiple light source statuses, the status numbers are incremented by 1 in the order they are set. Preferably, a maximum of 10 light source statuses can be set. For example, the light source corresponding to trigger input channel 1 has five light source statuses, and the light source corresponding to trigger input channel 2 has three light source statuses, as shown in the table below.
[0032]
[0033] As shown in the table above, light sources with the same sequence number corresponding to the same trigger input channel operate simultaneously according to the set light source states. When trigger input channel 1 receives a trigger signal, light source 1 (corresponding to sequence number 1) illuminates for 100µs, light source 2 for 100µs, light source 3 for 120µs, and light source 4 for 120µs. The sequence number increases sequentially according to the received trigger signal, and the operation cycles. When a trigger input channel receives a trigger signal, its paired camera takes a picture. That is, by taking pictures of the product under different light source states, different images are obtained, thereby enabling the detection of different parameters.
[0034] After the light source status setting module is completed, the status number is sent to the trigger module, and the status number and light source status are sent to the light source pulse width modulation module.
[0035] The filtering module is used to receive the trigger signal output from the trigger input channel and process the trigger signal. The processing includes filtering out noise and glitches in the trigger signal to prevent false triggering of the system and ensure the stability of the system triggering.
[0036] The triggering module includes a single-step triggering module and a continuous triggering module. The single-step triggering module receives trigger signals from the trigger input channel and sends a status number to the light source delay module after receiving each trigger signal. It increments the status number sequentially based on the received trigger signals until it reaches the maximum status number, then returns to the minimum status number, and repeats this cycle. Simultaneously, the single-step triggering module sends a working signal to the camera delay module upon receiving each trigger signal, initiating camera operation. Taking trigger input channel 1 as an example, when using the single-step triggering module, upon receiving a trigger signal, the light source state corresponding to status number 1 is executed; upon receiving the next trigger signal, the light source state corresponding to status number 2 is executed, and so on, until the last status number is reached.
[0037] The continuous trigger module receives trigger signals from the trigger input channel and, upon receiving a trigger signal, sends the state sequence number in ascending order to the light source delay module. Simultaneously, the continuous trigger module sends a working signal to the camera delay module for each state sequence number, initiating camera operation. Taking trigger input / output channel 1 as an example, when using the continuous trigger module, upon receiving a trigger signal, the light source states corresponding to state sequences 1-5 are executed sequentially.
[0038] The light source delay module sends the received status sequence number to the light source pulse width modulation module after a certain delay. The camera delay module sends the received working signal to the camera pulse width modulation module. The light source delay module and the camera delay module are used for delay. By setting different delay lengths, the light source and the camera can better coordinate. Of course, in actual use, the delay can also be set to 0.
[0039] The light source pulse width modulation module receives the state sequence number of the light source corresponding to the trigger input channel and simultaneously controls the corresponding light source drive channel to output according to the corresponding light source state. The light source operates according to the corresponding light source state. Each light source corresponds to one light source pulse width modulation module.
[0040] The camera pulse width modulation module outputs a pulse signal to the camera drive channel for each working signal it receives, and the pulse width of the signal is adjustable.
[0041] The idle feedback module is used to obtain the status information of whether the light source delay module, the light source pulse width modulation module, the camera delay module, and the camera pulse width modulation module are idle. When the status information is busy, it means that a task is currently being executed, and no new trigger signals are received. New trigger signals are only received when the status information is idle.
[0042] For single-step triggering modules, external trigger signals are not responded to until the task for the current state number is completed. Taking trigger channel 1 as an example, assuming that the output of state number 1 is currently being executed, a trigger signal input will not be responded to before the output of state number 1 ends, that is, the state number will not be incremented.
[0043] For continuous triggering modules, external trigger signals are not responded to until all state numbers in the current trigger input channel have been output in turn. Taking trigger input channel 1 as an example, external input signals are not responded to until all tasks of state numbers 1-5 have been completed.
[0044] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention. The scope of protection claimed by the appended claims and their equivalents is defined.
Claims
1. A programmable machine vision light source control system, characterized in that, include: The programmable controller has multiple trigger input channels, multiple light source drive channels, and multiple camera drive channels. The multiple trigger input channels are used to receive trigger signals, each light source drive channel is electrically connected to a light source, and each camera drive channel is electrically connected to a camera. The trigger channel allocation module is used to pair the trigger input channel with the light source driving channel and the camera driving channel respectively. Each trigger input channel can be matched with one or more light source driving channels, and each trigger input channel is matched with only one camera driving channel. The light source status setting module is used to set the light source status of each light source and the status number corresponding to the light source status. The light source status includes the on-time of the light source. The trigger module is used to receive the trigger signal from the trigger input channel and the status number set by the light source status setting module, and output the status number. The light source pulse width modulation module is used to receive the status sequence number output by the trigger module and the light source status set by the light source status setting module, and output the corresponding light source status to the light source according to the status sequence number output by the trigger module. The triggering module includes a single-step triggering module, which is used to output a status number after receiving a trigger signal from the trigger input channel. When the trigger input channel has multiple status numbers, the status numbers are increased sequentially according to the triggering order of the received trigger signals until the largest status number is output and then the system returns to the smallest status number. It also includes a light source delay module, which receives the status sequence number output by the trigger module and sends the status sequence number to the light source pulse width modulation module after a delay as needed; It also includes a camera delay module and a camera pulse width modulation module. The camera delay module is used to receive the status sequence number sent by the trigger module and send the status sequence number to the camera pulse width modulation module after a delay as needed. The camera pulse width modulation module sends a working signal to the camera.
2. The programmable machine vision light source control system according to claim 1, characterized in that, The triggering module also includes a continuous triggering module, which is used to output all the status numbers in ascending order after receiving a trigger signal from the trigger input channel.
3. The programmable machine vision light source control system according to claim 2, characterized in that, It also includes an idle feedback module, which is used to obtain the status information of whether the light source delay module, the light source pulse width modulation module, the camera delay module and the camera pulse width modulation module are idle. When the status information is busy, the trigger module will no longer output the status number after receiving the trigger signal.
4. A programmable machine vision light source control method, employing the programmable machine vision light source control system described in claim 3, characterized in that, Specifically, the steps include the following: Step 1: According to actual needs, use the trigger channel allocation module to pair the trigger input channel with the light source drive channel and the camera drive channel; Step 2: As needed, use the light source status setting module to set the light source status and the corresponding status number for each light source status, and send the status number to the trigger module and the status number and light source status to the light source pulse modulation module. Step 3: The trigger signal is input to the trigger module through the trigger input channel; Step 4: The trigger module sends a status sequence number to the light source pulse modulation module corresponding to the trigger input channel. The light source pulse modulation module sends a pulse signal corresponding to the status sequence number to the light source according to the received status sequence number.
5. The programmable machine vision light source control method according to claim 4, characterized in that, When performing step three, you need to first select either the single-step trigger module or the continuous trigger module; When the single-step trigger module is selected, in step four, the single-step trigger module outputs a status number to the light source pulse modulation module corresponding to the trigger input channel for each trigger signal received. Furthermore, when multiple trigger signals are input, the status number gradually increases according to the order of the trigger signal input until it reaches the maximum status number, then returns to the minimum status number; and / or, When the continuous trigger module is selected, in step four, each time the continuous trigger module receives a trigger signal, it outputs all the status numbers to the corresponding light source pulse width modulation module in ascending order.
Citation Information
Patent Citations
Multi-path light source stroboscopic and camera trigger control device and control system
CN113075835A
Defect detection method and system based on double cameras and multiple light sources
CN113538420A