Automatic driver testing method and system based on PLC (Programmable Logic Controller) and HMI (Human Machine Interface)

By using automated testing methods for PLCs and HMIs, the problems of low testing efficiency and inconsistent results in traditional drive controller testing have been solved, achieving efficient and reliable drive testing and generating standardized reports.

CN121879253APending Publication Date: 2026-04-17SHENZHEN JUST MOTION CONTROL ELECTROMECHANICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN JUST MOTION CONTROL ELECTROMECHANICS CO LTD
Filing Date
2025-12-24
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Traditional drive controller testing methods are inefficient, produce inconsistent results, lack reliability, and have incomplete functional coverage. They cannot meet the needs of large-scale production and are difficult to conduct continuous testing over long periods of time.

Method used

An automated testing method based on PLC and HMI is adopted to achieve automated testing of the drive through hardware connection, software configuration, test data processing and feedback data comparison.

Benefits of technology

It achieves automation, integration, and high precision in driver testing, improves testing efficiency, ensures the consistency and reliability of test results, supports full functional coverage, and generates standardized reports.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121879253A_ABST
    Figure CN121879253A_ABST
Patent Text Reader

Abstract

The invention provides a method and a system for automatically testing a driver based on a PLC (Programmable Logic Controller) and an HMI (Human Machine Interface). The method comprises the steps that hardware is connected through a preset rule, software configuration is completed, a system state is acquired according to hardware connection state data and communication state data, and basic parameters are set; obtaining a test type and configuring final parameters, and if the test is a full test, testing the digital quantity, the analog quantity, the encoder and Profinet communication according to a preset sequence to obtain feedback data; the PLC preprocesses the feedback data and compares the feedback data with a preset threshold value to obtain a single test result; the HMI displays the test progress and feedback data in real time and automatically generates a test report; therefore, automatic testing of the driver is achieved, manual intervention is reduced, testing efficiency and accuracy are improved, faults can be fed back in real time, and testing reliability is effectively guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of automated testing, and more specifically, to automated testing methods and systems for PLC and HMI-based drives. Background Technology

[0002] Drive controllers are core components in modern industrial automation equipment, and their performance and quality directly affect the stability and accuracy of the entire system. After the drive controller leaves the factory or is repaired, key functional tests are performed on its digital input / output, analog input / output, encoder signal transmission, and Profinet communication.

[0003] Currently, traditional testing methods primarily rely on testers using multiple instruments such as multimeters, oscilloscopes, and signal generators to manually connect wires, apply signals, and record test results. This method has the following significant drawbacks: First, it is inefficient, with a cumbersome testing process and a long testing cycle, which cannot meet the needs of large-scale production. Second, there is poor consistency: test results are easily affected by the experience and state of the testers, and the standards are not uniform; third, there is insufficient reliability, manual interpretation is prone to errors, and it is difficult to achieve long-term continuous testing; fourth, the functional coverage is incomplete, and it is impossible to simulate complex linkage conditions.

[0004] Therefore, there is an urgent need in this field for a drive controller testing solution that can achieve automation, integration, high precision, and ease of operation. Summary of the Invention

[0005] The purpose of this application is to provide an automated testing method and system for drives based on PLC and HMI. By judging the system status, configuring software parameters, judging the test status, and comparing feedback data, automated testing of drives is achieved.

[0006] This application also provides an automated testing method for drives based on PLC and HMI, including the following steps: Connect the hardware according to preset rules, obtain hardware connection status data and communication status data, and configure the software. System status data is obtained by processing hardware connection status data and communication status data, and basic parameters are set based on system status data. Obtain test type data and configure the final parameters based on the test type data; According to the test type data, the digital quantity, analog quantity, encoder and Profinet communication are tested in a preset order, and feedback data is obtained according to the test status. The feedback data is preprocessed by the PLC, and the preprocessed data is compared with the corresponding threshold to obtain the corresponding single test result data. The HMI displays test progress and feedback data in real time and automatically generates test reports.

[0007] Optionally, in the PLC and HMI-based automated test method for drivers described in this application, the step of connecting the hardware according to preset rules, acquiring hardware connection status data and communication status data, and configuring the software specifically includes: The driver under test is connected to the PLC through a signal conditioning module, wherein the driver's DI terminal is connected to the PLC's DO point, the AI ​​terminal is connected to the PLC's AO point, and the encoder's A / B / Z phase terminals are connected to the PLC's HSC channel; Obtain hardware connection status data, including hardware connection success data or hardware connection failure data; Obtain communication status data, including successful or failed communication data. The software configuration includes the product model, serial number, HSC working mode, and Profinet communication parameters.

[0008] Optionally, in the PLC and HMI-based automated test method for drives described in this application, the step of obtaining system status data by processing hardware connection status data and communication status data, and setting basic parameters based on the system status data, specifically includes: Perform a bitwise AND operation on the hardware connection status data and communication status data to obtain system status data, including system readiness or system failure. If the system malfunctions, a fault warning will be sent to the display. Fault factors include hardware connection failure data or communication failure data. If the system is ready, the PLC sends a pre-configuration instruction to the driver under test to complete the basic parameter settings, including the corresponding preset control mode and signal range.

[0009] Optionally, in the PLC and HMI-based automated test method for drives described in this application, the step of acquiring test type data and configuring final parameters based on the test type data specifically includes: Obtain test type data, including single test or full test; The individual test is one of the following: digital quantity test, analog quantity test, encoder test, or Profinet communication test; Based on the test type data, the corresponding final parameter configuration numbers are sent to the driver under test via the Profinet protocol.

[0010] Optionally, in the PLC and HMI-based automated test method for drives described in this application, the step of testing digital quantities, analog quantities, encoders, and Profinet communication according to a preset order based on test type data, obtaining the test process status, and obtaining feedback data based on the test process status specifically includes: If the test type data is a single test, the corresponding single process status data will be obtained after testing according to the preset test process, including the process pass status or the process fail status. Display the status data of each individual process on the HMI terminal; If the test type data is a full-item test, then the digital quantity, analog quantity, encoder and Profinet communication are tested in a preset order to obtain the corresponding single process status data; If all individual process status data are in the process pass state, then collect the feedback data of each individual test, including digital feedback data, analog feedback data, encoder feedback data, and Profinet communication feedback data.

[0011] Optionally, in the PLC and HMI-based automated test method for drives described in this application, the step of preprocessing the feedback data using the PLC to process the raw data, and comparing the preprocessed data with the corresponding threshold to obtain the corresponding single test item result data, specifically includes: The feedback data is filtered by the PLC and then preprocessed, including unit conversion or error calculation. Standard feedback data or error data are obtained after preprocessing; The standard feedback data or error data is compared with the corresponding preset threshold to obtain the individual test result data.

[0012] Optionally, the PLC and HMI-based automated test method for drives described in this application further includes: If an abnormality occurs during a single test, the PLC will pause the test. The HMI displays the name of the exception and the fault type.

[0013] Secondly, this application provides an automated testing system for drivers based on PLC and HMI. The system includes a memory and a processor. The memory stores a program for an automated testing method for drivers based on PLC and HMI. When the program for the automated testing method for drivers based on PLC and HMI is executed by the processor, it performs the following steps: Connect the hardware according to preset rules, obtain hardware connection status data and communication status data, and configure the software. System status data is obtained by processing hardware connection status data and communication status data, and basic parameters are set based on system status data. Obtain test type data and configure the final parameters based on the test type data; According to the test type data, the digital quantity, analog quantity, encoder and Profinet communication are tested in a preset order, and feedback data is obtained according to the test status. The feedback data is preprocessed by the PLC, and the preprocessed data is compared with the corresponding threshold to obtain the corresponding single test result data. The HMI displays test progress and feedback data in real time and automatically generates test reports.

[0014] Optionally, in the PLC and HMI-based automated test system for drivers described in this application, the step of connecting the hardware according to preset rules, acquiring hardware connection status data and communication status data, and configuring the software specifically includes: The driver under test is connected to the PLC through a signal conditioning module, wherein the driver's DI terminal is connected to the PLC's DO point, the AI ​​terminal is connected to the PLC's AO point, and the encoder's A / B / Z phase terminals are connected to the PLC's HSC channel; Obtain hardware connection status data, including hardware connection success data or hardware connection failure data; Obtain communication status data, including successful or failed communication data. The software configuration includes the product model, serial number, HSC working mode, and Profinet communication parameters.

[0015] Optionally, in the PLC and HMI-based automated test system for drives described in this application, the step of obtaining system status data by processing hardware connection status data and communication status data, and setting basic parameters based on the system status data, specifically includes: Perform a bitwise AND operation on the hardware connection status data and communication status data to obtain system status data, including system readiness or system failure. If the system malfunctions, a fault warning will be sent to the display. Fault factors include hardware connection failure data or communication failure data. If the system is ready, the PLC sends a pre-configuration instruction to the driver under test to complete the basic parameter settings, including the corresponding preset control mode and signal range.

[0016] As described above, this application provides an automated testing method and system for drives based on PLC and HMI. This method connects the hardware and completes software configuration through preset rules; it obtains the system status and sets basic parameters based on hardware connection status data and communication status data; it obtains the test type and configures the final parameters; if it is a full-item test, it tests digital quantities, analog quantities, encoders, and Profinet communication in a preset order to obtain feedback data; the PLC preprocesses the feedback data and compares it with preset thresholds to obtain individual test results; the HMI displays the test progress and feedback data in real time and automatically generates a test report.

[0017] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings. Attached Figure Description

[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 A flowchart illustrating the automated testing method for drivers based on PLC and HMI provided in this application embodiment; Figure 2 A schematic diagram of the main test interface of the PLC and HMI-based automated test system for drives provided in this application embodiment; Figure 3 This is a schematic diagram of a PLC and HMI-based automated test system for drives provided in an embodiment of this application. Detailed Implementation

[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0021] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0022] Please refer to Figure 1 , Figure 1 This is a flowchart of an automated testing method for PLC and HMI-based drivers according to some embodiments of this application. This automated testing method for PLC and HMI-based drivers is used in terminal devices, such as computers and mobile phones. The automated testing method for PLC and HMI-based drivers includes the following steps: S11. Connect the hardware according to preset rules, obtain hardware connection status data and communication status data, and configure the software. S12. Process the hardware connection status data and communication status data to obtain system status data, and set the basic parameters based on the system status data. S13. Obtain test type data and configure the final parameters based on the test type data; S14. Test digital quantities, analog quantities, encoders and Profinet communication in a preset order according to the test type data, and obtain feedback data according to the test status. S15. The feedback data is preprocessed by the PLC to obtain the corresponding single test result data by comparing the preprocessed data with the corresponding threshold. The S16 and HMI display test progress and feedback data in real time and automatically generate test reports.

[0023] Understandably, the process begins by establishing standardized hardware connections between the driver under test and the PLC, HMI, and industrial switch. Hardware connection and communication status data are collected, and software configuration, including product information entry and communication parameter initialization, is completed. By integrating these two types of status data, the system is determined to be either ready or faulty. Once ready, basic parameters such as control mode and signal range are sent to the driver. Depending on the single or full test type selected by the tester, specific final parameter configuration instructions are sent via the Profinet protocol. Tests are executed in a preset order: "digital → analog → encoder → Profinet communication," with real-time acquisition of driver feedback signals. The PLC processes the raw feedback data... The system performs preprocessing steps such as filtering to remove interference, unit conversion (e.g., voltage to speed conversion), and error calculation. Then, it compares the results with preset thresholds to automatically determine the individual test results. The HMI displays the test progress, real-time data, and waveforms in real time. After the test is completed, a standardized report containing product information, test data, and judgment conclusions is automatically generated. Through the above steps, a fully closed-loop automated process of "preparation-configuration-testing-processing-output" is constructed, completely eliminating the dependence on manual operation and significantly improving testing efficiency compared to traditional methods. At the same time, the standardized process design ensures the consistency and repeatability of test results. The system integrates four core test modules to achieve full functional coverage, and the automatically generated reports provide support for quality traceability and data analysis.

[0024] According to an embodiment of the present invention, the step of connecting the hardware according to preset rules, obtaining hardware connection status data and communication status data, and configuring the software specifically includes: The driver under test is connected to the PLC through a signal conditioning module, wherein the driver's DI terminal is connected to the PLC's DO point, the AI ​​terminal is connected to the PLC's AO point, and the encoder's A / B / Z phase terminals are connected to the PLC's HSC channel; Obtain hardware connection status data, including hardware connection success data or hardware connection failure data; Obtain communication status data, including successful or failed communication data. The software configuration includes the product model, serial number, HSC working mode, and Profinet communication parameters.

[0025] As is understood, a PLC is a programmable logic controller, DI is digital input, DO is digital output, AI is analog input, AO is analog output, HSC is a high-speed counter, and Profinet is a process field network. In this embodiment, the signal interface correspondence between the driver under test and the PLC is as follows: the driver's DI terminal connects to the PLC's DO point, the AI ​​terminal connects to the PLC's AO point, and the encoder's A / B / Z phase terminals connect to the PLC's HSC channel, ensuring accurate signal transmission paths. Hardware connection status data and communication status data are collected through system self-testing to accurately identify wiring problems or communication link anomalies. During software configuration, product information such as the driver model and serial number must be entered, the PLC HSC operating mode must be configured to adapt to encoder testing, and Profinet communication parameters (IP address, device name) between the PLC and the driver must be set to ensure communication compatibility. Standardized hardware connection rules reduce wiring errors, and advance collection of two types of status data allows for rapid identification of hidden problems, avoiding interruptions or data distortion during testing. Unified software configuration lays the foundation for consistency in subsequent tests, significantly improving the efficiency and reliability of the test preparation phase.

[0026] According to an embodiment of the present invention, the step of obtaining system status data based on hardware connection status data and communication status data, and setting basic parameters based on the system status data, specifically includes: Perform a bitwise AND operation on the hardware connection status data and communication status data to obtain system status data, including system readiness or system failure. If the system malfunctions, a fault warning will be sent to the display. Fault factors include hardware connection failure data or communication failure data. If the system is ready, the PLC sends a pre-configuration instruction to the driver under test to complete the basic parameter settings, including the corresponding preset control mode and signal range.

[0027] Understandably, the hardware connection status data and communication status data are processed using "AND" logic. The system is considered ready only when both types of data are "successful," and a system fault is determined when either data is "failed." When a system fault occurs, the HMI will clearly indicate the specific fault factor (such as "encoder A phase wiring failure" or "Profinet IP conflict"), facilitating rapid problem location. After the system is ready, the PLC sends pre-configuration instructions to the driver under test to complete the basic parameter settings for the control mode (such as analog speed control or Profinet control) and signal range (such as AI channel 0-10V), ensuring that the driver can reliably receive the PLC's test signals. The system status is clearly determined through logical judgment, avoiding equipment damage or data deviation caused by starting the test with a fault. Precise fault indication shortens the problem-solving time, and standardized basic parameter settings provide a unified test benchmark for drivers with different initial states, effectively reducing test errors.

[0028] According to an embodiment of the present invention, the step of obtaining test type data and configuring final parameters based on the test type data specifically includes: Obtain test type data, including single test or full test; The individual test is one of the following: digital quantity test, analog quantity test, encoder test, or Profinet communication test; Based on the test type data, the corresponding final parameter configuration numbers are sent to the driver under test via the Profinet protocol.

[0029] It is understood that this embodiment supports two types of test data acquisition: single-item testing that only tests one of the digital, analog, encoder, and Profinet communication modules, and full-item testing that comprehensively covers all four modules, adapting to different scenario requirements. The PLC starts testing after obtaining the start signal based on the acquired test type data, and sends the corresponding final parameter configuration to the driver under test through the Profinet protocol. Single-item testing only configures the relevant parameters of the corresponding module (e.g., only the AI / AO range is configured for analog testing), while full-item testing configures the key parameters of all modules (including control mode, encoder resolution, communication messages, etc.), avoiding redundant configuration. Precise parameter configuration reduces transmission volume and the risk of configuration errors. Profinet protocol transmission ensures the real-time and stability of parameter sending, conforming to industrial automation standards.

[0030] According to an embodiment of the present invention, the step of testing digital quantities, analog quantities, encoders, and Profinet communication in a preset order according to test type data, obtaining test process status, and obtaining feedback data based on the test process status specifically includes: If the test type data is a single test, the corresponding single process status data will be obtained after testing according to the preset test process, including the process pass status or the process fail status. Display the status data of each individual process on the HMI terminal; If the test type data is a full-item test, then the digital quantity, analog quantity, encoder and Profinet communication are tested in a preset order to obtain the corresponding single process status data; If all individual process status data are in the process pass state, then collect the feedback data of each individual test, including digital feedback data, analog feedback data, encoder feedback data, and Profinet communication feedback data.

[0031] Understandably, if the test type is a single-item test, the system directly executes the preset test process of the corresponding module, generating real-time status data for process pass or failure and displaying it on the HMI. If it is a full-item test, the tests are performed in a fixed order of "digital quantity → analog quantity → encoder → Profinet communication," with each module generating process status data. Only when all individual process statuses in the full-item test are passed is complete feedback data (including digital quantity response time, analog quantity error, encoder position increment, communication response time, etc.) collected. If any individual process fails, the test is paused and a notification is displayed. The fixed full-item test order conforms to the test logic of "from basic to complex," avoiding signal interference. Single-item tests can quickly complete specific verifications, process status visualization facilitates real-time monitoring, and targeted feedback data collection rules reduce invalid data processing, improving test efficiency and data accuracy. In this embodiment, the test processes for digital quantity, analog quantity, encoder, and Profinet communication are as follows: In the process of digital quantity testing, the test parameter mapping is first clarified, as shown in Table 1;

[0032] Table 1 Then, the test was conducted and the data was recorded. The PLC output DO signals in the order of "Enable → Forward → Reverse → Emergency Stop → Reset". Each signal was held for 100ms and then the DI feedback was read. After the test, the DIDO test end light was bright green when the process passed. When simulating a fault, the SM1232AO module was disconnected, the driver ALM alarm was triggered, the I0.3 feedback time was recorded, and then Q0.3=TRUE was output to reset and verify that the alarm was cleared.

[0033] During the analog signal test, the PLC outputs AO signals in a stepped manner from "1V→3V→6V→9V" (corresponding to speeds of 300→900→1800→2700rpm); each output is stable for 2 seconds, and AI feedback data is collected; the HMI plots the trend curve of "given speed - feedback speed" in real time.

[0034] During encoder testing, the PLC outputs 5V (corresponding to 1500rpm) through the AO module to drive the driver. The S7-1200HSC1 is configured as "absolute mode" to read the encoder's absolute position value (address ID200) with a sampling duration of 1 second. Four consecutive samples are taken, and the error between each position increment and the theoretical value is calculated. The theoretical absolute position is calculated as follows: rotational speed n (rpm) → absolute position increment within 1 second = (n / 60) × 8388608.

[0035] In the PROFINET communication test, the PLC calls the PN_Write function to write "15000" (corresponding to 1500rpm) to address 29200; it calls the PN_Read function to read addresses 29202 (actual speed) and 29204 (actual current), and records the "write → read" response time; the data consistency is verified by reading and writing 6 times in a row.

[0036] According to an embodiment of the present invention, if the irrigation state is a waiting irrigation state, the soil bulk density data, planting area data, and irrigation efficiency are acquired. The process involves preprocessing the raw data using a PLC and comparing the preprocessed data with corresponding thresholds to obtain the corresponding single-item test result data. Specifically, this includes: The feedback data is filtered by the PLC and then preprocessed, including unit conversion or error calculation. Standard feedback data or error data are obtained after preprocessing; The standard feedback data or error data is compared with the corresponding preset threshold to obtain the individual test result data.

[0037] Understandably, the PLC first filters the collected feedback data to remove noise signals caused by electromagnetic interference. Then, it preprocesses the data according to the type of test module, including converting the raw digital data into engineering physical quantities such as speed, current, and position increment, or calculating the error using the standard formula "error (%) = |actual value - theoretical value| / theoretical value × 100%". After preprocessing, standard feedback data (such as response time) or error data is obtained and compared with the corresponding preset thresholds (such as response time ≤ 100ms, analog quantity error ≤ ±1%, and absolute position error of 23-bit absolute encoder ≤ ±0.5%). Finally, individual test result data for each test item is generated. Filtering ensures data stability, unit conversion unifies data dimensions, standardized error calculation avoids human error, and threshold comparison judgment rules eliminate subjective interference.

[0038] According to an embodiment of the present invention, it further includes: If an abnormality occurs during a single test, the PLC will pause the test. The HMI displays the name of the exception and the fault type.

[0039] Understandably, during a single test, if abnormal situations such as feedback data exceeding the preset range, communication interruption, or hardware signal loss occur, the PLC will immediately pause the test to prevent the abnormal state from spreading. At the same time, the HMI will accurately indicate the name of the abnormal item (such as "encoder test abnormality") and the specific fault type (such as "position increment deviation exceeds threshold"), providing operators with clear troubleshooting guidance. Timely pause of the test avoids invalid data collection and equipment damage. Accurate abnormal prompts can shorten troubleshooting time, improve the maintainability and safety of the test, and ensure the smooth progress of the test process.

[0040] This invention also discloses an automated testing system for drivers based on PLC and HMI, including a memory 41 and a processor 42. The memory stores a program for an automated testing method for drivers based on PLC and HMI. When the processor executes the program for the automated testing method for drivers based on PLC and HMI, it performs the following steps: Connect the hardware according to preset rules, obtain hardware connection status data and communication status data, and configure the software. System status data is obtained by processing hardware connection status data and communication status data, and basic parameters are set based on system status data. Obtain test type data and configure the final parameters based on the test type data; According to the test type data, the digital quantity, analog quantity, encoder and Profinet communication are tested in a preset order, and feedback data is obtained according to the test status. The feedback data is preprocessed by the PLC, and the preprocessed data is compared with the corresponding threshold to obtain the corresponding single test result data. The HMI displays test progress and feedback data in real time and automatically generates test reports.

[0041] Understandably, the process begins by establishing standardized hardware connections between the driver under test and the PLC, HMI, and industrial switch. Hardware connection and communication status data are collected, and software configuration, including product information entry and communication parameter initialization, is completed. By integrating these two types of status data, the system is determined to be either ready or faulty. Once ready, basic parameters such as control mode and signal range are sent to the driver. Depending on the single or full test type selected by the tester, specific final parameter configuration instructions are sent via the Profinet protocol. Tests are executed in a preset order: "digital → analog → encoder → Profinet communication," with real-time acquisition of driver feedback signals. The PLC processes the raw feedback data... The system performs preprocessing steps such as filtering to remove interference, unit conversion (e.g., voltage to speed conversion), and error calculation. Then, it compares the results with preset thresholds to automatically determine the individual test results. The HMI displays the test progress, real-time data, and waveforms in real time. After the test is completed, a standardized report containing product information, test data, and judgment conclusions is automatically generated. Through the above steps, a fully closed-loop automated process of "preparation-configuration-testing-processing-output" is constructed, completely eliminating the dependence on manual operation and significantly improving testing efficiency compared to traditional methods. At the same time, the standardized process design ensures the consistency and repeatability of test results. The system integrates four core test modules to achieve full functional coverage, and the automatically generated reports provide support for quality traceability and data analysis.

[0042] According to an embodiment of the present invention, the step of connecting the hardware according to preset rules, obtaining hardware connection status data and communication status data, and configuring the software specifically includes: The driver under test is connected to the PLC through a signal conditioning module, wherein the driver's DI terminal is connected to the PLC's DO point, the AI ​​terminal is connected to the PLC's AO point, and the encoder's A / B / Z phase terminals are connected to the PLC's HSC channel; Obtain hardware connection status data, including hardware connection success data or hardware connection failure data; Obtain communication status data, including successful or failed communication data. The software configuration includes the product model, serial number, HSC working mode, and Profinet communication parameters.

[0043] It is understood that PLC stands for Programmable Logic Controller, DI for Digital Input, DO for Digital Output, AI for Analog Input, AO for Analog Output, HSC for High-Speed ​​Counter, and Profinet for Process Field Network. In this embodiment, the signal interface correspondence rules between the driver under test and the PLC are as follows: the driver's DI terminal connects to the PLC's DO point, the AI ​​terminal connects to the PLC's AO point, and the encoder's A / B / Z phase terminals connect to the PLC's HSC channel, ensuring accurate signal transmission paths. Hardware connection status data and communication status data are collected through system self-testing to accurately identify wiring problems or communication link anomalies. During software configuration, product information such as the driver model and serial number must be entered, the PLC HSC operating mode must be configured to adapt to encoder testing, and Profinet communication parameters (IP address, device name) between the PLC and the driver must be set to ensure communication compatibility. Standardized hardware connection rules reduce wiring errors, and advance collection of two types of status data allows for rapid identification of hidden problems, avoiding interruptions or data distortion during testing. Unified software configuration lays the foundation for consistency in subsequent tests, significantly improving the efficiency and reliability of the test preparation phase.

[0044] According to an embodiment of the present invention, the step of obtaining system status data based on hardware connection status data and communication status data, and setting basic parameters based on the system status data, specifically includes: Perform a bitwise AND operation on the hardware connection status data and communication status data to obtain system status data, including system readiness or system failure. If the system malfunctions, a fault warning will be sent to the display. Fault factors include hardware connection failure data or communication failure data. If the system is ready, the PLC sends a pre-configuration instruction to the driver under test to complete the basic parameter settings, including the corresponding preset control mode and signal range.

[0045] Understandably, the hardware connection status data and communication status data are processed using "AND" logic. The system is considered ready only when both types of data are "successful," and a system fault is determined when either data is "failed." When a system fault occurs, the HMI will clearly indicate the specific fault factor (such as "encoder A phase wiring failure" or "Profinet IP conflict"), facilitating rapid problem location. After the system is ready, the PLC sends pre-configuration instructions to the driver under test to complete the basic parameter settings for the control mode (such as analog speed control or Profinet control) and signal range (such as AI channel 0-10V), ensuring that the driver can reliably receive the PLC's test signals. The system status is clearly determined through logical judgment, avoiding equipment damage or data deviation caused by starting the test with a fault. Precise fault indication shortens the problem-solving time, and standardized basic parameter settings provide a unified test benchmark for drivers with different initial states, effectively reducing test errors.

[0046] According to an embodiment of the present invention, the step of obtaining test type data and configuring final parameters based on the test type data specifically includes: Obtain test type data, including single test or full test; The individual test is one of the following: digital quantity test, analog quantity test, encoder test, or Profinet communication test; Based on the test type data, the corresponding final parameter configuration numbers are sent to the driver under test via the Profinet protocol.

[0047] It is understood that this embodiment supports two types of test data acquisition: single-item testing that only tests one of the digital, analog, encoder, and Profinet communication modules, and full-item testing that comprehensively covers all four modules, adapting to different scenario requirements. The PLC starts testing after obtaining the start signal based on the acquired test type data, and sends the corresponding final parameter configuration to the driver under test through the Profinet protocol. Single-item testing only configures the relevant parameters of the corresponding module (e.g., only the AI / AO range is configured for analog testing), while full-item testing configures the key parameters of all modules (including control mode, encoder resolution, communication messages, etc.), avoiding redundant configuration. Precise parameter configuration reduces transmission volume and the risk of configuration errors. Profinet protocol transmission ensures the real-time and stability of parameter sending, conforming to industrial automation standards.

[0048] According to an embodiment of the present invention, the step of testing digital quantities, analog quantities, encoders, and Profinet communication in a preset order according to test type data, obtaining test process status, and obtaining feedback data based on the test process status specifically includes: If the test type data is a single test, the corresponding single process status data will be obtained after testing according to the preset test process, including the process pass status or the process fail status. Display the status data of each individual process on the HMI terminal; If the test type data is a full-item test, then the digital quantity, analog quantity, encoder and Profinet communication are tested in a preset order to obtain the corresponding single process status data; If all individual process status data are in the process pass state, then collect the feedback data of each individual test, including digital feedback data, analog feedback data, encoder feedback data, and Profinet communication feedback data.

[0049] Understandably, if the test type is a single-item test, the system directly executes the preset test process of the corresponding module, generating real-time status data for process pass or failure and displaying it on the HMI. If it is a full-item test, the tests are performed in a fixed order of "digital quantity → analog quantity → encoder → Profinet communication," with each module generating process status data. Only when all individual process statuses in the full-item test are passed is complete feedback data (including digital quantity response time, analog quantity error, encoder position increment, communication response time, etc.) collected. If any individual process fails, the test is paused and a notification is displayed. The fixed full-item test order conforms to the test logic of "from basic to complex," avoiding signal interference. Single-item tests can quickly complete specific verifications, process status visualization facilitates real-time monitoring, and targeted feedback data collection rules reduce invalid data processing, improving test efficiency and data accuracy. In this embodiment, the test processes for digital quantity, analog quantity, encoder, and Profinet communication are as follows: During the digital quantity testing process, the test parameter mapping is first clarified, then the test is performed and the data is recorded. The PLC outputs DO signals in the order of "enable → forward rotation → reverse rotation → emergency stop → reset". Each signal is held for 100ms and then the DI feedback is read. After the test is completed, the DIDO test end light is bright green when the process is passed. When simulating a fault, the SM1232AO module wiring is disconnected, the driver ALM alarm is triggered, the I0.3 feedback time is recorded, and then Q0.3=TRUE is output to reset and verify that the alarm is cleared.

[0050] During the analog signal test, the PLC outputs AO signals in a stepped manner from "1V→3V→6V→9V" (corresponding to speeds of 300→900→1800→2700rpm); each output is stable for 2 seconds, and AI feedback data is collected; the HMI plots the trend curve of "given speed - feedback speed" in real time.

[0051] During encoder testing, the PLC outputs 5V (corresponding to 1500rpm) through the AO module to drive the driver. The S7-1200HSC1 is configured as "absolute mode" to read the encoder's absolute position value (address ID200) with a sampling duration of 1 second. Four consecutive samples are taken, and the error between each position increment and the theoretical value is calculated. The theoretical absolute position is calculated as follows: rotational speed n (rpm) → absolute position increment within 1 second = (n / 60) × 8388608.

[0052] In the PROFINET communication test, the PLC calls the PN_Write function to write "15000" (corresponding to 1500rpm) to address 29200; it calls the PN_Read function to read addresses 29202 (actual speed) and 29204 (actual current), and records the "write → read" response time; the data consistency is verified by reading and writing 6 times in a row.

[0053] According to an embodiment of the present invention, if the irrigation state is a waiting irrigation state, the soil bulk density data, planting area data, and irrigation efficiency are acquired. The process involves preprocessing the raw data using a PLC and comparing the preprocessed data with corresponding thresholds to obtain the corresponding single-item test result data. Specifically, this includes: The feedback data is filtered by the PLC and then preprocessed, including unit conversion or error calculation. Standard feedback data or error data are obtained after preprocessing; The standard feedback data or error data is compared with the corresponding preset threshold to obtain the individual test result data.

[0054] Understandably, the PLC first filters the collected feedback data to remove noise signals caused by electromagnetic interference. Then, it preprocesses the data according to the type of test module, including converting the raw digital data into engineering physical quantities such as speed, current, and position increment, or calculating the error using the standard formula "error (%) = |actual value - theoretical value| / theoretical value × 100%". After preprocessing, standard feedback data (such as response time) or error data is obtained and compared with the corresponding preset thresholds (such as response time ≤ 100ms, analog quantity error ≤ ±1%, and absolute position error of 23-bit absolute encoder ≤ ±0.5%). Finally, individual test result data for each test item is generated. Filtering ensures data stability, unit conversion unifies data dimensions, standardized error calculation avoids human error, and threshold comparison judgment rules eliminate subjective interference.

[0055] According to an embodiment of the present invention, it further includes: If an abnormality occurs during a single test, the PLC will pause the test. The HMI displays the name of the exception and the fault type.

[0056] Understandably, during a single test, if abnormal situations such as feedback data exceeding the preset range, communication interruption, or hardware signal loss occur, the PLC will immediately pause the test to prevent the abnormal state from spreading. At the same time, the HMI will accurately indicate the name of the abnormal item (such as "encoder test abnormality") and the specific fault type (such as "position increment deviation exceeds threshold"), providing operators with clear troubleshooting guidance. Timely pause of the test avoids invalid data collection and equipment damage. Accurate abnormal prompts can shorten troubleshooting time, improve the maintainability and safety of the test, and ensure the smooth progress of the test process.

[0057] This invention discloses an automated testing method and system for drives based on PLC and HMI. It connects hardware and completes software configuration through preset rules, obtains system status and sets basic parameters based on hardware connection and communication status data, acquires the test type and configures final parameters. If it is a full-item test, it tests digital quantities, analog quantities, encoders, and Profinet communication in a preset order to obtain feedback data. The PLC preprocesses the feedback data and compares it with preset thresholds to obtain individual test results. The HMI displays the test progress and feedback data in real time and automatically generates test reports. This achieves automated drive testing, reduces manual intervention, improves testing efficiency and accuracy, provides real-time fault feedback, and effectively ensures test reliability.

[0058] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.

[0059] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0060] In addition, in the various embodiments of the present invention, each functional unit can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0061] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0062] Alternatively, if the integrated units of this invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.

Claims

1. A method for testing automation of a drive based on PLC and HMI, characterized in that, include: Connect the hardware according to preset rules, obtain hardware connection status data and communication status data, and configure the software. System status data is obtained by processing hardware connection status data and communication status data, and basic parameters are set based on system status data. Obtain test type data and configure the final parameters based on the test type data; According to the test type data, the digital quantity, analog quantity, encoder and Profinet communication are tested in a preset order, and feedback data is obtained according to the test status. The feedback data is preprocessed by the PLC, and the preprocessed data is compared with the corresponding threshold to obtain the corresponding single test result data. The HMI displays test progress and feedback data in real time and automatically generates test reports.

2. The PLC and HMI based driver automation testing method as claimed in claim 1 wherein, The process of connecting the hardware according to preset rules, acquiring hardware connection status data and communication status data, and configuring the software specifically includes: The driver under test is connected to the PLC through a signal conditioning module, wherein the driver's DI terminal is connected to the PLC's DO point, the AI ​​terminal is connected to the PLC's AO point, and the encoder's A / B / Z phase terminals are connected to the PLC's HSC channel; Obtain hardware connection status data, including hardware connection success data or hardware connection failure data; Obtain communication status data, including successful or failed communication data. The software configuration includes the product model, serial number, HSC working mode, and Profinet communication parameters.

3. The PLC and HMI based driver automation testing method as claimed in claim 2 wherein, The process of obtaining system status data based on hardware connection status data and communication status data, and setting basic parameters based on the system status data, specifically includes: Perform a bitwise AND operation on the hardware connection status data and communication status data to obtain system status data, including system readiness or system failure. If the system malfunctions, a fault warning will be sent to the display. Fault factors include hardware connection failure data or communication failure data. If the system is ready, the PLC sends a pre-configuration instruction to the driver under test to complete the basic parameter settings, including the corresponding preset control mode and signal range.

4. The PLC and HMI based driver automation testing method as claimed in claim 3 wherein, The process of obtaining test type data and configuring final parameters based on the test type data specifically includes: Obtain test type data, including single test or full test; The individual test is one of the following: digital quantity test, analog quantity test, encoder test, or Profinet communication test; Based on the test type data, the corresponding final parameter configuration numbers are sent to the driver under test via the Profinet protocol.

5. The automated testing method for drivers based on PLC and HMI according to claim 4, characterized in that, The process involves testing digital quantities, analog quantities, encoders, and Profinet communication in a preset order based on test type data, obtaining the test process status, and obtaining feedback data based on the test process status. Specifically, this includes: If the test type data is a single test, the corresponding single process status data will be obtained after testing according to the preset test process, including the process pass status or the process fail status. Display the status data of each individual process on the HMI terminal; If the test type data is a full-item test, then the digital quantity, analog quantity, encoder and Profinet communication are tested in a preset order to obtain the corresponding single process status data; If all individual process status data are in the process pass state, then collect the feedback data of each individual test, including digital feedback data, analog feedback data, encoder feedback data, and Profinet communication feedback data.

6. The PLC and HMI based driver automation testing method as claimed in claim 5 wherein, The step of preprocessing the feedback data using a PLC to obtain the original data, and then comparing the preprocessed data with the corresponding threshold to obtain the result data for the corresponding single test item, specifically includes: The feedback data is filtered by the PLC and then preprocessed, including unit conversion or error calculation. Standard feedback data or error data are obtained after preprocessing; The standard feedback data or error data is compared with the corresponding preset threshold to obtain the individual test result data.

7. The PLC and HMI based driver automation testing method as claimed in claim 1 wherein, Also includes: If an abnormality occurs during a single test, the PLC will pause the test. The HMI displays the name of the exception and the fault type.

8. A PLC and HMI based driver automation testing system, characterized in that, The system includes a memory and a processor. The memory contains a PLC-based and HMI-based driver automation testing method program. When executed by the processor, the PLC-based and HMI-based driver automation testing method program performs the following steps: Connect the hardware according to preset rules, obtain hardware connection status data and communication status data, and configure the software. System status data is obtained by processing hardware connection status data and communication status data, and basic parameters are set based on system status data. Obtain test type data and configure the final parameters based on the test type data; According to the test type data, the digital quantity, analog quantity, encoder and Profinet communication are tested in a preset order, and feedback data is obtained according to the test status. The feedback data is preprocessed by the PLC, and the preprocessed data is compared with the corresponding threshold to obtain the corresponding single test result data. The HMI displays test progress and feedback data in real time and automatically generates test reports.

9. The PLC and HMI based driver automation testing system as claimed in claim 8, wherein, The process of connecting the hardware according to preset rules, acquiring hardware connection status data and communication status data, and configuring the software specifically includes: The driver under test is connected to the PLC through a signal conditioning module, wherein the driver's DI terminal is connected to the PLC's DO point, the AI ​​terminal is connected to the PLC's AO point, and the encoder's A / B / Z phase terminals are connected to the PLC's HSC channel; Obtain hardware connection status data, including hardware connection success data or hardware connection failure data; Obtain communication status data, including successful or failed communication data. The software configuration includes the product model, serial number, HSC working mode, and Profinet communication parameters.

10. The PLC and HMI based driver automation testing system as claimed in claim 9, wherein, The process of obtaining system status data based on hardware connection status data and communication status data, and setting basic parameters based on the system status data, specifically includes: Perform a bitwise AND operation on the hardware connection status data and communication status data to obtain system status data, including system readiness or system failure. If the system fails, send the failure factor warning to the display, the failure factor includes hardware connection failure data or communication failure data; If the system is ready, the PLC sends pre-configuration instructions to the measured driver, completes the basic parameter setting, including the corresponding preset control mode and signal range.