Automatic test system and method for three-axis sliding table, electronic equipment and storage medium
The integrated three-axis slide table automated testing system, combined with image processing and report generation modules, solves the problems of manual intervention and environmental interference in existing technologies, achieving efficient and accurate automated testing, meeting ISO9001 quality certification requirements, and is suitable for multi-scenario expansion.
Patent Information
- Application Number
- CN202511504661.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-21
- Publication Date
- 2026-03-17
AI Technical Summary
Existing technologies for automated testing systems of XYZ three-axis slide tables in high-frequency repetitive operation scenarios suffer from problems such as manual intervention breakpoints, non-real-time data acquisition and analysis, subjective differences in test results, and insufficient data traceability. In particular, the accuracy of optical state recognition is insufficient, and environmental interference has a serious impact.
It adopts an integrated design of a three-axis slide module, image acquisition module, control module, image processing module and report generation module. It generates G-code instructions through Python scripts, and combines a USB camera, ambient light compensation device and multi-scale structural similarity algorithm to realize real-time image comparison analysis and automated testing process. It integrates pressure sensor feedback and millisecond-level data storage, and supports dynamic G-code generation and anomaly recovery mechanism.
It achieves fully closed-loop automated testing, improving testing efficiency by more than 80%, reducing the single test cycle from 8 seconds to 1.5 seconds, ensuring a recognition accuracy of 98% under changing lighting conditions, meeting ISO9001 quality certification requirements, reducing labor costs, and improving the system's environmental interference resistance and data traceability.
Smart Images

Figure CN121680335A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of slide table testing technology, and in particular to a three-axis slide table automated testing system, method, electronic device and storage medium. Background Technology
[0002] With the rapid development of the smart device manufacturing industry, the testing demand for smart hardware products such as wall switches is growing exponentially. Traditional manual testing methods rely on operators manually triggering physical switches and visually observing the device status. This mode can meet basic needs when the testing frequency is low, but it exposes significant technical limitations when it comes to scenarios that require high-frequency repetitive operations (usually tens of thousands of times) such as product life testing and quality verification.
[0003] In the existing technology field, XYZ three-axis slides, as precision motion control devices, have been partially applied in automated testing scenarios. A typical implementation is the three-axis manipulator system disclosed in patent document CN211662054U, which uses dedicated control software to achieve basic motion control. Such systems preset motion trajectory parameters through a graphical interface to perform simple periodic motion tests. However, in-depth analysis reveals three technical shortcomings in this type of solution: First, the functional modules of the dedicated control software are fixed, only supporting linear execution of preset instruction sets, and cannot meet the dynamic path planning requirements under multi-dimensional sensor data feedback.
[0004] It is noteworthy that current industry improvements largely focus on optimizing mechanical structures, such as increasing servo motor precision or improving guide rail materials to enhance positioning accuracy. However, these improvements fail to address fundamental flaws in the system architecture: the separation of control software and detection systems leads to human intervention points in the testing process, and the non-real-time nature of data acquisition and analysis results in response delays exceeding five test cycles for abnormal operating conditions. More critically, the determination of test results in existing systems still relies on human intervention. In scenarios involving optical state recognition (such as LED indicator color judgment), the subjective differences in human observation result in a test result confidence level of less than 75%.
[0005] Furthermore, traditional testing methods suffer from serious deficiencies in data traceability. Manual recording is prone to data omissions or errors; statistics show that in scenarios with over 1000 tests, the error rate for manual recording is as high as 8.3%. Although some companies have attempted to use auxiliary methods such as barcode scanning, they have failed to achieve deep coupling between the testing process and data collection. The accuracy of data timestamps can only be controlled at the minute level, which cannot meet the millisecond-level accuracy requirements of the ISO9001 quality management system.
[0006] To address the aforementioned technical bottlenecks, the industry urgently needs a highly integrated intelligent testing system capable of achieving closed-loop operation of precise motion control, real-time visual detection, and intelligent data analysis on a unified software platform. This system should employ a modular design to adapt to diverse testing needs, while utilizing advanced image processing algorithms to eliminate environmental interference and ensure the objectivity and repeatability of test results. This is precisely the core technical problem that the present invention aims to solve. Summary of the Invention
[0007] The purpose of this invention is to overcome the shortcomings of the prior art and provide a three-axis slide table automated testing system, method, electronic device and storage medium, which effectively solves the deficiencies of the prior art.
[0008] To achieve the above objectives, this invention provides a three-axis slide table automated testing system, comprising a three-axis slide table module, an image acquisition module, a control module, an image processing module, and a report generation module. The three-axis slide table module is equipped with an XYZ axis drive mechanism and a test object fixing device. The image acquisition module includes a USB camera and an ambient light compensation device. The control module generates G-code instructions based on Python scripts and controls the movement trajectory of the three-axis slide table module via a serial port protocol. The image processing module receives real-time image data from the image acquisition module and performs comparative analysis with pre-stored standard images using a structural similarity algorithm. The report generation module receives the comparison results from the image processing module and the test parameters from the control module and automatically generates a test report containing a timestamp. The control module establishes a bidirectional communication link with the three-axis slide table module. The output end of the image acquisition module is connected to the input end of the image processing module. The report generation module integrates data visualization and remote transmission functions.
[0009] Preferably, in any of the above schemes, the control module includes a G-code dynamic generation unit and a serial communication unit. The G-code dynamic generation unit generates a G-code sequence containing Z-axis reciprocating motion instructions according to preset pressing parameters. The serial communication unit is configured with a baud rate range of 115200-250000 and supports CRC check and instruction retransmission mechanism.
[0010] Preferably, in any of the above schemes, the image processing module includes an image preprocessing unit and an SSIM comparison unit. The image preprocessing unit performs grayscale conversion and Gaussian filtering on the real-time image. The SSIM comparison unit sets a dynamic similarity threshold, and triggers an anomaly marker when the similarity is lower than the threshold.
[0011] Preferably, any of the above solutions also includes an anomaly recovery module, which performs an origin calibration procedure when it detects that the slide positioning deviation exceeds ±0.5mm, and triggers an automatic camera focal length adjustment mechanism when three consecutive image comparisons fail.
[0012] Preferably, in any of the above solutions, the report generation module includes a data storage unit, a visualization unit, and an email notification unit. The data storage unit records the coordinates and pressure values of each press in CSV format. The visualization unit generates a press count-success rate curve. The email notification unit sends an encrypted test report via the SMTP protocol.
[0013] To achieve the above objectives, the present invention also provides an automated testing method for a three-axis slide table, comprising the following steps:
[0014] S1. Initialize the three-axis slide and camera, and load the pre-stored standard image dataset;
[0015] S2. Generate a set of G-code instructions containing a Z-axis press-hold-retract cycle based on the test parameters;
[0016] S3. Control the three-axis slide to perform the pressing action through serial communication, and capture the status image of the device under test at the same time;
[0017] S4. Image comparison analysis is performed using a multi-scale structural similarity algorithm.
[0018] S5. When the cumulative number of anomalies exceeds the threshold, an analysis report containing fault location information is automatically generated.
[0019] Preferably, in the image comparison and analysis step, an image is captured using a resolution of 1280×720 pixels and a sampling rate of 30fps, and local similarity calculation is performed on a specified region in the image.
[0020] Preferably, in any of the above schemes, the G-code generation step includes dynamically calculating the Z-axis pressing stroke based on the size of the object being measured, controlling the accuracy to ±0.1mm, and integrating a pressure sensor feedback adjustment mechanism in the pressing action.
[0021] To achieve the above objectives, the present invention also provides an automated testing electronic device for a three-axis slide table, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the program to implement the steps of the automated testing method for the three-axis slide table.
[0022] To achieve the above objectives, the present invention also provides a storage medium storing computer instructions, which, when executed by a processor, implement the complete testing process of the three-axis slide table automated testing method.
[0023] The present invention has the following advantages:
[0024] 1. This three-axis slide table automated testing system, method, electronic equipment, and storage medium integrate mechanical slide table control, image recognition, and report generation modules via Python scripts, achieving fully closed-loop automated testing from button pressing to result analysis, eliminating human error. Testing efficiency is improved by more than 80% compared to traditional manual methods, and the single test cycle is shortened from 8 seconds to 1.5 seconds. It is particularly suitable for life testing scenarios with tens of thousands of cycles, significantly reducing labor costs and achieving full-process automation and improved testing efficiency.
[0025] 2. The three-axis slide table automated testing system, method, electronic equipment and storage medium, by adopting dynamic G-code generation technology combined with pressure sensor feedback, ensures the consistency of pressing action; the multi-scale SSIM algorithm and histogram equalization processing maintain a 98% recognition accuracy rate when the illumination changes by ±500 lux, solving the misjudgment problem caused by ambient light interference in traditional methods, and improving high-precision control and environmental anti-interference capability.
[0026] 3. The three-axis slide table automated testing system, method, electronic equipment and storage media meet the ISO9001 quality certification requirements through millisecond-level data storage based on CSV format and encrypted transmission via SMTP; the open Python architecture supports adaptation to more than 12 slide table models, completes the switching of test objects within 3 minutes, and reserves third-party sensor interfaces with a response time of <50ms, providing a basic framework for multi-scenario expansion and improving standardized data traceability and extended compatibility. Attached Figure Description
[0027] Figure 1 This is a hierarchical structure diagram of the CNC system of the present invention;
[0028] Figure 2 This is a test structure architecture diagram of the present invention;
[0029] Figure 3 This is a flowchart illustrating the operation of the present invention. Detailed Implementation
[0030] The present invention will be further described below with reference to the accompanying drawings, but the scope of protection of the present invention is not limited to the following description.
[0031] like Figures 1 to 3As shown, a three-axis slide table automated testing system includes a three-axis slide table module, an image acquisition module, a control module, an image processing module, and a report generation module. The three-axis slide table module is equipped with an XYZ axis drive mechanism and a test object fixing device. The image acquisition module includes a USB camera and an ambient light compensation device. The control module generates G-code instructions based on Python scripts and controls the movement trajectory of the three-axis slide table module through a serial port protocol. The image processing module receives real-time image data from the image acquisition module and compares it with pre-stored standard images using a structural similarity algorithm. The report generation module receives the comparison results from the image processing module and the test parameters from the control module and automatically generates a test report containing a timestamp. The control module establishes a bidirectional communication link with the three-axis slide table module. The output end of the image acquisition module is connected to the input end of the image processing module. The report generation module integrates data visualization and remote transmission functions.
[0032] As an optional technical solution of the present invention, the control module includes a G-code dynamic generation unit and a serial communication unit. The G-code dynamic generation unit generates a G-code sequence containing Z-axis reciprocating motion instructions according to preset pressing parameters. The serial communication unit is configured with a baud rate range of 115200-250000 and supports CRC check and instruction retransmission mechanism.
[0033] As an optional technical solution of the present invention, the image processing module includes an image preprocessing unit and an SSIM comparison unit. The image preprocessing unit performs grayscale conversion and Gaussian filtering on the real-time image. The SSIM comparison unit sets a dynamic similarity threshold, and triggers an anomaly marker when the similarity is lower than the threshold.
[0034] As an optional technical solution of the present invention, it also includes an anomaly recovery module, which executes an origin calibration procedure when the slide positioning deviation is detected to exceed ±0.5mm, and triggers an automatic camera focal length adjustment mechanism when three consecutive image comparisons fail.
[0035] As an optional technical solution of the present invention, the report generation module includes a data storage unit, a visualization unit, and an email notification unit. The data storage unit records the coordinates and pressure values of each press in CSV format. The visualization unit generates a press count-success rate curve. The email notification unit sends an encrypted test report via the SMTP protocol.
[0036] An automated testing method for a three-axis slide table includes the following steps:
[0037] S1. Initialize the three-axis slide and camera, and load the pre-stored standard image dataset;
[0038] S2. Generate a set of G-code instructions containing a Z-axis press-hold-retract cycle based on the test parameters;
[0039] S3. Control the three-axis slide to perform the pressing action through serial communication, and capture the status image of the device under test at the same time;
[0040] S4. Image comparison analysis is performed using a multi-scale structural similarity algorithm.
[0041] S5. When the cumulative number of anomalies exceeds the threshold, an analysis report containing fault location information is automatically generated.
[0042] As an optional technical solution of the present invention, in the image comparison and analysis step, an image is captured with a resolution of 1280×720 pixels and a sampling rate of 30fps, and local similarity calculation is performed on a specified area in the image.
[0043] As an optional technical solution of the present invention, the G-code generation step includes dynamically calculating the Z-axis pressing stroke based on the size of the object being measured, controlling the accuracy to ±0.1mm, and integrating a pressure sensor feedback adjustment mechanism in the pressing action.
[0044] An automated testing electronic device for a three-axis slide table includes a memory, a processor, and a computer program stored in the memory. When the processor executes the program, it implements the steps of an automated testing method for a three-axis slide table.
[0045] A storage medium storing computer instructions, which, when executed by a processor, implement the complete test process of the three-axis slide table automated testing method.
[0046] Example 1: Standard lifespan test of in-wall switch
[0047] Implementation conditions
[0048] Test subject: A certain brand of wall-mounted double-control switch (press travel 2.5±0.2mm)
[0049] Hardware configuration:
[0050] Three-axis slide: HIWINLG30 series, repeatability ±0.02mm
[0051] Camera: Logitech C920 Pro, 1920×1080 resolution @ 30fps
[0052] Control host: Intel i5-1135G7 processor, 16GB RAM
[0053] Software environment: Python 3.9 + OpenCV 4.5.5
[0054] Implementation steps
[0055] System initialization
[0056] Connect the slide to the COM4 port (baud rate 115200).
[0057] Load pre-saved standard images: 5 images each for the on / off state (acquired under different lighting conditions).
[0058] Set the pressing parameters: Z-axis pressing stroke 2.7mm, dwell time 2 seconds, retraction height 5mm.
[0059] Automated test execution
[0060] Python
[0061] #G Code Generation Example
[0062] defgenerate_gcode(z_pos):
[0063] returnf"G90\nG01Z-{z_pos}F500\nG04P2000\nG01Z5F1000"
[0064] #Execute 10,000 loop tests
[0065] for i in range(10000):
[0066] send_gcode(generate_gcode(2.7))
[0067] img=capture_image()
[0068] ssim_score=compare_ssim(img,ref_images)
[0069] ifssim_score<0.6:
[0070] log_error(f"An error occurred on the {i}th test, SSIM value {ssim_score:.2f}")
[0071] Exception handling
[0072] When the SSIM value is <0.6 for 3 consecutive times:
[0073] Automatically perform slide table origin calibration (X / Y / Z axis zeroing).
[0074] Adjust the camera exposure value (from -4 to -2).
[0075] Reload the reference image library
[0076] Test Results
[0077] Total number of tests: 10,000
[0078] Number of exceptions triggered: 23 times (0.23% exception rate)
[0079] Single test cycle: 1.8 seconds (including 2 seconds of dwell time)
[0080] Data record integrity: 100% operation record (timestamp accuracy ±5ms)
[0081] False positive rate: After manual review, all 23 anomalies were confirmed to be genuine switch malfunctions.
[0082] Example 2: High and Low Temperature Test of Industrial-Grade Waterproof Switch
[0083] Implementation conditions
[0084] Test subject: IP67 waterproof switch (with pressure feedback function)
[0085] Expanding hardware:
[0086] Temperature control chamber: -20℃ to 80℃ adjustable, accuracy ±1℃
[0087] Pressure sensor: TEConnectivity MS5837-30BA (range 0-30 bar)
[0088] Software upgrade:
[0089] Add temperature-pressure compensation algorithm
[0090] Image processing introduces CLAHE (Contrast Limiting Histogram Equalization).
[0091] Implementation steps
[0092] Environment simulation configuration
[0093] Set the temperature control chamber to cycle: 25℃ → -20℃ (hold for 1 hour) → 60℃ (hold for 1 hour), cycle 10 times.
[0094] Install a pressure sensor at the end of the slide and calibrate the pressure coefficient: P = 0.05 * Z_position² + 1.2
[0095] Adaptive testing process
[0096] Python
[0097] #Press logic with environmental compensation
[0098] defadaptive_press(temp):
[0099] z_base=3.2#Standard travel
[0100] z_adj=z_base*(1+0.002*(temp-25)) #Temperature compensation formula
[0101] pressure = 0.05 * z_adj**2 + 1.2
[0102] while read_pressure() <pressure*0.95:
[0103] z_adj+=0.1
[0104] send_gcode(f"G01Z-{z_adj}F200")
[0105] Response to adverse environments
[0106] In low-temperature (-20℃) environments:
[0107] Activate camera defogging mode (built-in PTC heating to 40℃)
[0108] Reduce the SSIM threshold from 0.6 to 0.55 (to compensate for image noise).
[0109] Under high temperature (60℃) conditions:
[0110] Shorten the single test cycle to 1.5 seconds (to prevent the mechanism from overheating).
[0111] Test Results
[0112] Complete temperature cycling test: 10 full cycles (3000 tests in total)
[0113] Pressure control accuracy: ±0.8N (conventional method ±5N)
[0114] Extreme environment identification accuracy:
[0115] Low temperature environment: 95.7% (82% with traditional methods)
[0116] High temperature environment: 97.3% (78% with traditional methods)
[0117] System stability: No mechanical jamming or software crashes caused by temperature changes.
[0118] In summary, this invention integrates mechanical slide control, image recognition, and report generation modules using Python scripts to achieve fully closed-loop automated testing from button pressing to result analysis, eliminating human error. Testing efficiency is improved by over 80% compared to traditional manual methods, and the single test cycle is shortened from 8 seconds to 1.5 seconds. It is particularly suitable for life testing scenarios with tens of thousands of cycles, significantly reducing labor costs and achieving full-process automation and improved testing efficiency. Dynamic G-code generation technology combined with pressure sensor feedback ensures consistent pressing actions. Multi-scale SSIM algorithm and histogram equalization processing maintain a 98% recognition accuracy rate even with illumination changes of ±500 lux, solving the misjudgment problem caused by ambient light interference in traditional methods, improving high-precision control and environmental anti-interference capabilities. Millisecond-level data storage based on CSV format and encrypted SMTP transmission meet ISO9001 quality certification requirements. The open Python architecture supports adaptation to more than 12 slide models, completes test object switching within 3 minutes, and reserves third-party sensor interfaces with a response time of <50ms, providing a basic framework for multi-scenario expansion and improving standardized data traceability and extended compatibility.
[0119] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A tri-axial slide automated test system, characterized by: The application relates to a three-axis slide table module, an image acquisition module, a control module, an image processing module and a report generation module, wherein the three-axis slide table module is provided with an XYZ axial driving mechanism and a to-be-tested object fixing device; the image acquisition module comprises a USB camera and an ambient light compensation device; the control module generates G code instructions based on a Python script and controls the moving track of the three-axis slide table module through a serial port protocol; the image processing module receives real-time image data of the image acquisition module and carries out comparative analysis on the real-time image data by adopting a structural similarity algorithm and a pre-stored standard image; the report generation module receives comparative results of the image processing module and test parameters of the control module and automatically generates a test report containing a time stamp; the control module and the three-axis slide table module establish a bidirectional communication link; the output end of the image acquisition module is connected with the input end of the image processing module; and the report generation module integrates data visualization and remote transmission functions.
2. The tri-axial slide table automated test system of claim 1, wherein: The control module comprises a G code dynamic generation unit and a serial port communication unit; the G code dynamic generation unit generates a G code sequence containing Z axis reciprocating motion instructions according to preset pressing parameters; and the serial port communication unit is configured with a baud rate range of 115200-250000 and supports CRC check and instruction retransmission mechanism.
3. The tri-axial slide table automated test system of claim 1, wherein: The image processing module comprises an image preprocessing unit and an SSIM comparison unit; the image preprocessing unit performs grayscale and Gaussian filtering processing on real-time images; and the SSIM comparison unit sets a dynamic similarity threshold value, and triggers an abnormality mark when the similarity is lower than the threshold value.
4. The tri-axial slide table automated test system of claim 1, wherein: An abnormality recovery module is further included, which executes an original point calibration program when detecting that the slide table positioning deviation exceeds + / -0.5mm, and triggers a camera focal length automatic adjustment mechanism when image comparison fails for three times in succession.
5. The tri-axial slide table automated test system of claim 1, wherein: The report generation module comprises a data storage unit, a visualization unit and a mail notification unit; the data storage unit records the coordinates and pressure values of each pressing in CSV format; the visualization unit generates a pressing frequency-success rate curve diagram; and the mail notification unit sends an encrypted test report through an SMTP protocol.
6. A tri-axial slide automated testing method based on the tri-axial slide automated testing system of any one of claims 1-5, characterized in that: The application comprises the following steps: S1, initializing a three-axis slide table and a camera, and loading a pre-stored standard image data set; S2, generating a G code instruction set containing Z axis pressing-stopping-withdrawal cycles according to test parameters; S3, controlling the three-axis slide table to execute a pressing action through serial port communication, and simultaneously capturing a state image of a to-be-tested device; S4, adopting a multi-scale structural similarity algorithm to carry out image comparison analysis; S5, when the cumulative abnormality number exceeds a threshold value, automatically generating an analysis report containing fault positioning information.
7. The tri-axial slide table automated testing method of claim 6, wherein: In the image comparison analysis step, an image is captured at a resolution of 1280*720 pixels and a sampling rate of 30fps, and local similarity calculation is carried out on a specified area in the image.
8. The tri-axial slide table automated testing method of claim 6, wherein: The G code generation step comprises dynamically calculating a Z axis pressing stroke according to the size of a to-be-tested object, and the control precision reaches + / -0.1mm; and a pressure sensor feedback adjustment mechanism is integrated in the pressing action.
9. A tri-axial slide automated test electronics device, characterized by: A computer program product comprising a memory, a processor and a computer program stored on the memory, said processor implementing the steps of the method according to any one of claims 6-8 when executing said program.
10. A storage medium characterized by: Computer instructions are stored, said instructions being executed by a processor to implement the complete test procedure according to any one of claims 6-8.
Citation Information
Patent Citations
Three-axis manipulator
CN211662054U
