A unified door opening detection and control device and method based on GPIO
Patent Information
- Application Number
- CN202611286881.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-24
- Publication Date
- 2026-10-23
AI Technical Summary
[0003]本发明提供一种基于GPIO的统一开门检测与控制装置,既可以解决现有的智能检测系统容易产生误停机的问题,同时还可以保证生产的安全
[0021]本发明的有益效果如下:通过本发明的基于GPIO的统一开门检测与控制装置,无论门是被意外推开,还是人员按按钮正常进入,系统均遵循同一套判断标准,彻底避免了传统方案中,虽然按钮按过了但在门尚未开时,工业视觉检测系统不响应(继续其推理、保存及告警),或门开了但视觉检测系统误以为是故障的问题。由于手动开门标志在按钮按下的瞬间,即门锁弹开前即被置位,统一控制模块会提前向视觉检测系统发出暂停指令。这覆盖了从按下按钮到门锁打开再到门体拉开的完整时间链,填补了传统仅靠门磁检测存在的保护真空期,有效防止操作员在门未完全开启时误入干扰区。
Smart Images

Figure CN122963050A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of industrial automation control equipment technology, specifically a unified door opening detection and control device based on GPIO. Background Technology
[0002] In the fiberglass composite manufacturing industry, using intelligent detection systems to inspect for defects in the yarn can automate quality control. In a closed production environment, the intelligent detection system takes photos and analyzes them using algorithms to determine if the yarn has flaws such as broken yarn or stains. If the production line door is opened at this time, strong external light and dust may enter, causing abnormal images captured by the camera. If the intelligent detection system continues to judge and inspect under these circumstances, it may misidentify thousands of "false defects" due to the sudden change in light, triggering numerous invalid "save" operations. This results in the hard drive being filled with useless images. More importantly, the intelligent detection system may issue alarms and execute shutdown operations due to the large number of defects detected, leading to accidental shutdowns and interruptions of the entire production line. This not only delays production capacity but also takes a very long time to recover. Furthermore, the process parameters and images of semi-finished products in the production workshop are trade secrets. If the system is still saving high-definition defect images when the door is open, internal process details may be leaked through screens or logs. Summary of the Invention
[0003] This invention provides a unified door opening detection and control device based on GPIO, which can solve the problem of false shutdowns in existing intelligent detection systems, while also ensuring production safety.
[0004] The unified door opening detection and control device based on GPIO of the present invention includes:
[0005] The door opening detection input module has its GPIO pins electrically connected to the door magnetic switch to read the door's open / closed state;
[0006] The door opening request input module has its GPIO pins electrically connected to the door opening request button to monitor the door opening request button signal;
[0007] The manual door opening sign management unit has its input terminal electrically connected to the request door opening input module. When a request door opening button signal is detected, a manual door opening sign is generated. Its input terminal is also electrically connected to the door opening detection input module. When the door is in the closed state, the manual door opening sign is cleared.
[0008] The unified control module has its input terminals connected to the door opening detection input module, the door opening request input module, and the manual door opening sign management unit, respectively. Its output terminal is electrically connected to the control terminal of the industrial vision inspection system. Based on the door's open / closed status, the door opening request button signal, and the manual door opening sign, it controls the industrial vision inspection system to start protection and recovery operations.
[0009] Preferably, the device further includes an alarm light control module, whose input terminal is electrically connected to the door opening detection input module, and controls the alarm light to turn on and off according to the door's open / closed state.
[0010] Preferably, the device further includes a door opening output module, the input of which is connected to the door opening request input module, for outputting a door opening control pulse signal to the door according to the door opening request button signal to control the door opening action.
[0011] Preferably, the door opening control pulse signal is a 500ms high-level pulse signal, and the door opening output module automatically resets the output level to low level after outputting the door opening control pulse signal.
[0012] Preferably, the GPIO pins of the door opening detection input module are configured in pull-up input mode to eliminate signal interference when the pins are floating.
[0013] Preferably, the unified control module controls the industrial vision inspection system to initiate protection measures including: pausing the current inference task to prevent interfered image frames from entering the judgment process; blocking alarm output to prevent false alarms caused by sudden changes in light; and stopping image saving operations to prevent invalid images from being written to the storage device.
[0014] This invention also provides a unified door opening detection and control method based on GPIO, comprising the following steps:
[0015] S1, detect the status of the door magnetic switch, detect whether there is a request to open the door button signal, and detect whether there is a manual door opening indicator;
[0016] S2, when the door magnetic switch is detected to be on, or a request to open the door button signal or a manual door opening sign is detected, the industrial vision inspection system is controlled to pause inference, alarm and save operations;
[0017] S3: Clear the manual door opening indicator when the door magnetic switch is detected to be closed;
[0018] S4, when the door magnetic switch is detected to be off, there is no request to open the door button signal and no manual door opening sign, the industrial vision inspection system is controlled to resume inference, alarm and save operations.
[0019] Preferably, the alarm light is turned on when the door magnetic switch is detected to be on, or when a request to open the door button signal or a manual door opening indicator is detected.
[0020] Preferably, the door is opened when a request to open the door button is detected.
[0021] The beneficial effects of this invention are as follows: Through the GPIO-based unified door opening detection and control device of this invention, regardless of whether the door is accidentally pushed open or a person enters normally by pressing a button, the system follows the same set of judgment criteria. This completely avoids the problems in traditional solutions where, although the button has been pressed, the industrial vision inspection system does not respond (continues its reasoning, saving, and alarming) before the door is opened, or the vision inspection system mistakenly identifies the door as open but considers it a malfunction. Because the manual door opening indicator is set the instant the button is pressed, before the door lock pops open, the unified control module sends a pause command to the vision inspection system in advance. This covers the complete time chain from pressing the button to the door lock opening and then the door being pulled open, filling the protection vacuum period existing in traditional door magnetic detection alone, and effectively preventing operators from accidentally entering the interference area before the door is fully opened. Attached Figure Description
[0022] Figure 1 The flowchart of the unified door opening detection and control method based on GPIO of the present invention is shown. Detailed Implementation
[0023] This invention provides a unified door opening detection and control device based on GPIO (General Purpose Input / Output Port), used to control an industrial vision inspection system according to a door control composite trigger signal. It includes a door opening detection input module, a door opening request input module, a manual door opening sign management unit, and a unified control module. The GPIO pins of the door opening detection input module are electrically connected to a door magnetic switch to read the switch's state. The door magnetic switch state directly indicates the physical state of the door; when the door magnetic switch is open, the door is open; when it is closed, the door is closed. In this embodiment, the GPIO pins of the door opening detection input module are configured in pull-up input mode to eliminate signal interference when the pins are floating. The GPIO pins of the door opening request input module are electrically connected to a door opening request button to monitor the button signal. The button signal indicates the intention to enter the door, i.e., it predicts that the door will open.
[0024] The input terminal of the manual door opening indicator management unit is electrically connected to the door opening request input module. It generates a manual door opening indicator when a door opening request button signal is detected. By configuring the manual door opening indicator management unit, the instantaneous button pulse is converted into a continuous monitoring state. The input terminal of the manual door opening indicator management unit is also electrically connected to the door opening detection input module, clearing the manual door opening indicator when the door is in the closed state.
[0025] The unified control module's input terminals are connected to the door opening detection input module, the door opening request input module, and the manual door opening sign management unit, respectively. Its output terminal is electrically connected to the control terminal of the industrial vision inspection system. Based on the door's open / closed status, the door opening request button signal, and the manual door opening sign, it controls the industrial vision inspection system to initiate protection and recovery operations. Through the same control module, the physical door opening, door opening intention, and authorization status signals are logically synchronized within the unified control module. Field operators do not need to manually click the "pause / resume" button on the control software; opening the door stops the operation, and closing the door resumes it, achieving fully automatic and seamless integration between the door control system and the vision system. This reduces the risk of equipment damage or data loss due to human error.
[0026] Without a manual door opening indicator management unit, when a request to open the door button is detected while the door is closed, the vision detection system will pause. However, after the door opening button signal disappears, the door remains closed until it is fully opened, at which point the vision detection system will resume operation, performing inference and saving. But then the door is opened. Although the door opening detection module reads the door magnetic switch status and transmits it to the unified control module, which then controls the vision detection system to activate protection (pause the task), there is a hardware response delay (microseconds to milliseconds) between the door magnetic switch disengaging and the unified control module responding and outputting a pause signal. Although this delay is very short, at the instant the door is opened, external light has already entered, airflow has begun to disturb, and the vision detection system has already received the interfered image frame; damage has already occurred. Furthermore, during this process, the vision detection system is subjected to two pauses within a very short time. This invention establishes a manual door opening indicator management unit. From the moment a request to open the door button signal is detected, the manual door opening indicator appears and persists until the door is closed again. During this period, the visual detection system remains in a paused state, so it will not be disturbed at the moment of opening the door, nor will it be subjected to the impact of two pauses in a short period of time.
[0027] The GPIO-based unified door opening detection and control device of this invention adheres to the same set of judgment criteria regardless of whether the door is accidentally pushed open or a person enters normally by pressing a button. This completely avoids the problems of traditional solutions where the button is pressed but the door is not open, resulting in the industrial vision inspection system not responding, or the door being opened but the vision inspection system mistakenly identifying it as a malfunction and causing the entire production line to be suspended. Because the manual door opening indicator is set the instant the button is pressed, before the door lock pops open, the unified control module sends a pause command to the vision inspection system in advance. This covers the entire time chain from pressing the button to the door lock opening and then the door being pulled open, filling the protection vacuum period that exists in traditional door magnetic detection alone, and effectively preventing interference when the door is not fully open.
[0028] When the gated composite trigger signal is valid, the vision system immediately suspends the inference task of the current vision inspection system to prevent interfered image frames from entering the judgment process, and suspends image saving to prevent invalid images from being written to the storage device. This avoids a large number of false defects caused by sudden changes in light and airflow disturbances at the moment the door opens, and also protects core process parameters and production data from accidental leakage. At the same time, the vision inspection system disables alarm output, thereby eliminating unnecessary emergency shutdowns of the production line caused by a surge in false defect rates.
[0029] The device also includes an alarm light control module, whose input is electrically connected to the door opening detection input module. The module controls the alarm light to turn on and off based on the door's open / closed state. When the door is open, the alarm light illuminates, visually alerting the operator and surrounding personnel that the current reasoning has been paused and the vision system is in a protective state.
[0030] The device also includes a door opening output module, whose input end is connected to the door opening request input module. It is used to output a door opening control pulse signal to the door according to the door opening request button signal to control the door opening action. In this way, the button signal is directly converted into a door lock drive signal, completing the fully automated connection from "human command" to "door lock action".
[0031] In this embodiment, the door opening control pulse signal is a 500ms high-level pulse signal. After the door opening output module outputs the door opening control pulse signal, it automatically resets the output level to a low level to prevent the door from being powered on for a long time.
[0032] This invention also provides a unified door opening detection and control method based on GPIO, comprising the following steps:
[0033] S1, detect the status of the door magnetic switch and detect whether there is a request to open the door button signal. If a request to open the door button signal is detected, set the manual door opening flag. If no request to open the door button signal is detected, keep the original flag unchanged.
[0034] S2, when the door magnetic switch is detected to be on, or a request to open the door button signal or a manual door opening sign is detected, the industrial vision inspection system is controlled to pause inference, alarm and save operations, and the alarm light is turned on at the same time;
[0035] S3: Clear the manual door opening indicator when the door magnetic switch is detected to be closed;
[0036] S4, when the door magnetic switch is detected to be off, there is no request to open the door button signal and no manual door opening sign, the industrial vision inspection system is controlled to resume inference, alarm and save operations.
[0037] When a request to open the door button is detected, the door will open automatically.
[0038] The above embodiments are merely exemplary embodiments of the present invention and are not intended to limit the present invention. The scope of protection of the present invention is defined by the claims. Various modifications or equivalent substitutions made by those skilled in the art to the present invention within its spirit and scope of protection also fall within the scope of protection of the present invention.
Claims
1. A unified door opening detection and control device based on GPIO, characterized in that, include: The door opening detection input module has its GPIO pins electrically connected to the door magnetic switch to read the door's open / closed state; The door opening request input module has its GPIO pins electrically connected to the door opening request button to monitor the door opening request button signal; The manual door opening sign management unit has its input terminal electrically connected to the request door opening input module. When a request door opening button signal is detected, a manual door opening sign is generated. Its input terminal is also electrically connected to the door opening detection input module. When the door is in the closed state, the manual door opening sign is cleared. The unified control module has its input terminals connected to the door opening detection input module, the door opening request input module, and the manual door opening sign management unit, respectively. Its output terminal is electrically connected to the control terminal of the industrial vision inspection system. Based on the door's open / closed status, the door opening request button signal, and the manual door opening sign, it controls the industrial vision inspection system to start protection and recovery operations.
2. The apparatus according to claim 1, characterized in that, The device also includes an alarm light control module, whose input terminal is electrically connected to the door opening detection input module, and controls the alarm light to turn on and off according to the door's open / closed state.
3. The apparatus according to claim 1, characterized in that, The device also includes a door opening output module, whose input terminal is connected to the door opening request input module, and is used to output a door opening control pulse signal to the door according to the door opening request button signal to control the door opening action.
4. The apparatus according to claim 3, characterized in that, The door opening control pulse signal is a 500ms high-level pulse signal, and the door opening output module automatically resets the output level to low level after outputting the door opening control pulse signal.
5. The apparatus according to claim 1, characterized in that, The GPIO pins of the door opening detection input module are configured as pull-up inputs.
6. The apparatus according to claim 1, characterized in that, The unified control module controls the industrial vision inspection system to activate protection measures including: pausing the current inference task to prevent interfered image frames from entering the judgment process; blocking alarm outputs to prevent false alarms caused by sudden changes in light; and stopping image saving operations to prevent invalid images from being written to the storage device.
7. A unified door opening detection and control method based on GPIO, characterized in that, Includes the following steps: S1, detect the status of the door magnetic switch, detect whether there is a request to open the door button signal, and detect whether there is a manual door opening indicator; S2, when the door magnetic switch is detected to be on, or a request to open the door button signal or a manual door opening sign is detected, the industrial vision inspection system is controlled to pause inference, alarm and save operations; S3: Clear the manual door opening indicator when the door magnetic switch is detected to be closed; S4, when the door magnetic switch is detected to be off, there is no request to open the door button signal and no manual door opening sign, the industrial vision inspection system is controlled to resume inference, alarm and save operations.
8. The method according to claim 7, characterized in that, When the door magnetic switch is detected to be on, or a request to open the door button signal or a manual door opening indicator is detected, the alarm light will be turned on.
9. The method according to claim 7, characterized in that, When a request to open the door button is detected, the door is opened.