A control system and method for a bagging and boxing machine based on PLC
Patent Information
- Application Number
- CN202611087977.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-22
- Publication Date
- 2026-08-18
AI Technical Summary
[0004]针对上述缺陷,本发明的目的在于提出一种基于PLC的套袋装箱包机控制方法及系统,解决现有套袋装箱包机无法使用PLC数据进行监控的问题
[0013] One of the above technical solutions has the following advantages or beneficial effects: This invention avoids misjudgment of bagging time caused by changes in product type or fluctuations in conveyor belt speed, significantly improves the robustness of anomaly detection, and at the same time, through multi-signal fusion positioning within the time window, it greatly shortens the troubleshooting time, enabling operators to make timely adjustments and repairs, and ensuring packaging quality and production efficiency.
Smart Images

Figure CN122585508A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of PLC control technology, and in particular to a PLC-based bagging and packing machine control system and method. Background Technology
[0002] A bagging and boxing machine is a machine used for packaging bulk or granular goods. It primarily utilizes automation technology and packaging materials to bag and seal items, maintaining their freshness, hygiene, and shelf life. It improves packaging quality and work efficiency, making it an indispensable piece of automated packaging equipment. Bag packaging machines can automatically complete operations such as dispensing, metering, packaging, and sealing based on manually set parameters. However, various malfunctions are inevitable during these operations, necessitating timely monitoring of the bagging and boxing machine's operating status for prompt adjustment and repair when problems arise.
[0003] Currently, the testing technology for production equipment typically involves detecting the bagging time. For example, the existing patent with authorization announcement number CN116502172 B analyzes the detected bagging time value to determine if there are any problems with the bagging and packing machine. However, the bagging time varies for different products and is easily affected by the conveyor belt. While PLC control signals, as stable control output information, can reliably reflect the working status of the bagging and packing machine, most existing detection algorithms require specific formulas such as noise reduction or outlier calculation, making them difficult to directly apply to the detection of PLC signals in bagging and packing machines. Summary of the Invention
[0004] To address the aforementioned shortcomings, the present invention aims to propose a PLC-based control method and system for bagging and packing machines, thereby solving the problem that existing bagging and packing machines cannot be monitored using PLC data.
[0005] To achieve this objective, the present invention adopts the following technical solution: a PLC-based control method for a bagging and packing machine, comprising the following steps: The operating signals from the PLC controller are acquired in real time, and the operating signals are input into a dynamic monitoring model, which is used to identify abnormal states in the operating signals. When an abnormal state is identified, the fault source is accurately located by integrating signals from multiple PLC sensors within a time window constructed based on the dynamic monitoring model.
[0006] Preferably, the real-time acquisition of operating signals from the PLC controller includes: Read at least one of the following operating signals from the PLC controller in real time at a fixed frequency: Real-time power of main motor, real-time current of main motor, speed of transmission shaft, and overall vibration amplitude of bagging and packing machine; A signal sequence is constructed based on time order, and the signal sequence is used as the input to the dynamic monitoring model.
[0007] Preferably, before inputting the operating signal into the dynamic monitoring model, the following steps also need to be performed: Step A1: Divide the signal sequence into multiple segments of length L using a sliding window; Step A2: Apply empirical mode decomposition to each segment to obtain K components of intrinsic mode functions. ; Step A3: For the components Perform a Fast Fourier Transform to obtain the spectrum. ; Based on prior knowledge of the equipment or the spectrum under normal operating conditions, a frequency threshold is set for the spectrum. Classify the frequencies in the spectrum Frequencies exceeding the frequency threshold are designated as the first frequency. Calculate the spectrum separately The total energy of all frequencies and the first energy of the first frequency are used as the ratio of the first energy to the total energy as the proportion of high-frequency noise. ; Step A4: Obtain the components Similarity between segments ; Step A5: Based on the high-frequency noise ratio and similarity Get components The corresponding weight Wk; Step A6: Use weights Wk and components Multiply the components to obtain the processed components, then accumulate the processed components to obtain the purified signal sequence.
[0008] Preferably, the total energy in step A3 The formula for obtaining the first energy is as follows: , For energy spectral density, , This is a fixed sampling frequency for PLC signals. For frequency resolution, N is the number of frequencies in the spectrum; , Frequency threshold; In step A5, the proportion of high-frequency noise is used... and similarity Get components The formula for the corresponding weight Wk is as follows: ; in , For signal sequences, This is an adjustment factor, with a value ranging from 15 to 20. The preset noise reference value is 0.2 to 0.5.
[0009] Preferably, the dynamic monitoring model performs the following steps: Obtain the fluctuation energy and shape deviation value within one working cycle; Determine whether the fluctuation energy exceeds the threshold multiple of the historical average value in M consecutive working cycles, or whether the morphological deviation value is greater than the deviation threshold. If the value exceeds the threshold multiple of the historical average or the morphological deviation value is greater than the deviation threshold, it is considered that there is an abnormal state, and several sliding windows before and after the current moment are recorded to construct the time window.
[0010] Preferably, the formula for obtaining the wave energy is as follows: ,in The signal at time t in the purified signal sequence. The length of one work cycle; The formula for obtaining the morphological deviation value is as follows: ,in The standard template's running signal at time t.
[0011] Preferably, the steps for accurately locating the fault source are as follows: Step B1: Within the time window, extract the detection values of multiple sensors from the PLC controller; Step B2: Based on the number of products processed within the time window and the sensor readings for each product, create a product analysis matrix. The construction; For each sensor q, construct its time series as a function of product serial number p. ; Step B3: For time series Calculate the detection value of each product p and the product analysis matrix. Local outlier ; ; Where N(p) is the dynamic neighborhood of product p on sensor q, and dist() is the Euclidean distance; Step B4: For product p, construct a state vector from the sensor's detection values. Calculate the state vector The set of all product state vectors under historical normal conditions Cooperative deviation ; ; Step B5: For the local outlier factor and coordination deviation Perform fusion to obtain the fault degree; For all products within the time window, calculate the average failure rate of each sensor q, and mark the equipment corresponding to the sensor whose average failure rate is greater than the failure threshold as the failure source; The formula for obtaining the fault degree is as follows: ,in The outlier threshold. This is a balance coefficient, with a value ranging from 0.1 to 0.3. This is the steepness coefficient of the S-shaped function, with a value ranging from 50 to 150.
[0012] A PLC-based control system for a bagging and packing machine, and a PLC-based control method for the bagging and packing machine, comprising the following steps: The detection module is used to collect the operating signals in the PLC controller in real time and input the operating signals into the dynamic monitoring model, which is used to identify abnormal states in the operating signals. The positioning module is used to accurately locate the source of the fault by integrating signals from multiple PLC sensors within a time window constructed based on a dynamic monitoring model when an abnormal state is identified.
[0013] One of the above technical solutions has the following advantages or beneficial effects: This invention avoids misjudgment of bagging time caused by changes in product type or fluctuations in conveyor belt speed, significantly improves the robustness of anomaly detection, and at the same time, through multi-signal fusion positioning within the time window, it greatly shortens the troubleshooting time, enabling operators to make timely adjustments and repairs, and ensuring packaging quality and production efficiency. Attached Figure Description
[0014] Figure 1 This is a flowchart of one embodiment of the method of the present invention.
[0015] Figure 2 This is a schematic diagram of the structure of one embodiment of the system of the present invention. Detailed Implementation
[0016] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0017] In the description of embodiments of the present invention, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of embodiments of the present invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0018] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, unless otherwise stated, "a plurality of" means two or more. Those skilled in the art will understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0019] like Figures 1-2 As shown, a PLC-based control method for a bagging and packing machine includes the following steps: The operating signals from the PLC controller are acquired in real time, and the operating signals are input into a dynamic monitoring model, which is used to identify abnormal states in the operating signals. When an abnormal state is identified, the fault source is accurately located by integrating signals from multiple PLC sensors within a time window constructed based on the dynamic monitoring model.
[0020] Current bagging and packing machines typically rely on analyzing bagging time data to determine if a problem exists. However, bagging times vary between products and are easily affected by the conveyor belt. Therefore, testing different product packaging often requires resetting parameters, failing to provide a robust monitoring method for bagging and packing machines.
[0021] Therefore, in this invention, PLC operating signals are used to monitor the bagging and packing machine. Each device's PLC signal is independent data, unaffected by differences in products or transmission speeds, making it suitable for detecting various types of product packaging. During detection, the PLC controller dynamically monitors the operating signal input values from different devices. By comparing the changes and logical constraints of each operating signal at normal times, abnormal states are identified. Then, signals from multiple different device PLC sensors within the same time interval are fused and analyzed to accurately pinpoint the fault source, such as insufficient material supply, abnormal sealing temperature, bag misalignment, or cylinder jamming.
[0022] This invention avoids misjudgment of bagging time caused by changes in product type or fluctuations in conveyor belt speed, significantly improving the robustness of anomaly detection. At the same time, by using multi-signal fusion positioning within a time window, it greatly shortens the troubleshooting time, enabling operators to make timely adjustments and repairs, thus ensuring packaging quality and production efficiency.
[0023] Preferably, the real-time acquisition of operating signals from the PLC controller includes: Read at least one of the following operating signals from the PLC controller in real time at a fixed frequency: Real-time power of main motor, real-time current of main motor, speed of transmission shaft, and overall vibration amplitude of bagging and packing machine; A signal sequence is constructed based on time order, and the signal sequence is used as the input to the dynamic monitoring model.
[0024] Preferably, before inputting the operating signal into the dynamic monitoring model, the following steps also need to be performed: Step A1: Divide the signal sequence into multiple segments of length L using a sliding window; Step A2: Apply empirical mode decomposition to each segment to obtain K components of intrinsic mode functions. ; Step A3: For the components Perform a Fast Fourier Transform to obtain the spectrum. ; Based on prior knowledge of the equipment or the spectrum under normal operating conditions, a frequency threshold is set for the spectrum. Classify the frequencies in the spectrum Frequencies exceeding the frequency threshold are designated as the first frequency. Calculate the spectrum separately The total energy of all frequencies and the first energy of the first frequency are used as the ratio of the first energy to the total energy as the proportion of high-frequency noise. ; .
[0025] Step A4: Obtain the components Similarity between segments ; Step A5: Based on the high-frequency noise ratio and similarity Get components The corresponding weight Wk; Step A6: Use weights Wk and components Multiply the components to obtain the processed components, then accumulate the processed components to obtain the purified signal sequence.
[0026] The bagging and packing machine operates amidst numerous interference sources, such as motor start-up and shutdown shocks, gear meshing vibrations, electromagnetic interference, and sensor noise. These factors, superimposed on normal signals, result in numerous high-frequency spikes and baseline drift in the acquired power, current, and speed signals. Directly using the operating signals for detection can easily lead to false alarms. Traditional denoising processes typically focus only on the high-frequency components. However, the motor of the bagging and packing machine experiences a power spike at startup. Using traditional denoising methods would cause the normal motor start-up signal to be mistaken for noise and filtered out. Therefore, this invention calculates the correlation coefficient between the IMF component and the original signal, protecting components structurally similar to the original signal and ensuring that true characteristics are not destroyed. Specifically, this invention primarily uses similarity... Components strongly correlated with the original signal are retained, effectively maintaining the fault characteristic waveform. However, some IMF components may have high correlation with the original signal but also contain a large amount of high-frequency noise. Using only similarity... If these components cannot be suppressed, a frequency threshold will be set based on the device's prior knowledge or the spectrum under normal operating conditions. Generally speaking, the frequency is higher than the frequency threshold. This will be considered a noise band, and then the first frequency that is greater than the frequency threshold will be statistically determined. The proportion of high-frequency noise between normal frequencies will be obtained through this first frequency. By means of the high-frequency noise ratio and similarity Get components The corresponding weight Wk is calculated using a sigmoid function. Achieving a soft threshold: when In this approach, the weights decrease smoothly rather than being hard-truncated, thus avoiding discontinuities in the reconstructed signal. The weight Wk is used to suppress the contribution of noise components to the purified operation and maintenance signal, rather than directly using a binary decision of "either keep or discard" as in traditional methods. This approach better reflects the physical nature of continuous signal mixing.
[0027] Preferably, the total energy in step A3 The formula for obtaining the first energy is as follows: , For energy spectral density, , This is a fixed sampling frequency for PLC signals. For frequency resolution, N is the number of frequencies in the spectrum; , Frequency threshold; In step A5, the proportion of high-frequency noise is used... and similarity Get components The formula for the corresponding weight Wk is as follows: ; in , For signal sequences, This is an adjustment factor, with a value ranging from 15 to 20. The preset noise reference value is 0.2 to 0.5.
[0028] Preferably, the dynamic monitoring model performs the following steps: Obtain the fluctuation energy and shape deviation value within one working cycle; Determine whether the fluctuation energy exceeds the threshold multiple of the historical average value in M consecutive working cycles, or whether the morphological deviation value is greater than the deviation threshold. If the value exceeds the threshold multiple of the historical average or the morphological deviation value is greater than the deviation threshold, it is considered that there is an abnormal state, and several sliding windows before and after the current moment are recorded to construct the time window.
[0029] The fluctuation energy E reflects the intensity of the signal within a complete packaging cycle. During normal operation, the derivatives of signals such as motor power and speed are relatively small, and the energy remains stable at a low level. When mechanical jamming, belt slippage, or abnormal motor vibration occurs, the signal will fluctuate violently, and the fluctuation energy E will increase significantly.
[0030] The morphological deviation value measures the difference between the waveform shape of the current cycle and the standard waveform. It can detect gradual drift or local distortion, such as a temperature curve drop caused by heater aging. These two parameters can effectively detect whether there are problems. If either one is satisfied, a construction time window will be immediately triggered, and the data range will be filtered for subsequent anomaly localization.
[0031] Preferably, the formula for obtaining the wave energy is as follows: ,in The signal at time t in the purified signal sequence. The length of one work cycle; The formula for obtaining the morphological deviation value is as follows: ,in The standard template's running signal at time t.
[0032] Preferably, the steps for accurately locating the fault source are as follows: Step B1: Within the time window, extract the detection values of multiple sensors from the PLC controller; Step B2: Based on the number of products processed within the time window and the sensor readings for each product, create a product analysis matrix. The construction of features is as follows: For example, if p products are processed within a time window, and each product passes through different devices during bagging, the detection values of the product when passing through or being processed by these devices are used to construct feature values. Construct the corresponding product analysis matrix using all the eigenvalues. , where the eigenvalues This represents the detection value when the p-th product passes the q-th sensor.
[0033] For each sensor q, construct its time series as a function of product serial number p. ; Step B3: For time series Calculate the detection value of each product p and the product analysis matrix. Local outlier ; ; Where N(p) is the dynamic neighborhood of product p on sensor q, and dist() is the Euclidean distance; Step B4: For product p, construct a state vector from the sensor's detection values. Calculate the state vector The set of all product state vectors under historical normal conditions Cooperative deviation ; ; Step B5: For the local outlier factor and coordination deviation Perform fusion to obtain the fault degree; For all products within the time window, calculate the average failure rate of each sensor q, and mark the equipment corresponding to the sensor whose average failure rate is greater than the failure threshold as the failure source; The formula for obtaining the fault degree is as follows: ,in The outlier threshold. This is a balance coefficient, with a value ranging from 0.1 to 0.3. This is the steepness coefficient of the S-shaped function, with a value ranging from 50 to 150.
[0034] First, all available PLC sensor readings within the time window are synchronously extracted from the PLC controller, including but not limited to vibration velocity sensors, vibration displacement sensors, temperature sensors, speed sensors, and thin-film marking sensors. These sensors are installed on key mechanical parts such as the motor base, drive shaft bearing housing, and the top corner of the carton machine chassis; therefore, each reading naturally corresponds to a physical location. Then, a product analysis matrix is constructed accordingly. and time series The analysis uses matrices and sequences in two different directions, which preserves both the vertical variation between different products and the horizontal correlation between different sensors on the same product.
[0035] Through time series With product analysis matrix Local outlier factor When acquiring the data, a dynamic neighborhood N(p) is formed by using products with similar process parameters from different batches, rather than simply selecting a neighborhood based on time sequence or a fixed window. The advantage of this approach is that, for the same equipment, normal detection values will naturally vary systematically due to process changes across different batches or product types. Blindly comparing neighborhood data over time could easily misjudge normal changes caused by process adjustments as abnormalities. Furthermore, when calculating the coordination deviation, all sensor feature values of product p are treated as a state vector. Then calculate the vector and the set of all product state vectors under historical normal conditions. The average Mahalanobis distance between the sensors eliminates the influence of different dimensions and correlations between them. For example, when vibration increases while temperature rises slightly, the covariance between the two sensors is incorporated into the distance calculation, thus more accurately reflecting the pattern of simultaneous anomalies in multiple parameters. When the co-variance is... The larger the value, the greater the deviation of the product's overall state from the normal pattern across all sensor dimensions. This implies that the product's operational process is likely a global anomaly, rather than isolated noise from a single sensor. Then, through the aforementioned local outlier factor... and coordination deviation When fusing data to obtain the fault degree, and then performing final anomaly localization, the average fault degree of each sensor q is calculated. Once the average fault degree exceeds the fault threshold, the corresponding monitoring location is identified as the fault source. The reason for taking the average is that the time window may include the process of fault development; the fault degree is low in early products and high in later ones. Taking the average can stably reflect the overall anomaly degree of the sensor throughout the entire anomaly window.
[0036] A PLC-based control system for a bagging and packing machine, and a PLC-based control method for the bagging and packing machine, comprising the following steps: The detection module is used to collect the operating signals in the PLC controller in real time and input the operating signals into the dynamic monitoring model, which is used to identify abnormal states in the operating signals. The positioning module is used to accurately locate the source of the fault by integrating signals from multiple PLC sensors within a time window constructed based on a dynamic monitoring model when an abnormal state is identified.
[0037] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0038] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
Claims
1. A PLC-based control method for a bagging and packing machine, characterized in that, Includes the following steps: The operating signals from the PLC controller are acquired in real time, and the operating signals are input into a dynamic monitoring model, which is used to identify abnormal states in the operating signals. When an abnormal state is identified, the fault source is accurately located by integrating signals from multiple PLC sensors within a time window constructed based on the dynamic monitoring model.
2. The PLC-based control method for a bagging and packing machine according to claim 1, characterized in that, Real-time acquisition of operating signals from the PLC controller includes: Read at least one of the following operating signals from the PLC controller in real time at a fixed frequency: Real-time power of main motor, real-time current of main motor, speed of transmission shaft, and overall vibration amplitude of bagging and packing machine; A signal sequence is constructed based on time order, and the signal sequence is used as the input to the dynamic monitoring model.
3. The PLC-based control method for a bagging and packing machine according to claim 2, characterized in that, Before inputting the operating signals into the dynamic monitoring model, the following steps need to be performed: Step A1: Divide the signal sequence into multiple segments of length L using a sliding window; Step A2: Apply empirical mode decomposition to each segment to obtain K components of intrinsic mode functions. ; Step A3: For the components Perform a Fast Fourier Transform to obtain the spectrum. ; Based on prior knowledge of the equipment or the spectrum under normal operating conditions, a frequency threshold is set for the spectrum. Classify the frequencies in the spectrum Frequencies exceeding the frequency threshold are designated as the first frequency. Calculate the spectrum separately The total energy of all frequencies and the first energy of the first frequency are used as the ratio of the first energy to the total energy as the proportion of high-frequency noise. ; Step A4: Obtain the components Similarity between segments ; Step A5: Based on the high-frequency noise ratio and similarity Get components The corresponding weight Wk; Step A6: Use weights Wk and components Multiply the components to obtain the processed components, then accumulate the processed components to obtain the purified signal sequence.
4. The PLC-based control method for a bagging and packing machine according to claim 3, characterized in that, Total energy in step A3 The formula for obtaining the first energy is as follows: , For energy spectral density, , This is a fixed sampling frequency for PLC signals. For frequency resolution, N is the number of frequencies in the spectrum; , Frequency threshold; In step A5, the proportion of high-frequency noise is used... and similarity Get components The formula for the corresponding weight Wk is as follows: ; in , For signal sequences, This is an adjustment factor, with a value ranging from 15 to 20. The preset noise reference value is 0.2 to 0.
5.
5. The control method for a bagging and packing machine based on PLC according to claim 1, characterized in that, The dynamic monitoring model performs the following steps: Obtain the fluctuation energy and shape deviation value within one working cycle; Determine whether the fluctuation energy exceeds the threshold multiple of the historical average value in M consecutive working cycles, or whether the morphological deviation value is greater than the deviation threshold. If the value exceeds the threshold multiple of the historical average or the morphological deviation value is greater than the deviation threshold, it is considered that there is an abnormal state, and several sliding windows before and after the current moment are recorded to construct the time window.
6. The PLC-based control method for a bagging and packing machine according to claim 5, characterized in that, The formula for obtaining the wave energy is as follows: ,in The signal at time t in the purified signal sequence. The length of one work cycle; The formula for obtaining the morphological deviation value is as follows: ,in The standard template's running signal at time t.
7. The PLC-based control method for a bagging and packing machine according to claim 6, characterized in that, The steps for accurately locating the fault source are as follows: Step B1: Within the time window, extract the detection values of multiple sensors from the PLC controller; Step B2: Based on the number of products processed within the time window and the sensor readings for each product, create a product analysis matrix. The construction; For each sensor q, construct its time series as a function of product serial number p. ; Step B3: For time series Calculate the detection value of each product p and the product analysis matrix. Local outlier ; ; Where N(p) is the dynamic neighborhood of product p on sensor q, and dist() is the Euclidean distance; Step B4: For product p, construct a state vector from the sensor's detection values. Calculate the state vector The set of all product state vectors under historical normal conditions Cooperative deviation ; ; Step B5: For the local outlier factor and coordination deviation Perform fusion to obtain the fault degree; For all products within the time window, calculate the average failure rate of each sensor q, and mark the equipment corresponding to the sensor whose average failure rate is greater than the failure threshold as the failure source; The formula for obtaining the fault degree is as follows: ,in The outlier threshold. This is a balance coefficient, with a value ranging from 0.1 to 0.
3. This is the steepness coefficient of the S-shaped function, with a value ranging from 50 to 150.
8. A PLC-based control system for a bagging and packing machine, using the PLC-based control method for a bagging and packing machine according to any one of claims 1 to 7, characterized in that, Includes the following steps: The detection module is used to collect the operating signals in the PLC controller in real time and input the operating signals into the dynamic monitoring model, which is used to identify abnormal states in the operating signals. The positioning module is used to accurately locate the source of the fault by integrating signals from multiple PLC sensors within a time window constructed based on a dynamic monitoring model when an abnormal state is identified.
Citation Information
Patent Citations
A method and system for intelligent fault diagnosis of bag packaging machine
CN116502172B