High-precision adaptive embedded electronic particle counter control system and method

By introducing a high-frequency photoelectric sensor, an industrial camera, and a weighing module into the grain counter, a closed-loop feedback system was constructed, enabling real-time error calculation and adaptive parameter correction. This solved the problem of the counting accuracy of the grain counter decreasing over time, and improved production efficiency and accuracy stability.

CN122172574APending Publication Date: 2026-06-09TIANCHEN BIOTECHNOLOGY (WEIHAI) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
TIANCHEN BIOTECHNOLOGY (WEIHAI) CO LTD
Filing Date
2026-03-12
Publication Date
2026-06-09

Smart Images

  • Figure CN122172574A_ABST
    Figure CN122172574A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of industrial automation control, in particular to a high-precision self-adaptive embedded electronic particle counting machine control system and method, which comprises the following steps: calling a historical optimal parameter set in a material database through a parameter presetting module, and configuring a high-frequency photoelectric sensor and an industrial camera; synchronously collecting event data and image data by using a multi-modal perception counting module, and generating a particle counting result by using a data fusion algorithm; acquiring a total weight by using a weighing module and calculating an actual particle quantity by using a physical reference feedback module; comparing the actual quantity and the counting result by using an error calculation and judgment module, calculating a real-time counting error rate, and dynamically fine-tuning photoelectric sensitivity and visual analysis parameters in the historical optimal control parameter set based on the error rate by using a self-adaptive correction module when the error rate is out of limit. The application realizes online self-correction and long-term stable maintenance of counting precision, and effectively improves adaptability and counting accuracy of the equipment to complex materials.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial automation control technology, and in particular to a high-precision adaptive embedded electronic counting machine control system and method. Background Technology

[0002] Electronic counting machines are key equipment in modern industrial production for the rapid and accurate counting and packaging of granular items such as tablets, capsules, seeds, and hardware parts. By replacing traditional manual counting, they significantly improve production efficiency and counting accuracy. Existing counting machines typically rely on photoelectric sensors or machine vision technology for detection, triggering a counting signal by detecting the occlusion of light or image features by falling particles.

[0003] However, existing technologies generally suffer from a key drawback: their control systems are mostly open-loop structures, lacking an effective self-calibration mechanism. Specifically, after initial parameter adjustments, the counting accuracy gradually decreases over time due to sensor drift, optical lens contamination, mechanical wear, or minor changes in material properties, and this accuracy decay cannot be self-detected or corrected. Operators must periodically stop the machine, manually check parameters, and adjust them based on experience to restore accuracy. This not only leads to a loss of production efficiency but also places excessive demands on the operators' professional experience, making it difficult to guarantee consistently stable counting accuracy. Therefore, how to enable the counting machine to have adaptive capabilities, allowing it to self-assess and correct its counting accuracy online in real time, has become a technical problem to be solved in this field. Summary of the Invention

[0004] To overcome the above shortcomings, this invention provides a high-precision adaptive embedded electronic counting machine control system and method, aiming to improve the problem that most existing control systems are open-loop structures and lack effective self-correction mechanisms.

[0005] In a first aspect, the present invention provides the following technical solution: a high-precision adaptive embedded electronic grain counting machine control system, wherein the system is executed by a grain counting machine including a high-frequency photoelectric sensor, an industrial camera, and a weighing module, and includes the following modules:

[0006] The parameter preset module is used to respond to user operations by calling the historical optimal control parameter set corresponding to the selected target material from the pre-built material database, and configuring the high-frequency photoelectric sensor and the industrial camera accordingly. The historical optimal control parameter set includes photoelectric sensitivity parameters and visual analysis parameters.

[0007] The multimodal sensing and counting module is used to simultaneously collect event data from the high-frequency photoelectric sensor and image data from the industrial camera during the falling of particulate material, and to process the event data and image data using a data fusion algorithm to generate particle counting results.

[0008] The physical reference feedback module is used to periodically obtain the total weight of the packaged material through the weighing module during the counting process, and calculate the actual number of particles based on the standard weight of the unit particle.

[0009] The error calculation and judgment module is used to compare the actual number of particles with the particle counting result, calculate the real-time counting error rate, and determine whether the real-time counting error rate exceeds a preset threshold.

[0010] An adaptive correction module is used to dynamically fine-tune the photoelectric sensitivity parameters and visual analysis parameters in the historical optimal control parameter set based on the real-time counting error rate when the real-time counting error rate exceeds a preset threshold.

[0011] Preferably, the configuration process for the high-frequency photoelectric sensor and the industrial camera includes:

[0012] In response to the user's selection command on the operation interface, determine the target material identifier;

[0013] Using the target material identifier as an index, the corresponding historical optimal control parameter set is queried and retrieved from the pre-built material database. The historical optimal control parameter set includes photoelectric sensitivity parameters for the high-frequency photoelectric sensor and visual analysis parameters for the industrial camera.

[0014] The photoelectric sensitivity parameters are sent to the driving unit of the high-frequency photoelectric sensor for configuration.

[0015] The visual analysis parameters are sent to the image processing unit connected to the industrial camera for configuration.

[0016] Preferably, the process for generating the particle counting results includes:

[0017] The event data generated by the high-frequency photoelectric sensor is pulse shaped and compared with a threshold to generate a binarized photoelectric event sequence.

[0018] The image sequence acquired by the industrial camera is subjected to time-series analysis. Particle targets are detected and located for each frame of the image, and a visual counting event sequence is generated.

[0019] Under a unified timestamp, the photoelectric event sequence and the visual counting event sequence are aligned and associated;

[0020] Based on the association results, a fusion decision is executed, and the counting results of the visual counting event sequence are preferentially adopted as the output of the fusion decision;

[0021] Based on the output of the fusion decision, the cumulative particle count is updated.

[0022] Preferably, the execution process of the fusion decision includes:

[0023] Determine whether the target material is transparent or reflective.

[0024] If the judgment result is yes, then the counting result of the visual counting event sequence shall be adopted as the fusion counting result.

[0025] If the judgment result is negative, the counting result of the photoelectric event sequence shall be adopted as the fusion counting result.

[0026] Preferably, the calculation process for the actual number of particles includes:

[0027] Read the standard weight of a unit particle corresponding to the selected target material from the pre-built material database;

[0028] The total weight of the packaged material obtained by the weighing module is divided by the standard weight of the unit particle to obtain the theoretical number of particles.

[0029] The theoretical particle count is rounded down, and the result is taken as the actual particle count.

[0030] Preferably, the calculation process for the real-time counting error rate includes:

[0031] The difference between the actual number of particles and the particle count result is calculated as the absolute error;

[0032] Divide the absolute error by the particle count result to obtain the relative error value;

[0033] The absolute value of the relative error is taken as the real-time counting error rate.

[0034] Preferably, the process for dynamically fine-tuning the photoelectric sensitivity parameters and visual analysis parameters includes:

[0035] The real-time counting error rate is compared with a preset threshold to generate an error status signal;

[0036] Based on the error state signal, a preset parameter adjustment mapping table is queried to determine the fine-tuning direction and fine-tuning step size for the photoelectric sensitivity parameter and the visual analysis parameter.

[0037] Based on the fine-tuning direction and the fine-tuning step size, the photoelectric sensitivity parameter and the visual analysis parameter in the historical optimal control parameter set are numerically updated.

[0038] The updated photoelectric sensitivity parameters and visual analysis parameters are sent to the high-frequency photoelectric sensor and the industrial camera to complete the configuration.

[0039] Secondly, the present invention provides a high-precision adaptive embedded electronic counting machine control method, the method comprising the following steps:

[0040] In response to user operation, the system retrieves the historical optimal control parameter set corresponding to the selected target material from the pre-built material database, and configures the high-frequency photoelectric sensor and the industrial camera accordingly. The historical optimal control parameter set includes photoelectric sensitivity parameters and visual analysis parameters.

[0041] During the falling of particulate material, event data from the high-frequency photoelectric sensor and image data from the industrial camera are collected simultaneously. A data fusion algorithm is used to process the event data and the image data to generate a particle counting result.

[0042] During the counting process, the total weight of the packaged material is periodically obtained through the weighing module, and the actual number of particles is calculated based on the standard weight of the unit particle.

[0043] The actual number of particles is compared with the particle counting result to calculate the real-time counting error rate, and it is determined whether the real-time counting error rate exceeds a preset threshold.

[0044] When the real-time counting error rate exceeds a preset threshold, the photoelectric sensitivity parameter and visual analysis parameter in the historical optimal control parameter set are dynamically fine-tuned based on the real-time counting error rate.

[0045] The present invention has the following beneficial effects:

[0046] 1. In this invention, by introducing a weighing module as a physical reference and constructing a closed-loop feedback, the system can calculate the counting error in real time and automatically fine-tune key parameters, effectively compensating for the accuracy decay caused by sensor drift, optical contamination and mechanical wear, and solving the problem of the accuracy of traditional open-loop counting systems decreasing with running time.

[0047] 2. In this invention, by employing a multimodal data fusion algorithm and specifically setting a strategy that prioritizes visual analysis when processing transparent or reflective particles, the inherent defects of a single photoelectric sensor in such scenarios are overcome, and the reliability under complex material conditions is greatly improved.

[0048] 3. In this invention, one-click production changeover and parameter self-tuning are realized based on the pre-built material database, which transforms the tedious manual debugging process into automated parameter calling and fine-tuning, greatly shortening the production changeover time, lowering the operation threshold, and providing a foundation for realizing flexible and intelligent production. Attached Figure Description

[0049] Figure 1 This is a schematic diagram of the architecture of a high-precision adaptive embedded electronic counting machine control system proposed in this invention;

[0050] Figure 2 This is a flowchart illustrating a high-precision adaptive embedded electronic counting machine control method proposed in this invention. Detailed Implementation

[0051] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0052] Example 1:

[0053] In a first embodiment of the present invention, a high-precision adaptive embedded electronic pellet counter control system is provided. The system is executed by a pellet counter including a high-frequency photoelectric sensor, an industrial camera, and a weighing module. Figure 1 As shown, it includes the following modules:

[0054] The parameter preset module is used to respond to user operations by calling the historical optimal control parameter set corresponding to the selected target material from the pre-built material database, and configuring the high-frequency photoelectric sensor and industrial camera accordingly. The historical optimal control parameter set includes photoelectric sensitivity parameters and visual analysis parameters.

[0055] Furthermore, the configuration process for high-frequency photoelectric sensors and industrial cameras includes:

[0056] In response to the user's selection command on the operation interface, determine the target material identifier;

[0057] Using the target material identifier as an index, the corresponding historical optimal control parameter set is queried and retrieved from the pre-built material database. The historical optimal control parameter set includes photoelectric sensitivity parameters for high-frequency photoelectric sensors and visual analysis parameters for industrial cameras.

[0058] The photoelectric sensitivity parameters are sent to the drive unit of the high-frequency photoelectric sensor for configuration.

[0059] The visual analysis parameters are sent to the image processing unit connected to the industrial camera for configuration.

[0060] Specifically, firstly, the system receives user operation instructions through its human-machine interface (such as a touchscreen). These instructions are the target material identifier selected by the user from a preset material list, such as "5mm transparent capsule_Type A". The material list is associated with a material database pre-built in the system's non-volatile memory. Subsequently, the parameter preset module queries the material database using the target material identifier as the index key. The material database stores a set of historically optimal control parameters that correspond one-to-one with various material identifiers. After a successful query, the system retrieves the complete set of parameters corresponding to the target material from the database. The set of historically optimal control parameters is a structured dataset that includes at least two key parameters: one is the photoelectric sensitivity parameter used to configure the high-frequency photoelectric sensor (e.g., a voltage value or digital code used to set the comparator threshold), and the other is the visual analysis parameter used to configure the industrial camera (e.g., the grayscale threshold for image binarization, the coordinate range of the region of interest (ROI), or the sensitivity value related to the background subtraction algorithm).

[0061] After the parameters are called, the configuration process begins. Specifically, the parameter preset module sends the photoelectric sensitivity parameters to the high-frequency photoelectric sensor's integrated or dedicated drive unit (usually a microcontroller or programmable logic device) via an internal communication bus (such as SPI, I2C, or Ethernet). The drive unit adjusts the operating point of its internal circuit (such as amplification gain or comparison level) according to the received parameter values, thereby completing the precise configuration of the sensor sensitivity. At the same time, the parameter preset module sends the visual analysis parameters to the image processing unit that works in conjunction with the industrial camera via a camera interface (such as GigEVision or USB3Vision). The image processing unit can be an independent embedded processor (such as the ARM Cortex-A series) or software running on an industrial control computer. After these parameters are loaded, they will directly guide the algorithm behavior in the subsequent image acquisition and processing process, ensuring that the visual analysis of the current material is in the optimal state.

[0062] Through the above steps, the automatic association and matching between the material database and the target material enables one-click production changeover and accurate and rapid preset of sensor parameters, significantly reducing the equipment's reliance on operator experience and improving production changeover efficiency.

[0063] The multimodal sensing and counting module is used to simultaneously collect event data from a high-frequency photoelectric sensor and image data from an industrial camera during the falling of particulate materials. It then uses a data fusion algorithm to process the event data and image data and generate particle counting results.

[0064] Furthermore, the process for generating particle counting results includes:

[0065] Pulse shaping and threshold comparison are performed on the event data generated by the high-frequency photoelectric sensor to generate a binarized photoelectric event sequence.

[0066] Perform time-series analysis on image sequences acquired by industrial cameras, detect and locate particle targets for each frame, and generate a visual counting event sequence.

[0067] Align and correlate photoelectric event sequences and visual counting event sequences under a unified timestamp;

[0068] Based on the association results, a fusion decision is executed, prioritizing the use of the counting results of the visual counting event sequence as the output of the fusion decision;

[0069] The cumulative particle count is updated based on the output of the fusion decision.

[0070] Furthermore, the execution process of integrated decision-making includes:

[0071] Determine whether the current target material is transparent or reflective;

[0072] If the judgment result is yes, then the counting result of the visual counting event sequence shall be adopted as the fusion counting result.

[0073] If the judgment result is negative, the counting result of the photoelectric event sequence shall be adopted as the fusion counting result.

[0074] Specifically, as the particulate material is conveyed by the vibratory feeder and falls through the detection area, the system simultaneously triggers a high-frequency photoelectric sensor and an industrial camera. The high-frequency photoelectric sensor detects the obstruction of the light beam by the particles in real time and outputs a series of continuous level changes, which are recorded as event data. At the same time, the industrial camera acquires an image sequence of the falling particles at a preset frame rate. The multimodal sensing and counting module first preprocesses the two heterogeneous data to generate a standardized counting event sequence. Specifically, for the event data, the module first performs pulse shaping (such as Schmitt triggering) through its internal signal conditioning circuit or digital algorithm to eliminate noise interference. Then, the shaped signal is compared with a signal set by a photoelectric sensitivity parameter. Voltage thresholds are compared to generate a binary photoelectric event sequence consisting of high and low levels. Each effective pulse peak that rises from low to high and then falls back represents a particle passing event. For image sequences, the module performs time-series analysis in the image processing unit. For each frame of the image, the image is first binarized using visual analysis parameters (such as preset grayscale thresholds), and then particle target detection and localization are performed using a connected component analysis algorithm. The number of particle contour center points identified in each frame is counted. Each successfully identified and located particle is recorded as a visual counting event in the frame in which it first appears. All these events constitute a visual counting event sequence in chronological order.

[0075] To achieve data fusion, the system assigns a unified timestamp provided by the system's master clock to each photoelectric and visual event. Then, within a configurable time association window Δt, the module aligns and associates the photoelectric event sequence with the visual counting event sequence. Specifically, if the timestamp difference between a photoelectric event and a visual event is less than Δt, they are considered to originate from the same particle and associated. Based on the association result, the module executes a fusion decision. Its core logic is to first determine whether the target material currently set by the parameter preset module is transparent or reflective. This determination can be based on the attribute tags preset for the material in the material database, or by analyzing the initial... The grayscale distribution and contrast of the image sequence are used to automatically determine whether the material is transparent or reflective. If the determination result is yes (i.e., the current material is transparent or reflective), then within a time window, as long as there is a valid particle recognition event in the visual counting event sequence, the counting result of that visual event is adopted first as the fusion counting result of the current time window. At this time, the photoelectric event sequence is mainly used to assist in verification and triggering, or to provide backup counting when there is no valid event in the visual sequence. If the determination result is no (i.e., the current material is ordinary opaque material), then the counting result of the photoelectric event sequence with faster response and smaller data volume is adopted first as the fusion counting result, and visual counting events are periodically sampled for result verification.

[0076] Finally, based on the real-time output of this fusion decision, the module dynamically updates the accumulated particle count result, and the count result N can be updated using the following formula:

[0077] ;

[0078] in, This represents the cumulative number of particles at the previous moment. This represents the number of newly added particles confirmed within the current fusion decision-making cycle;

[0079] Through the above steps, high-speed counting can be guaranteed in general scenarios, and the system can automatically switch to vision-driven mode when dealing with special materials such as transparent and reflective materials, thus solving the problems of missed counting and misjudgment of such particles.

[0080] The physical reference feedback module is used to periodically obtain the total weight of the packaged materials through the weighing module during the counting process, and calculate the actual number of particles based on the standard weight of the unit particle.

[0081] Furthermore, the calculation process for the actual number of particles includes:

[0082] Read the standard weight of a unit particle corresponding to the selected target material from the pre-built material database;

[0083] The total weight of the packaged material obtained through the weighing module is divided by the standard weight of the unit particle to obtain the theoretical particle count.

[0084] The theoretical particle count is rounded down, and the result is used as the actual particle count.

[0085] Specifically, during the counting and packaging process of the particle counter, the physical reference feedback module is responsible for providing a precise physical reference to verify the counting accuracy. Its operation is triggered by the particle counting results. For example, when the cumulative particle count generated by the multimodal sensing counting module reaches the preset sampling batch (e.g., every 1000 particles counted), a feedback process is initiated. Specifically, the physical reference feedback module first reads the unit particle standard weight that uniquely corresponds to the selected target material currently being produced from the pre-built material database. This value is a precise value obtained by weighing a large number of such particles using a precision balance and taking the average during the material library construction. It is stored in the database as a calculation benchmark. Subsequently, the module sends a command to the weighing module through a communication interface (such as RS232 or Ethernet) to obtain the total weight of the packaged material (i.e., the counted particles and their containers). The weighing module typically uses a high-precision digital sensor, and the weight value it returns has already undergone temperature compensation and filtering. Next, the module performs the core calculation step, dividing the obtained total weight by the standard weight per unit particle to obtain the theoretical particle count. The calculation process is represented by the following formula:

[0086] ;

[0087] Since the actual number of particles must be an integer, the calculated number is... The number is usually a decimal, and the module needs to perform rounding operations on it. This invention uses the rounding rule for rounding, and its operation process is defined by the following formula:

[0088] ;

[0089] in, (.) is the rounding function, and the result is... This is the actual number of particles that ultimately serve as the verification benchmark;

[0090] Through the above steps, the count, which cannot be directly observed, can be transformed into a physical weight that can be accurately measured. Through rigorous calculation and data processing, a reliable actual quantity value is obtained, providing a real and objective feedback basis for the subsequent error calculation and adaptive correction of the system.

[0091] The error calculation and judgment module is used to compare the actual number of particles with the particle counting result, calculate the real-time counting error rate, and determine whether the real-time counting error rate exceeds the preset threshold.

[0092] Furthermore, the calculation process for the real-time counting error rate includes:

[0093] Calculate the difference between the actual number of particles and the particle count result, and use it as the absolute error;

[0094] Divide the absolute error by the particle count result to obtain the relative error value;

[0095] The absolute value of the relative error is used as the real-time counting error rate.

[0096] Specifically, the error calculation and judgment module receives the actual number of particles from the physical reference feedback module. Compared with particle counting results from the multimodal sensing and counting module The error calculation and judgment module quantifies the degree of deviation between the two and makes a judgment accordingly. First, the module calculates the absolute error between the two. This value reflects the direct numerical deviation of the counting result and is calculated using the following formula:

[0097] ;

[0098] Since absolute error cannot objectively reflect the severity of the deviation (for example, the absolute error of 10 grains is completely different for a target count of 100 grains and 10,000 grains), the module then calculates the relative error value. This value normalizes the absolute error to the total count and is calculated using the following formula:

[0099] ;

[0100] Finally, to ensure that the error rate is a positive scalar used to measure the magnitude of the deviation, the module takes the absolute value of the aforementioned relative error values ​​and uses it as the final real-time counting error rate. Its calculation is defined by the following formula:

[0101] ;

[0102] This formula expresses the error rate as a percentage, which aligns with intuitive practices in engineering. After calculating the real-time counting error rate, the module compares it with a preset threshold T (e.g., 0.1%). This threshold, stored in the system configuration, represents the maximum relative error the system can tolerate. The judgment logic is as follows: if... If the error exceeds T, an error over-limit signal is generated, triggering the subsequent adaptive correction module. If T ≤ T, then the system is considered to be in normal working condition and continues to run;

[0103] Through the above steps, the counting deviation can be transformed into a standardized, quantifiable, and comparable indicator, providing a key decision-making basis for the system to achieve intelligent precision control and self-correction.

[0104] The adaptive correction module is used to dynamically fine-tune the photoelectric sensitivity parameters and visual analysis parameters in the historical optimal control parameter set based on the real-time counting error rate when the real-time counting error rate exceeds the preset threshold.

[0105] Furthermore, the process for dynamically fine-tuning the photoelectric sensitivity parameters and visual analysis parameters includes:

[0106] The real-time counting error rate is compared with a preset threshold to generate an error status signal;

[0107] Based on the error status signal, a preset parameter adjustment mapping table is queried to determine the fine-tuning direction and fine-tuning step size for the photoelectric sensitivity parameter and the visual analysis parameter.

[0108] Based on the fine-tuning direction and fine-tuning step size, the photoelectric sensitivity parameters and visual analysis parameters in the historical optimal control parameter set are numerically updated.

[0109] The updated photoelectric sensitivity parameters and visual analysis parameters are sent to the high-frequency photoelectric sensor and industrial camera to complete the configuration.

[0110] Specifically, when the error calculation and judgment module determines that the real-time counting error rate exceeds a preset threshold, the adaptive correction module is activated and begins to execute the parameter fine-tuning process. Its core lies in intelligently adjusting the behavior of the sensing system based on the error. First, the module classifies the error into states and generates error state signals. This signal not only contains out-of-limit information, but also precisely indicates the direction of the error. When the actual quantity is greater than the count result, it is defined as a negative deviation state (the system count is too low), and can be assigned a value. ,like When the actual quantity is less than the count result, it is defined as a positive deviation state (the system count is too high), and can be assigned a value. Subsequently, the module queries a preset parameter adjustment mapping table, which defines the parameters from... The specific rules for adjusting behavior are shown in Table 1 below;

[0111] Table 1:

[0112] error state signal Direction of photoelectric sensitivity parameter adjustment Visual analysis parameter (grayscale threshold) adjustment direction -1 (Count is too low) Increase (improve sensitivity) Reduce (make binarization more sensitive) 1 (Too many counts) Reduce (lower sensitivity) Improve (make binarization more conservative)

[0113] The fine-tuning step size ΔP can be determined by proportionally adjusting the error rate, for example, by calculating the following formula:

[0114] ;

[0115] Where K is a configurable gain coefficient used to control the aggressiveness of the correction;

[0116] Next, the module updates the parameters, setting the current photoelectric sensitivity parameter value to [value missing]. The visual analysis parameters (taking grayscale threshold as an example) are: The updated formula is:

[0117] ;

[0118] ;

[0119] in, and It is the adjustment direction (+1 or -1) for each parameter, which is obtained from the mapping table. and These are the fine-tuning step sizes calculated for the two types of parameters respectively;

[0120] Finally, the module sends the updated parameters to the drive unit of the high-frequency photoelectric sensor and the image processing unit of the industrial camera through the system bus to complete the hardware configuration of the new parameters. The system will continue to run under the new parameter settings and verify the correction effect through the next weighing feedback, thus forming a closed loop of continuous optimization.

[0121] Through the above steps, a closed-loop mapping and adaptive fine-tuning mechanism from error to parameters can be established, enabling the system to automatically compensate for performance drift and dynamically maintain the counting accuracy within the preset threshold, thus realizing the transition from static setting to dynamic self-correction.

[0122] Example 2:

[0123] After initial parameter debugging, the counting accuracy of the equipment gradually decreases over time due to sensor drift, optical lens contamination, mechanical wear, or minor changes in material properties, and it cannot self-detect or correct this accuracy degradation. Operators must periodically stop the machine, manually check and adjust parameters based on experience to restore accuracy. This not only leads to a loss of production efficiency but also places excessive demands on the operator's professional experience, making it difficult to guarantee consistently stable counting accuracy. To solve the above problems, this invention provides a high-precision adaptive embedded electronic counting machine control method, the structure of which is as follows: Figure 2 As shown. The specific implementation process of this method is as follows:

[0124] In response to user operations, the system retrieves the historical optimal control parameter set corresponding to the selected target material from the pre-built material database and configures the high-frequency photoelectric sensor and industrial camera accordingly. The historical optimal control parameter set includes photoelectric sensitivity parameters and visual analysis parameters.

[0125] During the falling of particulate material, event data from a high-frequency photoelectric sensor and image data from an industrial camera are collected simultaneously. A data fusion algorithm is used to process the event data and image data and generate particle counting results.

[0126] During the counting process, the total weight of the packaged materials is obtained periodically through the weighing module, and the actual number of particles is calculated based on the standard weight of the unit particle.

[0127] The actual number of particles is compared with the particle counting result, the real-time counting error rate is calculated, and it is determined whether the real-time counting error rate exceeds the preset threshold.

[0128] When the real-time counting error rate exceeds the preset threshold, the photoelectric sensitivity parameters and visual analysis parameters in the historical optimal control parameter set are dynamically fine-tuned based on the real-time counting error rate.

[0129] Specifically, in response to the user's selection command on the operation interface, the target material identifier is determined. Using the target material identifier as an index, the corresponding historical optimal control parameters are queried and retrieved from the pre-built material database. This parameter set includes at least photoelectric sensitivity parameters for high-frequency photoelectric sensors and visual analysis parameters for industrial cameras (such as image binarization threshold, exposure time, etc.). The system sends the photoelectric sensitivity parameters to the drive unit of the high-frequency photoelectric sensor for configuration, and at the same time sends the visual analysis parameters to the image processing unit connected to the industrial camera for configuration, thereby completing the rapid production changeover and initialization of the equipment.

[0130] During the process of particulate material being conveyed by a vibratory feeder and falling through the detection area, the system simultaneously collects event data from a high-frequency photoelectric sensor and image data from an industrial camera. The event data is pulse-shaped and threshold-compared to generate a binary photoelectric event sequence. At the same time, the image sequence is subjected to temporal analysis, and a visual counting event sequence is generated through target detection and localization. Under a unified timestamp, the two event sequences are aligned and correlated. Based on the correlation results, a fusion decision is executed. When the target material is identified as transparent or reflective, the counting result of the visual counting event sequence is adopted first; otherwise, the counting result of the photoelectric event sequence is adopted first. Finally, based on the output of the fusion decision, the cumulative particle count result is updated.

[0131] During the counting process, the system periodically (e.g., after a certain number of packages are completed) obtains the total weight of the packaged materials through the weighing module. Then, the standard weight per unit particle of the current target material is read from the material database. Through calculation The theoretical number of particles is obtained, and then rounded to the nearest integer to get the actual number of particles. ,Will Compared with the particle counting results generated above To make a comparison, first calculate the absolute error. Then calculate the relative error value. Finally, take its absolute value and multiply it by 100% to obtain the real-time counting error rate. The system judges Does it exceed the preset threshold?

[0132] When the real-time counting error rate exceeds a preset threshold, the system initiates an adaptive correction process. First, it generates an error status signal based on the sign of the error. Subsequently, based on The system queries a preset parameter adjustment mapping table to determine the fine-tuning direction (increase or decrease) and fine-tuning step size ΔP for the photoelectric sensitivity parameter and visual analysis parameter. Then, based on the determined fine-tuning direction and step size, the system updates the historical optimal control parameter set stored in the system to obtain new parameter values. Finally, the updated parameters are sent to the high-frequency photoelectric sensor and industrial camera to complete online reconfiguration, thus forming a complete perception-feedback-decision-correction closed loop, enabling the counting accuracy to automatically return to and stabilize within the optimal range.

[0133] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A high-precision adaptive embedded electronic counting machine control system, characterized in that, The system is executed by a grain counting machine that includes a high-frequency photoelectric sensor, an industrial camera, and a weighing module, and includes the following modules: The parameter preset module is used to respond to user operations by calling the historical optimal control parameter set corresponding to the selected target material from the pre-built material database, and configuring the high-frequency photoelectric sensor and the industrial camera accordingly. The historical optimal control parameter set includes photoelectric sensitivity parameters and visual analysis parameters. The multimodal sensing and counting module is used to simultaneously collect event data from the high-frequency photoelectric sensor and image data from the industrial camera during the falling of particulate material, and to process the event data and image data using a data fusion algorithm to generate particle counting results. The physical reference feedback module is used to periodically obtain the total weight of the packaged material through the weighing module during the counting process, and calculate the actual number of particles based on the standard weight of the unit particle. The error calculation and judgment module is used to compare the actual number of particles with the particle counting result, calculate the real-time counting error rate, and determine whether the real-time counting error rate exceeds a preset threshold. An adaptive correction module is used to dynamically fine-tune the photoelectric sensitivity parameters and visual analysis parameters in the historical optimal control parameter set based on the real-time counting error rate when the real-time counting error rate exceeds a preset threshold.

2. The high-precision adaptive embedded electronic counting machine control system according to claim 1, characterized in that, The configuration process for the high-frequency photoelectric sensor and the industrial camera includes: In response to the user's selection command on the operation interface, determine the target material identifier; Using the target material identifier as an index, the corresponding historical optimal control parameter set is queried and retrieved from the pre-built material database. The historical optimal control parameter set includes photoelectric sensitivity parameters for the high-frequency photoelectric sensor and visual analysis parameters for the industrial camera. The photoelectric sensitivity parameters are sent to the driving unit of the high-frequency photoelectric sensor for configuration. The visual analysis parameters are sent to the image processing unit connected to the industrial camera for configuration.

3. The high-precision adaptive embedded electronic counting machine control system according to claim 1, characterized in that, The process for generating the particle counting results includes: The event data generated by the high-frequency photoelectric sensor is pulse shaped and compared with a threshold to generate a binarized photoelectric event sequence. The image sequence acquired by the industrial camera is subjected to time-series analysis. Particle targets are detected and located for each frame of the image, and a visual counting event sequence is generated. Under a unified timestamp, the photoelectric event sequence and the visual counting event sequence are aligned and associated; Based on the association results, a fusion decision is executed, and the counting results of the visual counting event sequence are preferentially adopted as the output of the fusion decision; Based on the output of the fusion decision, the cumulative particle count is updated.

4. The high-precision adaptive embedded electronic counting machine control system according to claim 3, characterized in that, The execution process of the fusion decision includes: Determine whether the target material is transparent or reflective. If the judgment result is yes, then the counting result of the visual counting event sequence shall be adopted as the fusion counting result. If the judgment result is negative, the counting result of the photoelectric event sequence shall be adopted as the fusion counting result.

5. The high-precision adaptive embedded electronic counting machine control system according to claim 1, characterized in that, The calculation process for the actual number of particles includes: Read the standard weight of a unit particle corresponding to the selected target material from the pre-built material database; The total weight of the packaged material obtained by the weighing module is divided by the standard weight of the unit particle to obtain the theoretical number of particles. The theoretical particle count is rounded down, and the result is taken as the actual particle count.

6. The high-precision adaptive embedded electronic counting machine control system according to claim 1, characterized in that, The calculation process for the real-time counting error rate includes: The difference between the actual number of particles and the particle count result is calculated as the absolute error; Divide the absolute error by the particle count result to obtain the relative error value; The absolute value of the relative error is taken as the real-time counting error rate.

7. The high-precision adaptive embedded electronic counting machine control system according to claim 1, characterized in that, The process for dynamically fine-tuning the photoelectric sensitivity parameters and visual analysis parameters includes: The real-time counting error rate is compared with a preset threshold to generate an error status signal; Based on the error state signal, a preset parameter adjustment mapping table is queried to determine the fine-tuning direction and fine-tuning step size for the photoelectric sensitivity parameter and the visual analysis parameter. Based on the fine-tuning direction and the fine-tuning step size, the photoelectric sensitivity parameter and the visual analysis parameter in the historical optimal control parameter set are numerically updated. The updated photoelectric sensitivity parameters and visual analysis parameters are sent to the high-frequency photoelectric sensor and the industrial camera to complete the configuration.

8. A high-precision adaptive embedded electronic counting machine control method, characterized in that, For a high-precision adaptive embedded electronic counting machine control system according to any one of claims 1-7, the method includes the following steps: In response to user operation, the system retrieves the historical optimal control parameter set corresponding to the selected target material from the pre-built material database, and configures the high-frequency photoelectric sensor and the industrial camera accordingly. The historical optimal control parameter set includes photoelectric sensitivity parameters and visual analysis parameters. During the falling of particulate material, event data from the high-frequency photoelectric sensor and image data from the industrial camera are collected simultaneously. A data fusion algorithm is used to process the event data and the image data to generate a particle counting result. During the counting process, the total weight of the packaged material is periodically obtained through the weighing module, and the actual number of particles is calculated based on the standard weight of the unit particle. The actual number of particles is compared with the particle counting result to calculate the real-time counting error rate, and it is determined whether the real-time counting error rate exceeds a preset threshold. When the real-time counting error rate exceeds a preset threshold, the photoelectric sensitivity parameter and visual analysis parameter in the historical optimal control parameter set are dynamically fine-tuned based on the real-time counting error rate.