Industrial camera system and method of controlling the same
Patent Information
- Application Number
- CN202611001431.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-07
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2046-07-07
AI Technical Summary
[0003]本发明的主要目的在于提供一种工业相机系统及其控制方法,旨在改善工业相机因静电干扰进入物理死锁状态的问题,提高工业相机系统的可靠性和自动化产线的生产效率
Smart Images

Figure CN122513670B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of camera technology, and more particularly to an industrial camera system and its control method. Background Technology
[0002] After being subjected to strong electromagnetic interference or electrostatic discharge, a common failure mode of industrial cameras is that the internal logic of the industrial camera enters a "deadlock" state. In a deadlock state, although the internal circuitry or firmware of the industrial camera may become unresponsive—for example, the microcontroller, field-programmable gate array, or image sensor may experience register state corruption due to interference, program crashes, or fall into an unrecoverable hardware hang state—the industrial camera will not respond to any software commands issued by the host computer. Existing recovery solutions to this problem mainly fall into two categories: the first is a pure software reconnection mechanism. When the host computer detects that the industrial camera is unresponsive, it only attempts to close and reinitialize the communication interface. However, this logic-level retry cannot clear the physical deadlock within the hardware, and reconnection often fails. The second category relies on manual or mechanical relay-based physical power-off restarts. Although this method can forcibly remove the deadlock state, frequent power-offs can cause electrical stress on the electronic components inside the camera (such as memory chips) and require manual intervention, affecting the efficiency of automated production lines. Summary of the Invention
[0003] The main objective of this invention is to provide an industrial camera system and its control method, which aims to improve the problem of industrial cameras entering a physical deadlock state due to electrostatic interference, thereby improving the reliability of the industrial camera system and the production efficiency of automated production lines.
[0004] To achieve the above objectives, this invention proposes a control method for an industrial camera system. The industrial camera includes a memory for storing the operating parameters of the industrial camera. The control method for the industrial camera system includes: A query command is sent to the target industrial camera at a preset time interval, and the first timing begins to obtain the first duration; If the first duration has not reached the preset first duration and a camera response command is received, the process of sending query commands to the target industrial camera at preset time intervals is executed repeatedly. If the first duration reaches the preset first duration and no camera response command is received, the physical layer reset interface is invoked to generate a soft reset command and send the soft reset command to the target industrial camera, and the second timing is started to obtain the second duration; When the second duration reaches the preset second duration, a connection is established with the target industrial camera so that the target industrial camera is in working condition. When the target industrial camera receives the soft reset command, it triggers the hardware-level circuit to execute the reset action and the initialization action in sequence.
[0005] In one embodiment, the industrial camera system includes a software development kit, and the step of sending query commands to the target industrial camera at preset time intervals includes: The software development kit sends heartbeat packets to the target industrial camera at preset time intervals.
[0006] In one embodiment, the heartbeat packet includes an instruction to read the status register of the target industrial camera, or an empty command that does not contain payload data.
[0007] In one embodiment, the industrial camera system includes a software development kit (SDK) storing device enumeration interface functions and device opening interface functions. Establishing a connection with the target industrial camera includes: Call the device enumeration interface function to scan and obtain the list of access device information; The target industrial camera is determined based on the access device information list, and the open device interface function is called to establish a communication connection with the target industrial camera.
[0008] In one embodiment, the control method for the industrial camera system further includes: The operating parameters of the target industrial camera are written into the memory and set to be automatically loaded upon power-on, so that the target industrial camera automatically loads the operating parameters when performing the initialization action, so as to restore the operating state that matches the operating parameters.
[0009] In one embodiment, the control method for the industrial camera system further includes: In the event of failure to establish a connection with the target industrial camera, the process of calling the physical layer reset interface to generate a soft reset command and sending the soft reset command to the target industrial camera when the first time period reaches a preset first time period and no camera response command is received, and starting the second timer to obtain the second time period, is repeated. If the preset number of loops is reached and the connection with the target industrial camera fails to be established, an error log message will be output, and the target industrial camera will be marked as offline due to a fault.
[0010] In one embodiment, the reset action includes forcibly terminating the current instruction set of the target industrial camera, pointing the central processing unit pointer of the target industrial camera to the firmware start address, forcibly restoring the hardware state machine to the initial state, and forcibly clearing or restoring the control register, status register and data cache inside the target industrial camera to the hardware default values. The initialization action includes reloading the firmware program based on the firmware start address, clearing the current configuration parameters in the registers of the target industrial camera based on the loaded firmware program, and resetting the registers until the target industrial camera enters standby mode.
[0011] In one embodiment, the industrial camera includes a power management chip and an image acquisition module, and the reset action further includes: The power management chip controlling the target industrial camera sequentially performs power-off and power-on actions on the image acquisition module.
[0012] The present invention also proposes an industrial camera system, which includes a terminal device and an industrial camera, wherein the terminal device is electrically connected to the industrial camera; The terminal device includes a control unit, which is used to execute the steps of the control method for the industrial camera system described above.
[0013] In one embodiment, the industrial camera system further includes a hub, the industrial camera being electrically connected to a first end of the hub, and the terminal device being electrically connected to a second end of the hub; The metal casing of the industrial camera, the metal casing of the hub, and the chassis of the terminal equipment are connected to the same grounding terminal through a grounding conductor to form a single-point grounding system. The cross-sectional area of the grounding conductor is not less than 2.5 square millimeters.
[0014] In practical applications, the soft reset command in this solution is generated by calling the physical layer reset interface. Therefore, the soft reset command is captured at the physical or data link layer, forcing the industrial camera program back to its initial state and improving the hardware deadlock problem. Simultaneously, compared to restarting due to an external physical power outage, it reduces the risk of current surges and data corruption that may result from sudden power outages, extending the lifespan of the industrial camera. Furthermore, it eliminates the need for additional relays, control circuits, or other hardware on the production line, directly utilizing existing communication cables, thus reducing costs. In this way, it addresses the issue that pure software reconnection mechanisms cannot resolve hardware physical deadlock states, improving the reliability of the industrial camera system and consequently increasing the production efficiency of automated production lines. Attached Figure Description
[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a flowchart illustrating an embodiment of the control method for the industrial camera system of the present invention. Figure 2 A flowchart is provided for yet another embodiment of the control method for the industrial camera system of the present invention. Figure 3 A flowchart illustrating another embodiment of the control method for the industrial camera system of the present invention; Figure 4 This is a schematic diagram of another embodiment of the control method for the industrial camera system of the present invention.
[0018] The objectives, features, and advantages of this invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0019] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of the present invention and are not intended to limit the present invention.
[0020] To better understand the technical solution of the present invention, a detailed description will be provided below in conjunction with the accompanying drawings and specific embodiments.
[0021] After being subjected to strong electromagnetic interference or electrostatic discharge, a common failure mode of industrial cameras is that the internal logic of the industrial camera enters a "deadlock" state. In a deadlock state, although the internal circuitry or firmware of the industrial camera may become unresponsive—for example, the microcontroller, field-programmable gate array, or image sensor may experience register state corruption due to interference, program crashes, or fall into an unrecoverable hardware hang state—the industrial camera will not respond to any software commands issued by the host computer. Existing recovery solutions to this problem mainly fall into two categories: the first is a pure software reconnection mechanism. When the host computer detects that the industrial camera is unresponsive, it only attempts to close and reinitialize the communication interface. However, this logic-level retry cannot clear the physical deadlock within the hardware, and reconnection often fails. The second category relies on manual or mechanical relay-based physical power-off restarts. Although this method can forcibly remove the deadlock state, frequent power-offs can cause electrical stress on the electronic components inside the camera (such as memory chips) and require manual intervention, affecting the efficiency of automated production lines.
[0022] Therefore, refer to Figure 1This invention proposes a control method for an industrial camera system. The industrial camera includes a memory for storing the operating parameters of the industrial camera. The control method for the industrial camera system includes: Step S100: Send a query command to the target industrial camera at a preset time interval and start the first timing to obtain the first duration; In this embodiment, the control method of the industrial camera system of the present invention can be applied to the control device of a terminal device. The terminal device is communicatively connected to the industrial camera and is used to send control commands to the industrial camera and receive data sent by the industrial camera. The control device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The computer program is configured to implement the steps of the control method of the industrial camera system. The control device can be implemented using a main controller, such as an MCU (Micro Controller Unit), DSP (Digital Signal Processor), FPGA (Field Programmable Gate Array), PLC (Programmable Logic Controller), or SOC (System on Chip).
[0023] In this embodiment, the preset time interval can be pre-set by the R&D personnel and stored in the internal or external memory of the control device. The preset time interval is typically in the range of 500ms to 1000ms. By periodically sending query commands, the terminal device can continuously sense the online status of the industrial camera, accurately identify communication anomalies by quantifying time parameters (first duration), avoid misjudgments caused by instantaneous network fluctuations, and provide sufficient response time for the industrial camera. Optionally, the terminal device can send query commands to the target industrial camera via a communication cable.
[0024] In this embodiment, the host computer is used as the terminal device for illustration. The host computer sends a query command to the target industrial camera at preset time intervals (e.g., every 700 milliseconds). Each time a query command is sent, the timing module inside the control device starts the first timing and records the time waiting for the industrial camera to respond.
[0025] Understandably, unlike fixed-cycle, one-size-fits-all monitoring, the control device can dynamically adjust the preset time interval based on the industrial camera's workload. For example, when the industrial camera performs a high-precision, long-exposure task, the preset time interval is automatically extended to 1000 milliseconds to reduce communication interference; when the industrial camera is in standby or low-speed operation mode, the interval is shortened to 500 milliseconds to achieve more sensitive fault detection. This intelligent dynamic adjustment mechanism demonstrates the industrial camera system's adaptability to different operating conditions. Furthermore, query commands can also include lightweight status checks (such as reading the camera's temperature register or buffer occupancy). This not only confirms the camera's online status but also collects health data.
[0026] Step S200: If the first duration has not reached the preset first duration and a camera response instruction is received, the process of sending query instructions to the target industrial camera at preset time intervals is executed repeatedly. In this embodiment, the preset first duration can be pre-set by the R&D personnel and stored in the internal or external memory of the control device. In industrial automation environments, occasional response delays are common due to electromagnetic interference, data packet collisions, or momentary processor overload. This step sets a "preset first duration" as a fault tolerance threshold to ensure that the system will not mistakenly trigger a soft reset operation due to millisecond-level delays, thereby ensuring the continuity and stability of the industrial camera's operation.
[0027] In this embodiment, the host computer's control device monitors the count value (first duration) of the first timer in real time. As long as the current first duration does not exceed the preset first duration, and a response command is successfully received from the camera during this period, it is determined that the communication between the host computer and the industrial camera is normal. At this time, the first timer can be reset to zero, that is, the first timer can be reset, and the next query cycle can be started immediately, forming a closed-loop cyclic monitoring circuit.
[0028] Understandably, the preset first duration can also be a variable value, which the control device can dynamically adjust based on historical response times. For example, if the control device records an average response time of 80 milliseconds and a standard deviation of 20 milliseconds over the past 10 times, it will automatically set the preset first duration to the sum of the average value and three times the standard deviation (140 milliseconds), making the fault tolerance mechanism more accurate.
[0029] Industrial network environments are typically complex and variable. If the preset first latency is set to a small, fixed value (e.g., 80 milliseconds), when normal transient network fluctuations or a brief increase in CPU load (causing a response delay of 100 milliseconds) occur, the control device may mistakenly interpret it as an industrial camera disconnection, entering a "freeze" state and triggering an unnecessary soft reset. By statistically analyzing the average response time (80 milliseconds) and fluctuations (standard deviation 20 milliseconds) of past successful attempts, the normal latency boundary (140 milliseconds) in the current environment can be calculated. As long as the industrial camera's response is within this normal latency boundary, the control device determines it to be "normal," thus avoiding false resets caused by environmental fluctuations and ensuring continuous production line operation. Furthermore, if the preset first latency is set to a larger value (e.g., 2 seconds) to avoid false resets, although it will not cause false resets, when an industrial camera actually malfunctions (such as deadlock), it must wait 2 seconds to confirm the fault and begin recovery, extending downtime. Therefore, the control device can adjust the preset first latency based on the actual network conditions.
[0030] In a normal distribution, over 99% of the data will fall within the range of "mean ± 3 standard deviations". This means that setting the preset first duration to the sum of the average response time of the historical preset number of responses and 3 standard deviations mathematically guarantees that over 99% of normal communications will not be misjudged as faults, thereby improving the accuracy and reliability of subsequent soft reset operations.
[0031] Step S300: When the first duration reaches the preset first duration and no camera response command is received, the physical layer reset interface is called to generate a soft reset command and send the soft reset command to the target industrial camera, and the second timing is started to obtain the second duration. In this embodiment, if no camera response command is received within a preset first time period, i.e., when the control device detects a communication timeout and no response, it indicates that the industrial camera may be in a deadlock state. At this time, automatic intervention is required. By calling the physical layer reset interface, potentially invalid higher-level application protocols are bypassed, and the camera's communication state machine is reset directly from the hardware layer. This reduces the risk of hardware damage from directly cutting off power and effectively resolves the deadlock state.
[0032] In this embodiment, when the first timer reaches a preset first duration and no camera response command is received, the system determines that the camera is offline, calls the physical layer reset interface in the underlying driver, and generates and sends a soft reset command. The soft reset command triggers the camera's internal hardware-level circuitry to perform reset and initialization actions. Simultaneously, the control device starts a second timer to monitor the recovery process after the soft reset.
[0033] It should be noted that industrial camera manufacturers typically provide an SDK (Software Development Kit), which includes library files (.dll, .so, etc.), header files (.h), sample code, and documentation. The library files encapsulate the low-level functions for communicating with the camera (such as opening the device, reading images, and sending reset commands); the header files (.h) declare callable functions and data structures; the sample code demonstrates how to use these functions; and the documentation explains the usage of each interface. In this embodiment, it is not necessary for the worker to press the corresponding hardware reset button, nor is it necessary to control an external relay to cut off the power. Instead, a standard communication command (soft reset command) is sent through the SDK's low-level interface (such as GXGigEResetDevice or GenICam's DeviceReset), equivalent to a hardware reset effect after a power outage and restart. This communication command bypasses the application layer software that may be stuck inside the camera and is directly captured by the industrial camera's low-level communication chip (such as an FPGA or PHY chip) or hardware reset circuit. Upon receiving a soft reset command, the industrial camera will either force the reset pin low at the hardware level or control the internal power management chip to momentarily power off and then power on the core circuitry. In this way, the convenience of software commands achieves the thoroughness of a physical power-off restart.
[0034] Understandably, traditional software-based reconnection solutions involve the host computer disconnecting and re-establishing a TCP / IP (Transmission Control Protocol / Internet Protocol) or USB (Universal Serial Bus) communication link. TCP / IP is the low-level language for communication between the GigE camera and the host computer, responsible for reliable image data transmission in complex network environments. USB, on the other hand, is the physical and logical standard for connecting USB interface cameras to the host computer, responsible for device identification, command issuance, and high-speed data transmission. TCP / IP and USB represent two different physical interfaces with corresponding "communication languages" and "connection rules." Regardless of whether it's TCP / IP or USB communication protocols, conventional software reconnection simply re-initiates a "call" or "identification request" at the upper layer. When the camera hardware is in a deadlock state, this purely software-level protocol reconnection is ineffective; the camera's internal hardware circuitry remains in a state of logical chaos or suspension, unable to respond to any reconnection requests. This solution, however, sends low-level commands (soft reset commands) via the SDK, triggering the camera's internal hardware circuitry to perform reset and initialization actions. In this way, the core logic circuit is reset directly at the hardware level, completely eliminating the deadlock state, and the soft reset command reaches the bottom layer (physical layer).
[0035] Step S400: When the second duration reaches the preset second duration, establish a connection with the target industrial camera so that the target industrial camera is in working state. When the target industrial camera receives the soft reset command, it triggers the hardware-level circuit to execute the reset action and the initialization action in sequence.
[0036] In this embodiment, when the second time period reaches the preset second time period, the control device actively initiates a connection request to the target industrial camera. After the connection between the industrial camera and the host computer is established, it can resume its working state. In this embodiment, the preset second time period can be set in advance by the R&D personnel and stored in the memory of the control device. The preset second time period is to ensure that the industrial camera has enough time to complete the reset and initialization actions after receiving the soft reset command. Therefore, the preset second time period can be set according to the hardware initialization time constant of the industrial camera.
[0037] In this embodiment, during the connection establishment process between the host computer and the industrial camera, the host computer not only performs a link handshake, but can also automatically trigger the reading of the previously saved working parameters from the industrial camera's non-volatile memory (such as Flash or EEPROM). For example, after a PCB inspection industrial camera is reset, it automatically restores to the settings of 2048x2048 resolution, external trigger mode, and 10ms exposure time.
[0038] In this embodiment, for example in an automated logistics sorting production line, an industrial camera momentarily disconnects due to electrostatic discharge. If a preset first time period is reached and the host computer does not receive a response command from the camera, the physical layer reset interface is invoked to generate a soft reset command and send it to the target industrial camera. Then, a preset second time period is waited for the target industrial camera to complete its reset and initialization actions. After this, the host computer and the target industrial camera reconnect successfully. The entire process is short, the sorting line does not need to be stopped, reducing the risk of package backlog, and no manual operation is required.
[0039] In practical applications, the soft reset command in this solution is generated by calling the physical layer reset interface. Therefore, the soft reset command is captured at the physical or data link layer, forcing the industrial camera program back to its initial state and improving the hardware deadlock problem. Simultaneously, compared to restarting due to an external physical power outage, it reduces the risk of current surges and data corruption that may result from sudden power outages, extending the lifespan of the industrial camera. Furthermore, it eliminates the need for additional relays, control circuits, or other hardware on the production line, directly utilizing existing communication cables, thus reducing costs. In this way, it addresses the issue that pure software reconnection mechanisms cannot resolve hardware physical deadlock states, improving the reliability of the industrial camera system and consequently increasing the production efficiency of automated production lines.
[0040] In another embodiment, the industrial camera system includes a software development kit, and the step of sending query commands to the target industrial camera at preset time intervals includes: The software development kit sends heartbeat packets to the target industrial camera at preset time intervals.
[0041] The heartbeat packet may include an instruction to read the status register of the target industrial camera, or an empty command that does not contain payload data.
[0042] In this embodiment, the Software Development Kit (SDK) encapsulates complex low-level communication protocols (such as TCP / IP and USB command sets), providing developers with a series of simple and easy-to-use function interfaces. In this embodiment, the host computer does not need to assemble complex binary network data packets itself; instead, it directly calls the standard interfaces provided by the SDK (such as SendHeartbeat() or GetDeviceStatus()). The SDK automatically converts these commands into signals that the industrial camera can parse and sends them to the industrial camera via a communication cable.
[0043] In this embodiment, the status register includes, but is not limited to, a temperature register and an error code register. For example, the heartbeat packet includes an instruction to read the temperature register of the target industrial camera. When the industrial camera receives the heartbeat packet, it returns the current temperature. If the host computer receives multiple consecutive abnormal temperature readings, it can issue an early warning message or actively reduce the frequency. Thus, the heartbeat packet, which includes the instruction to read the status register of the target industrial camera, also has a status monitoring function.
[0044] In this embodiment, an empty command without payload data indicates that it contains no actual business data request and is merely an extremely small data packet. Its purpose is to trigger the camera's communication module to respond and determine whether the communication link is working properly. For example, in an unattended weather monitoring station in the field, the industrial camera maintains a connection with a remote server via a 4G network. Every 1000ms, the host computer sends a very short data packet containing only a "start flag" and a "heartbeat type code" via the SDK, without any read or write data payload. Upon receiving this, the industrial camera only needs to reply with a simple acknowledgment signal (ACK). This saves network bandwidth and device power consumption, and reduces the unnecessary burden on the camera processor caused by frequent register reads.
[0045] In one embodiment, reference Figure 2 The industrial camera system includes a software development kit (SDK), which stores device enumeration interface functions and device opening interface functions. Establishing a connection with the target industrial camera includes: Step S410: Call the device enumeration interface function to scan and obtain the list of access device information; Step S420: Determine the target industrial camera based on the access device information list, and call the open device interface function to establish a communication connection with the target industrial camera.
[0046] In this embodiment, the device enumeration interface function in the industrial camera SDK is typically named EnumDevices. Its function is to traverse all physical interfaces of the host computer (such as gigabit network cards, USB 3.0 controllers), detecting and collecting camera information connected to these physical interfaces. When the device enumeration interface function is called, it usually returns a list of devices containing key identification information for the industrial camera, such as serial number, model name, IP address (if it's a network camera), and MAC address. This is the "name-calling" step before establishing any communication. Only devices that are enumerated are considered "reachable" by the operating system and SDK. After the industrial camera performs reset and initialization actions, the host computer cannot blindly connect directly to the industrial camera. Calling the device enumeration interface allows the host computer to broadcast a query to all ports via the communication bus (network cable or USB cable): "Which devices are currently online?", thereby obtaining a list of all currently connected and responding devices.
[0047] In this embodiment, the scanned list of access device information may contain multiple industrial cameras or other unrelated network devices. Therefore, the host computer needs to identify the target industrial camera from the access device information list based on a preset unique identifier (such as a serial number) corresponding to the target industrial camera. Then, it calls the open device interface function to initiate a formal "handshake" request to the target industrial camera, requesting exclusive or shared control rights, thereby establishing a communication channel that can issue commands such as taking pictures and configuring parameters.
[0048] Understandably, in the SDK, the function to open the device interface is usually named OpenDevice. Based on the device information (handle or index) obtained in the previous step, it establishes a low-level transport layer connection with the industrial camera (such as establishing a TCP connection or USB pipe). After successful execution, the host computer essentially obtains a "remote control" (device handle) to operate the camera. All subsequent operations (such as setting exposure time or starting image acquisition) must be communicated through this "remote control." Without calling the OpenDevice interface function, the host computer only knows that the target industrial camera exists but cannot issue commands to it.
[0049] In this embodiment, it is assumed that an industrial camera with serial number CAM-2026-001 is responsible for detecting part defects on the production line. Due to electrostatic interference generated by the start-up of a large robotic arm in the workshop, camera CAM-2026-001 suddenly goes offline. The host computer detects a heartbeat timeout (i.e., the first preset time has elapsed and no response command has been received from the camera), and immediately sends a soft reset command to camera CAM-2026-001 via the SDK, and waits for a preset second time. This is because the microcontroller (MCU) and image sensor inside the camera need time to power on, load firmware, and initialize registers. If a connection is attempted directly before the industrial camera has completed power-on, firmware loading, and register initialization, the connection will fail. The host computer calls the device enumeration interface function. The SDK scans the computer's network card and finds a device list: [{Serial Number: CAM-2026-001, IP: 192.168.1.50}, {Serial Number: CAM-2026-002, IP: 192.168.1.51}]. This indicates that CAM-2026-001 has successfully restarted and connected to the network. The program iterates through the list and matches the target serial number CAM-2026-001. Subsequently, the open device interface function is called, and the SDK initiates a connection request to 192.168.1.50. If the industrial camera accepts the request, the connection is established successfully. The host computer then automatically sends the previously backed-up parameters (such as an exposure time of 5000µs), and the industrial camera immediately resumes normal image acquisition. The production line continues to operate normally without manual intervention.
[0050] The device enumeration interface function is responsible for the "wide-area scanning" of the physical layer. By traversing the physical interfaces, it obtains a list of devices containing key information such as serial numbers and IP addresses, improving the issue of device "presence" after a reset. The device opening interface function is responsible for the "handshake" of the logical layer, establishing a transport layer connection by obtaining the device handle. Considering the physical characteristics of hardware reset, a reasonable delay waiting window (preset second duration) is set to reduce the risk of connection failure due to incomplete camera firmware loading. Through the three-step reconnection strategy of "enumeration-location-opening," the entire process from fault detection (heartbeat timeout), command issuance (soft reset) to service recovery (parameter reload, acquisition restart) can be completed automatically. In this way, not only is the lag of manual intervention improved, but the reliability of long-term unattended operation in industrial sites is also ensured, giving the vision inspection system containing the industrial camera system basic self-healing capabilities.
[0051] When industrial cameras are operating normally, their operating parameters are typically stored in volatile memory (RAM). Once power is lost or a hardware reset occurs, these parameters are instantly lost, reverting to factory default values. This means that even after a soft reset, although the camera is connected, it may still fail to function properly because the parameters are incorrect (e.g., it has switched to automatic exposure or internal triggering).
[0052] In another embodiment, the control method for the industrial camera system further includes: The operating parameters of the target industrial camera are written into the memory and set to be automatically loaded upon power-on, so that the target industrial camera automatically loads the operating parameters when performing the initialization action, so as to restore the operating state that matches the operating parameters.
[0053] Based on the above embodiments, refer to Figure 4The control device periodically sends heartbeat packets and sets a timeout timer (e.g., 3000ms). If a camera response command is received within the preset first time interval, the connection is considered normal, and monitoring continues. If no camera response command is received within the preset first time interval, the target industrial camera is determined to be offline and enters a deadlock state. At this time, the SDK reset API is called: the host computer uses the reset interface function provided by the SDK (e.g., ResetDevice()), that is, calls the physical layer reset interface, to send a soft reset command to the target industrial camera, causing the target industrial camera to restart its internal system (e.g., MCU, image sensor, etc.). After receiving the soft reset command, the target industrial camera begins to perform internal reset and initialization operations, including power-on, firmware loading, register initialization, etc. The host computer waits for a preset second time interval (2~5S) for the camera to complete the reset and bootstrap process (the reset time varies depending on the camera model, but is usually 1000ms). The host computer scans the USB / Ethernet ports, that is, the host computer uses the SDK's device enumeration interface function to scan all physical interfaces (e.g., USB 3.0, Gigabit Ethernet) to detect currently online devices. The system re-enumerates devices to obtain a list of all currently connected and responding devices (e.g., serial number, IP address, model). It matches the target camera's unique identifier (e.g., serial number) in the device list to confirm the camera has successfully restarted and is online. Then, it opens the camera: calling the SDK's device opening interface function establishes a communication connection with the target camera and obtains the device handle. The camera automatically loads the User Set: reading preset operating parameters (e.g., trigger mode, exposure time, gain) from non-volatile memory, restoring it to its previous operating state. Parameter loading: confirming successful parameter loading, it prepares to resume acquisition. Resuming acquisition: the host computer controls the camera to restart image acquisition, returning to normal operating status. Normal operating status means the industrial camera is in a normal image acquisition and data transmission state, with a communication connection maintained between the host computer and the industrial camera. The reset API is a physical layer reset interface function in the SDK specifically used to trigger a soft reset of the camera. The time from disconnection to automatic recovery is typically within 3-5 seconds, less than the time required for manual intervention (several minutes or even longer).
[0054] In this embodiment, before the camera is put into normal operation, the host computer writes a complete set of debugged working parameters (such as exposure, gain, trigger mode, etc.) into the camera's internal non-volatile memory in advance through the SDK, and marks it as automatically loaded upon power-on.
[0055] It's important to note that operating parameters refer to a series of configuration parameters that determine the camera's image quality and communication behavior, including but not limited to trigger mode and trigger source, exposure time, gain, ROI region, and frame rate. Trigger mode and trigger source determine "when the industrial camera takes a picture." For example, setting it to "external hardware trigger" means the industrial camera must receive an electrical signal from an external sensor or PLC to take a picture; if the trigger mode and trigger source parameters are lost after a reset and the camera reverts to "continuous acquisition," it will uncontrollably take pictures indiscriminately, causing system crashes. Exposure time refers to the length of time the camera shutter is open, directly determining the brightness of the image. Gain is equivalent to the camera's "ISO," amplifying the signal to increase brightness, but excessive gain can produce noise. ROI region, or "region of interest," refers to the portion of the image captured from the sensor for output (e.g., only capturing the QR code in the middle of the product). This significantly reduces image size and improves processing speed. Frame rate refers to how many images the camera captures and outputs per second.
[0056] In this embodiment, power-on auto-load is a key configuration instruction (usually corresponding to the UserSetDefault property in the SDK). Its function is to tell the camera's underlying firmware: "As soon as power is applied (or hardware reset initialization is completed), do not use the factory default settings, but automatically read and apply the specified group of User Set parameters." In this way, by storing the working parameters in the non-volatile memory of the industrial camera in advance and setting it to be automatically read upon power-on, it is ensured that the camera can automatically return to its previous working state after a soft reset, without the need for the host computer to reissue the configuration parameters or for manual intervention.
[0057] Understandably, electrostatic interference is often not a single pulse that disappears instantly, but rather a continuous fluctuation. If the camera restarts at the exact moment of an interference peak, or if residual charge noise inside the device has not completely dissipated, it is easy to re-enter a deadlock state.
[0058] In one embodiment, reference Figure 3 The control method for the industrial camera system further includes: Step S500: In the event that the connection with the target industrial camera fails to be established, the following steps are repeated: when the first duration reaches the preset first duration and no camera response instruction is received, the physical layer reset interface is called to generate a soft reset instruction and send the soft reset instruction to the target industrial camera, and the second timing is started to obtain the second duration. Step S600: If the number of loops reaches the preset number and the connection with the target industrial camera fails, output error log information and mark the target industrial camera as faulty and offline.
[0059] In this embodiment, based on the above embodiments, upon detecting a heartbeat timeout (the first duration reaches a preset first duration and there is no response), the physical layer reset interface is invoked, a soft reset command is sent, and a "reset waiting period" is entered, waiting for a preset second duration (to allow the camera to fully start). Then, a connection attempt is made, performing connection operations such as device enumeration and device opening. If the connection fails, the current reset operation number is determined. If n is less than or equal to the preset number, a counter is incremented by 1, and the physical layer reset interface is repeatedly invoked to send the soft reset command. If a connection to the target industrial camera still cannot be established, and the number of reset operations exceeds the preset number, the cyclic reset stops, an error log is output, and error information is recorded (e.g., "Camera connection timed out, soft reset failed 3 times"). Simultaneously, the camera is marked as "faulty offline state." A sound or light warning can also be issued to notify manual intervention for inspection. The preset number of attempts is pre-set by the R&D personnel; in this embodiment, the preset number can be selected as 3.
[0060] In this embodiment, the preset number of times reduces the problem of deadlock after restarting caused by electrostatic interference fluctuations, improves the reliability and stability of the industrial camera system, and further ensures the stable operation of the production line where the industrial camera is located.
[0061] In another embodiment, the reset action includes forcibly terminating the current instruction set of the target industrial camera, pointing the central processing unit pointer of the target industrial camera to the firmware start address, forcibly restoring the hardware state machine to the initial state, and forcibly clearing or restoring the control register, status register and data cache inside the target industrial camera to the hardware default value. The initialization action includes reloading the firmware program based on the firmware start address, clearing the current configuration parameters in the registers of the target industrial camera based on the loaded firmware program, and resetting the registers until the target industrial camera enters standby mode.
[0062] In this embodiment, the reset action is equivalent to forcibly returning the camera to zero, the initialization action is equivalent to reloading the operating system (firmware), configuring each register according to the factory default rules, and finally putting the industrial camera in a ready-to-use idle state, waiting for the host computer to issue commands again.
[0063] It's important to note that the instruction set is the collection of all instructions that the industrial camera's internal processor (CPU) can understand and execute. It refers to the sequence of tasks the industrial camera is currently executing (e.g., "Start acquisition → Process image → Send data"). Forced termination means cutting off the CPU's current execution flow and ceasing further task execution. The CPU pointer, usually referring to the program counter, is a register in the CPU that stores the address in memory of the next instruction to be executed. Setting the CPU pointer to the firmware start address means that after a reset, the industrial camera's CPU will resume execution from the first line of the firmware code, rather than continuing from where it left off. The firmware start address is the starting location in the camera's internal non-volatile memory where the firmware program (the camera's operating system) code is stored; it's the entry point for camera startup. After a reset, the CPU must jump to this location to begin loading the program. A hardware state machine is a digital logic circuit design pattern used to manage the operational flow of hardware. It divides hardware operations into several "states" (e.g., idle, exposure, reading, transmission) and transitions between these states based on a clock or signal. If a camera crashes due to interference, its state machine may be stuck in the "exposing" state, making it unable to respond to new commands. Forcing the hardware state machine back to its initial state is equivalent to forcibly pulling it back to the "idle" state, thus resolving the deadlock. Control registers are a set of storage units used to configure hardware behavior. Writing different values can enable / disable specific functions (such as enabling trigger mode or setting gain). Clearing or restoring the control registers to default values during reset prevents the industrial camera from restarting with incorrect configurations (such as incorrect exposure times). Status registers are storage units used to record the current state of the hardware. They use different bits to mark whether the hardware is busy, has encountered an error, or whether the data is ready. If the camera crashes because the "error flag" is set, the reset action must clear these flags; otherwise, the system will assume the error still exists. Data buffers typically refer to the camera's frame buffer or FIFO buffer, used to temporarily store raw image data acquired by the image sensor, awaiting transmission to the host computer. Forcibly clearing the buffer during reset prevents data from before the reset (which may be incomplete or interfered with) from being mistakenly transmitted to the host computer after restarting. Standby mode refers to the final state of the camera after initialization. At this time, the firmware has been loaded and the registers have been configured, but the camera has not yet started acquiring images and is in a low-power or command-listening state.
[0064] In this embodiment, the initialization action is equivalent to the "system reinstallation" and "factory reset" process performed by the industrial camera after a reset. During the reset action, the CPU pointer is forcibly reset to the firmware start address. Therefore, during the initialization action, the CPU begins reading instructions line by line from the firmware start address. Firmware is the camera's "operating system," instructing the camera on how to control sensor exposure, how to package data, and how to respond to host computer commands. Reloading means that the industrial camera has re-established its operational logic, ensuring it is no longer in the chaotic, deadlocked state it was in before the reset. Registers are high-speed storage units inside the camera used to store temporary configurations. For example, the "exposure time register" stores 5000µs, and the "gain register" stores 10dB. When the camera crashes or is interfered with, the values in these registers may become garbled (e.g., become invalid values) or retain markers from the previous incomplete tasks (e.g., a "transferring" marker). After the firmware program starts, it executes an initialization code that forcibly writes all these registers to their "default values" (factory settings), restoring all settings of the industrial camera (exposure, gain, trigger mode) to their factory default state, ensuring that the industrial camera has no residual misconfigurations. Once the firmware is loaded and the registers are reset, all modules inside the camera (sensor, FPGA, network card / USB interface) are ready. At this point, the camera will not automatically start taking pictures but will enter standby mode, waiting for new commands (such as "set parameters" or "start acquisition") from the host computer, ready to receive a new round of control.
[0065] In this embodiment, the industrial camera includes a power management chip and an image acquisition module, and the reset action further includes: The power management chip controlling the target industrial camera sequentially performs power-off and power-on actions on the image acquisition module.
[0066] In this embodiment, when a reset is required, the host computer directly controls the power management chip to cut off the power rail specifically supplied to the image acquisition module, maintaining a power outage for a very short time (e.g., tens of milliseconds), and then reconnecting the power. The image acquisition module contains complex analog circuits and digital logic. When subjected to strong electrostatic interference or signal abnormalities, the analog circuits inside the image acquisition module may enter a "latch-up effect" or physical deadlock state. In this state, the image acquisition module may experience physical "deadlock" or abnormal charge accumulation. Therefore, by performing a power-off action on the image acquisition module, all internal capacitors are forced to discharge, all transistors are turned off, and all residual charge is released. After the power-off, a power-on action is performed, and the analog circuit begins to establish a bias voltage, thus resolving the physical deadlock state. Furthermore, the image acquisition module requires precise voltage bias to function properly. Electrostatic interference may cause these internal bias voltages to drift. Power-on triggers the power-on reset circuit inside the image acquisition module, recalibrating all analog bias voltages and ensuring that the image acquisition module returns to the appropriate operating point.
[0067] The present invention also proposes an industrial camera system, which includes a terminal device and an industrial camera, wherein the terminal device is electrically connected to the industrial camera; The terminal device includes a control unit, which is used to execute the steps of the control method for the industrial camera system described in any of the above-described embodiments.
[0068] Optionally, the industrial camera system further includes a hub, wherein the industrial camera is electrically connected to a first end of the hub, and the terminal device is electrically connected to a second end of the hub; The metal casing of the industrial camera, the metal casing of the hub, and the chassis of the terminal equipment are connected to the same grounding terminal through a grounding conductor to form a single-point grounding system. The cross-sectional area of the grounding conductor is not less than 2.5 square millimeters.
[0069] In this embodiment, the metal casings of all devices in the industrial camera system (camera casing, hub casing, terminal equipment chassis) are connected to the same physical grounding point (such as the ground wire of a mains socket) via wires. The larger the cross-sectional area of the grounding conductor, the lower the resistance. Electrostatic discharge (ESD) is characterized by extremely high voltage and large instantaneous current. If thin wires are used, the high resistance will cause a high voltage drop when a large current passes through, and may even burn out the wires. Therefore, this embodiment can use a thick copper wire of not less than 2.5 mm² as the grounding conductor, which can ensure that the electrostatic current flows into the ground instantaneously without generating high voltage accumulation on the equipment casing. The single-point grounding system forces all devices to be at the same potential (0V), eliminates potential differences, provides a low-impedance discharge path for electrostatic current, and reduces the coupling of electrostatic current to communication lines.
[0070] With the above settings, on the hardware side, the risk of industrial cameras entering a deadlock state is physically reduced by using a single-point grounding system, and the deadlock state can be cleared by a soft reset in the event of interference.
[0071] The control device for the industrial camera system provided by this invention is based on the control method for the industrial camera system described above. Compared with the prior art, the beneficial effects of the industrial camera system provided by this invention are the same as those of the control method for the industrial camera system provided in the above embodiments, and other technical features in the control device are the same as those disclosed in the method of the above embodiments, and will not be repeated here.
[0072] The above description is only a part of the embodiments of the present invention and does not limit the patent scope of the present invention. All equivalent structural transformations made under the technical concept of the present invention using the contents of the present invention specification and drawings, or direct / indirect applications in other related technical fields, are included within the patent protection scope of the present invention.
Claims
1. A control method for an industrial camera system, characterized in that, The industrial camera includes a memory for storing the operating parameters of the industrial camera, and the control method of the industrial camera system includes: A query command is sent to the target industrial camera at a preset time interval, and the first timing begins to obtain the first duration; If the first duration has not reached the preset first duration and a camera response command is received, the process of sending query commands to the target industrial camera at preset time intervals is executed repeatedly. If the first duration reaches the preset first duration and no camera response command is received, the physical layer reset interface is invoked to generate a soft reset command and send the soft reset command to the target industrial camera, and the second timing is started to obtain the second duration; When the second duration reaches the preset second duration, a connection is established with the target industrial camera so that the target industrial camera is in working condition. When the target industrial camera receives the soft reset command, it triggers the hardware-level circuit to execute the reset action and the initialization action in sequence. The reset action includes forcibly terminating the current instruction set of the target industrial camera, pointing the central processing unit pointer of the target industrial camera to the firmware start address, forcibly restoring the hardware state machine to the initial state, and forcibly clearing or restoring the control register, status register and data cache inside the target industrial camera to the hardware default value. The initialization action includes reloading the firmware program based on the firmware start address, clearing the current configuration parameters in the registers of the target industrial camera based on the loaded firmware program, and resetting the registers until the target industrial camera enters standby mode.
2. The control method for the industrial camera system as described in claim 1, characterized in that, The industrial camera system includes a software development kit, and the step of sending query commands to the target industrial camera at preset time intervals includes: The software development kit sends heartbeat packets to the target industrial camera at preset time intervals.
3. The control method for the industrial camera system as described in claim 2, characterized in that, The heartbeat packet may include instructions to read the status register of the target industrial camera, or an empty command that does not contain payload data.
4. The control method for the industrial camera system as described in claim 1, characterized in that, The industrial camera system includes a software development kit (SDK), which stores device enumeration interface functions and device opening interface functions. Establishing a connection with the target industrial camera includes: Call the device enumeration interface function to scan and obtain the list of access device information; The target industrial camera is determined based on the access device information list, and the device interface opening function is called to establish a communication connection with the target industrial camera.
5. The control method for the industrial camera system as described in any one of claims 1 to 4, characterized in that, The control method for the industrial camera system also includes: The operating parameters of the target industrial camera are written into the memory and set to be automatically loaded upon power-on, so that the target industrial camera automatically loads the operating parameters when performing the initialization action, so as to restore the operating state that matches the operating parameters.
6. The control method for the industrial camera system as described in any one of claims 1 to 4, characterized in that, The control method for the industrial camera system also includes: In the event of failure to establish a connection with the target industrial camera, the process of calling the physical layer reset interface to generate a soft reset command and sending the soft reset command to the target industrial camera when the first time period reaches a preset first time period and no camera response command is received, and starting the second timer to obtain the second time period, is repeated. If the number of loops reaches the preset number and the connection with the target industrial camera fails to be established, an error log message will be output, and the target industrial camera will be marked as faulty and offline.
7. The control method for the industrial camera system as described in claim 1, characterized in that, The industrial camera includes a power management chip and an image acquisition module, and the reset action further includes: The power management chip controlling the target industrial camera sequentially performs power-off and power-on actions on the image acquisition module.
8. An industrial camera system, characterized in that, The industrial camera system includes a terminal device and an industrial camera, wherein the terminal device is electrically connected to the industrial camera. The terminal device includes a control unit for performing the steps of the control method for the industrial camera system as described in any one of claims 1 to 7.
9. The industrial camera system as described in claim 8, characterized in that, The industrial camera system also includes a hub, the industrial camera is electrically connected to a first end of the hub, and the terminal device is electrically connected to a second end of the hub; The metal casing of the industrial camera, the metal casing of the hub, and the chassis of the terminal equipment are connected to the same grounding terminal through a grounding conductor to form a single-point grounding system. The cross-sectional area of the grounding conductor is not less than 2.5 square millimeters.
Citation Information
Patent Citations
Order-for-money slip of paper with adhesive backed tab
CA2026001A1
Pneumatic suspension in a rail system for controlling and stabilizing towing jib
CA2026002A1
Vehicle-mounted Ethernet gateway dynamic configuration method and system and vehicle
CN120378308A
PCIe-based network card firmware hot restart method, medium and equipment
CN122261624A