An electronic surface mount deviation intelligent compensation method and system based on a cloud edge architecture
Patent Information
- Application Number
- CN202610597761.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-30
- Publication Date
- 2026-08-25
AI Technical Summary
[0003](1)贴片机在长期连续运行过程中,其机械传动组件会因磨损、温度变化等因素发生参数漂移,而固定算法无法实时响应此类动态变化,导致贴装偏差随设备运行时长逐步累积,最终影响产品良率,补偿的实时性与动态适配性不足;
[0042](1)贴装精度与良率提升;通过云边端协同的实时偏差预测与补偿,贴片机的贴装偏差可被精准预测,有效避免因贴装偏移导致的电气连接故障,显著提升产品的质量稳定性与一次通过率;通过阶梯式控制策略减少了优化变量维数,保证了贴片机的计算快速性,在此基础上考虑包含三项的目标函数设计了控制器,该控制器可以在保证轨迹跟踪快速的同时,还可以产生连续平滑的控制信号,从而提高系统的控制性能,保证轨迹跟踪的平滑性与准确性,提升贴装精度;
Smart Images

Figure CN122641002A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical fields of printed circuits; housings or structural components of electrical equipment; and the manufacture of electrical component assemblies, and particularly to an intelligent compensation method and system for electronic surface mount deviation based on a cloud-edge architecture. Background Technology
[0002] In the electronics manufacturing industry, surface mount technology (SMT) is a core step in the printed circuit board (PCB) assembly process. The placement accuracy of the pick-and-place machine directly determines the electrical connection reliability of the PCB and the quality stability of the final product. Currently, the mainstream placement deviation compensation schemes in the industry are mainly divided into two categories: one is "single-machine fixed algorithm compensation," where the pick-and-place machine has a built-in preset deviation correction logic that statically adjusts the placement coordinates based on the machine's factory calibration parameters; the other is "manual periodic debugging," where technicians periodically collect placement deviation samples and manually update the compensation parameters. However, the above schemes have certain drawbacks:
[0003] (1) During the long-term continuous operation of the pick and place machine, the parameters of its mechanical transmission components will drift due to wear, temperature changes and other factors. The fixed algorithm cannot respond to such dynamic changes in real time, resulting in the gradual accumulation of placement deviation as the equipment runs, which ultimately affects the product yield. The real-time and dynamic adaptability of the compensation are insufficient.
[0004] (2) If the deviation prediction model is built locally on a single machine, the model training can only rely on limited local data due to the limited computing power and data storage capacity of the single machine. Overfitting is likely to occur, and the model update cycle is long, making it difficult to match the dynamic production needs of the production line. The efficiency and accuracy of model iteration are limited.
[0005] (3) Traditional solutions often adopt an isolated mode of "independent control of a single machine". The deviation data and models of different pick-and-place machines cannot be shared. When the production line scale expands, the same hardware and software systems need to be deployed repeatedly, which increases the cost investment and makes it difficult to achieve unified control and global optimization of the entire production line. The scalability and synergy of the architecture are weak.
[0006] (4) Although the cloud-edge-device collaborative architecture in the industrial Internet field has been gradually applied in the manufacturing industry, the existing technology has not yet deeply integrated it with the deviation compensation requirements of the pick-and-place machine. Most solutions only use the cloud as a data storage node and have not built a complete closed loop of "cloud model training - edge real-time inference". They also have not designed a data isolation and model personalized iteration mechanism for the single-machine exclusive compensation requirements of the pick-and-place machine, resulting in the architecture being unable to adapt to the actual production scenario of the SMT production line.
[0007] Furthermore, the pick-and-place machine is a dual-axis motion system, consisting of two permanent magnet synchronous motors with their axes perpendicular to each other. The tracking error generated during operation is determined by both the horizontal and vertical axes. Currently, control methods for dual-axis motion systems include PID control, feedforward compensation, and sliding mode control. However, due to the obvious dynamic coupling effect of the dual-axis system, traditional control methods have shortcomings such as a dispersed control architecture and high-frequency coupling vibration amplification when dealing with coupling, which seriously affect the tracking accuracy and are not ideal in practical applications. Summary of the Invention
[0008] This invention solves the problems existing in the prior art and provides an intelligent compensation method and system for electronic surface mount deviation based on cloud-edge architecture, which takes into account real-time compensation, dynamic model iteration and flexible architecture expansion.
[0009] The technical solution adopted in this invention is an intelligent compensation method for electronic surface mount deviation based on a cloud-edge-device architecture, the method comprising the following steps:
[0010] The S1 end-side AOI device collects the inspection data after the PCB is mounted and uploads it to the edge layer MES system;
[0011] Based on the detection data, the S2 MES system calculates the mounting deviation compensation value through a locally deployed deviation prediction model;
[0012] The S3 MES system sends the placement deviation compensation value to the corresponding pick and place machine;
[0013] Based on the placement deviation compensation value, the S4 placement machine adjusts the placement coordinates and generates the optimal control quantity for the cantilever motion through an improved predictive control algorithm.
[0014] The S5 MES system uploads the detection data and compensation execution records to the cloud.
[0015] The S6 cloud platform performs iterative training of the model based on the uploaded data and then distributes the updated model to the MES system.
[0016] Preferably, the detection data includes at least the offset and offset angle of the mounted component in the X and Y directions.
[0017] Preferably, the deviation prediction model is a combined model of XGBoost and LSTM, where XGBoost is used to extract nonlinear static features from the detection data and LSTM is used to mine temporal dynamic features from the detection data. The combined model dynamically allocates the prediction weights of XGBoost and LSTM using the inverse error method and performs weighted fusion of the prediction results of the two models to obtain the final deviation prediction value.
[0018] Preferably, in S3, the MES system encapsulates the compensation value into a standardized instruction format according to the pick-and-place machine control protocol and sends it to the pick-and-place machine, and uses a timeout retransmission mechanism to monitor the delivery of the instruction; after the pick-and-place machine executes the instruction, it sends the execution status back to the MES system.
[0019] Preferably, in step S4, the process of adjusting the placement coordinates and generating the optimal control quantity for the cantilever motion by the pick-and-place machine includes the following steps:
[0020] S4.1 Based on the placement point coordinates, the received placement deviation compensation value is corrected to generate a reference trajectory for the cantilever movement of the pick-and-place machine.
[0021] S4.2 Based on the unified model obtained after uniformly modeling the motors that drive the horizontal and vertical axes of the pick-and-place machine, a step-by-step incremental control strategy is used to construct a prediction model.
[0022] S4.3 calculates the optimal control input in real time to drive the cantilever along the reference trajectory by solving a finite-time objective function that includes a penalty for the increment of the predicted output.
[0023] Preferably, in S5, the MES system uses a hybrid strategy that combines data volume triggering and time triggering to compress accumulated data and upload it to the cloud.
[0024] Preferably, in S6, the cloud adopts a hybrid training strategy that combines sliding window and incremental update to iteratively train the model and update the parameters. After the model in the cloud has completed iterative training, the accuracy is verified using reserved test data. If the verification result meets the preset accuracy standard, the model is deemed to have met the standard; otherwise, the training strategy is adjusted and the model is retrained.
[0025] Preferably, in S6, the cloud performs version management on the distributed models, retaining multiple historical versions for each pick and place machine; when the edge layer reports an abnormal operation of the new model, it rolls back to the historical version.
[0026] A cloud-edge-device-based intelligent compensation system for electronic surface mount deviation includes:
[0027] The end-side equipment layer includes a pick-and-place machine for performing placement and an AOI device for performing inspection;
[0028] The edge layer MES system is deployed locally on the production line and communicates with the end-side device layer.
[0029] The cloud-based data and model layer is deployed on an industrial cloud platform and communicates with the edge-layer MES system.
[0030] The edge-layer MES system includes:
[0031] The data receiving and isolation module is used to receive, isolate, and store detection data from AOI devices.
[0032] The real-time deviation prediction module is used to calculate compensation values based on the locally deployed deviation prediction model and the detection data.
[0033] The compensation instruction sending module is used to send compensation values to the pick-and-place machine and receive execution feedback;
[0034] The data upload module is used to upload local data to the cloud.
[0035] Preferably, the cloud data and model layer includes:
[0036] The data storage and preprocessing module is used to store and preprocess data uploaded from the edge layer;
[0037] The model iterative training module is used to train the bias prediction model based on the preprocessed data;
[0038] The model accuracy verification module is used to verify the accuracy of the trained model.
[0039] The model distribution and version management module is used to distribute validated models to the edge layer and manage model versions.
[0040] This invention relates to an intelligent compensation method and system for electronic surface mount deviation based on a cloud-edge-device architecture. The system includes an edge-side device layer, an edge-layer MES system, and a cloud-based data and model layer. The edge-side AOI device collects detection data after PCB mounting is completed and uploads it to the edge-layer MES system. Based on the detection data, the MES system calculates the mounting deviation compensation value through a locally deployed deviation prediction model and sends it to the corresponding pick-and-place machine. The pick-and-place machine adjusts the mounting coordinates and generates the optimal control quantity for cantilever motion based on the mounting deviation compensation value through an improved predictive control algorithm. The MES system uploads the detection data and compensation execution records to the cloud. The cloud performs iterative training of the model based on the uploaded data and sends the updated model back to the MES system.
[0041] The beneficial effects of this invention are as follows:
[0042] (1) Improved placement accuracy and yield; Through real-time deviation prediction and compensation through cloud-edge-device collaboration, the placement deviation of the pick-and-place machine can be accurately predicted, effectively avoiding electrical connection failures caused by placement offset, and significantly improving product quality stability and first pass rate; The step-by-step control strategy reduces the dimension of optimization variables, ensuring the fast computation of the pick-and-place machine. Based on this, a controller was designed considering a three-term objective function. This controller can ensure fast trajectory tracking while generating continuous and smooth control signals, thereby improving the control performance of the system, ensuring the smoothness and accuracy of trajectory tracking, and improving placement accuracy;
[0043] (2) Model iteration efficiency and adaptability optimization; The cloud trains the model based on the full historical data to ensure the generalization ability of the model. The edge layer performs real-time inference locally to avoid cloud transmission delay. The model can quickly adapt to the mechanical parameter drift of the chip mounter and improve the dynamic response capability of the compensation logic.
[0044] (3) Enhanced architecture stability and scalability; the edge layer realizes local closed loop of the production line. Even if the cloud network is interrupted, the compensation operation can still be completed by relying on the local model to ensure the continuous and stable operation of the production line. At the same time, the cloud-edge-device layered architecture supports flexible production line expansion. When adding a chip mounter, you only need to configure a dedicated data directory and model in the edge layer to quickly access the system, reducing expansion costs and complexity.
[0045] (4) Reduced operation and maintenance costs and workload; automated deviation compensation and model iteration replace the traditional manual debugging process, reducing the repetitive operation and maintenance work of technicians; the full-process data traceability function facilitates the rapid location of equipment failures and quality problems, further improving the operation and maintenance efficiency of the production line. Attached Figure Description
[0046] Figure 1 This is a flowchart of the method of the present invention;
[0047] Figure 2 This is a schematic diagram of the deviation prediction model in this invention;
[0048] Figure 3 This is a schematic diagram of the system structure of the present invention;
[0049] Figure 4 This is a schematic diagram of the collaborative logic of each layer of the system according to the present invention. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of 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, 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.
[0051] This invention relates to an intelligent compensation method for electronic surface mount deviation based on a cloud-edge-device architecture. Based on this method, the system includes an edge device layer, an edge MES system, and a cloud data and model layer.
[0052] The end-side device layer serves as the terminal carrier for collecting and compensating for mounting deviation data. Through industrial-grade hardware configuration and standardized communication protocols, it ensures the real-time nature of data transmission and the accuracy of operation execution.
[0053] The edge layer MES system is deployed on an industrial server cluster on the production line. It adopts a microservice architecture and is implemented based on the Spring Cloud technology stack. The hardware configuration of a single node of the system is 8-core CPU, 32GB memory, and 1TB SSD storage, which has high concurrency processing capabilities.
[0054] The cloud-based data and model layer is deployed on an industrial cloud platform and is divided into core service units based on a microservice architecture, including data storage and preprocessing, model iteration training, model accuracy verification, model distribution and version management. Each service is registered to the Nacos service discovery center, supporting load balancing and failover.
[0055] The method includes the following steps:
[0056] The S1 end-side AOI device collects the inspection data after the PCB is mounted and uploads it to the edge layer MES system;
[0057] The detection data includes at least the offset and offset angle of the mounted component in the X and Y directions.
[0058] Based on the detection data, the S2 MES system calculates the mounting deviation compensation value through a locally deployed deviation prediction model;
[0059] The deviation prediction model is a combination model that integrates the XGBoost model and the LSTM model. The XGBoost model is used to extract nonlinear static features from the detection data, while the LSTM model is used to mine temporal dynamic features from the detection data. The combination model dynamically allocates the prediction weights of the XGBoost model and the LSTM model using the inverse error method, and then performs a weighted fusion of the prediction results of the two models to obtain the final deviation prediction value.
[0060] In this invention, the deviation prediction model combines the ability of machine learning to capture nonlinear static features with the advantages of deep learning to mine temporal dynamic features, resulting in a significant improvement in prediction accuracy and robustness.
[0061] The XGBoost model extracts nonlinear static features from the mounting deviation data, including but not limited to the correlation between component type and mounting offset, and the mapping relationship between equipment mechanical parameters and deviation. By constructing multiple decision trees for ensemble learning, it accurately fits the complex nonlinear laws in the data.
[0062] LSTM models mine the time-series dynamic features of mounting deviations, including but not limited to the deviation trends of multiple consecutive PCBs and the drift characteristics of equipment operating status over time. By utilizing its long short-term memory units and gating mechanisms, it effectively captures long dependencies in time-series data and avoids prediction interference caused by time-series fluctuations in deviation data.
[0063] The deviation prediction model addresses the problem of insufficient capture of temporal features by the single XGBoost model, and also makes up for the deficiency of the LSTM model in the generalization ability of small sample data scenarios. It can adapt to different operating conditions and parameter drift states of the pick-and-place machine, and achieve high-precision deviation prediction in all scenarios.
[0064] The following is a specific implementation of a deviation prediction model. Real-time detection data from the current AOI inspection ensures the capture of the current deviation status of the equipment under its operating condition, such as X / Y axis offset and angular deviation. Historical correlation features, used to comprehensively uncover potential patterns in deviation accumulation, are also included, such as the historical average deviation of the last 50 batches for this single machine, the deviation change trend of consecutive batches, and the time-series features of deviation fluctuation within batches. These are used as input features, and after normalization processing to eliminate the influence of dimensional differences on the calculation results, a feature vector that meets the model input requirements is formed. This feature vector is then input in parallel into the XGBoost model and the LSTM model. Both sub-models output independent predicted values. The prediction weights of the XGBoost model and the LSTM model are then dynamically allocated using the inverse error method.
[0065] The mean square error (MSE) of the deviation predictions for the XGBoost and LSTM models in the previous batch is statistically recorded. The deviation prediction results of the two sub-models for the current batch are then weighted and fused using the inverse error method to obtain the comprehensive prediction result of the mounting deviation for the current batch. The smaller the error of a sub-model, the higher its weight ratio. The calculation formula is as follows:
[0066]
[0067] in, The respective The weight coefficients of the batch XGBoost model and the LSTM model satisfy... , ; For the first Batch XGBoost model predictions For the first Predictions from the batch LSTM model For the first Prediction error of batch XGBoost models For the first Prediction error of batch LSTM models;
[0068] The prediction results of the two models are weighted and fused to obtain the final deviation prediction value.
[0069] The S3 MES system sends the placement deviation compensation value to the corresponding pick and place machine;
[0070] In S3, the MES system encapsulates the compensation value into a standardized instruction format according to the pick-and-place machine control protocol and sends it to the pick-and-place machine. It also uses a timeout retransmission mechanism to monitor the delivery of instructions. After the pick-and-place machine executes the instruction, it sends the execution status back to the MES system.
[0071] The S4 pick-and-place machine adjusts the placement coordinates and generates the optimal control quantity for the cantilever motion based on the placement deviation compensation value through an improved predictive control algorithm.
[0072] Specifically, the process of adjusting the placement coordinates and generating the optimal control values for the cantilever motion of the pick-and-place machine includes the following steps:
[0073] S4.1 Based on the placement point coordinates, the received placement deviation compensation value is corrected to generate a reference trajectory for the cantilever movement of the pick-and-place machine.
[0074] S4.2 Based on the unified model obtained after uniformly modeling the motors that drive the horizontal and vertical axes of the pick-and-place machine, a step-by-step incremental control strategy is used to construct a prediction model.
[0075] Define the output vector State vector ,in, for The mechanical angle of the motor rotor at all times, for The motor at the moment before shaft current, These represent the horizontal and vertical axis motors, respectively; the unified incremental model for the pick-and-place machine is...
[0076]
[0077] in, express Incremental state over time; express Incremental output over time; express Time increment control input; For the system matrix, To control the input matrix, For the output matrix; in this embodiment, the incremental state ,express Time state and Difference in state at any given moment; incremental output ,express Time system output and Difference between system outputs at different times; system matrix Control input matrix Output matrix ,in, This represents the parameter matrix corresponding to the horizontal axis. This represents the parameter matrix corresponding to the vertical axis. , , In the above matrix, Sampling time, It is the equivalent moment of inertia of the motor. It is the equivalent motor viscous friction coefficient. It is the torque coefficient. These represent the horizontal and vertical axis motors, respectively; similarly, we can obtain... .
[0078] To address the issue of high online computational cost in model predictive control algorithms, a step-by-step incremental control strategy is proposed, which incorporates future computational demands. The incremental control input at each moment is used for the current The optimal incremental control input at each time step is represented to reduce the dimensionality of the optimization variables, explicitly plan future control trends, and reduce the online computational load of the algorithm. When the future control increment decreases over time, the current control quantity becomes more important, resulting in a faster system response; when At this time, the response speed is relatively slow, and the change in control quantity is gradual. Based on the step-by-step control strategy, in the future... Each incremental control input is defined as follows:
[0079]
[0080] Then the incremental control input vector
[0081]
[0082] in, To control the time domain, The step factor controls the incremental step change matrix. Based on a stepped incremental control strategy, the prediction model for the pick-and-place machine is as follows:
[0083]
[0084] in, for Predict the output vector at each time step. ; To predict the time domain, , , .
[0085] S4.3 calculates the optimal control input in real time to drive the cantilever to move along the reference trajectory by solving a finite-time objective function that includes a penalty for the increment of the predicted output.
[0086] To be precise, a finite-time objective function for model predictive control optimization is constructed. Based on the dynamic model of the motor and its real-time state, a predictive model is used to predict the future system state and behavior. By minimizing the objective function, the optimization problem is solved to obtain the optimal control input in the future time domain. The placement machine is controlled in real time, and iterative cycles are performed in the new control cycle to predict the model, solve for the optimal control input, and update the control commands in real time until the placement machine arm moves to the target position along the reference trajectory.
[0087] In traditional model predictive control algorithms, the objective function usually includes penalty terms for output error and input increment. However, for the application requirements of pick-and-place machines, it is necessary to ensure the smoothness of their motion and reduce large jitters during motion. Therefore, a three-penalty objective function is proposed, which adds the predicted output increment to the penalty term. This penalizes the predicted output increment when solving the optimization problem, suppresses output jitter, and improves the stability of the pick-and-place machine's motion.
[0088] In this embodiment, the objective function of the pick-and-place machine model predictive control is:
[0089]
[0090] in, for The reference trajectory vector is used at all times; the first term of the objective function reflects the system's ability to track the target trajectory, the second term reflects the system's requirements for control quantity constraints, and the last term reflects the system's suppression of output jitter. and Here, is the weight matrix in traditional model predictive control, and is a diagonal block matrix with all non-zero elements set to the same constant value. , , and These are the weighting coefficients; The weight matrix for the incremental prediction output, which is the third term added to the objective function, has its first few terms in the diagonal block set to zero, and the last few terms set to non-zero values. , These are the weighting coefficients. Zero weights in the controller can handle the inverse characteristics of the controlled object and prevent output oscillations. Based on this, the predictive controller of the pick-and-place machine is... ,in, This represents the optimal solution to the optimization problem.
[0091] The method of the present invention provides a corrected reference trajectory for the movement of the pick-and-place machine and uses a stepped predictive control algorithm for trajectory tracking, thereby improving the trajectory tracking accuracy of the pick-and-place machine.
[0092] The S5 MES system uploads the detection data and compensation execution records to the cloud.
[0093] In S5, the MES system uses a hybrid strategy that combines data volume triggering and time triggering to compress accumulated data and upload it to the cloud.
[0094] Specifically, in this embodiment, when the data from a single machine accumulates to 100 batches or reaches a preset time interval, the module starts the data processing flow.
[0095] The S6 cloud platform performs iterative training of the model based on the uploaded data and then distributes the updated model to the MES system.
[0096] In S6, the cloud adopts a hybrid training strategy that combines sliding window and incremental update to iteratively train the model and update the parameters. After the model in the cloud has completed iterative training, the accuracy is verified using reserved test data. If the verification result meets the preset accuracy standard, the model is judged to have met the standard; otherwise, the training strategy is adjusted and the model is retrained.
[0097] Specifically, the recent operating data of the chip mounter is used as the sliding window training set to ensure the model's adaptability to the current state of the equipment. After accumulating a certain amount of new data, an incremental training process is triggered to update the model based on the parameters of the existing model, which shortens the training time and retains the model's historical learning results. If the equipment state changes significantly, a full training process is triggered to rebuild the model.
[0098] One embodiment of the present invention is provided, wherein when the data reaches 1000 batches (approximately corresponding to 1-2 days of production data on a single machine), the incremental training process of the model is automatically triggered, and only the core parameters are updated. The XGBoost sub-model focuses on adjusting the weights of the leaf nodes and the split threshold of the decision tree without changing the existing topology of the decision tree. The LSTM sub-model fixes the configuration of the number of nodes in the input layer, hidden layer, and output layer and the temporal memory step size, and only updates the weight matrix and bias terms within the network. In this way, the existing core structure of the model, the long-term accumulated fitting deviation correlation rules, and the temporal drift feature capture logic are fully preserved, achieving lightweight and rapid adaptation. When the cloud receives a cumulative total of 1000 batches of data, the incremental training process of the model is automatically triggered. When the number of new data batches for a single machine reaches 5000, a sliding window full training process is automatically triggered. The most recent 5000 batches of processed data for that single machine (approximately equivalent to one week's production data volume for that single machine) are selected to construct a dedicated training set. The bias prediction model is then fully reconstructed and optimized. The XGBoost sub-model redesigns the number, depth, and split node distribution of the decision tree, optimizes the leaf node weight matrix, and comprehensively fits the nonlinear features in recent data. The LSTM sub-model resets the number of hidden layer nodes, network connection method, and time-series memory step size, and updates the entire network parameters to deeply mine long-term time-series dependencies. If the device status changes significantly, a full training process is triggered to rebuild the model.
[0099] In the bias prediction model, XGBoost's loss function uses the mean squared error (MSE) as the core prediction loss term. It employs categorical L2 regularization to constrain the model learning process for both real-time data features and historical correlation features, avoiding overfitting or underfitting of a single feature. The loss function is as follows:
[0100]
[0101] in, For the total sample size, For the first Actual placement deviation measurement value of the batch. For the first Batch deviation prediction output value; For real-time feature regularization coefficients, This is the historical feature regularization coefficient, used to control the strength of L2 regularization of features. The larger the coefficient, the stricter the constraint on feature weights. This represents the total number of leaf nodes in the real-time feature branches. The total number of leaf nodes in the historical feature branches; For real-time features The weight values of each leaf node. For historical characteristics The weight values of each leaf node; , These are the balance coefficients for real-time and historical features, respectively, satisfying the normalization constraint. The prediction error loss term is the core component that measures the degree of fit between the model's predicted values and the actual deviations. Mean squared error is used as the base loss term. .
[0102] In the bias prediction model, the LSTM loss function is defined as the weighted mean square error loss, which satisfies the following:
[0103]
[0104] in, The total length of the time step corresponds to the time series modeling range of 50 batches; in this method, T = 50. For the first Actual placement deviation measurement value of the batch. For the LSTM model, the first Predicted output value of batch placement deviation. For the first The weighting coefficients for time step deviations are determined; the weighting design employs an exponential decay weighting design, where the weight decreases exponentially as the time step moves further away from the current batch, thus mitigating the contribution of deviations from earlier batches. , The decay coefficient controls the decay rate of the time weight. The closer it is to 1, the slower the weight decays and the longer the historical trend is preserved. The closer to 0, the faster the decay, and the higher the weight of recent features.
[0105] After training, the model was validated in multiple dimensions using reserved single-machine test data. Validation metrics included the mean squared error (MSE) of bias predictions, the mean absolute error (MAE), and the coefficient of determination (R²). 2 The validation metrics are used to characterize the fit of the deviation prediction and its adaptability under different working conditions. The values of the validation metrics are compared with the preset accuracy standards. If all metrics meet the preset thresholds, the model is deemed to have met the standards and can proceed to the subsequent model deployment process. If any metric fails to meet the standards, the strategy is adjusted according to the training type: if incremental training fails to meet the standards, 500 batches of new single-machine data are added and incremental training is re-executed, focusing on optimizing the decision tree weights of XGBoost and the network parameters of LSTM to improve the model's adaptability to the new data features; if full training fails to meet the standards, the model hyperparameters are adjusted (such as the decision tree depth and learning rate of XGBoost, the number of hidden layer nodes and temporal memory step size of LSTM, the momentum coefficient of the momentum gradient descent algorithm, etc.), and full training is re-executed based on the sliding window training set until all model validation metrics meet the preset standards, ensuring that the qualified model can accurately support the single-machine mounting deviation compensation requirements.
[0106] In S6, the cloud manages the versions of the distributed models, retaining multiple historical versions for each pick and place machine; when the edge layer reports an abnormal operation of the new model, it rolls back to the historical version.
[0107] In this invention, during idle periods on the production line, the updated model that meets the standards is sent to the corresponding single-machine model directory of the edge layer MES system, and the model version information of each pick-and-place machine is recorded. Each version fully saves key information such as core model parameters, training data range, and accuracy verification indicators, enabling version traceability. The model files of the most recent available versions are retained, which facilitates the edge layer to roll back to historical versions when necessary. Specifically, the edge layer MES system monitors the actual running effect of the model in real time and continuously calculates the matching degree between the deviation compensation value output by the model and the actual placement deviation. If the new model is detected to have abnormal running conditions such as excessive prediction deviation or decreased adaptability multiple times, the abnormal information and related running data are promptly fed back to the cloud. After receiving the feedback, the cloud triggers the model rollback mechanism. Based on the operating conditions of the pick-and-place machine and the adaptation effect of historical versions, the optimal historical compliant version is selected and sent to the edge layer MES system to replace the abnormal model and ensure the stable operation of the pick-and-place machine.
[0108] This invention also relates to an intelligent compensation system for electronic surface mount deviation based on a cloud-edge architecture, comprising:
[0109] (1) End-side equipment layer, including a pick-and-place machine for performing placement and an AOI device for performing inspection.
[0110] In this embodiment, the end-side device layer includes a chip mounter and an AOI device;
[0111] The pick-and-place machine is used to precisely place surface mount components on designated positions on printed circuit boards. It is equipped with a high-precision servo drive system. The equipment has a built-in industrial controller that supports the TCP / IP protocol. It can continuously listen to the instructions issued by the edge layer MES system. After receiving the compensation value that matches its own equipment code, the controller parses the compensation amount of the mounting coordinates and drives the X / Y / Z axis servo motors to complete the coordinate calibration, achieving millisecond-level response of parameters. The pick-and-place machine records the execution status of the compensation instructions in real time, such as "execution successful" or "parameter exceeds limit", and feeds it back to the edge layer MES system through the industrial intranet to form an execution closed loop.
[0112] AOI equipment uses optical principles to inspect finished PCBs for defects. Equipped with a high-speed intelligent digital industrial camera and telecentric lens, along with a high-brightness tri-color ring LED light source, and integrating deep learning algorithms such as OCR, TOC, MATCH, and COMPARE, AOI can automatically adapt to different inspection point parameters and accurately identify more than ten types of appearance defects, including solder overflow, insufficient solder, solder bridging, missing components, misalignment, flipped components, incorrect components, and reverse orientation. The equipment has a built-in image preprocessing unit that uses an adaptive median filtering algorithm to remove ambient light interference and sensor noise, and employs a sub-pixel-level edge detection algorithm to extract component placement coordinates, calculating key parameters such as X / Y axis offset, angle deviation, and solder joint area and height. After inspection, the equipment generates structured data based on preset rules, including a unique machine code, work order number, and inspection timestamp, and uploads it to the edge-layer MES system in real time via TCP / IP protocol.
[0113] (2) Edge layer MES system, deployed locally on the production line, communicates with the end-side device layer;
[0114] The edge-layer MES system includes:
[0115] (2-1) Data receiving and isolation module, used to receive, isolate and store detection data from AOI equipment;
[0116] A distributed data storage structure is built based on the unique device code of the pick-and-place machine, following a hierarchical data model of "order-board-point-compensation". An independent database directory is created for each device to achieve physical isolation of data on a single machine, ensuring decoupling between services and clear data boundaries. The module receives AOI inspection data through port listening and stores the original inspection data and execution records in a directory structure of "device code-date". It supports fast query by device, batch, and time range, providing data support for subsequent deviation analysis and quality traceability.
[0117] (2-2) Real-time deviation prediction module, used to calculate compensation value based on locally deployed deviation prediction model and detection data;
[0118] In this embodiment, the deviation prediction model is deployed locally and uses a local inference mode, without calling cloud resources, ensuring that the calculation of the compensation value is completed within the real-time range allowed by the production line. The model input features include the current X / Y axis offset and angle deviation detected by AOI, as well as the historical average deviation of the last 50 batches of this single machine. As the core unit of process service, the module focuses on process parameter optimization and compensation algorithm calculation, and accurately predicts the offset compensation value based on real-time data and historical features.
[0119] (2-3) Compensation instruction issuing module, used to issue compensation values to the pick and place machine and receive execution feedback;
[0120] After receiving the compensation value output by the real-time deviation prediction module, the module encapsulates it into a standardized instruction format according to the pick-and-place machine control protocol and sends it to the pick-and-place machine. The instruction includes fields such as device code, compensation parameters, and sending timestamp. After the instruction is sent, the module ensures that the instruction is delivered through a timeout retransmission mechanism. At the same time, the module receives the execution status feedback from the pick-and-place machine in real time, updates the instruction execution record in the data storage directory, and provides complete data for the data upload module. This module works in conjunction with the device service to realize closed-loop management of device instruction sending and status feedback.
[0121] (2-4) Data upload module, used to upload local data to the cloud;
[0122] A hybrid upload strategy of "data volume trigger + time trigger" is adopted. When the data on a single machine accumulates to 100 batches or reaches the preset time interval, the module starts the data processing process. After data compression, the data is uploaded to the cloud data and model layer through a dedicated VPN link.
[0123] After the upload is complete, the cloud returns a confirmation signal, and the module updates the local data upload status to ensure the security and reliability of data transmission. As a key link in data acquisition, this module enables efficient data flow between the device and the cloud, providing data support for global model training.
[0124] (3) Cloud data and model layer, deployed on an industrial cloud platform, communicating with the edge layer MES system; including:
[0125] (3-1) Data storage and preprocessing module, used to store and preprocess data uploaded from the edge layer;
[0126] After receiving the data uploaded by the edge layer MES system, the entire historical data is stored in a directory structure of "device code + date". Preprocessing includes removing outliers using the 3σ principle and filling missing values using the KNN algorithm, extracting time series features, and generating a standardized training dataset after data processing, which is then stored in the cloud model training database.
[0127] (3-2) Model Iteration Training Module, used to train the bias prediction model based on the preprocessed data;
[0128] In this invention, a hybrid training strategy of "sliding window + incremental update" is adopted to ensure that the model focuses on the recent operating status of the equipment, retains the key parameters of the historical model during training, shortens the training time, and dynamically allocates the prediction weights of XGBoost and LSTM through the inverse error method of the combined model, so that the two work together to improve the accuracy of deviation prediction. If a significant change in the equipment status is detected, such as the chip mounter completing a major overhaul or replacing core components, the full training process is triggered to reconstruct the decision tree structure of XGBoost and the network layer parameter matrix of LSTM.
[0129] (3-3) Model accuracy verification module, used to verify the accuracy of the trained model;
[0130] Construct a multi-dimensional verification indicator system, including mean squared error, mean absolute error, and coefficient of determination R for deviation prediction. 2 To comprehensively evaluate the predictive performance of the combined model;
[0131] After training is completed, the model is validated using 20% of the reserved single-machine test data. If all indicators meet the preset standards, the model is deemed to have met the standards. If it does not meet the standards, the training parameters are automatically adjusted, such as increasing the learning rate, adjusting the decision tree depth of the XGBoost model and the number of hidden layer nodes of the LSTM, and returning to the model iteration training module for retraining until the standards are met.
[0132] (3-4) Model distribution and version management module, used to distribute verified models to the edge layer and manage model versions;
[0133] Based on the production line production plan, during idle periods such as equipment downtime maintenance and batch switching, the qualified combined model (including XGBoost model and LSTM model parameters and weight allocation rules) is distributed to the corresponding single-machine model directory of the edge layer MES system according to the equipment code;
[0134] A model version management system is built to retain the five most recent available combined model files for each pick-and-place machine, recording key information such as version number, training time, validation metrics, and weight allocation ratio; if the edge layer reports abnormal operation of the new model (such as increased prediction deviation), it supports one-click rollback to the historical best combined model to ensure stable operation of the production line;
[0135] This module enables unified management and dynamic updating of combined model parameters through the Nacos configuration center, including XGBoost decision tree parameters, LSTM network parameters, and weight allocation coefficients, ensuring consistency of model versions and parameters between the edge layer and the cloud.
[0136] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0137] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0138] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0139] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process.Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0140] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.
[0141] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A smart compensation method for electronic surface mount deviation based on cloud-edge-device architecture, characterized in that: The method includes the following steps: The S1 end-side AOI device collects the inspection data after the PCB is mounted and uploads it to the edge layer MES system; Based on the detection data, the S2 MES system calculates the mounting deviation compensation value through a locally deployed deviation prediction model; The S3 MES system sends the placement deviation compensation value to the corresponding pick and place machine; The S4 pick-and-place machine adjusts the placement coordinates and generates the optimal control quantity for the cantilever motion based on the placement deviation compensation value through an improved predictive control algorithm. The S5 MES system uploads the detection data and compensation execution records to the cloud. The S6 cloud platform performs iterative training of the model based on the uploaded data and then distributes the updated model to the MES system.
2. The intelligent compensation method for electronic surface mount deviation based on cloud-edge architecture according to claim 1, characterized in that: The detection data includes at least the offset and offset angle of the mounted component in the X and Y directions.
3. The intelligent compensation method for electronic surface mount deviation based on cloud-edge architecture according to claim 1, characterized in that: The deviation prediction model is a combination of the XGBoost model and the LSTM model. The XGBoost model is used to extract nonlinear static features from the detection data, and the LSTM model is used to mine the temporal dynamic features from the detection data. The combined model dynamically allocates the prediction weights of the XGBoost model and the LSTM model using the inverse error method, and then performs a weighted fusion of the prediction results of the two models to obtain the final deviation prediction value.
4. The intelligent compensation method for electronic surface mount deviation based on cloud-edge architecture according to claim 1, characterized in that: In S3, the MES system encapsulates the compensation value into a standardized instruction format according to the pick-and-place machine control protocol and sends it to the pick-and-place machine. It also uses a timeout retransmission mechanism to monitor the delivery of instructions. After the pick-and-place machine executes the instruction, it sends the execution status back to the MES system.
5. The intelligent compensation method for electronic surface mount deviation based on cloud-edge architecture according to claim 1, characterized in that: In S4, the process of adjusting the placement coordinates and generating the optimal control values for the cantilever motion by the pick-and-place machine includes the following steps: S4.1 Based on the placement point coordinates, the received placement deviation compensation value is corrected to generate a reference trajectory for the cantilever movement of the pick-and-place machine. S4.2 Based on the unified model obtained after uniformly modeling the motors that drive the horizontal and vertical axes of the pick-and-place machine, a step-by-step incremental control strategy is used to construct a prediction model. S4.3 calculates the optimal control input in real time to drive the cantilever along the reference trajectory by solving a finite-time objective function that includes a penalty for the increment of the predicted output.
6. The intelligent compensation method for electronic surface mount deviation based on cloud-edge architecture according to claim 1, characterized in that: In S5, the MES system uses a hybrid strategy that combines data volume triggering and time triggering to compress accumulated data and upload it to the cloud.
7. The intelligent compensation method for electronic surface mount deviation based on cloud-edge architecture according to claim 1, characterized in that: In S6, the cloud adopts a hybrid training strategy that combines sliding window and incremental update to iteratively train the model and update the parameters. After the model in the cloud has completed iterative training, the accuracy is verified using reserved test data. If the verification result meets the preset accuracy standard, the model is judged to have met the standard; otherwise, the training strategy is adjusted and the model is retrained.
8. The intelligent compensation method for electronic surface mount deviation based on cloud-edge architecture according to claim 1, characterized in that: In S6, the cloud manages the versions of the distributed models, retaining multiple historical versions for each pick and place machine; when the edge layer reports an abnormal operation of the new model, it rolls back to the historical version.
9. An intelligent compensation system for electronic surface mount deviation based on a cloud-edge-device architecture, characterized in that: include: The end-side equipment layer includes a pick-and-place machine for performing placement and an AOI device for performing inspection; The edge layer MES system is deployed locally on the production line and communicates with the end-side device layer. The cloud-based data and model layer is deployed on an industrial cloud platform and communicates with the edge-layer MES system. The edge-layer MES system includes: The data receiving and isolation module is used to receive, isolate, and store detection data from AOI devices. The real-time deviation prediction module is used to calculate compensation values based on the locally deployed deviation prediction model and the detection data. The compensation instruction sending module is used to send compensation values to the pick-and-place machine and receive execution feedback; The data upload module is used to upload local data to the cloud.
10. The intelligent compensation system for electronic surface mount deviation based on cloud-edge architecture according to claim 9, characterized in that: The cloud data and model layer includes: The data storage and preprocessing module is used to store and preprocess data uploaded from the edge layer; The model iterative training module is used to train the bias prediction model based on the preprocessed data; The model accuracy verification module is used to verify the accuracy of the trained model. The model distribution and version management module is used to distribute validated models to the edge layer and manage model versions.