A method and system for automatically testing encoders
By designing automated test encoder methods and systems, using the upper computer to control the power supply line between the servo drive and the encoder to turn on and off, the problem of manual operation in the prior art affecting the testing efficiency is solved, and more efficient encoder testing is achieved .
Patent Information
- Application Number
- CN202211443322.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-17
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2042-11-17
AI Technical Summary
During the testing of existing encoders, manual control of the power supply line between the servo drive and the encoder is required to be powered on and off, resulting in low testing efficiency and high operation difficulty.
Design an automated test encoder method and system, send test instructions through the upper computer to control the power supply line between the servo drive and the encoder to be turned on and off, and realize automatic testing of the encoder.
Reliance on manual operations is reduced, the efficiency of encoder testing is improved, and the requirements for operator technical level are reduced.
Smart Images

Figure CN115683196B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of equipment testing, and in particular to a method and system for automatically testing encoders. Background Art
[0002] An encoder is a sensor that measures circumferential position information and converts it into an electrical signal. It is often used to measure the circumferential position of a motor and provide feedback reference data to a servo drive. The encoder, motor, and servo drive together form a servo system. The performance of the encoder directly affects the speed control stability and positioning accuracy of the servo system. Therefore, a test device is needed to test the performance of the encoder and its performance in the servo system.
[0003] In the current encoder testing process, the servo drive supplies power to the encoder, but the power supply line between the servo drive and the encoder needs to be manually plugged in and out by the staff. The manual operation not only affects the efficiency of the encoder testing work, but also has high requirements on the technical level of the operator. Summary of the invention
[0004] The present application provides an automated encoder testing method and system, which can reduce the reliance on manual labor during the testing process and improve the efficiency of encoder testing.
[0005] In a first aspect, the present application provides an automated encoder testing method, which is applied to a first servo drive, wherein the first servo drive is connected to an encoder under test, and includes:
[0006] In response to a first test instruction sent by a host computer, controlling the encoder under test to be powered on, wherein the first test instruction includes first target data, and the first target data is used to indicate a test of the encoder under test;
[0007] Sending first feedback data to the host computer so that the host computer obtains the test result of the encoder under test based on comparative analysis of the first feedback data and the second feedback data, the first feedback data represents the reading of the encoder under test when the motor reaches the first target data, the second feedback data represents the reading of the reference encoder when the motor reaches the first target data, the motor is connected to the encoder under test and the reference encoder, the reference encoder is connected to a second servo driver, and the second feedback data is the data sent to the host computer by the second servo driver.
[0008] Optionally, the first target data includes indication data of a power-off count test, and the method further includes:
[0009] Based on a second control signal corresponding to the first target data, controlling the encoder under test to power off;
[0010] In response to determining that the motor is running at a second target position, power supply to the encoder under test is restored, and the first feedback data is obtained, wherein the first feedback data represents a reading of the encoder under test when the motor reaches the second target position in a power-off count test, and the second target position is used to indicate a test condition for a power-off count test of the encoder under test.
[0011] Optionally,
[0012] If the first feedback data and the second feedback data do not match, the test result indicates that the encoder under test has failed;
[0013] If the first feedback data and the second feedback data match, the test result indicates that the encoder under test functions normally.
[0014] Optionally, the first feedback data and the second feedback data match, including: the first feedback data is consistent with the record of the number of revolutions of the motor during the period when the encoder under test is powered off.
[0015] Optionally, the method further comprises:
[0016] Receiving an adjustment instruction sent by a host computer, wherein the adjustment instruction is used to instruct to modify a control parameter of the first servo driver;
[0017] Based on the third control signal corresponding to the adjustment instruction, the first servo driver is controlled to correct the corresponding control parameter, so that the servo system where the corrected first servo driver is located completes the corresponding test.
[0018] Optionally, the control parameters include speed control parameters and / or position control parameters.
[0019] Optionally, the first target data includes a first target rotation speed.
[0020] Optionally, the first target data includes a first target position.
[0021] Optionally, the servo system in which the first servo driver is located is a servo system that performs a rotation speed test.
[0022] Optionally, the test result is used to indicate whether a difference between the first feedback data and the second feedback data is within a preset range.
[0023] In a second aspect, the present application further provides an automated encoder testing device, which is applied to a first servo drive, wherein the first servo drive is connected to an encoder under test, and the device comprises:
[0024] A first control unit, configured to control the encoder under test to power on in response to a first test instruction sent by a host computer, wherein the first test instruction includes first target data, and the first target data is used to indicate a test of the encoder under test;
[0025] A sending unit is used to send first feedback data to the host computer, so that the host computer obtains the test result of the encoder under test based on the comparative analysis of the first feedback data and the second feedback data, the first feedback data represents the reading of the encoder under test when the motor reaches the first target data, the second feedback data represents the reading of the reference encoder when the motor reaches the first target data, the motor is connected to the encoder under test and the reference encoder, the reference encoder is connected to a second servo driver, and the second feedback data is the data sent to the host computer by the second servo driver.
[0026] Optionally, the first target data includes indication data of a power-off count test, and the device further includes:
[0027] a second control unit, configured to control the encoder under test to power off based on a second control signal corresponding to the first target data;
[0028] A recovery unit is used for, in response to determining that the motor is running at a second target position, restoring power to the encoder under test and obtaining the first feedback data, wherein the first feedback data represents a reading of the encoder under test when the motor reaches the second target position in a power-off count test, and the second target position is used to indicate a test condition for a power-off count test of the encoder under test.
[0029] Optionally,
[0030] If the first feedback data and the second feedback data do not match, the test result indicates that the encoder under test has failed;
[0031] If the first feedback data and the second feedback data match, the test result indicates that the encoder under test functions normally.
[0032] Optionally, the first feedback data and the second feedback data match, including: the first feedback data is consistent with the record of the number of revolutions of the motor during the period when the encoder under test is powered off.
[0033] Optionally, the device further comprises:
[0034] A receiving unit, used for receiving an adjustment instruction sent by a host computer, wherein the adjustment instruction is used for instructing to modify a control parameter of the first servo driver;
[0035] The third control unit is used to control the first servo driver to correct the corresponding control parameters based on the third control signal corresponding to the adjustment instruction, so that the servo system where the corrected first servo driver is located completes the corresponding test.
[0036] Optionally, the control parameters include speed control parameters and / or position control parameters.
[0037] Optionally, the first target data includes a first target rotation speed.
[0038] Optionally, the first target data includes a first target position.
[0039] Optionally, the servo system in which the first servo driver is located is a servo system that performs a rotation speed test.
[0040] Optionally, the test result is used to indicate whether a difference between the first feedback data and the second feedback data is within a preset range.
[0041] In a third aspect, the present application further provides an automated encoder test system, comprising: a host computer, a motor, an encoder under test, a reference encoder, a first servo drive and a second servo drive, wherein the host computer is connected to the first servo drive and the second servo drive, the first servo drive is connected to the encoder under test, the second servo drive is connected to the reference encoder, and the encoder under test and the reference encoder are both connected to the motor, wherein:
[0042] The first servo driver is used to receive a first test instruction sent by the host computer, control the encoder under test to power on based on the first test instruction, and send first feedback data to the host computer, the first feedback data represents the reading of the encoder under test when the motor reaches a first target data, the first test instruction includes the first target data, and the first target data is used to indicate a test of the encoder under test;
[0043] The second servo driver is used to send second feedback data to the host computer, wherein the second test data represents a reading of the reference encoder when the motor reaches the first target data;
[0044] The host computer is used to compare and analyze the first feedback data and the second feedback data to obtain a test result.
[0045] Optionally, a first power supply line is provided between the first servo driver and the encoder under test, and a second power supply line is provided between the second servo driver and the reference encoder.
[0046] The host computer is further used to send a first power supply instruction to the first servo driver and send a second power supply instruction to the second servo driver;
[0047] The first servo driver is further used to control the connection or disconnection of the first power supply circuit according to the first power supply instruction, the connection of the first power supply circuit corresponds to the power-on of the encoder under test, and the disconnection of the first power supply circuit corresponds to the power-off of the encoder under test;
[0048] The second servo driver is also used to control the connection or disconnection of the second power supply circuit according to the second power supply instruction, the connection of the second power supply circuit corresponds to the power-on of the reference encoder, and the disconnection of the second power supply circuit corresponds to the power-off of the reference encoder.
[0049] In a fourth aspect, the present application further provides an electronic device, the electronic device comprising a processor and a memory:
[0050] The memory is used to store computer programs;
[0051] The processor is used to execute the method provided in the first aspect according to the computer program.
[0052] In a fifth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method provided in the first aspect above.
[0053] It can be seen that this application has the following beneficial effects:
[0054] The present application provides an automated test encoder method, which is applied to a first servo driver, wherein the first servo driver is connected to the encoder under test, and specifically includes: in response to a first test instruction sent by a host computer, controlling the encoder under test to be powered on, wherein the first test instruction includes a first target data, and the first target data is used to indicate the test of the encoder under test; sending a first feedback data to the host computer, so that the host computer obtains the test result of the encoder under test based on the comparative analysis of the first feedback data and the second feedback data, wherein the first feedback data represents the reading of the encoder under test when the motor reaches the first target data, and the second feedback data represents the reading of the reference encoder when the motor reaches the first target data, the motor connects the encoder under test and the reference encoder, and the reference encoder is connected to a second servo driver, and the second feedback data is the data sent by the second servo driver to the host computer. In this way, the host computer controls the power on and off of the power supply line between the servo driver and the encoder by sending instructions to the servo driver, and no longer needs to control the power on and off by manual plugging and unplugging, which reduces the degree of dependence on manual work during the test, and also improves the efficiency of the encoder test work. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0056] Figure 1 This is a schematic diagram of the structure of an automated encoder testing system 100 in an embodiment of the present application;
[0057] Figure 2 A schematic diagram of a flow chart of an automated encoder testing method in an embodiment of the present application;
[0058] Figure 3 A schematic diagram of a flow chart of an example of an automated encoder testing method in an embodiment of the present application;
[0059] Figure 4 A schematic diagram of a flow chart of another example of an automated encoder testing method in an embodiment of the present application;
[0060] Figure 5 A schematic diagram of a flow chart of another example of an automated encoder testing method in an embodiment of the present application;
[0061] Figure 6 A schematic diagram of the structure of an automated test encoder device 600 provided in an embodiment of the present application;
[0062] Figure 7 A schematic diagram of the structure of an electronic device 700 provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] The multiple involved in the embodiments of the present application means greater than or equal to two. It should be noted that in the description of the embodiments of the present application, the words "first", "second", etc. are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.
[0064] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0065] In the current encoder test process, the servo drive supplies power to the encoder, but the power supply line between the servo drive and the encoder needs to be manually plugged in and out to control the power supply. In addition, the parameter setting link, position test, speed test and power-off count test all require manual operation step by step. The manual operation method not only affects the efficiency of the encoder test work to a certain extent, but also has high requirements on the technical level of the operator.
[0066] Based on this, the embodiment of the present application provides an automated test encoder method, which may include: in response to a first test instruction sent by a host computer, controlling the tested encoder to power on, the first test instruction including a first target data, the first target data being used to indicate the test of the tested encoder; sending a first feedback data to the host computer so that the host computer obtains the test result of the tested encoder based on the comparative analysis of the first feedback data and the second feedback data, wherein the first feedback data represents the reading of the tested encoder when the motor reaches the first target data, the second feedback data represents the reading of the reference encoder when the motor reaches the first target data, the motor connects the tested encoder and the reference encoder, the reference encoder is connected to a second servo driver, and the second feedback data is the data sent by the second servo driver to the host computer. In this way, the host computer controls the power on and off of the power supply line between the servo driver and the encoder by sending instructions to the servo driver, and no longer needs to control the power on and off by manual plugging and unplugging, thereby improving the efficiency of the encoder test work. In addition, the control parameters of the servo controller are no longer manually adjusted, reducing the degree of dependence on manual labor during the test process and reducing the requirements for the technical level of the operator.
[0067] To facilitate understanding of the specific implementation of the automated test encoder provided in the embodiments of the present application, an explanation will be given below with reference to the accompanying drawings.
[0068] It should be noted that the subject implementing the automated test encoder method may be an automated test encoder device provided in the embodiment of the present application, and the automated test encoder device may be carried in an electronic device or a functional module of an electronic device. The electronic device in the embodiment of the present application may be any device capable of implementing the automated test encoder method in the embodiment of the present application, for example, an Internet of Things (IoT) device.
[0069] See also Figure 1 , Figure 1 A structural schematic diagram of an automated test encoder system 100 is provided for an embodiment of the present application, wherein the automated test encoder system 100 includes: a host computer 110, a first servo drive 120, a second servo drive 130, a tested encoder 140, a motor 150 and a reference encoder 160, wherein the host computer 110 is connected to the first servo drive 120 and the second servo drive 130, the first servo drive 120 is connected to the tested encoder 140, the second servo drive 130 is connected to the reference encoder 160, and the tested encoder 140 and the reference encoder 160 are both connected to the motor 150.
[0070] The first servo driver 120 is used to receive a first test instruction sent by the host computer 110, control the encoder under test 140 to power on based on the first test instruction, and send first feedback data to the host computer 110, the first feedback data represents the reading of the encoder under test 140 when the motor 150 reaches the first target data, the first test instruction includes the first target data, and the first target data is used to indicate the test of the encoder under test 140; the second servo driver 130 is used to send second feedback data to the host computer 110, the second feedback data represents the reading of the reference encoder 160 when the motor 150 reaches the first target data; the host computer 110 is used to compare and analyze the first feedback data and the second feedback data to obtain a test result.
[0071] A first power supply circuit 170 is included between the first servo driver 120 and the encoder under test 140, and a second power supply circuit 180 is included between the second servo driver 130 and the reference encoder 160. The host computer 110 is further used to send a first power supply instruction to the first servo driver 120 and a second power supply instruction to the second servo driver 130; the first servo driver 120 is further used to control the connection or disconnection of the first power supply circuit 170 according to the first power supply instruction, the connection of the first power supply circuit 170 corresponds to the power-on of the encoder under test 140, and the disconnection of the first power supply circuit 170 corresponds to the power-off of the encoder under test 140; the second servo driver 130 is further used to control the connection or disconnection of the second power supply circuit 180 according to the second power supply instruction, the connection of the second power supply circuit 180 corresponds to the power-on of the reference encoder 160, and the disconnection of the second power supply circuit 180 corresponds to the power-off of the reference encoder 160.
[0072] Host computer 110 can be a computer, and servo driver is controlled by computer software, or other equipment that provides control signal to servo driver. Tested encoder 130 or reference encoder 150 include Tamagawa encoder, BISS-C protocol encoder or incremental AB quadrature signal encoder, wherein, Tamagawa encoder communicates via RS-485 serial port, BISS-C protocol encoder communicates via SPI serial port, incremental AB quadrature signal encoder communicates via GPIO interface, in addition, tested encoder 130 or reference encoder 150 can also be an encoder supporting other non-mainstream communication protocols, which do not affect the realization of the embodiment of the present application. Host computer 110 can communicate with the first servo driver 120 and the second servo driver 130 by CANopen protocol, and baud rate is not limited, and can be, for example, 1 megabit per second (Mbit / s), the first servo driver 120 and the second servo driver 130 can also communicate by CANopen protocol, and reference encoder 160 can be a high-precision encoder, for use as the test benchmark of tested encoder 140, and is coaxially connected to motor 150 with tested encoder 140.
[0073] It should be noted that Figure 1 The straight lines with arrows in the figure represent the signal transmission between the connected components. The host computer 110 receives the encoder data fed back by the first servo driver 120 or the second servo driver 130 through the CAN bus, and the first servo driver 120 or the second servo driver 130 outputs power to the motor or cuts off the power through the three-phase power line. The power supply line of the servo driver is equipped with power electronic devices, which can control the power on and off of the power supply line between the servo driver and the encoder according to the instructions of the host computer 110.
[0074] In some implementations, according to the requirements of the encoder under test 140, the first servo driver 120 provides power supply of, for example, 3.3V or 5V to the motor through a voltage output interface, and according to the requirements of the reference encoder 160, the second servo driver 130 provides power supply of, for example, 3.3V or 5V to the motor through a voltage output interface.
[0075] Figure 2 A flow chart of an automated encoder testing method provided in an embodiment of the present application is applied to a first servo drive, wherein the first servo drive is connected to an encoder under test. The method can be applied to an automated encoder testing device, wherein the automated encoder testing device can be, for example, Figure 6 The automated test encoder device 600, or the automated test encoder device may also be integrated in Figure 7 Functional modules in the electronic device 700 are shown.
[0076] See also Figure 2 In an embodiment of the present application, the method for implementing an automated encoder test includes the following steps:
[0077] S201: In response to a first test instruction sent by a host computer, controlling the encoder under test to power on, wherein the first test instruction includes first target data, and the first target data is used to indicate a test on the encoder under test.
[0078] In an embodiment of the present application, each time the encoder under test needs to be tested, the test instruction sent by the host computer to the first servo driver can be recorded as a first test instruction, which is used to trigger a test of the encoder under test, that is, to execute the method once.
[0079] The first test instruction is used to instruct the first servo driver to control the encoder under test to power on, and the first test instruction contains the indication data of the test type and the first target data. The first test instruction is also used to instruct the encoder under test to perform a speed test, a position test or a power-off count test. When the indication data in the first test instruction is used to instruct the encoder under test to perform a power-off count test, the second servo driver supplies power to the motor. When the indication data in the first test instruction is used to instruct the encoder under test to perform a speed test or a position test, the first servo driver supplies power to the motor.
[0080] It should be noted that during the speed test, the reading of the reference encoder is analyzed and regarded as the actual speed of the motor. The first servo controller controls the motor to rotate at a certain target speed. The deviation of the actual speed of the motor from the target speed is used to evaluate the speed stability of the servo system where the first servo driver is located. Similarly, during the position test, the reading of the reference encoder is analyzed and regarded as the actual position of the motor. After the first servo driver controls the motor to reciprocate at a certain target position, the deviation of the actual position of the motor from the target position is used to evaluate the repeatability of the servo system where the first servo driver is located. By testing the performance of the servo system using the encoder under test, a reference for selecting a suitable encoder can be provided to decision makers.
[0081] S202: Sending first feedback data to the host computer so that the host computer obtains the test result of the encoder under test based on comparative analysis of the first feedback data and the second feedback data, the first feedback data represents the reading of the encoder under test when the motor reaches the first target data, the second feedback data represents the reading of the reference encoder when the motor reaches the first target data, the motor is connected to the encoder under test and the reference encoder, the reference encoder is connected to a second servo driver, and the second feedback data is the data sent to the host computer by the second servo driver.
[0082] The first servo driver sends first feedback data to the host computer, and the second servo system sends second feedback data to the host computer. The host computer obtains the test result according to the first feedback data and the second feedback data.
[0083] In some implementations, when the first target data includes indication data of a power-off count test, the method further includes: controlling the power off of the encoder under test based on a second control signal corresponding to the first target data; the host computer sends a second test instruction to the second servo driver, the second test instruction includes a second target position, and the second servo driver controls the operation of the motor based on the control signal corresponding to the second target position; the first servo driver, in response to determining that the motor is running at the second target position, restores power to the encoder under test and obtains the first feedback data, the first feedback data representing the reading of the encoder under test when the motor reaches the second target position in the power-off count test, and the second target position is used to indicate the test conditions of the power-off count test of the encoder under test.
[0084] As an example, if the first feedback data and the second feedback data do not match, the test result indicates that the encoder under test is failed; if the first feedback data and the second feedback data match, the test result indicates that the encoder under test is functioning normally. The first feedback data and the second feedback data match, which may include: the first feedback data is consistent with the record of the number of turns of the motor during the power-off period of the encoder under test.
[0085] It should be noted that the second feedback data represents the reading of the reference encoder when the motor reaches the second target position in the power-off counting test. If the first feedback data and the second feedback data do not match, it means that the encoder under test does not meet the test standard, and the test result indicates that the encoder under test is invalid; if the first feedback data and the second feedback data match, it means that the first feedback data is consistent with the record of the number of turns of the motor during the power-off of the encoder under test, that is, the encoder under test meets the test standard, and the test result indicates that the encoder under test is functioning normally.
[0086] In other implementations, when the indication data in the first test instruction is used to instruct the encoder under test to perform a speed test or a position test, the method further includes: receiving an adjustment instruction sent by a host computer, the adjustment instruction being used to instruct correction of control parameters of the first servo driver; and based on a third control signal corresponding to the adjustment instruction, controlling the first servo driver to correct the corresponding control parameters, so that the servo system in which the corrected first servo driver is located completes the corresponding test.
[0087] As an example, the host computer gradually adjusts the proportional integral (PI) control parameters and the filter cutoff frequency of the first servo driver according to the feedback data of the first servo driver until the first servo driver achieves the best control effect.
[0088] It should be noted that the control parameters include speed control parameters and / or position control parameters, but the speed control parameters need to be adjusted before adjusting the position control parameters. In some implementations, when the first target data includes the first target speed, S201-S202 is a speed test. Before performing the speed test, the method further includes: receiving an adjustment instruction sent by a host computer, the adjustment instruction is used to instruct to correct the speed control parameters of the first servo driver; based on the third control signal corresponding to the adjustment instruction, controlling the first servo driver to correct the speed control parameters, so that the servo system where the first servo driver is located after the correction completes the speed test.
[0089] The host computer sends an instruction to switch the speed mode to the first servo driver, the first servo driver supplies power to the motor and controls the operation of the motor, and the host computer issues an adjustment instruction based on the feedback data of the first servo driver, the adjustment instruction instructs to correct the speed control parameters of the first servo driver. In the specific implementation process, the host computer gradually adjusts the speed control parameters and filter cutoff frequency of the first servo driver based on the feedback data of the first servo driver until the first servo driver achieves the best control effect.
[0090] In some other implementations, when the first target data includes a first target position, the servo system where the first servo drive is located is the servo system that completes the speed test, S201 to S202 are a position test, and before performing the position test, the method further includes: receiving an adjustment instruction sent by a host computer, the adjustment instruction being used to instruct correction of a position control parameter of the first servo drive; and based on a fourth control signal corresponding to the adjustment instruction, controlling the first servo drive to correct the position control parameter, so that the servo system where the corrected first servo drive is located completes the position test.
[0091] The host computer sends an instruction to switch the position mode to the first servo driver, the first servo driver supplies power to the motor and controls the operation of the motor, and the host computer issues an adjustment instruction based on the feedback data of the first servo driver, the adjustment instruction indicates that the position control parameters of the first servo driver are to be corrected. In the specific implementation process, the host computer gradually adjusts the position control parameters and the filter cutoff frequency of the first servo driver based on the feedback data of the first servo driver until the first servo driver achieves the best control effect and enters the position test phase.
[0092] It should be noted that when the servo system where the first servo driver is located completes the speed test or the position test, the test result can also be used to indicate whether the difference between the first feedback data and the second feedback data is within a preset range. The speed test and the position test can be performed multiple times, but the speed test needs to be performed before the positioning test. In this way, the host computer controls the power on and off of the power supply line between the servo driver and the encoder by sending multiple test instructions and other test instructions for controlling the power on and off to the servo driver, thereby improving the efficiency of the encoder test.
[0093] In order to make the method provided in the embodiment of the present application clearer and easier to understand, a specific example of the method is described below in conjunction with a specific test scenario in which the reference encoder is a high-precision encoder.
[0094] like Figure 3 The embodiment of the present application takes the power-off count test as an example and may include the following steps:
[0095] S301: The host computer controls the second servo driver to supply power to the motor.
[0096] Before step S301, the method further includes: the first servo driver supplies power to the encoder under test, and the second servo driver supplies power to the high-precision encoder.
[0097] S302: The host computer obtains pre-test data of the encoder under test in the first servo driver.
[0098] The pre-test data is used to indicate the value of the instruction for controlling the motor to run to a specific position sent by the host computer to the second servo driver in step S304.
[0099] S303: The host computer turns off the power supply of the first servo driver to the encoder under test.
[0100] S304: The host computer sends an instruction to the second servo driver to control the motor to run to a specific position.
[0101] S305: The host computer restores the power supply of the first servo driver to the encoder under test, and obtains first feedback data of the encoder under test.
[0102] S306: The host computer obtains a test result based on the first feedback data and the second feedback data.
[0103] S307: If the test result is accurate, execute step S308; if the test result is inaccurate, the encoder under test fails and the test ends.
[0104] If the test result is accurate, the next step is executed. If the test result is inaccurate, the encoder under test fails and the test ends.
[0105] S308: The host computer determines whether all instructions have been issued. If so, the encoder under test is normal and the test ends. If not, continue to execute step S303.
[0106] If not all instructions are issued, the power-off count test will continue.
[0107] according to Figure 3 The flow chart implements a power-off counting test on the encoder under test.
[0108] like Figure 4 As shown, it is a flow chart of another automatic encoder testing method provided in an embodiment of the present application. Taking the rotation speed test as an example, the present embodiment of the present application may include the following steps:
[0109] S401: The host computer sends an instruction for switching the speed control mode to the first servo driver, so that the first servo driver switches to the speed control mode.
[0110] Before step S401, the method further includes: controlling the first servo driver to supply power to the encoder under test, and controlling the second servo driver to supply power to the high-precision encoder.
[0111] After step S401, the method further includes: controlling the first servo driver to supply power to the motor.
[0112] S402: The host computer issues a speed instruction of a specific waveform, and gradually adjusts the PI control parameters and filter cutoff frequency of the first servo driver according to the acquired feedback data of the first servo driver.
[0113] S403: The host computer determines whether the first servo driver has achieved the current optimal control effect. If so, proceed to step S404; if not, return to step S402.
[0114] If the first servo drive achieves the current optimal control effect, it proves that the next speed test can be performed. If the first servo drive does not achieve the current optimal control effect, return to step S402, and the host computer adjusts the PI control parameters and filter cutoff frequency of the first servo drive until the first servo drive achieves the optimal control effect.
[0115] S404: The host computer issues a speed instruction.
[0116] The speed instruction is used to indicate the speed of the motor.
[0117] S405: The host computer determines whether the motor runs stably at the target speed. If so, proceed to step S407; if not, wait until the motor runs stably at the target speed.
[0118] Smooth operation at the target speed means that the deviation between the first feedback speed value of the measured encoder and the command speed is less than a predetermined threshold. If it is less than the predetermined threshold, it can be regarded that the measured encoder has reached the target speed and the next step can be carried out. If it is not less than the predetermined threshold, wait until the motor target speed runs smoothly.
[0119] S406: The host computer obtains a first feedback rotation speed value of the encoder under test and a second feedback rotation speed value of the high-precision encoder within a period of time.
[0120] S407: The host computer determines whether all speed instructions have been issued. If so, it proceeds to step S408; if not, it returns to step S404 and continues to issue the next speed instruction.
[0121] S408: The host computer records the first feedback rotation speed value of the encoder under test and the second feedback rotation speed value of the high-precision encoder, and stops the first servo driver from supplying power to the motor.
[0122] according to Figure 4The flowchart of the present application embodiment realizes the setting of the speed control parameter without manual operation, which reduces the technical requirements of the operator. In addition, the second feedback speed value is regarded as the actual speed of the motor after analysis, and the deviation of the actual speed of the motor from the target speed is used to evaluate the speed stability of the servo system where the first servo driver is located.
[0123] like Figure 5 As shown, it is a flow chart of another method for automatically testing encoders provided in an embodiment of the present application. The embodiment of the present application takes the position test as an example. It should be noted that the encoder under test first performs a speed test and then a position test. Compared with the speed test, the position test instruction is issued by the host computer in the embodiment of the present application. The other processes are roughly similar to the speed test and may include:
[0124] S501: The host computer sends an instruction for switching the position control mode to the first servo driver, so that the first servo driver switches to the position control mode.
[0125] Before step S501, the method further includes: controlling the first servo driver to supply power to the encoder under test, and controlling the second servo driver to supply power to the high-precision encoder.
[0126] After step S501, the method further includes: controlling the first servo driver to supply power to the motor.
[0127] S502: The host computer issues a position instruction of a specific waveform, and gradually adjusts the PI control parameters and the filter cutoff frequency of the first servo driver according to the acquired feedback data of the first servo driver.
[0128] S503: The host computer determines whether the first servo driver has achieved the current optimal control effect. If so, proceed to step S504; if not, return to step S502.
[0129] S504: The host computer issues a position instruction.
[0130] The position command is used to indicate the target position that the motor is to reach.
[0131] S505: The host computer determines whether the motor has reached the command position. If so, it proceeds to step S506; if not, it waits until the motor reaches the command position.
[0132] S506: The host computer obtains a first feedback reading of the encoder under test and a second feedback reading of the high-precision encoder.
[0133] After step S506, the method further includes: the host computer interprets the first feedback reading and the second feedback reading into position information of the motor and saves the information.
[0134] S507: The host computer determines whether all position instructions have been issued. If so, proceed to step S508. If not, return to step S504 and continue to perform position testing on the encoder under test until the host computer issues all position instructions.
[0135] S508: The host computer records the first feedback reading of the encoder under test and the second feedback reading of the high-precision encoder, and stops the first servo driver from supplying power to the motor.
[0136] according to Figure 5 The flow chart, the embodiment of the present application also realizes the setting of the position control parameters without manual operation, which reduces the requirements on the technical level of the operator. In addition, the second feedback reading is regarded as the actual position of the motor after analysis, and the deviation of the actual position of the motor from the target position is used to evaluate the repeatability of the servo system where the first servo drive is located.
[0137] See also Figure 6 The embodiment of the present application further provides an automated test encoder device 600. The automated test encoder device 600 may include:
[0138] A first control unit 601, configured to control the encoder under test to power on in response to a first test instruction sent by a host computer, wherein the first test instruction includes first target data, and the first target data is used to indicate a test of the encoder under test;
[0139] The sending unit 602 is used to send the first feedback data to the host computer, so that the host computer obtains the test result of the encoder under test based on the comparative analysis of the first feedback data and the second feedback data, the first feedback data represents the reading of the encoder under test when the motor reaches the first target data, the second feedback data represents the reading of the reference encoder when the motor reaches the first target data, the motor is connected to the encoder under test and the reference encoder, the reference encoder is connected to a second servo drive, and the second feedback data is the data sent to the host computer by the second servo drive.
[0140] Optionally, the first target data includes indication data of a power-off count test, and the device 600 further includes:
[0141] a second control unit, configured to control the encoder under test to power off based on a second control signal corresponding to the first target data;
[0142] A recovery unit is used for, in response to determining that the motor is running at a second target position, restoring power to the encoder under test and obtaining the first feedback data, wherein the first feedback data represents a reading of the encoder under test when the motor reaches the second target position in a power-off count test, and the second target position is used to indicate a test condition for a power-off count test of the encoder under test.
[0143] Optionally,
[0144] If the first feedback data and the second feedback data do not match, the test result indicates that the encoder under test has failed;
[0145] If the first feedback data and the second feedback data match, the test result indicates that the encoder under test functions normally.
[0146] Optionally, the first feedback data and the second feedback data match, including: the first feedback data is consistent with the record of the number of revolutions of the motor during the period when the encoder under test is powered off.
[0147] Optionally, the device 600 further includes:
[0148] A receiving unit, used for receiving an adjustment instruction sent by a host computer, wherein the adjustment instruction is used for instructing to modify a control parameter of the first servo driver;
[0149] The third control unit is used to control the first servo driver to correct the corresponding control parameters based on the third control signal corresponding to the adjustment instruction, so that the servo system where the corrected first servo driver is located completes the corresponding test.
[0150] Optionally, the control parameters include speed control parameters and / or position control parameters.
[0151] Optionally, the first target data includes a first target rotation speed.
[0152] Optionally, the first target data includes a first target position.
[0153] Optionally, the servo system in which the first servo driver is located is a servo system that performs a rotation speed test.
[0154] Optionally, the test result is used to indicate whether a difference between the first feedback data and the second feedback data is within a preset range.
[0155] In addition, the present application embodiment also provides an electronic device 700, such as Figure 7 As shown, the electronic device 700 includes a processor 701 and a memory 702:
[0156] The memory 702 is used to store computer programs;
[0157] The processor 701 is used to execute according to the computer program Figure 2 The method provided.
[0158] In addition, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method provided by the embodiment of the present application.
[0159] Through the description of the above implementation methods, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in each embodiment of the present application or some parts of the embodiments.
[0160] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is only schematic, in which the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the goals of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0161] The above is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. It should be noted that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the present application, and these improvements and modifications should also be regarded as the protection scope of the present application.
Claims
1. A method for automatically testing an encoder, characterized in that: Applied to a first servo driver, the first servo driver is connected to an encoder under test, the method comprising: In response to a first test instruction sent by a host computer, the encoder under test is controlled to be powered on, wherein the first test instruction includes first target data, and the first target data is used to indicate a test of the encoder under test; the first target data includes indication data of a power-off count test; Based on a second control signal corresponding to the first target data, controlling the encoder under test to power off; In response to determining that the motor is running at a second target position, power supply to the encoder under test is restored, and first feedback data is obtained, wherein the first feedback data represents a reading of the encoder under test when the motor reaches the second target position in a power-off count test, and the second target position is used to indicate a test condition of a power-off count test on the encoder under test; The first feedback data is sent to the host computer so that the host computer obtains the test result of the encoder under test based on the comparative analysis of the first feedback data and the second feedback data, the first feedback data represents the reading of the encoder under test when the motor reaches the first target data, the second feedback data represents the reading of the reference encoder when the motor reaches the first target data, the motor is connected to the encoder under test and the reference encoder, the reference encoder is connected to a second servo drive, and the second feedback data is the data sent to the host computer by the second servo drive.
2. The method according to claim 1, characterized in that If the first feedback data and the second feedback data do not match, the test result indicates that the encoder under test has failed; If the first feedback data and the second feedback data match, the test result indicates that the encoder under test functions normally.
3. The method according to claim 1, characterized in that The method further comprises: Receiving an adjustment instruction sent by a host computer, wherein the adjustment instruction is used to instruct to modify a control parameter of the first servo driver; Based on the third control signal corresponding to the adjustment instruction, the first servo driver is controlled to correct the corresponding control parameter, so that the servo system where the corrected first servo driver is located completes the corresponding test.
4. The method according to claim 3, characterized in that The control parameters include speed control parameters and / or position control parameters.
5. The method according to claim 1, characterized in that The first target data includes a first target rotation speed.
6. The method according to claim 1, characterized in that The first target data includes a first target position.
7. The method according to claim 6, characterized in that The servo system where the first servo driver is located is a servo system that completes a rotation speed test.
8. A system for automatically testing an encoder, characterized in that: include: A host computer, a motor, an encoder under test, a reference encoder, a first servo driver and a second servo driver, wherein the host computer is connected to the first servo driver and the second servo driver, the first servo driver is connected to the encoder under test, the second servo driver is connected to the reference encoder, and the encoder under test and the reference encoder are both connected to the motor, wherein: The first servo driver is used to receive a first test instruction sent by the host computer, control the encoder under test to power on based on the first test instruction, and send first feedback data to the host computer, the first feedback data represents the reading of the encoder under test when the motor reaches a first target data, the first test instruction includes the first target data, and the first target data is used to indicate a test of the encoder under test; The second servo driver is used to send second feedback data to the host computer, wherein the second feedback data represents a reading of the reference encoder when the motor reaches the first target data; The host computer is used to compare and analyze the first feedback data and the second feedback data to obtain a test result; A first power supply circuit is provided between the first servo driver and the encoder under test, and a second power supply circuit is provided between the second servo driver and the reference encoder. The host computer is further used to send a first power supply instruction to the first servo driver and send a second power supply instruction to the second servo driver; The first servo driver is further used to control the connection or disconnection of the first power supply circuit according to the first power supply instruction, the connection of the first power supply circuit corresponds to the power-on of the encoder under test, and the disconnection of the first power supply circuit corresponds to the power-off of the encoder under test; The second servo driver is also used to control the connection or disconnection of the second power supply circuit according to the second power supply instruction, the connection of the second power supply circuit corresponds to the power-on of the reference encoder, and the disconnection of the second power supply circuit corresponds to the power-off of the reference encoder.
Citation Information
Patent Citations
AC servo system
CN112865614A
Encoder automatic test system and method
CN114910110A