Automatic control system and feedback repair method based on wax painting platform
By combining high-precision cameras and deep learning models, precise defect detection and repair of wax products is achieved, which solves the problems of low automation control integration and insufficient defect detection and repair in the existing technology, and significantly improves the quality and production efficiency of batik products.
Patent Information
- Application Number
- CN202510291390.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2045-03-12
AI Technical Summary
The existing wax painting process has low integration of automation control, insufficient defect detection and repair, resulting in unstable production quality.
The high-precision camera is used to combine it with a pre-trained deep learning model to achieve accurate defect detection and repair of the images of wax products. By comparing the wax trajectory diagram of the original design drawing with the actual product diagram, defects such as missing edges and insufficient filling are identified, and precise repairs are carried out through the dynamic repair path generation algorithm.
It significantly improves the quality and production efficiency of batik products, realizes the intelligence and automation of the wax painting process, reduces manual intervention, and improves the consistency and accuracy of the product.
Smart Images

Figure CN120147289A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of automatic control technology and image processing, and particularly to an automatic control system for the wax painting process. The system combines technologies such as cloud computing, path planning, image recognition, and defect detection, aiming to achieve automatic detection, defect repair, and precise printing of wax painting patterns, and improve the efficiency and quality of the wax painting process. Background Art
[0002] As a traditional process, wax painting usually dyes and prints patterns on fabrics by manual drawing or printing. Although this manual method has unique artistic value, its production process is time-consuming and laborious, and has high requirements for process accuracy and stability. In addition, due to more uncontrollable factors in manual operations, the quality of finished products is often difficult to achieve consistency, especially for the production of wax paintings with complex patterns, there is a high defect rate.
[0003] With the development of automation technology, some wax painting production lines have tried to use mechanical equipment to replace manual labor. However, current automation equipment usually only has basic pattern printing functions and lacks refined trajectory planning and defect detection functions. Existing systems often cannot identify and repair defects in real time, resulting in unstable production quality. In addition, the automatic control system also has deficiencies in aspects such as path generation and temperature control of wax painting patterns, and cannot meet the requirements of high-precision wax painting processes.
[0004] In order to improve the production efficiency and product quality of the wax painting process, there is an urgent need for an automatic control system with image processing, trajectory planning, and defect detection functions to achieve the intelligence and automation of the wax painting process, reduce manual intervention, and improve product consistency and accuracy. The automatic control system based on the wax painting platform of the present invention aims to provide an intelligent control solution suitable for the wax painting process through technologies such as cloud computing, image processing, and automatic control, and realize the full-process automatic operation from pattern recognition to precise printing. Summary of the Invention
[0005] The present invention aims to solve the problems of low automation control integration and insufficient defect detection and repair in the existing wax painting process. A method for feedback repair of defective products is proposed, and an automatic control system based on a wax painting platform integrating this method is constructed. The core idea of the method is as follows: The product image information is collected by a high-precision camera on the wax painting platform and uploaded to the cloud server of the pre-trained defect detection and repair model. The model compares the original image with the product image, identifies and distinguishes defects such as edge missing and insufficient filling, extracts the coordinates of the defect area, generates a repair file according to the trajectory planning program, and sends it to the control system for dynamic repair. After the repair is completed, the system detects and verifies the repair effect, forms a closed-loop feedback, and at the same time updates the defect feature library of the model to improve the adaptability and accuracy of the model. In addition, the automatic control system integrates the functions of the upper computer and the cloud server, and can efficiently realize the automatic operation of the wax painting task and the feedback repair process. The present invention effectively improves the quality and production efficiency of batik products, is applicable to the digital and intelligent scenarios of the batik process, and has broad industrial application value.
[0006] In the first aspect of the present invention, a feedback repair method based on a wax painting platform is provided, including the following steps:
[0007] S1. After the wax painting platform completes the wax painting task, the platform sends the image information of the wax painting product taken in real time after preliminary processing, together with the device number of the current batik platform, to the cloud server;
[0008] S2. After the cloud server receives the uploaded information, it preprocesses the image information and extracts the geometric features and filling information in the image;
[0009] S3. The pre-trained defect detection and repair model analyzes and identifies whether there is a defect area on the product according to the geometric features and filling information of the current image information and the wax painting trajectory map generated by the original design image, distinguishes different types of defects, and marks the coordinate information of the defect area;
[0010] S4. According to the coordinate information corresponding to the marked defect area, the trajectory planning and filling algorithm is called to generate a corresponding repair file and send it to the wax painting platform;
[0011] S5. The defect detection and repair model is trained and updated based on the type of the image, the feature information of the defect, and the user preference.
[0012] Specifically, the preprocessing described in step S2 includes denoising processing, grayscale processing, cropping, and geometric correction to ensure the consistency of the processed image data with the design image.
[0013] Specifically, different types of defects in step S3 include edge missing and insufficient filling; by comparing geometric features, the edge area in the image is accurately matched to detect the missing edge part; by comparing the filling information in the image, it is identified whether there is an insufficient filling part.
[0014] More specifically, to accurately match the edge area in the image by comparing geometric features and thus detect the missing edge part, specifically, the comparison formula of geometric features is as follows:
[0015]
[0016] Where: (x, y) are the coordinate points in the detection plane area, and the value ranges of x and y depend on the size of the current printed image. is the output of the geometric features of the model at the position (x, y) of the current product image P i is the output of the geometric features at the position (x, y) of the waxing trajectory image I generated by the model for the original design image. is the output of the geometric features of the model at the position (x, y) of the waxing trajectory image I generated by the model for the original design image. i is the output of the geometric features at the position (x, y), τ edge > 0.9 is the threshold for edge missing detection, R edge is the edge missing area;
[0017] To identify whether there is an insufficient filling part by comparing the filling information in the image, the detection formula for the insufficient filling area is as follows:
[0018]
[0019] Where: (x, y) are the coordinate points in the detection plane area, and the value ranges of x and y depend on the size of the current printed image. is the filling information of the model at the position (x, y) through the product image P i is the filling information at the position (x, y), is the filling information of the model at the position (x, y) of the waxing trajectory image I generated by the model for the original design image. i is the filling information at the position (x, y), τ fill > 0.95 is the threshold for filling defect detection, R fill is the insufficient filling area, R fill The specific form of is a set of defect points {(x1, y1), (x2, y2), (x3, y3),......(xi, yi)}.
[0020] Specifically, in step S4, for edge loss, the spiral trajectory generation algorithm in the trajectory planning and filling algorithm is selected to generate a repair path, and a repair code file is generated based on this path; for insufficient filling, the zigzag filling trajectory generation algorithm in the trajectory planning and filling algorithm is selected to generate a repair path and generate the corresponding repair code file.
[0021] More specifically, the spiral trajectory generation algorithm generates a repair path, and the generation of the spiral trajectory is represented by the following formula:
[0022] P repair_edge = SpiralTrack(θ, r max , Δr)
[0023] where: P repair_edge is the set of repair path points, in the specific form of {(x1, y1), (x2, y2), (x3, y3),......(xi, yi)}, θ is the starting angle of the spiral trajectory, θ ∈ [0, 2π], r max is the maximum radius of the spiral trajectory, r max depends on the size of the repair area, Δr is the radius increment of each spiral ring, Δr is set to 0.5 times the diameter of the wax pen tip, and SpiralTrack represents the abstract function using the Spiral repair method.
[0024] The zigzag filling trajectory generation algorithm generates a repair path, which is represented by the following formula:
[0025] P repair_fill = ZigzagTrack(y 0 , m, n, x start , x end )
[0026] where: P repair_fill is the set of repair path points, y 0 is the ordinate at which it is implemented, m is the step length of each row, n is the number of rows, [x start , x end is the starting and ending positions of the filling area on the x-axis, and ZigzagTrack represents the abstract function using the Zigzag repair method.
[0027] More specifically, in step S4, generating the corresponding repair file includes calling the GenerateRepairCode function according to the generated repair path to generate a repair code file:
[0028] F repair = GenerateRepairCode(P repair , type)
[0029] Where: F repair is the output code file, P repair is the spiral trajectory path or the zigzag filling path, type is the repair type, and GenerateRepairCode represents the abstract function of the method for generating the repair path.
[0030] Specifically, the updated model parameters in step S5 are:
[0031]
[0032] where θ′ is the parameter after model update, and argmin θ minimizes the loss function, is the loss function calculated through the original image dataset, including the measurement of the difference between the image I i and the target image P i where I′ j is the j-th image in the new image dataset, P′ j is the j-th target image in the new image dataset, N is the number of images in the original image dataset, and M represents the number of images in the new image dataset. is the loss calculated through the new image dataset, λ is the weight of the new data, preset to 1, L is the loss function, and μL u e(f θ ) represents the loss term based on user preference, μ represents the weight of the user preference loss, μ ∈ [0, 0.5], and f θ represents the model function, L u is the loss function of user preference, e is the error, and vL type (f θ ) is the loss term based on image type, v represents the weight of the image type loss, μ ∈ [0.5, 2], and L type is the loss function related to image type, and ξL defect (f θ ) is the loss term related to curve features, ξ represents the weight of the curve feature related loss, ξ ∈ [0.5, 2], and L defect represents the loss function related to defects.
[0033] In the second aspect of the present invention, an automatic control system based on a wax painting platform is provided. This system can execute the above feedback repair method, including:
[0034] The hardware part is used to complete the production of wax painting products and capture the image information of the wax painting products and upload it to the cloud server;
[0035] The underlying driver layer part is used to interact with the hardware to realize communication with various sensors and control modules;
[0036] The upper computer part is used to store and run multiple independent threads, and each thread is responsible for different functional modules; it includes a main interface UI thread, a network communication thread, a serial port communication thread, a temperature control thread, a temperature measurement thread, a Debug debugging thread, a temperature interface display thread, a file transfer thread, and a database operation thread;
[0037] The network service architecture part is responsible for the communication and data interaction between the PC side, the web side, the mobile communication side, and the main control MCU, and is composed of a network interface request module, an Nginx load balancing server, a Tornado server, and a handler.
[0038] In the above solution, the hardware part includes a main control MCU, a temperature measurement module, a display module, a debugging interface module, a network transmission module, an actuator, a relay control unit, and a heating module;
[0039] The main control MCU is equipped with a Linux kernel and is used to coordinate and control the operation of each subsystem;
[0040] The temperature measurement module is used to accurately measure the temperature data of each part of the system and transmit the real-time temperature information to the main control MCU for processing and storage;
[0041] The display module is used to provide a human-computer interaction interface;
[0042] The debugging interface module is used to provide program modification, debugging, fault diagnosis, and system upgrade;
[0043] The actuator is used to perform various physical operations according to the instructions sent by the main control MCU;
[0044] The network transmission module is used to implement all data communication and transmission functions between the system and external devices, cloud servers, and the PC side;
[0045] The relay control unit is used to perform real-time switching operations during the temperature control process;
[0046] The heating module is used to heat the wax to ensure that the wax liquid does not solidify.
[0047] The advantages and beneficial effects of the present invention are as follows:
[0048] 1. The present invention combines a high-precision camera with a pre-trained deep learning model to achieve precise defect detection and repair of batik products' images. By comparing the batik trajectory map of the original design drawing with the actual product image, defects such as edge missing and insufficient filling can be accurately identified, and the defect area can be precisely repaired through a dynamic repair path generation algorithm (such as a spiral path and a zigzag path), greatly improving the repair accuracy and efficiency.
[0049] 2. After defect repair, the system can collect images again and conduct quality verification on the repair effect, forming a closed-loop feedback. Through this real-time feedback and repair iteration, the quality of each product is effectively guaranteed, avoiding omissions or errors that may be brought by single repair, and significantly improving the consistency and stability of the products.
[0050] 3. The present invention integrates an automatic control system, including a hardware part, a bottom driving layer, a host computer, and a cloud service architecture, realizing the full-automatic operation of batik tasks and automatic detection and repair of defects. By automating all links in the defect detection and repair process, manual intervention is reduced, production efficiency is improved, the working intensity of operators is lowered, and the stability of the production process is ensured.
[0051] 4. The defect detection and repair model in the present invention has an adaptive ability and can be updated and optimized according to new image data during each defect detection and repair process. By continuously updating the defect feature library, the system can continuously improve its recognition and repair capabilities for different types of defects, ensuring that the system can adapt to the constantly changing defect patterns in the batik process.
[0052] 5. The present invention can adapt to the digital and intelligent transformation of the batik process and is widely applicable to all links of batik production. Through high-precision defect detection and repair, the quality and production efficiency of batik products can be effectively improved, providing strong technical support for the modernization, automation, and intelligence of traditional manual batik processes.
[0053] 6. The system is built based on cloud service and edge computing technologies and has high flexibility and scalability. As production requirements change, the system functions can be extended or upgraded according to actual situations to meet the batik production needs of different scales and types, providing technical guarantee for industrial large-scale production. Description of the Drawings
[0054] Figure 1 is the flowchart of the defect detection and feedback repair method of the present invention;
[0055] Figure 2 is the structure diagram of the automatic control system based on the batik platform of the present invention;
[0056] Figure 3It is the hardware structure diagram of the automatic control system of the present invention;
[0057] Figure 4 It is the structure diagram of the host computer of the automatic control system of the present invention;
[0058] Figure 5 It is the multi-terminal control system architecture diagram of the wax painting platform of the present invention;
[0059] Figure 6 It is the flow chart of network request processing of the wax painting platform for an exemplary embodiment of the present invention;
[0060] Figure 7 It is the flow chart of the automatic control system based on the wax painting platform for an exemplary embodiment of the present invention. Detailed implementation manners
[0061] Next, the technical solutions in the embodiments of the present invention will be clearly and detailedly described in conjunction with the accompanying drawings in the embodiments of the present invention. The described embodiments are only a part of the embodiments of the present invention.
[0062] Figure 1 It is the flow chart of the defect detection and feedback repair method for an exemplary embodiment of the present invention. The following exemplary embodiments describe the method according to the present invention in more detail. The method specifically includes:
[0063] S1. After the wax painting platform completes the wax painting task, the high-precision camera carried on the platform will capture the image information of the wax painting product in real time. Then, after the image information is preliminarily processed, it is locally stored in JPG format. To ensure the secure transmission of the image data, the image file will be packaged into a compressed file together with the device number of the current batik platform. Then, the compressed file is uploaded to the cloud server for storage and further processing through a standardized network protocol.
[0064] S2. After the cloud server receives the uploaded image information, it first decompresses the image file. Then, the cloud server preprocesses the image information to improve the accuracy and efficiency of subsequent processing. The image first undergoes denoising to remove noise points in the image, enhancing the quality and clarity of the image. Subsequently, the image is grayscaled to simplify the image data and retain its core features for subsequent defect detection. Next, the image is cropped and geometrically corrected to remove irrelevant regions and perform geometric correction according to the actual boundaries of the batik pattern, ensuring that the key regions in the image are centered and eliminating distortion or warping. After these corrections, the resolution of the image is adjusted to be consistent with the original design image to ensure the consistency of the processed image data with the design image for subsequent comparative analysis. The finally processed image information is stored in the local storage of the cloud server, and the geometric features and filling information in the image are further extracted to provide basic data support for subsequent defect detection and repair.
[0065] S3. The pre-trained defect detection and repair model performs defect detection based on the geometric feature information and filling information of the current image. Specifically, the model analyzes the geometric features by comparing the wax-drawing trajectory map generated from the current image and the original design image to identify whether there are edge defects in the product. The comparison of geometric features helps to accurately match the edge regions in the image, thereby detecting missing parts. In addition, the model also identifies whether there is a problem of insufficient filling by comparing the filling information in the image. For the identified defects, the model classifies and marks them according to the defect type. For edge defects, the model uses a green mark to highlight the missing edge regions; for regions with insufficient filling, the model uses a red mark for clear distinction. These marks help the subsequent repair operation to accurately locate the defect position for targeted repair.
[0066] The model analyzes the geometric features by comparing the wax-drawing trajectory map generated from the current image and the original design image to identify whether there are edge defects in the product. Specifically, it further includes: the detection of edge missing is achieved by comparing the geometric features in the current image and the design image. Specifically, the model judges whether there is an edge missing at a certain position by calculating the difference in the geometric feature output at that position. The comparison formula for geometric features is as follows:
[0067]
[0068] where: (x, y) is the coordinate point in the detection plane area, and the value ranges of x and y depend on the size of the current printed image. is the geometric feature output of the model for the current product image P i at the position (x, y). is the wax-drawing trajectory image I generated by the model for the original design image iGeometric feature output at the (x, y) position, τ edge >0.9 is the threshold for edge missing detection, R edge is the edge missing area;
[0069] The model also identifies whether there is a problem of insufficient filling by comparing the filling information in the image. Specifically, it further includes: The detection of insufficient filling is achieved by comparing the filling information in the current image and the design image. The model analyzes the filling information at each position in the image and determines whether there is a problem of insufficient filling by comparing and calculating the difference in filling information. The detection formula for the insufficient filling area is as follows:
[0070]
[0071] where: (x, y) is the coordinate point in the detection plane area, and the value ranges of x and y depend on the size of the current printed image, is the filling information at the position (x, y) in the product image P i of the model, is the filling information at the position (x, y) in the waxing trajectory image I generated by the model for the original design image, τ i >0.85 is the threshold for filling defect detection, R fill is the insufficient filling area, R fill The specific form of which is a set of defect points {(x1, y1), (x2, y2), (x3, y3),......(xi, yi)}. fill
[0072] S4. The model extracts the corresponding coordinate information according to the defect areas marked in the above steps. For the green-marked edge missing area, the model selects the spiral trajectory generation algorithm in the trajectory planning and filling algorithm to generate a repair path, and generates a repair code file based on this path; for the red-marked insufficient filling area, the model selects the filling trajectory algorithm to generate a repair path and generates a corresponding repair code file. Subsequently, the cloud server sends the generated repair code file to the waxing platform, and the platform performs corresponding repair operations according to the repair code. After the repair is completed, the platform will continue to call the above steps for feedback repair until all defects are repaired.
[0073] The model selects the spiral trajectory generation algorithm in the trajectory planning and filling algorithm to generate a repair path, and uses the spiral trajectory to generate the repair path for the edge missing area. The generation of the spiral trajectory can be expressed by the following formula:
[0074] P repair_edge = SpiralTrack(θ, r max , Δr)
[0075] Where: P repair_edge is the set of repair path points, and the specific form is {(x1,y1),(x2,y2),(x3,y3),......(xi,yi)}, θ is the starting angle of the spiral trajectory, θ ∈ [0,2π], r max is the maximum radius of the spiral trajectory, r max depends on the size of the repair area, Δr is the radius increment of each spiral ring, Δr is set to 0.5 times the diameter of the wax drawing head, and SpiralTrack represents the abstract function of using the Spiral repair method.
[0076] The model selects the Z-shaped filling trajectory generation algorithm in the trajectory planning and filling algorithm to generate the repair path, and uses the Z-shaped filling trajectory to generate the repair path for the insufficient filling area. The generation of the Z-shaped filling trajectory can be expressed by the following formula:
[0077] P repair_fill = ZigzagTrack(y 0 , m, n, x start , x end )
[0078] Where: P repair_fill is the set of repair path points, y 0 is the ordinate at which it is implemented, m is the step length of each row, n is the number of rows, [x start , x end is the starting position and ending position of the filling area on the x-axis, and ZigzagTrack represents the abstract function of using the Zigzag repair method.
[0079] Generate the corresponding repair code file according to the generated spiral trajectory path and the Z-shaped filling path, and it also includes calling the GenerateRepairCode function according to the generated repair path to generate the repair code file:
[0080] F repair = GenerateRepairCode(P repair , type)
[0081] Where: F repair is the output code file, P repair is the spiral trajectory path or the Z-shaped filling path, type is the repair type, and GenerateRepairCode represents the abstract function of the method for generating the repair path, and generates the corresponding repair code file according to the corresponding repair path and the repair type.
[0082] S5. Train and update the defect detection model based on the type of image, defect feature information, and user preferences. Update the model parameters based on user preferences and new image data to achieve model upgrade and update.
[0083] The updated model parameters are:
[0084]
[0085] where θ′ is the parameter after model update, argmin θ Minimize the loss function is the loss function calculated through the original image dataset, including the measurement of the difference between the image I i and the target image P i where I′ j is the j-th image in the new image dataset, P′ j is the j-th target image in the new image dataset, N is the number of images in the original image dataset, and M represents the number of images in the new image dataset. is the loss calculated through the new image dataset, λ is the weight of the new data, preset to 1, L is the loss function, μL u e(f θ ) represents the loss term based on user preferences, μ represents the weight of user preference loss, μ ∈ [0, 0.5], f θ represents the model function, L u is the loss function of user preferences, e is the error, vL type (f θ ) is the loss term based on image type, v represents the weight of image type loss, μ ∈ [0.5, 2], L type is the loss function related to image type, ξL defect (f θ ) is the loss term related to curve features, ξ represents the weight of curve feature related loss, ξ ∈ [0.5, 2], L defect represents the loss function related to defects.
[0086] The pre-trained defect detection and repair model in step S3 includes the following steps:
[0087] Step B1: Collect the image information of the wax painting products through the wax painting platform. For the possible defects in the batik process (such as edge missing, insufficient filling, etc.), construct a sample dataset by combining the wax painting trajectory map of the original design image and the wax painting product image. The mathematical representation of the sample dataset is:
[0088]
[0089] where, Ii is the wax-drawing trajectory diagram of the original image, P i is the product image produced by the wax-drawing platform, and N is the total number of samples.
[0090] Step B2: Standardize and perform data augmentation on the sample dataset, and perform the following operations according to the characteristics of the wax-drawing process: Enhance the edge features of the batik pattern through the Sobel edge detection algorithm; perform normalization and resolution unification operations on the image to ensure the consistency of feature data; simulate the possible defects in the wax-drawing products to generate diverse samples, including: simulating edge breakage and generating a rough edge by randomly disturbing the positions of edge points; simulating insufficient filling and generating patterns for the missing filling parts by random generation.
[0091] Step B3: Based on the collected dataset, train the initialization model for defect detection and feedback repair. The model learns the characteristic differences between the wax-drawing trajectory diagram of the original image and the wax-drawing product image. The characteristic differences between the images include: differences in geometric features and differences in filling areas; to form a preliminary defect detection and repair ability. The parameter training formula for the initialization model is:
[0092]
[0093] where, f θ (I i ) is the output result of the model for the original image I i , is the loss function used to measure the model output and the product image P i , and θ is the model parameter.
[0094] Step B4: Further improve the model performance through a multi-task loss function that jointly optimizes the defect detection loss and the feedback repair loss. The form of the multi-task loss function is:
[0095] L = L detect + λL repair
[0096] where, L detect is the detection loss parameter used to measure the accuracy of the defect module localization result, L repair is the repair loss parameter used to measure the accuracy of the feedback repair module output result, and λ is the weight hyper-constant, which dynamically adjusts to balance the detection and repair performance.
[0097] Step B5: Use the validation set to evaluate the performance of the trained model. Take the defect detection accuracy rate and the repair success rate as the main indicators, save the model with the best performance for subsequent wax-drawing product defect detection and repair. At the same time, record the defect feature data during the repair process, and continuously train and update the model to adapt to the diverse defect patterns of wax-drawing products.
[0098] As Figure 2 shown, the present invention provides an automatic control system applicable to the wax painting process. This system integrates the functions of a host computer and a cloud server, and can efficiently realize the automated operation and feedback repair process of wax painting tasks. The present invention effectively improves the quality and production efficiency of batik products, is applicable to the digital and intelligent scenarios of the batik process, and has broad industrial application value.
[0099] The described automatic control system includes the design of the hardware part, the design of the underlying driver layer, the design of the host computer part, the design of the network service architecture, and the design of the network application layer. This automatic control system can implement the defect detection and feedback repair method as described above. It specifically includes the following contents:
[0100] 1. Design of the hardware part of the automatic control system based on the wax painting platform (as Figure 3 shown) consists of a main control MCU, a temperature measurement module, a display module, a debugging interface module, a network transmission module, an actuator, a relay control unit, and a heating module.
[0101] The main control MCU is equipped with a Linux kernel and serves as the main control unit of the entire control system, responsible for coordinating and controlling the operation of each subsystem. The Linux kernel provides powerful multitasking capabilities and a stable operating environment, supporting operating system-level task scheduling, resource management, and network communication functions, enabling the system to efficiently run various control tasks and support remote data exchange and processing with a cloud platform or an edge computing server.
[0102] The temperature measurement module is an essential key component in the control system, responsible for accurately measuring the temperature data of each part of the system and transmitting the real-time temperature information to the main control MCU for processing and storage.
[0103] The display module is an important part of the entire automatic control system, responsible for providing an intuitive and real-time human-machine interaction interface for operators or users to monitor the various states and control information of the system. The display module also shows the control information of the actuator, such as the current motion state, operation progress, executed path, etc., to help the operator monitor the operation of the device in real time and ensure that each task is executed as expected.
[0104] The debugging interface is an indispensable part of the entire control system, mainly responsible for program modification, debugging, fault diagnosis, and system upgrade. And it performs real-time debugging and optimization of control algorithms or system parameters to ensure the stability of the system under different working conditions.
[0105] The actuator is a key component in the entire control system, responsible for precisely performing various physical operations according to the instructions sent by the main control MCU. Each sub-module of the actuator uses high-precision sensors and a feedback system to real-time feedback position and status information to the main control MCU, ensuring the accuracy of closed-loop control and the efficient operation of the system, and guaranteeing that each operation meets the predetermined process requirements.
[0106] The network transmission module is the soul of the entire control system, undertaking all data communication and transmission functions between the system and external devices, cloud servers, and the PC side. It is a key link to ensure the effective interaction between the system and the external environment. Through the communication mechanism of network transmission, the control system realizes cross-platform and cross-region real-time data synchronization and instruction issuance, greatly improving the manageability and operation flexibility of the system.
[0107] The relay control unit is a key component in the entire automatic control system, responsible for performing real-time switch operations during the temperature control process. The system controls the temperature through the hysteresis interval algorithm to adjust the working state of heating elements or cooling devices, keeping the system within the predetermined temperature range.
[0108] The heating module is a key component in the control system, ensuring that the wax liquid does not solidify, and its switch is controlled by the relay control unit.
[0109] 2. The design of the underlying driver layer of the automatic control system based on the wax painting platform is mainly composed of the measurement temperature module driver, relay control unit module driver, display module driver, network transmission module driver, and serial port module driver. The specific contents are as follows:
[0110] The underlying driver layer directly interacts with the hardware to achieve communication with various sensors and control modules, ensuring the stable operation of the hardware devices.
[0111] Measurement temperature module driver: This driver is responsible for communicating with the temperature sensor module, collecting real-time temperature data, and transmitting the data to the upper-level control system. It supports different types of temperature sensors and ensures the accuracy and real-time nature of data collection.
[0112] Relay control unit module driver: The relay control unit driver is responsible for controlling the start and stop of heating and cooling devices. It turns on or off the relay according to the instructions of the temperature control module, thereby adjusting the working state of the heating or cooling system.
[0113] Display module driver: This driver controls the display content of the display module, including temperature, device status, alarm information, etc. It works in conjunction with the display screen or LCD monitor to update information in real-time, ensuring that the user interface accurately reflects the system status.
[0114] Network Transmission Module Driver: This driver enables data exchange between the system and an external network (such as a cloud server or a PC). Through the network transmission module, the system can upload data, receive remote instructions, and achieve remote monitoring and operation.
[0115] Serial Port Module Driver: The serial port driver is responsible for data transmission with hardware devices via the serial port, ensuring that control instructions and sensor data can flow efficiently and stably between the control system and external devices. This module supports automatic identification and error detection of serial port devices to ensure the reliability of communication.
[0116] The entire system realizes real-time and multi-task cooperation through multi-threading technology and an efficient hardware driver layer. Each thread in the application layer is independent yet closely coordinated to jointly complete tasks such as temperature regulation, data transmission, fault detection, and user interaction. The efficient docking of the underlying driver layer with hardware devices ensures the stability, response speed, and reliability of the temperature control system.
[0117] 3. Design of the upper computer part of the automatic control system based on the waxing platform (such as Figure 4 ), which mainly consists of a main interface UI thread, a network communication thread, a serial port communication thread, a temperature control thread, a temperature measurement thread, a Debug debugging thread, a temperature interface display thread, a file transfer thread, and a database operation thread. Each thread is responsible for a different functional module to ensure that the system efficiently and stably executes different tasks.
[0118] The core part of the upper computer consists of multiple independent threads, each responsible for a different functional module to ensure that the system efficiently and stably executes different tasks.
[0119] Main Interface UI Thread: This thread is responsible for handling the interaction between the user and the system, displaying real-time data (such as temperature, operation status, etc.), and providing a control interface for the operator to configure parameters, start or stop tasks, etc. Through the graphical interface function of Qt, users can intuitively view the system status and perform operations.
[0120] Network Communication Thread: This thread is responsible for realizing data exchange between the system and an external network (such as a cloud server, a PC, a remote device, etc.). Through this thread, the system can communicate with other devices in real time, supporting functions such as remote monitoring, remote control, data upload and download, etc., to ensure that the system can operate efficiently and stably.
[0121] Serial Port Communication Thread: Responsible for serial port communication with hardware devices, including data transmission and reception with external sensors, actuators, and other devices. This thread realizes real-time data exchange with serial port devices and supports the sending of control instructions and the reading of device feedback.
[0122] Temperature control thread: This thread performs real-time temperature regulation using the PID control algorithm through interaction with the temperature measurement and control module. It dynamically adjusts the operating state of heating or cooling devices based on the set temperature and real-time feedback to ensure the stability of the system temperature.
[0123] Temperature measurement thread: Responsible for periodically collecting temperature data and transmitting the data to the temperature control thread. This thread interacts with the temperature sensor module and realizes real-time monitoring of the system temperature by reading the data of the sensor.
[0124] Debugging thread: Provides support for development and troubleshooting, outputs the logs and debugging information of the system, and helps developers monitor the running state of the system, troubleshoot problems, and optimize the system.
[0125] Temperature interface display thread: Responsible for presenting real-time temperature-related data on the user interface to help operators view and monitor the temperature change trend. This thread ensures the real-time update and accurate display of temperature information.
[0126] File transfer thread: Used for data exchange between the system and external devices or cloud platforms, including receiving control instructions from the PC side or cloud, or uploading the system operation data to the cloud server. This thread supports file transfer protocols (such as FTP, HTTP, etc.) to ensure the stability and reliability of data transfer.
[0127] Database operation thread: Responsible for interacting with the system database, saving system operation data, user configurations, temperature history records, etc. It provides data storage and retrieval functions to support long-term data tracking and analysis.
[0128] 4. The network service architecture part of the automatic control system based on the wax painting platform is designed based on a cloud server and serves as the core hub of the entire control system. It is mainly responsible for communication and data interaction with the PC side, web side, mobile communication side, and the main control MCU. Network request processing is mainly composed of a network interface request module, an Nginx load balancing server, a Tornado server, and handlers. Each part cooperates with each other to ensure the efficiency, stability, and scalability of the system.
[0129] Network interface request module: Responsible for receiving access requests from external devices or users. As the entry point of the system, this module passes the requests from different clients to the server and supports multiple communication protocols to meet the connection requirements of the PC side, web side, and mobile side.
[0130] Nginx Load Balancing Server: As the front end of the network server, Nginx is responsible for load balancing and reverse proxying all incoming requests. Nginx distributes requests to the backend Tornado servers, thus improving the performance and reliability of the system. At the same time, Nginx also provides security access control and request filtering functions to ensure the security of the system.
[0131] Tornado Server: Tornado is a high-performance asynchronous non-blocking Web server responsible for handling requests from Nginx. It can quickly respond to concurrent requests and pass the requests to downstream handlers for further processing.
[0132] Handler: As the core business logic module of the system, the handler parses and executes the instructions passed by the Tornado server and passes the instructions to the main control MCU. The handler is responsible for instruction processing and data conversion to ensure that the instructions can be correctly executed by the main control MCU and complete the control process from the cloud to the device.
[0133] 5. The design of the network application layer part of the automatic control system based on the waxing platform includes the following parts: The network application layer consists of the image processing program, defect detection and feedback repair program, trajectory planning and filling program, and defect detection and feedback repair model described above. Finally, the feedback repair code file is sent to the main control MCU to execute the relevant waxing operations.
[0134] Figure 7 This is the flowchart of the automatic control system based on the waxing platform for the exemplary embodiment of the present invention, and shows how to adjust the models in the system. The following exemplary embodiments describe the control system of the present invention in more detail.
[0135] Step C1: Turn on the automatic control system of the waxing platform, including turning on the hardware of the automatic control system, the actuator, the cloud server, etc.;
[0136] Step C2: Set the target working temperature of the waxing platform, including the working temperature of the extrusion mechanism, the material bin, the hot bed, and the heating bin;
[0137] Step C3: Unlock the relevant control switches, including the temperature control switch, the serial communication control switch, and the network transmission control switch. The waxing platform will be registered as an idle device in the cloud server waiting for tasks to be executed;
[0138] Step C4: The user can select a suitable operation mode for the automatic control system according to their platform. The system supports bare-metal serial screen operation (only for the current machine), PC operation, web operation, and mobile operation. Among them, web and mobile operations are commonly used for the control of multiple machines. The user selects and uploads a picture to be waxed to the cloud server on the web or mobile side, and then the waxing process can be started;
[0139] Step C5: After receiving the uploaded picture, the cloud server first stores it in the cloud, then calls the processing program to preprocess the photo, extracts the contour, calls the trajectory planning and path generation program to generate the corresponding Gcode code file, and assigns an idle waxing platform for operation. Then, the generated file is sent to the bound idle waxing platform through the HTTP protocol to execute the waxing task;
[0140] Step C6: After receiving the Gcode code file to be waxed, the bound waxing platform first stores it locally, then parses the control instructions in the file one by one, and finally executes the corresponding instructions through the actuator to complete the waxing operation;
[0141] Step C7: After the waxing operation is completed, the high-precision camera mounted on the platform will capture the image information of the waxed product in real time. Then, after preliminary processing of the image information, it is stored locally in JPG format. To ensure the secure transmission of image data, the image file will be packaged into a compressed file together with the device number of the current batik platform. Then, the compressed file is uploaded to the cloud server for storage and further processing through a standardized network protocol;
[0142] Step C8: When the cloud server receives the uploaded image information, it first decompresses the image file. Then, the cloud server preprocesses the image information to improve the accuracy and efficiency of subsequent processing. The image first undergoes denoising processing to remove noise points in the image and improve the quality and clarity of the image. Subsequently, the image is grayscaled to simplify the image data and retain its core features for subsequent defect detection. Then, the image is cropped and geometrically corrected to remove irrelevant areas and perform geometric correction according to the actual boundary of the batik pattern to ensure that the key area in the image is centered and eliminate distortion or warping. After these corrections are completed, the resolution of the image is adjusted to be consistent with the original design image to ensure the consistency of the processed image data with the design image for subsequent comparative analysis. The finally processed image information will be stored in the local storage of the cloud server, and the geometric features and filling information in the image will be further extracted to provide basic data support for subsequent defect detection and repair;
[0143] Step C9: The pre-trained defect detection and repair model performs defect detection based on the geometric feature information and filling information of the current image. Specifically, the model analyzes the geometric features by comparing the waxing trajectory map generated from the current image and the original design image to identify whether there are edge defects in the product. The comparison of geometric features helps to accurately match the edge regions in the image, thereby detecting the missing parts. In addition, the model also identifies whether there is a problem of insufficient filling by comparing the filling information in the image. For the identified defects, the model classifies and marks them according to the defect type. For edge defects, the model uses green marks to highlight the missing edge regions; for regions with insufficient filling, the model uses red marks for clear distinction. These marks help the subsequent repair operations to accurately locate the defect positions for targeted repair;
[0144] Step C10: The model extracts the corresponding coordinate information based on the defect regions marked in the above steps. For the edge missing regions marked in green, the model selects the spiral trajectory generation algorithm in the trajectory planning and filling algorithm to generate a repair path and generates a repair code file based on this path; for the regions with insufficient filling marked in red, the model selects the filling trajectory algorithm to generate a repair path and generates the corresponding repair code file. Subsequently, the cloud server sends the generated repair code file to the waxing platform, and the platform performs the corresponding repair operations according to the repair code. After the repair is completed, the platform will continue to call the above steps for feedback repair until all defects are repaired;
[0145] Step C11: When the model detects that the product defects have been repaired, the current waxing task will end;
[0146] Step C12: The waxing platform will turn off the heating switch and unnecessary sensors and modules, enter the low-power mode, and wait to be woken up by the next waxing task;
[0147] Step C13: After the waxing platform completes the waxing task, the cloud service will re-mark the status of the waxing platform as idle, and then disconnect the connection of the client that initiated the waxing task.
[0148] In step C1 described above, after the automatic control system of the waxing platform is turned on, the following content is also included:
[0149] After the automatic control system is turned on, the system will perform an initial self-check operation to ensure that all modules are working properly.
[0150] The device registers the current waxing platform in the cloud server through the network module. Subsequently, the cloud server assigns a unique identification code to it and marks it as an idle waxing platform.
[0151] After the registration is completed, the wax painting platform will send the current status information and control information of the platform to the cloud through the network module for storage and display.
[0152] In step C4, the user selects a suitable operation method for the automatic control system according to their platform. The specific selection method can refer to Figure 5 . The cloud server will register this operation terminal as a wax painting task client to facilitate the subsequent display and update of the status information of the wax painting process.
[0153] In step C5, after the cloud server receives the uploaded picture, it first stores it in the cloud, then calls the processing program to preprocess the photo, extract the contour, calls the trajectory planning and path generation program to generate the corresponding Gcode code file, and allocates an idle wax painting platform for operation. Then, the generated file is sent to the bound idle wax painting platform through the HTTP protocol to execute the wax painting task, which should also include the following steps (the specific operation process can refer to Figure 6 ):
[0154] Step C51: The wax painting platform will first send a network interface request to the cloud server;
[0155] Step C52: The cloud server platform will call the Nginx reverse proxy server to process the network interface request and then proxy it to the tornado server;
[0156] Step C53: The tornado server will call the processing program to complete the corresponding operations, generate the Gcode code file, and allocate an idle wax painting platform in the initial state in step C3 or an idle wax painting platform marked as idle after just completing the wax painting task in step C13 for this wax painting task. Subsequently, the platform is marked as in the working state, realizing the binding between the client and the wax painting platform. The processing program includes an image processing program, a trajectory planning program, a path generation program, and a defect detection and repair large model program;
[0157] Step C54: The cloud server sends the generated file to the bound wax painting platform through the HTTP protocol to execute the wax painting task.
[0158] In step C6, during the execution of the wax painting, the wax painting platform will also continuously update the current status information and send it to the cloud server, and the cloud server will display this information in the client bound to the wax painting platform.
[0159] In the above step C10, after the model has completed the detection and repair task, the cloud server will train and update the defect detection model based on the type of the image, the characteristic information of the defect, and the user preference. Based on the user preference and the new image data, the model parameters are updated to achieve the upgrade and update of the model.
[0160] The systems, devices, modules or units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.
[0161] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, commodity or device including the said element.
[0162] The above embodiments should be understood as being only for illustrative purposes of the present invention and not for limiting the protection scope of the present invention. After reading the content described in the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent changes and modifications also fall within the scope defined by the claims of the present invention.
Claims
1. The feedback repair method based on the wax painting platform is characterized by: The following steps are involved: S1, when the wax painting platform completes the wax painting task, the platform will take the real-time image information of the wax painting product, after preliminary processing, and send it to the cloud server together with the device number of the current batik platform; S2, after receiving the uploaded information, the cloud server preprocesses the image information and extracts the geometric features and filling information in the image; S3, the pre-trained defect detection and repair model analyzes and identifies whether there are defective areas in the product, distinguishes different types of defects, and marks the coordinate information of the defective area based on the geometric features and filling information of the current image information and the wax painting trajectory map generated by the original design image; S4, according to the coordinate information corresponding to the marked defect area, call the trajectory planning and filling algorithm, generate the corresponding repair file, and send it to the wax painting platform; S5, trains and updates the defect detection and repair model based on the image type, defect feature information, and user preferences.
2. The feedback repair method based on the wax painting platform according to claim 1 is characterized in that: The preprocessing in step S2 includes denoising, grayscale processing, cropping and geometric correction to ensure that the processed image data is consistent with the designed image.
3. The feedback repair method based on the wax painting platform according to claim 1 is characterized in that: Different types of defects in step S3 include missing edges and insufficient filling; the edge area in the image is accurately matched by comparing geometric features, so as to detect the part with missing edges; and the filling information in the image is compared to identify whether there is an insufficiently filled part.
4. The feedback repair method based on the wax painting platform according to claim 1 or 3, characterized in that: The edge area in the image is accurately matched by contrasting geometric features, thereby detecting the edge missing part. Specifically, the contrast formula of geometric features is as follows: Where: (x, y) is the coordinate point in the detection plane area, and the value range of x, y depends on the size of the current printing image. is the model's understanding of the current product image P i The geometric feature output at position (x,y), It is the wax painting trajectory image I generated by the model for the original design image i The geometric feature output at position (x, y), τ edge >0.9 is the threshold for edge loss detection, R edge It is the edge missing area; By comparing the filling information in the image, it is identified whether there is an insufficiently filled part. The detection formula of the insufficiently filled area is as follows: Where: (x, y) is the coordinate point in the detection plane area, and the value range of x and y depends on the size of the current printing image. Is the model through the product image P i Fill information at position (x,y), It is the wax painting trajectory image I generated by the model for the original design image i Filling information at position (x,y), τ fill >0.95 is the threshold for filling defect detection, R fill is the underfilled area, R fill The specific form of is a set of defect points {(x1,y1),(x2,y2),(x3,y3),......(xi,yi)}.
5. The feedback repair method based on the wax painting platform according to claim 4 is characterized in that: In step S4, for edge missing, the spiral trajectory generation algorithm in the trajectory planning and filling algorithm is selected to generate a repair path, and a repair code file is generated based on the path; for insufficient filling, the Z-shaped filling trajectory generation algorithm in the trajectory planning and filling algorithm is selected to generate a repair path, and a corresponding repair code file is generated.
6. The feedback repair method based on the wax painting platform according to claim 4 is characterized in that: The spiral trajectory generation algorithm generates a repair path, and the generation of the spiral trajectory is expressed by the following formula: P repair_edge =SpiralTrack(θ,r max ,Δr) Where: P repair_edge is a set of repair path points, the specific form is {(x1,y1),(x2,y2),(x3,y3),......(xi,yi)}, θ is the starting angle of the spiral trajectory, θ∈[0,2π], r max is the maximum radius of the spiral trajectory, r max It depends on the size of the repair area, Δr is the radius increment of each spiral ring, Δr is set to 0.5 times the diameter of the wax drawing head, and SpiralTrack represents the abstract function using the Spiral repair method; The zigzag filling trajectory generation algorithm generates a repair path, which is expressed by the following formula: P repair_fill =ZigzagTrack(y0,m,n,x start ,x end ) Where: P repair_fill is a set of repair path points, y0 is the vertical coordinate of its implementation, m is the step length of each row, n is the number of rows, [x start ,x end ] is the starting and ending position of the filled area on the x-axis, and ZigzagTrack represents an abstract function using the Zigzag repair method.
7. The feedback repair method based on the wax painting platform according to any one of claims 1 to 6, characterized in that: The step S4 generates a corresponding repair file, including calling the GenerateRepairCode function according to the generated repair path to generate a repair code file: F repair =GenerateRepairCode(P repair ,type) Among them: F repair For the output code file, P repair It is a spiral trajectory path or a Z-shaped filling path, type is the repair type, and GenerateRepairCode represents the abstract function of the method for generating the repair path.
8. The feedback repair method based on the wax painting platform according to claim 1 is characterized in that: The model parameters updated in step S5 are: Where θ′ is the updated parameter of the model, argmin θ Minimize the loss function, is the loss function calculated by the original image dataset, including the image I i and the target image P i A measure of the difference between j is the jth image in the new image dataset, P′ j is the jth target image in the new image dataset, N is the number of images in the original image dataset, and M is the number of images in the new image dataset. is the loss calculated by the new image dataset, λ is the weight of the new data, which is preset to 1, L is the loss function, μL u e(f θ ) represents the loss term based on user preference, μ represents the weight of user preference loss, μ∈[0,0.5], f θ represents the model function, L u is the loss function of user preference, e is the error, vL type (f θ ) is the loss term based on image type, v represents the weight of image type loss, μ∈[0.5,2], L type is the loss function related to the image type, ξL defect (f θ ) is the loss term related to the curve feature, ξ represents the weight of the loss related to the curve feature, ξ∈[0.5,2], L defect represents the defect-related loss function.
9. The automatic control system based on the wax painting platform is characterized by: The feedback repair method according to any one of claims 1 to 8 can be executed, comprising: The hardware part is used to complete the production of wax painting products and take pictures of the image information of wax painting products and upload them to the cloud server; The bottom driver layer is used to interact with the hardware and realize communication with various sensors and control modules; The host computer part is used to store and run multiple independent threads, each of which is responsible for different functional modules; including the main interface UI thread, network communication thread, serial port communication thread, temperature control thread, temperature measurement thread, Debug thread, temperature interface display thread, file transfer thread and database operation thread; The network service architecture is responsible for the communication and data interaction between the PC, web page, mobile communication and main control MCU. It consists of a network interface request module, Nginx load balancing server, Tornado server and processing program.
10. The automatic control system based on the wax painting platform according to claim 9 is characterized in that: The hardware part includes a main control MCU, a temperature measurement module, a display module, a debugging interface module, a network transmission module, an actuator, a relay control unit and a heating module; The main control MCU is equipped with a Linux kernel for coordinating and controlling the operation of each subsystem; The temperature measurement module is used to accurately measure the temperature data of each part of the system and transmit the real-time temperature information to the main control MCU for processing and storage; The display module is used to provide a human-computer interaction interface; The debugging interface module is used to provide program modification, debugging, fault diagnosis and system upgrade; The execution mechanism is used to perform various physical operations according to the instructions sent by the main control MCU; The network transmission module is used to realize all data communication and transmission functions between the system and external devices, cloud servers and PC terminals; The relay control unit is used to perform real-time switching operations during the temperature control process; the heating module is used to heat the wax to ensure that the wax liquid does not solidify.
Citation Information
Patent Citations
Biomaterial system for in SITU tissue repair
CA2243154A1
Image restoration method and system based on edge restoration and content restoration
CN110675339A
Automatic process method for detecting and repairing surface microdefects of large-diameter element
CN114113114A
Tunnel crack automatic repairing method, device and system and readable storage medium
CN115182747A
Intelligent defect detection system for anode copper plate production
CN118485650A