Servo driver test method, encoder fault simulation method and system

By acquiring scenario parameters and fault simulation commands, the system automates the testing of servo drives' response to encoder faults, solving the problem of inefficiency in traditional testing methods and achieving efficient automated testing of servo drives.

CN121500929APending Publication Date: 2026-02-10SHENZHEN SHUMA ELECTRONICS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511594232.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-31
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Traditional servo drive testing methods have a low degree of automation and cannot efficiently test the response capability to encoder failures.

Method used

By acquiring scene parameters, preset fault types, and preset trigger conditions, fault simulation instructions are generated to automatically test the servo drive's response to encoder faults. By utilizing the communication between the host computer, the servo drive, and the simulated encoder, the simulation of encoder faults and the acquisition of response data are realized.

Benefits of technology

Automated testing of servo drives has been achieved, improving testing efficiency and avoiding the inefficient method of manually adjusting encoders to cause faults, thus ensuring the accuracy and efficiency of testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121500929A_ABST
    Figure CN121500929A_ABST
Patent Text Reader

Abstract

The invention relates to a servo driver test method and an encoder fault simulation method and system. The method comprises the following steps: acquiring scene parameters, a preset fault type, a preset trigger condition and preset response data; a control instruction corresponding to the scene parameter is sent to the servo driver to instruct the servo driver to enter a function scene matched with the scene parameter, so that the servo driver executes encoder operation in the function scene for the analog encoder; generating a fault simulation instruction based on a preset fault type and a preset trigger condition; sending a fault simulation instruction to the simulation encoder to instruct the simulation encoder to simulate an encoder fault under a preset fault type under the condition that the encoder operation meets a preset triggering condition; obtaining fault response data generated by the servo driver for the encoder fault in the function scene; and determining a test result based on the preset response data and the fault response data. By adopting the method, the testing efficiency of the servo driver can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of servo control technology, and in particular to a test method for servo drives, a simulation method for encoder failures, and a system. Background Technology

[0002] A servo control system is an automation system based on the principle of closed-loop control. The servo driver and encoder are key components in a servo control system. If the encoder fails, the servo driver must respond accurately to the encoder failure to ensure the closed-loop control performance of the servo control system.

[0003] Traditional techniques require manually adjusting the encoder to induce encoder failures in order to test the servo drive's response to these failures. Clearly, this method is highly limited in its automation and cannot avoid the problem of low testing efficiency for servo drives. Summary of the Invention

[0004] Therefore, it is necessary to provide a servo drive testing method, encoder fault simulation method, and system that can improve testing efficiency to address the above-mentioned technical problems.

[0005] Firstly, this application provides a method for testing a servo driver, including: Acquire scene parameters, preset fault types, preset trigger conditions, and preset response data; Send control commands corresponding to the scene parameters to the servo driver to instruct the servo driver to enter a functional scene that matches the scene parameters, so that the servo driver performs encoder operations under the functional scene for the analog encoder; A fault simulation command is generated based on the preset fault type and the preset triggering condition; Send the fault simulation command to the simulated encoder to instruct the simulated encoder to simulate an encoder fault under the preset fault type when the encoder operation meets the preset triggering condition; Acquire the fault response data generated by the servo driver in response to the encoder failure under the functional scenario; The test results are determined based on the preset response data and the fault response data.

[0006] Secondly, this application also provides a test system for a servo drive, including a host computer, a servo drive, and an analog encoder; The host computer is used to acquire scene parameters, preset fault types, preset trigger conditions, and preset response data; send control commands corresponding to the scene parameters to the servo driver; generate fault simulation commands based on the preset fault types and preset trigger conditions; and send the fault simulation commands to the simulation encoder. The servo driver is used to enter a functional scenario that matches the scene parameters according to the control command, and to perform encoder operations under the functional scenario for the analog encoder. The simulated encoder is used to simulate an encoder fault under the preset fault type when the encoder operation meets the preset triggering condition, based on the fault simulation instruction. The servo driver is also used to generate fault response data for encoder failures in the functional scenario. The host computer is also used to acquire the fault response data and determine the test results based on the preset response data and the fault response data.

[0007] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method.

[0008] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described method.

[0009] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps in the above-described method.

[0010] The aforementioned servo drive testing method, encoder fault simulation method and system, computer equipment, storage medium, and computer program products acquire scenario parameters, preset fault types, preset trigger conditions, and preset response data. They send control commands corresponding to the scenario parameters to the servo drive, instructing it to enter a functional scenario matching the parameters. This allows the servo drive to perform encoder operations under the simulated encoder scenario, enabling targeted testing of its ability to accurately respond to encoder faults simulated by the simulated encoder under the functional scenario. Fault simulation commands are generated based on the preset fault types and trigger conditions. These commands are then sent to the simulated encoder, instructing it to simulate encoder faults of the preset fault types when encoder operations meet the preset trigger conditions. The fault simulation commands enable encoder operations meeting the preset trigger conditions to trigger the simulated encoder to specifically simulate encoder faults of the preset fault types, eliminating the need for manual adjustments to the physical encoder to create faults, thus improving efficiency. By acquiring fault response data generated by the servo drive in response to encoder faults under the functional scenario, and determining the test results based on the preset response data and fault response data, automated testing of the servo drive can be achieved, significantly improving testing efficiency. Attached Figure Description

[0011] Figure 1 This is a flowchart illustrating a test method for a servo driver provided in an embodiment of this application.

[0012] Figure 2 This is an application environment diagram for a servo driver testing method provided in an embodiment of this application.

[0013] Figure 3 This is a schematic diagram of a functional flow for writing the zero point of a motor, provided in an embodiment of this application.

[0014] Figure 4 This is a flowchart illustrating a method for simulating encoder failures provided in an embodiment of this application.

[0015] Figure 5 This is a simplified flowchart illustrating a testing method for a servo driver provided in an embodiment of this application.

[0016] Figure 6 This is a simplified flowchart illustrating a method for simulating encoder faults provided in an embodiment of this application.

[0017] Figure 7 This is a structural block diagram of a servo driver testing system provided in an embodiment of this application.

[0018] Figure 8 This is an internal structure diagram of a host computer provided in an embodiment of this application.

[0019] Figure 9 This is an internal structure diagram of another host computer provided in an embodiment of this application. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0021] In one exemplary embodiment, such as Figure 1 The diagram shows a flowchart of a test method for a servo driver. Taking the application of this method to a host computer as an example, it includes the following steps 102 to 112.

[0022] Step 102: Obtain scene parameters, preset fault types, preset trigger conditions, and preset response data.

[0023] The scenario parameters indicate the functional scenarios the servo drive will enter during the test. A servo drive has multiple functions, and a functional scenario is a mode or state that the servo drive needs to enter to complete a function. In other words, under a functional scenario, the servo drive will perform a series of operations to complete that function. Encoder operations exist under functional scenarios. Encoder operations refer to operations performed on the encoder, such as reading and writing to the encoder's memory or reading a single-turn position. Preset response data characterizes the servo drive's expected response to encoder faults under preset fault types under functional scenarios.

[0024] The preset fault type is used to characterize the type of encoder fault to be simulated. The preset trigger condition is the condition used to trigger the simulation of encoder faults under the preset fault type. It can be understood that the preset fault type indicates which encoder fault to simulate, while the preset trigger condition indicates when to simulate encoder faults under the preset fault type. By adaptively configuring these two parameters, it is possible to accurately control the simulated encoder faults that meet the test requirements during the testing of the servo drive.

[0025] For example, the host computer can obtain configuration parameters from the test cases. Configuration parameters may include scenario parameters, preset fault types, preset trigger conditions, and preset response data.

[0026] In some embodiments, there is at least one test case. The host computer can automatically generate a test flow by traversing at least one test case. It can be understood that by simply configuring test cases on the host computer, it can automatically implement the test flow for the servo drive. The host computer can obtain the configuration parameters from the traversed test cases.

[0027] In some embodiments, the host computer may include at least one of a terminal or a server. The terminal may be, but is not limited to, various personal computers, laptops, or programmable controllers. The server may be implemented using a standalone server or a server cluster consisting of multiple servers.

[0028] Step 104: Send control commands corresponding to the scene parameters to the servo driver to instruct the servo driver to enter the functional scene that matches the scene parameters, so that the servo driver can perform encoder operations under the functional scene for the analog encoder.

[0029] For example, a communication connection exists between the host computer and the servo driver. The servo driver has an encoder interface, and an analog encoder is connected to the servo driver through the encoder interface. The host computer can send control commands corresponding to scene parameters to the servo driver based on the communication connection with the servo driver. It should be noted that the method of obtaining control commands is not limited in this embodiment.

[0030] The servo driver can parse control commands, obtain scene parameters, enter the functional scene that matches the scene parameters, and perform encoder operations under the functional scene for the analog encoder based on the encoder interface.

[0031] In some embodiments, an analog encoder is a device used to simulate the functions of various encoders. For example, an analog encoder can simulate an absolute encoder. Functional scenarios may include at least one scenario such as writing to the motor zero point or reading a single-turn position. Encoder operations may include at least one of writing to the encoder's memory, reading from the encoder's memory, reading single-turn data from the encoder, or reading multi-turn data from the encoder. The memory may be an electrically erasable programmable read-only memory (EEPROM). For example, writing to the encoder's memory occurs in the scenario of writing to the motor zero point. Reading single-turn position occurs in the scenario of reading single-turn data from the encoder.

[0032] In some embodiments, the configuration parameters of a test case may include scenario parameters. The host computer can obtain the control instructions corresponding to the scenario parameters. For example, the host computer can generate control instructions carrying scenario parameters, or determine the control instructions corresponding to the scenario parameters from various preset control instructions.

[0033] In some embodiments, the host computer may have a built-in test management program for controlling the test process of the servo driver, through which control commands corresponding to the scene parameters are sent to the servo driver.

[0034] Step 106: Generate a fault simulation command based on the preset fault type and preset triggering conditions.

[0035] For example, the host computer can generate fault simulation instructions carrying preset fault types and preset triggering conditions.

[0036] In some embodiments, the host computer can generate fault simulation instructions based on a preset number of triggers, a preset fault type, and preset trigger conditions. Specifically, the host computer can generate fault simulation instructions carrying a preset number of triggers, a preset fault type, and preset trigger conditions.

[0037] Step 108: Send a fault simulation command to the analog encoder to instruct the analog encoder to simulate an encoder fault of a preset fault type when the encoder operation meets the preset triggering conditions.

[0038] For example, a communication connection is established between the analog encoder and the host computer. The host computer can send fault simulation commands to the analog encoder based on this communication connection. The analog encoder can parse the fault simulation commands to obtain preset fault types and preset trigger conditions. For encoder operations from the servo drive, it determines whether the encoder operation meets the preset trigger conditions; if so, it simulates an encoder fault under the preset fault type.

[0039] In some embodiments, the host computer may have a built-in test management program for controlling the test process of the servo drive, through which fault simulation commands are sent to the analog encoder.

[0040] Step 110: Obtain the fault response data generated by the servo driver in response to encoder failure under functional scenarios.

[0041] For example, the servo driver can generate fault response data in response to encoder failures under certain functional scenarios. The host computer can then obtain the fault response data fed back by the servo driver.

[0042] In some embodiments, the host computer can monitor and record fault response data of the servo drive in real time. The fault response data may include at least one of the servo drive's status word or alarm code.

[0043] In some embodiments, the servo driver can identify an encoder fault each time an encoder operation on the analog encoder fails, and update the cumulative fault count corresponding to the encoder fault. When the cumulative fault count reaches a fault reporting threshold, the alarm code is modified to the fault code corresponding to the encoder fault. It is understood that, to ensure the normal operation of the servo driver and avoid frequent entry into fault states or reporting of encoder faults, the servo driver will not modify the alarm code every time an encoder fault is detected; the alarm code will only be modified when the cumulative fault count corresponding to the encoder fault reaches the fault reporting threshold, thus enabling the reporting of the encoder fault.

[0044] In some embodiments, the fault reporting threshold may be preset within the servo driver. Alternatively, the fault reporting threshold may be specified by a host computer. Specifically, scenario parameters may include the fault reporting threshold.

[0045] In some embodiments, the servo driver may be pre-configured with encoder operation logic for various functional scenarios. The host computer may also specify the encoder operation for each functional scenario. Specifically, scenario parameters may include operation parameters, which are used to indicate the encoder operation for each functional scenario.

[0046] Step 112: Determine the test results based on the preset response data and fault response data.

[0047] For example, the host computer can compare the preset response data and the fault response data to obtain the test results.

[0048] In some embodiments, the test results can be used to characterize whether the test passed or failed. The host computer can determine a test result indicating that the test passed when the fault response data matches preset response data, and determine a test result indicating that the test failed when the fault response data does not match preset response data.

[0049] In some embodiments, a test result refers to the test result corresponding to a test case. The host computer can generate a test report based on the test results corresponding to at least one test case. The test report may include configuration parameters, fault response data, and corresponding test results for each test case.

[0050] In some embodiments, the host computer can display a test report.

[0051] The aforementioned servo drive testing method acquires scenario parameters, preset fault types, preset trigger conditions, and preset response data. It then sends control commands corresponding to the scenario parameters to the servo drive, instructing it to enter a functional scenario matching the parameters. This allows the servo drive to perform encoder operations under the functional scenario for the simulated encoder, enabling targeted testing of its ability to accurately respond to encoder faults simulated by the simulated encoder within the functional scenario. Fault simulation commands are generated based on the preset fault types and trigger conditions. These commands are then sent to the simulated encoder, instructing it to simulate encoder faults of the preset fault types when encoder operations meet the preset trigger conditions. The fault simulation commands enable encoder operations meeting the preset trigger conditions to trigger the simulated encoder to specifically simulate encoder faults of the preset fault types, eliminating the need for manual adjustments to the physical encoder to create faults, thus improving efficiency. Finally, by acquiring fault response data generated by the servo drive for encoder faults within the functional scenario and determining the test results based on the preset response data and fault response data, automated testing of the servo drive can be achieved, significantly improving testing efficiency.

[0052] In some embodiments, obtaining scenario parameters, preset fault types, preset trigger conditions, and preset response data includes: traversing each test case according to the pre-configured execution order of each test case; obtaining configuration parameters in the test case for each traversed test case; the configuration parameters include scenario parameters, preset fault types, preset trigger conditions, and preset response data; determining the test result based on the preset response data and fault response data, including: determining the test result corresponding to the test case based on the preset response data and fault response data; continuing to traverse each test case and returning to the step of obtaining the configuration parameters in the test case for each traversed test case.

[0053] The execution order characterizes the order in which test cases are executed. Configuration parameters refer to the parameters configured for each test case. In essence, executable test cases are composed of configuration parameters.

[0054] In some embodiments, the host computer can use a test management program to traverse each test case according to the pre-configured execution order of each test case.

[0055] In some embodiments, configuration parameters may include a preset number of triggers. The simulated encoder can record the number of times an encoder fault is simulated. The host computer can obtain the number of times the simulated encoder simulates an encoder fault, and when the number of simulations reaches the preset number of triggers, determine the test result corresponding to the test case based on the preset response data and the fault response data.

[0056] In this embodiment, each test case is traversed according to the pre-configured execution order. For each traversed test case, the configuration parameters in the test case are obtained. The configuration parameters include scenario parameters, preset fault types, preset trigger conditions, and preset response data. The test result corresponding to the test case is determined based on the preset response data and fault response data. The process of traversing each test case and returning to the step of obtaining the configuration parameters in the test case for the traversed test case can automatically execute each test case in the order of execution, thus automating the test process and improving the testing efficiency of the servo drive.

[0057] In some embodiments, the configuration parameters further include a preset number of triggers; determining the test result corresponding to the test case based on preset response data and fault response data, including: polling the number of times the encoder fault recorded by the simulated encoder is simulated; and determining the test result corresponding to the test case based on the preset response data and fault response data when the number of simulations reaches the preset number of triggers.

[0058] For example, the host computer can periodically query the fault status word of the simulated encoder to obtain the number of times the encoder fault was simulated. By comparing the number of simulations with the preset trigger count, and if the number of simulations is not less than the preset trigger count, the host computer can obtain the test result corresponding to the test case by comparing the preset response data and the fault response data. Specifically, the host computer can determine a test result indicating that the test case has passed when the fault response data matches the preset response data, and determine a test result indicating that the test case has failed when the fault response data does not match the preset response data.

[0059] In this embodiment, the number of times an encoder fault is simulated can be specified by a preset trigger count, and then the number of times the encoder fault is simulated recorded by the simulated encoder is polled. When the number of simulations reaches the preset trigger count, the test result corresponding to the test case is determined based on the preset response data and fault response data. In the test process corresponding to the test case, the simulated encoder can be accurately controlled to simulate encoder faults for a preset number of trigger counts, thus ensuring the test efficiency of the servo drive.

[0060] In some embodiments, after determining the test result corresponding to the test case based on preset response data and fault response data, the method further includes: sending a fault clearing instruction to the simulated encoder to instruct the simulated encoder to clear the fault-related data corresponding to the test case.

[0061] For example, the host computer can, after determining the test result corresponding to the traversed test case, send a fault clearing command to the simulated encoder to instruct the simulated encoder to clear the fault-related data corresponding to the test case. It then continues traversing each test case, and for each newly traversed test case, obtains the preset fault type and preset trigger conditions from the test case to generate a fault simulation command. Finally, it sends the fault simulation command to the simulated encoder.

[0062] It is understandable that during the testing process corresponding to each test case, the simulated encoder will simulate the encoder fault specified by the configuration parameters of that test case. The simulated encoder will generate corresponding fault-related data. In order to ensure the testing accuracy of each test case, it is necessary to clear the fault-related data corresponding to the previous test case before controlling the simulated encoder to simulate the encoder fault required for that test case.

[0063] In some embodiments, the specific method of fault clearing may include, but is not limited to, resetting the analog encoder. The host computer may send a fault clearing command to the analog encoder to instruct it to be reset.

[0064] In this embodiment, a fault clearing command is sent to the analog encoder to instruct it to clear the fault-related data corresponding to the test cases. This can clear the fault-related data corresponding to the test cases in a timely manner, thereby ensuring the accuracy of subsequent test cases.

[0065] In some embodiments, sending a control command corresponding to a scene parameter to a servo driver includes: if the control command corresponding to the scene parameter includes a state reset command, directly sending the control command to the servo driver; if the control command does not include a state reset command, sending a state reset command to the servo driver to instruct the servo driver to reset its own state; and after the servo driver's state is reset, sending the control command to the servo driver.

[0066] It is understandable that, in order to avoid the impact of historical state-related data on the test accuracy of the servo drive and to save computing resources, for control commands that include state reset instructions, the control command is sent directly so that the servo drive performs a state reset when entering the functional scenario. For control commands that include state reset instructions, the state reset instruction is sent before the control command is sent.

[0067] For example, the host computer can obtain the scene parameters in the test cases iterates through. If the control command corresponding to the scene parameter includes a state reset command, it can directly send the control command to the servo driver. Otherwise, it can send a state reset command to the servo driver, and then send the control command to the servo driver again after the servo driver's state is reset.

[0068] In some embodiments, the scenario parameter indicates the functional scenario that the servo driver will enter during the test. If the functional scenario corresponding to the scenario parameter includes a state reset operation, then the control command corresponding to the scenario parameter will also include a state reset command. When the scenario parameter in the test case corresponds to a functional scenario that includes a state reset operation, the control command is sent directly to the servo driver. When the scenario parameter in the test case does not correspond to a functional scenario that includes a state reset operation, a state reset command is sent to the servo driver, and after the servo driver's state is reset, the control command is sent to the servo driver.

[0069] In this embodiment, if the control command corresponding to the scene parameters includes a state reset command, the control command is sent directly to the servo driver; if the control command does not include a state reset command, a state reset command is sent to the servo driver to instruct the servo driver to reset its own state; after the servo driver's state is reset, the control command is sent to the servo driver. By resetting the state, the historical state-related data can be avoided from affecting the test accuracy of the servo driver.

[0070] In some embodiments, such as Figure 2 The diagram shows the application environment for a servo drive testing method. The host computer 202 is connected to both the servo drive 204 and the analog encoder 206. The servo drive 204 has an encoder interface, and the analog encoder 206 is connected to the servo drive 204 through the encoder interface. The host computer 202, the servo drive 204, and the analog encoder 206 together constitute a testing system for implementing the servo drive testing method.

[0071] In some embodiments, write operations to the encoder's memory include writing zero-point data. For example... Figure 3 The diagram illustrates a functional flow for writing the zero point of a motor. The servo driver writes zero-point data to the address where the zero point is stored in the EEPROM of the analog encoder, based on request data containing a write EEPROM instruction. The written data is read from the address and compared to the zero-point data. If they match, subsequent operations are performed; otherwise, the write operation fails, indicating an encoder fault under a write memory exception type. The cumulative fault count corresponding to this encoder fault is updated, and it is determined whether the cumulative fault count exceeds the fault reporting threshold. If it does not exceed the threshold, the process restarts from the request data containing the write EEPROM instruction to write the zero-point data to the address where the zero point is stored in the EEPROM of the analog encoder. If the threshold is exceeded, an encoder fault under a write memory exception type is reported, and subsequent operations are stopped.

[0072] In some embodiments, as shown in Table 1, configuration parameters for each test case are provided.

[0073] Table 1: Execution order 1 2 3 4 Scene parameters Write the motor zero point; the fault reporting threshold is 3. Write the motor zero point; the fault reporting threshold is 3. Read single-cycle position; fault reporting threshold is 7. Read single-cycle position; fault reporting threshold is 7. Preset fault types Write memory exception types Write memory exception types Communication timeout type Communication timeout type Preset number of triggers 3 4 7 8 Preset trigger conditions The number of write operations to the memory reaches 1. The number of write operations to the memory reaches 1. The number of communication operations reached 5. The number of communication operations reached 5. Preset response data When the analog encoder records 3 analog cycles, the servo driver does not report an encoder fault under the memory write exception type. When the analog encoder records 4 simulation times, the servo driver reports an encoder fault under the memory write exception type. When the analog encoder records 7 simulation attempts, the servo driver does not report an encoder fault under the communication timeout type. When the analog encoder records 8 simulation attempts, the servo driver reports an encoder fault under the communication timeout type.

[0074] Taking the test process corresponding to the test case with execution order 1 in Table 1 as an example, the details are as follows: The host computer sends a fault simulation command to the analog encoder, instructing the analog encoder to simulate an encoder fault under the memory write exception type every time it acquires a write operation to the memory, starting from the first time, until the simulation count reaches 3 times.

[0075] The host computer sends control commands to the servo driver, instructing it to enter a functional scenario where the motor zero-point is written and the fault reporting threshold is 3. In this scenario, the servo driver sends a request data containing an EEPROM write command to the analog encoder to perform a write operation to the memory. The analog encoder can parse the request data to identify the write operation. Each time a write operation is detected, it simulates an encoder fault under the memory write exception type and updates the fault status word to record the number of simulations until the number of simulations reaches 3. After the number of simulations reaches 3, when the analog encoder detects a write operation to the memory again, it will no longer simulate an encoder fault under the memory write exception type.

[0076] The host computer queries the fault status word of the simulated encoder to obtain the number of simulations. When the number of simulations reaches 3, it obtains the fault response data of the servo drive. If the alarm code in the fault response data is not the fault code corresponding to the encoder fault under the write memory exception type, it means that the servo drive has not reported the encoder fault under the write memory exception type, and the test result representing the test case as passed is determined. It can be understood that the fault reporting threshold is 3. For each failed write operation to the memory by the servo drive, the cumulative fault count corresponding to the encoder fault under the write memory exception type is incremented by 1. If the cumulative fault count does not exceed the fault reporting threshold, the encoder fault will not be reported, corresponding to the expected response data of test case with execution order 1. Once the cumulative fault count exceeds the fault reporting threshold, the encoder fault will be reported, corresponding to the expected response data of test case with execution order 2.

[0077] The host computer fills the test case configuration parameters, fault response data, and test results into the test report. After resetting the servo drive and the analog encoder, it continues to execute the subsequent test cases in the execution order.

[0078] In some embodiments, such as Figure 4The diagram shows a flowchart of a method for simulating encoder faults. Taking the application of this method to an analog encoder as an example, the method includes the following steps 402 to 406.

[0079] Step 402: Analyze the fault simulation command sent by the host computer to obtain the preset fault type and preset triggering conditions.

[0080] For example, the simulated encoder can acquire fault simulation commands sent by the host computer. The fields in the fault simulation commands are parsed to obtain the preset fault type and preset trigger conditions.

[0081] Step 404: Determine the target simulation module from the local anomaly database according to the preset fault type.

[0082] For example, the analog encoder has a built-in exception library. The exception library is a software tool library containing candidate simulation modules for simulating encoder faults under various fault types. Each candidate simulation module is predefined program logic that specifies how to simulate faults when responding to encoder operations. The analog encoder can select the target simulation module corresponding to a preset fault type from the candidate simulation modules in the exception library.

[0083] Step 406: For encoder operations from the servo drive, when the encoder operation meets the preset trigger conditions, simulate encoder faults under preset fault types based on the target simulation module.

[0084] For example, the analog encoder is connected to the servo driver via the servo driver's encoder interface. The servo driver can send request data corresponding to encoder operations under a specific functional scenario to the analog encoder through the encoder interface. The analog encoder can receive the request data sent by the servo driver, parse the request data to identify the encoder operation from the servo driver. When the encoder operation meets preset trigger conditions, the analog encoder can call the target simulation module to simulate encoder faults under preset fault types.

[0085] In some embodiments, the preset trigger condition may be, but is not limited to, an encoder operation that is a preset operation. For example, a preset trigger condition may include an encoder operation that reads a single-turn position. In this case, the operation of reading a single-turn position will satisfy the preset trigger condition and trigger the simulated encoder to start simulating an encoder fault.

[0086] In some embodiments, the preset trigger condition may be, but is not limited to, the encoder operation being a preset operation and the number of preset operations reaching a preset number of operations. For example, if the preset operation is a communication operation with the encoder and the preset trigger condition is the nth communication operation after the start of communication, then the nth and subsequent communication operations after the start of communication will satisfy the preset trigger condition, triggering the simulated encoder to start simulating an encoder fault.

[0087] In some embodiments, the simulated encoder can generate normal response data in response to encoder operations from the servo drive. When the encoder operation meets preset trigger conditions, the normal response data is modified based on the target simulation module to simulate an encoder fault under a preset fault type.

[0088] In some embodiments, the number of simulated encoder failures is recorded. For example, a simulated encoder can record the number of simulated encoder failures by updating its own status word.

[0089] The aforementioned encoder fault simulation method is applied to simulated encoders. It parses the fault simulation commands sent by the host computer to obtain preset fault types and preset trigger conditions. Based on the preset fault types, it determines the target simulation module from the local exception library. The modular design of the exception library allows the simulated encoder to flexibly simulate various encoder faults, meeting the needs of different encoder faults in servo drive testing, thus providing greater adaptability. For encoder operations from the servo drive, when the encoder operation meets the preset trigger conditions, the encoder fault under the preset fault type is simulated based on the target simulation module. This ensures that the encoder operation meeting the preset trigger conditions triggers the simulation of the encoder fault under the preset fault type, making the encoder fault simulation occur during the response to the encoder operation, thus ensuring the realism of the encoder fault simulation and the effectiveness of the encoder fault simulation.

[0090] In some embodiments, parsing the fault simulation command sent by the host computer to obtain a preset fault type and a preset trigger condition includes: parsing the fault simulation command sent by the host computer to obtain the preset fault type, the preset trigger condition, and the preset trigger count; when the encoder operation meets the preset trigger condition, simulating an encoder fault under the preset fault type based on the target simulation module includes: when the encoder operation meets the preset trigger condition and the number of simulations of the encoder fault under the preset fault type has not reached the preset trigger count, simulating an encoder fault based on the target simulation module; the method further includes: when the encoder operation does not meet the preset trigger condition or the number of simulations reaches the preset trigger count, returning normal response data corresponding to the encoder operation to the servo driver.

[0091] In some embodiments, the simulated encoder can parse request data sent by the servo drive to identify encoder operations from the servo drive. Normal response data is generated for the encoder operation. Normal response data is returned to the servo drive when the encoder operation does not meet preset trigger conditions or when the number of simulations reaches a preset trigger count. When the encoder operation meets preset trigger conditions but the number of simulations has not reached the preset trigger count, an encoder fault under a preset fault type is simulated based on the target simulation module.

[0092] In some embodiments, the simulated encoder can determine whether the number of simulations has reached a preset trigger count. If not, it directly returns normal response data corresponding to the encoder operation to the servo driver. If so, it determines whether the encoder operation meets a preset trigger condition. If the encoder operation does not meet the preset trigger condition, it returns normal response data corresponding to the encoder operation to the servo driver. If the encoder operation meets the preset trigger condition, it simulates an encoder fault under a preset fault type based on the target simulation module.

[0093] In this embodiment, the fault simulation command sent by the host computer is parsed to obtain the preset fault type, preset trigger condition, and preset trigger count. When the encoder operation meets the preset trigger condition and the number of times the encoder fault simulation under the preset fault type is reached has not reached the preset trigger count, the encoder fault is simulated based on the target simulation module. When the encoder operation does not meet the preset trigger condition or the number of simulations reaches the preset trigger count, the normal response data corresponding to the encoder operation is returned to the servo driver. When the number of times the encoder fault simulation is reached, it represents the end of the fault simulation. This ensures that the simulated encoder can interact normally with the servo driver during non-fault simulation periods, and ensures that encoder operations that do not meet the preset trigger condition cannot trigger encoder faults, thus ensuring the accuracy of encoder fault simulation.

[0094] In some embodiments, the preset fault type includes an abnormal response type; the method further includes: generating normal response data corresponding to encoder operation; simulating encoder faults under the preset fault type based on the target simulation module, including: modifying the field corresponding to the abnormal response type in the normal response data based on the target simulation module to obtain abnormal response data; returning abnormal response data to the servo driver, so that the servo driver generates corresponding fault response data when it identifies the abnormal field in the abnormal response data.

[0095] In some implementations, the response exception type may include at least one of the following: communication verification error type, data frame error type, encoder status exception type, read memory exception type, write memory exception type, etc.

[0096] The analog encoder can modify the verification field corresponding to the communication verification error type in the normal response data based on the target simulation module to obtain abnormal response data with abnormal verification values.

[0097] The analog encoder can modify fixed flag bits such as the start bit or stop bit corresponding to the data frame error type in the normal response data based on the target simulation module to obtain abnormal response data.

[0098] The simulated encoder can modify the status bits corresponding to the encoder status anomaly type in the normal response data based on the target simulation module, to simulate at least one abnormal state such as low battery voltage, overheating, or encoder failure, and obtain abnormal response data for encoder status anomalies. Specifically, the status bit corresponding to the encoder status anomaly type can be set to 1 to obtain abnormal response data.

[0099] The analog encoder can modify the read data field corresponding to the read memory exception type in the normal response data based on the target simulation module, to simulate at least one abnormal response of the read memory, such as read data failure or data verification error, and obtain abnormal response data. Encoder faults under read memory exception types can include abnormal motor parameters. Specifically, the read data field contains the read motor parameters, and the verification byte in the motor parameters can be modified to obtain abnormal response data.

[0100] The analog encoder can modify the write data field corresponding to the write memory exception type based on the target simulation module, making the field value under the write data field inconsistent with the data written by the servo driver. This simulates at least one abnormal write memory response, such as write data failure or data verification error, and obtains abnormal response data. Encoder faults under write memory exception types can include at least one of the following: abnormal write motor parameters or abnormal write zero point.

[0101] The analog encoder can return abnormal response data to the servo driver through the encoder interface, so that the servo driver can generate corresponding fault response data when it recognizes the abnormal fields in the abnormal response data.

[0102] In this embodiment, normal response data corresponding to encoder operation is generated; based on the target simulation module, the field corresponding to the response anomaly type in the normal response data is modified to obtain abnormal response data; the abnormal response data is returned to the servo driver, so that the servo driver can generate corresponding fault response data when it identifies the abnormal field in the abnormal response data. It can simulate encoder faults by modifying fields, rather than simply simulating "on / off", which can ensure the testing efficiency of the servo driver.

[0103] In some embodiments, the preset fault type includes a communication timeout type; simulating encoder faults under the preset fault type based on the target simulation module includes: performing processing of timeout unresponsive encoder operation based on the target simulation module, so that the servo drive generates corresponding fault response data when it recognizes the response timeout.

[0104] For example, the simulated encoder can intercept the operation of sending normal response data to the servo driver based on the target simulation module to simulate the encoder failure under the communication timeout type, so that the servo driver generates corresponding fault response data if it does not receive any response data within a preset time period.

[0105] In this embodiment, the processing of encoder operation that times out without response is performed based on the target simulation module, so that the servo driver generates corresponding fault response data when the response timeout is detected, thereby simulating encoder faults under the communication timeout type. This eliminates the need to manually adjust the encoder to create encoder faults, thus improving the testing efficiency of the servo driver.

[0106] In some embodiments, such as Figure 5 As shown, a simplified flowchart of a test method for a servo driver is provided, including steps 502 to 520.

[0107] Step 502: The host computer obtains the pre-configured test cases.

[0108] It is understandable that test cases can be configured on the host computer, but are not limited to.

[0109] Step 504: The host computer generates a test process by traversing each test case.

[0110] It is understandable that the testing process consists of the testing procedures corresponding to each test case arranged in the order of execution.

[0111] Step 506: The host computer obtains the scenario parameters, preset fault types, preset trigger conditions, preset trigger counts, and preset response data from the test cases.

[0112] Specifically, the host computer retrieves the configuration parameters from the traversed test cases. The configuration parameters include scenario parameters, preset fault types, preset trigger conditions, preset trigger counts, and preset response data.

[0113] Step 508: The host computer sends a fault simulation command to the analog encoder, which carries a preset fault type, preset trigger conditions and preset number of triggers.

[0114] Step 510: The host computer sends the control command corresponding to the scene parameters to the servo driver.

[0115] Step 512: After the servo driver enters the functional scene that matches the scene parameters, it performs encoder operations under the functional scene on the analog encoder.

[0116] Step 514: Simulate encoder faults under preset fault types when the encoder operation meets preset trigger conditions and the number of times encoder faults under preset fault types are simulated has not reached the preset trigger number.

[0117] Step 516: The host computer acquires the fault response data of the servo driver when the number of simulations reaches the preset number of triggers.

[0118] Step 518: The host computer compares the fault response data with the preset response data. If they match, the test is deemed to have passed; otherwise, the test is deemed to have failed.

[0119] As you can understand, if a test is deemed to have passed, a test result indicating that the test case has passed will be generated. If a test is deemed to have failed, a test result indicating that the test case has failed will be generated.

[0120] Step 520: Generate a test report.

[0121] Specifically, the host computer can generate test reports based on the test results corresponding to each test case.

[0122] In some embodiments, such as Figure 6 The diagram illustrates a simplified flowchart of a method for simulating encoder faults. The simulated encoder continuously identifies encoder operations from the servo driver and generates normal response data for each operation. If the number of encoder fault simulations reaches a preset trigger count, normal response data is sent back to the servo driver. If the number of encoder fault simulations does not reach the preset trigger count, the target simulation module corresponding to the preset fault type is determined from the exception database. If the encoder operation does not meet the preset trigger conditions, normal response data is sent back to the servo driver. If the encoder operation meets the preset trigger conditions, the target simulation module simulates an encoder fault under the preset fault type, updating the simulation count.

[0123] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0124] Based on the same inventive concept, this application also provides a servo drive testing system for implementing the aforementioned servo drive testing method. The solution provided by this system is similar to the implementation described in the above method; therefore, the specific limitations of one or more servo drive testing system embodiments provided below can be found in the limitations of the servo drive testing method described above, and will not be repeated here.

[0125] In one exemplary embodiment, such as Figure 7 As shown, a test system 700 for a servo drive is provided, including: a host computer 702, a servo drive 704, and an analog encoder 706.

[0126] The host computer 702 is used to acquire scene parameters, preset fault types, preset trigger conditions and preset response data; send control commands corresponding to the scene parameters to the servo driver 704; generate fault simulation commands based on preset fault types and preset trigger conditions; and send fault simulation commands to the analog encoder 706.

[0127] The servo driver 704 is used to enter a functional scene that matches the scene parameters according to the control command, and to perform encoder operation in the functional scene for the analog encoder 706.

[0128] The analog encoder 706 is used to simulate encoder faults of a preset fault type when the encoder operation meets preset triggering conditions, based on fault simulation instructions.

[0129] The servo driver 704 is also used to generate fault response data for encoder failures in functional scenarios. The host computer 702 is also used to acquire fault response data and determine test results based on preset response data and fault response data.

[0130] In some embodiments, the host computer 702 is further configured to traverse each test case according to the pre-configured execution order of each test case; for each traversed test case, obtain the configuration parameters in the test case; the configuration parameters include scenario parameters, preset fault types, preset trigger conditions and preset response data; determine the test result corresponding to the test case based on the preset response data and fault response data; continue to traverse each test case, and return to the step of obtaining the configuration parameters in the test case for each traversed test case.

[0131] In some embodiments, the configuration parameters also include a preset number of triggers; the host computer 702 is also used to poll the number of times the encoder fault is simulated as recorded by the simulated encoder 706; when the number of simulations reaches the preset number of triggers, the test result corresponding to the test case is determined based on the preset response data and the fault response data.

[0132] In some embodiments, the host computer 702 is further configured to send a fault clearing command to the analog encoder 706; the analog encoder 706 is further configured to clear the fault-related data corresponding to the test case.

[0133] In some embodiments, the host computer 702 is further configured to send control commands directly to the servo driver 704 when the control commands corresponding to the scene parameters include a state reset command; and to send a state reset command to the servo driver 704 when the control commands do not include a state reset command. The servo driver 704 is further configured to reset its own state according to the state reset command. The host computer 702 is further configured to send control commands to the servo driver 704 after the state of the servo driver 704 has been reset.

[0134] In some embodiments, the simulated encoder 706 is further configured to parse the fault simulation command sent by the host computer 702 to obtain a preset fault type and a preset trigger condition; determine the target simulation module from the local exception library according to the preset fault type; and simulate the encoder fault under the preset fault type based on the target simulation module when the encoder operation meets the preset trigger condition for the encoder operation from the servo driver 704.

[0135] In some embodiments, the analog encoder 706 is also used to record the number of times an encoder failure is simulated.

[0136] In some embodiments, the simulated encoder 706 is further configured to parse the fault simulation command sent by the host computer 702 to obtain a preset fault type, a preset trigger condition, and a preset number of triggers; when the encoder operation meets the preset trigger condition and the number of simulations of the encoder fault under the preset fault type has not reached the preset number of triggers, the encoder 706 fault is simulated based on the target simulation module; when the encoder operation does not meet the preset trigger condition or the number of simulations reaches the preset number of triggers, normal response data corresponding to the encoder operation is returned to the servo driver 704.

[0137] In some embodiments, the preset fault type includes an abnormal response type; the simulated encoder 706 is also used to generate normal response data corresponding to encoder operation; based on the target simulation module, the field in the normal response data corresponding to the abnormal response type is modified to obtain abnormal response data; the abnormal response data is returned to the servo driver 704, so that the servo driver 704 generates corresponding fault response data when it identifies the abnormal field in the abnormal response data.

[0138] In some embodiments, the preset fault type includes a communication timeout type; the analog encoder 706 is also used to perform timeout non-response encoder operation processing based on the target analog module, so that the servo drive 704 generates corresponding fault response data when it recognizes a response timeout.

[0139] Each device in the aforementioned servo drive testing system can be implemented entirely or partially through software, hardware, or a combination thereof. These devices can be embedded in or independent of the processor in a computer device, or stored in the computer device's memory as software, so that the processor can invoke and execute the corresponding operations of each device.

[0140] In one exemplary embodiment, a host computer is provided, which may be a server, and its internal structure diagram may be as follows. Figure 8 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores configuration parameters for each test case. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a test method for a servo drive.

[0141] In one exemplary embodiment, another host computer is provided. This computer device can be a terminal, and its internal structure diagram can be as follows: Figure 9As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a test method for a servo drive. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0142] Those skilled in the art will understand that Figure 8 or Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0143] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0144] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0145] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0146] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0147] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0148] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A test method for a servo driver, characterized in that, The method includes: Acquire scene parameters, preset fault types, preset trigger conditions, and preset response data; Send control commands corresponding to the scene parameters to the servo driver to instruct the servo driver to enter a functional scene that matches the scene parameters, so that the servo driver performs encoder operations under the functional scene for the analog encoder; A fault simulation command is generated based on the preset fault type and the preset triggering condition; Send the fault simulation command to the simulated encoder to instruct the simulated encoder to simulate an encoder fault under the preset fault type when the encoder operation meets the preset triggering condition; Acquire the fault response data generated by the servo driver in response to the encoder failure under the functional scenario; The test results are determined based on the preset response data and the fault response data.

2. The method according to claim 1, characterized in that, The acquisition of scenario parameters, preset fault types, preset trigger conditions, and preset response data includes: According to the pre-configured execution order of each test case, traverse each test case; For each test case that has been traversed, the configuration parameters in the test case are obtained; the configuration parameters include scenario parameters, preset fault types, preset trigger conditions, and preset response data; Determining the test result based on the preset response data and the fault response data includes: The test results corresponding to the test cases are determined based on the preset response data and the fault response data. Continue traversing each test case, and return to the step of obtaining the configuration parameters in the traversed test case.

3. The method according to claim 2, characterized in that, The configuration parameters also include a preset number of triggers; determining the test result corresponding to the test case based on the preset response data and the fault response data includes: Poll the simulated encoder to record the number of times the encoder fault has been simulated; When the number of simulations reaches the preset number of triggers, the test result corresponding to the test case is determined based on the preset response data and the fault response data.

4. The method according to claim 2, characterized in that, After determining the test result corresponding to the test case based on the preset response data and the fault response data, the method further includes: A fault clearing command is sent to the simulated encoder to instruct the simulated encoder to clear the fault-related data corresponding to the test case.

5. The method according to claim 1, characterized in that, Sending the control command corresponding to the scene parameters to the servo driver includes: If the control command corresponding to the scene parameter includes a state reset command, the control command is sent directly to the servo driver. If the control command does not include the state reset command, the state reset command is sent to the servo driver to instruct the servo driver to reset its own state. After the state of the servo driver is reset, the control command is sent to the servo driver.

6. A method for simulating encoder faults, characterized in that, Applied to analog encoders; The method includes: Analyze the fault simulation commands sent by the host computer to obtain the preset fault type and preset trigger conditions; The target simulation module is determined from the local anomaly database according to the preset fault type; For encoder operations originating from a servo drive, when the encoder operation satisfies the preset triggering condition, an encoder fault under the preset fault type is simulated based on the target simulation module.

7. The method according to claim 6, characterized in that, The fault simulation command sent by the host computer is analyzed to obtain the preset fault type and preset triggering conditions, including: The fault simulation command sent by the host computer is parsed to obtain the preset fault type, preset trigger condition, and preset number of triggers; When the encoder operation satisfies the preset triggering condition, simulating an encoder fault under the preset fault type based on the target simulation module includes: When the encoder operation meets the preset triggering condition and the number of times the encoder fault under the preset fault type is simulated has not reached the preset triggering number, the encoder fault is simulated based on the target simulation module. The method further includes: When the encoder operation does not meet the preset trigger condition or the number of simulations reaches the preset trigger number, normal response data corresponding to the encoder operation is returned to the servo driver.

8. The method according to claim 6, characterized in that, The preset fault types include response anomaly types; The method further includes: Generate normal response data corresponding to the encoder operation; The simulation of encoder faults under the preset fault type based on the target simulation module includes: Based on the target simulation module, modify the field in the normal response data that corresponds to the response anomaly type to obtain abnormal response data; The abnormal response data is returned to the servo driver, so that the servo driver generates corresponding fault response data when it recognizes the abnormal field in the abnormal response data.

9. The method according to any one of claims 6 to 8, characterized in that, The preset fault types include communication timeout types; the simulation of encoder faults under the preset fault types based on the target simulation module includes: Based on the processing of the encoder operation that fails to respond within a timeout period by the target simulation module, the servo driver generates corresponding fault response data when it detects a response timeout.

10. A test system for a servo driver, characterized in that, The system is used to implement the steps of the method according to any one of claims 1 to 9, and the system includes a host computer, a servo driver, and an analog encoder; The host computer is used to acquire scene parameters, preset fault types, preset trigger conditions, and preset response data; Send the control command corresponding to the scene parameters to the servo driver; A fault simulation command is generated based on the preset fault type and the preset triggering condition; the fault simulation command is sent to the simulation encoder; The servo driver is used to enter a functional scenario that matches the scene parameters according to the control command, and to perform encoder operations under the functional scenario for the analog encoder. The simulated encoder is used to simulate an encoder fault under the preset fault type when the encoder operation meets the preset triggering condition, based on the fault simulation instruction. The servo driver is also used to generate fault response data for encoder failures in the functional scenario. The host computer is also used to acquire the fault response data and determine the test results based on the preset response data and the fault response data.