Motor production test method, electronic equipment, motor and sensor

By generating self-calibration compensation data for the encoder, the optical coupler signal and the physical deviation of the encoder are corrected, which solves the problem of tooth width calculation deviation caused by changes in the reflectivity of the motor encoder and improves the accuracy and stability of the motor's sensor-controlled closed loop.

CN121899644APending Publication Date: 2026-04-21SZ ZHUOYU TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SZ ZHUOYU TECH CO LTD
Filing Date
2026-01-20
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

The existing method of calibrating the motor encoder based on a preset optocoupler voltage test range is prone to tooth width calculation deviation when the reflectivity of the motor encoder changes, which affects the accuracy of the motor's sensing closed-loop control.

Method used

By acquiring the actual encoder data of the target motor and the preset theoretical encoder data, encoder self-calibration compensation data is generated to correct the optical coupler signal and encoder physical deviation, and the real-time acquired encoder data is dynamically corrected during the sensing closed-loop control process.

Benefits of technology

This improves the accuracy of encoder data acquisition, thereby enhancing the precision, stability, and robustness of the motor's sensor-controlled closed-loop control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121899644A_ABST
    Figure CN121899644A_ABST
Patent Text Reader

Abstract

The invention provides a motor production test method, electronic equipment, a motor and a sensor, and relates to the technical field of motors. According to the motor production test method, an optocoupler voltage calibration compensation mode is adopted, code disc self-calibration compensation data is generated based on real code disc data and preset theoretical code disc data collected by a target motor in a non-inductive dragging mode, and in the inductive closed-loop control process of the target motor, the code disc self-calibration compensation data is calculated. The code disc data collected in real time is dynamically corrected according to the code disc self-calibration compensation data, the collection accuracy of the code disc data is improved, and then the inductive closed-loop control precision, stability and robustness of the target motor are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of motor technology, and in particular to a method for testing motor production, electronic equipment, motor, and sensor. Background Technology

[0002] In the manufacturing of high-precision optical equipment such as lidar, the rotating mirror motor, as a core moving component, directly determines the detection accuracy and long-term operational reliability of the equipment through its precision and stability. Taking a lidar product as an example, its rotating mirror motor achieves high-precision speed closed-loop and position control through 128 pairs of toothed encoders (including 1 pair of zero-position teeth and 127 pairs of ordinary teeth). During the production process, the motor needs to complete key steps such as self-calibration, functional testing, and measurement of the dihedral angle and perpendicular angle of the rotating mirror to ensure the robustness of the motor's operation under complex working conditions.

[0003] In related technologies, motor production testing primarily relies on the LiDAR function library interface to achieve motor initialization, mode configuration, speed closed-loop control, and data acquisition. Simultaneously, a dihedral angle measuring instrument is used to acquire mirror angle data. Specifically, for the motor self-calibration process, motor encoder parameters are typically calibrated based on a preset optocoupler voltage test range (e.g., 1.1V-1.7V). Specifically, optocoupler sensors acquire motor encoder data (such as pulse width and time data corresponding to tooth width), using the theoretical pulse width and time derived from the encoder design as a reference benchmark. The average tooth width and pulse width and time are then calculated as the core parameters for the motor's sensed closed-loop control.

[0004] However, the above method of calibrating the motor encoder based on the preset optocoupler voltage test range is prone to tooth width calculation deviation when the reflectivity of the motor encoder changes, which in turn affects the accuracy of the motor's sensing closed-loop control. Summary of the Invention

[0005] This application provides a motor production testing method, electronic equipment, motor, and sensor to solve the problem in related technologies where motor encoder calibration based on a preset optocoupler voltage test range is prone to tooth width calculation deviation when the reflectivity of the motor encoder changes, thus affecting the accuracy of the motor's sensing closed-loop control.

[0006] In a first aspect, embodiments of this application provide a method for testing the production of an electric motor, comprising: acquiring actual encoder data and preset theoretical encoder data of a target motor, wherein the actual encoder data is encoder signal data obtained by an optocoupler sensor integrated on the target motor during the target motor's rotation of a preset number of revolutions in a sensorless drag mode; generating encoder self-calibration compensation data based on the actual encoder data and the preset theoretical encoder data, wherein the encoder self-calibration compensation data is used to correct optocoupler signal deviation and encoder physical deviation; loading the encoder self-calibration compensation data into the controller of the target motor, and dynamically correcting the real-time acquired encoder data based on the encoder self-calibration compensation data during the sensor-controlled closed-loop control process of the target motor.

[0007] In one possible implementation, the real encoder data includes the real pulse width time and real angle of each encoder scale in each revolution within a preset number of revolutions, and the preset theoretical encoder data includes the theoretical pulse width time and theoretical angle of each encoder scale. Based on the real encoder data and the preset theoretical encoder data, encoder self-calibration compensation data is generated, including: for each encoder scale, determining whether the encoder of the target motor needs to be intercepted based on the real angle of the encoder scale in each revolution; in response to the encoder not needing to be intercepted, calculating the pulse width time deviation for each revolution based on the real and theoretical pulse width times of the encoder scale in each revolution, and obtaining the target pulse width time deviation of the encoder scale within the preset number of revolutions based on the pulse width time deviation of each revolution; calculating the angle deviation for each revolution based on the real and theoretical angles of the encoder scale in each revolution, and obtaining the target angle deviation of the encoder scale within the preset number of revolutions based on the angle deviation of each revolution; and generating encoder self-calibration compensation data based on the target pulse width time deviation and target angle deviation of all encoder scales.

[0008] In one possible implementation, before acquiring the actual encoder data and the preset theoretical encoder data of the target motor, the motor production testing method further includes: controlling the target motor to start a preset number of times, acquiring the mechanical angle and electrical angle corresponding to each start; generating optocoupler initial bias compensation data based on the mechanical angle and electrical angle; loading the optocoupler initial bias compensation data into the controller, and dynamically correcting the optocoupler initial bias based on the optocoupler initial bias compensation data during the sensor-controlled closed-loop control process of the target motor.

[0009] In one possible implementation, after loading the initial bias compensation data of the optocoupler and the self-calibration compensation data of the encoder into the controller, the motor production test method further includes: using at least two different preset speeds, controlling the target motor to perform sensed closed-loop operation, and obtaining the speed deviation corresponding to each preset speed, which includes the average speed deviation and the maximum speed deviation; and verifying whether the sensed closed-loop control performance of the target motor meets the preset requirements based on the speed deviations under all preset speeds.

[0010] In one possible implementation, during the sensing closed-loop control process of the target motor, the motor production testing method further includes: after the target motor is running stably, collecting multidimensional vibration data of the target motor within a preset sampling time based on a preset sampling frequency, the multidimensional vibration data including the vibration frequency and vibration acceleration amplitude of each dimension; and screening whether the target motor belongs to a vibration abnormality component based on the multidimensional vibration data and a preset amplitude threshold.

[0011] In one possible implementation, during the process of the target motor rotating a preset number of revolutions in a sensorless driving mode, the motor production test method further includes: real-time acquisition of the temperature of the Field-Programmable Gate Array (FPGA) and the temperature of the motor board; calculation of the temperature difference between the FPGA temperature and the motor board temperature; and triggering an abnormal alarm and controlling the target motor to stop rotating in response to the temperature difference not being within a preset threshold range.

[0012] In one possible implementation, the motor production testing method further includes: automatically testing the dihedral angle and perpendicular angle of the target rotating mirror based on a preset communication protocol and preset data query instructions, wherein the target rotating mirror is integrated on the target motor after self-calibration.

[0013] Secondly, embodiments of this application provide a motor production testing device, comprising:

[0014] The acquisition module is used to acquire the actual encoder data and the preset theoretical encoder data of the target motor. The actual encoder data is the encoder signal data obtained by the optocoupler sensor integrated on the target motor during the target motor rotating a preset number of times in a sensorless dragging mode.

[0015] The generation module is used to generate code disk self-calibration compensation data based on real code disk data and preset theoretical code disk data. This code disk self-calibration compensation data is used to correct optical coupler signal deviation and code disk physical deviation.

[0016] The correction module is used to load the encoder self-calibration compensation data into the controller of the target motor, and dynamically correct the real-time collected encoder data according to the encoder self-calibration compensation data during the sensor-controlled closed-loop control process of the target motor.

[0017] In one possible implementation, the real encoder data includes the real pulse width time and real angle of each encoder scale in each revolution within a preset number of revolutions, and the preset theoretical encoder data includes the theoretical pulse width time and theoretical angle of each encoder scale. The generation module is specifically used for: determining whether the encoder of the target motor needs to be intercepted for each encoder scale based on the real angle of the encoder scale in each revolution; in response to the encoder not needing interception, calculating the pulse width time deviation for each revolution based on the real and theoretical pulse width times of the encoder scale in each revolution, and obtaining the target pulse width time deviation of the encoder scale within the preset number of revolutions based on the pulse width time deviation of each revolution; calculating the angle deviation for each revolution based on the real and theoretical angles of the encoder scale in each revolution, and obtaining the target angle deviation of the encoder scale within the preset number of revolutions based on the angle deviation of each revolution; and generating encoder self-calibration compensation data based on the target pulse width time deviation and target angle deviation of all encoder scales.

[0018] In one possible implementation, before acquiring the actual encoder data and the preset theoretical encoder data of the target motor, the acquisition module is further used to control the target motor to start a preset number of times and acquire the mechanical angle and electrical angle corresponding to each start; the generation module is further used to generate optocoupler initial bias compensation data based on the mechanical angle and electrical angle; the correction module is further used to load the optocoupler initial bias compensation data into the controller and dynamically correct the optocoupler initial bias based on the optocoupler initial bias compensation data during the sensor-controlled closed-loop control process of the target motor.

[0019] In one possible implementation, after loading the initial bias compensation data of the optocoupler and the self-calibration compensation data of the encoder into the controller, the motor production testing device also includes a verification module (not shown). This verification module is used to: control the target motor to perform sensed closed-loop operation using at least two different preset speeds, and obtain the speed deviation corresponding to each preset speed, including the average speed deviation and the maximum speed deviation; and verify whether the sensed closed-loop control performance of the target motor meets the preset requirements based on the speed deviations under all preset speeds.

[0020] In one possible implementation, during the sensing closed-loop control process of the target motor, the motor production testing device further includes a screening module (not shown). This screening module is used to: after the target motor is running stably, collect multidimensional vibration data of the target motor within a preset sampling time based on a preset sampling frequency. The multidimensional vibration data includes the vibration frequency and vibration acceleration amplitude of each dimension; and screen whether the target motor belongs to a vibration abnormality component based on the multidimensional vibration data and a preset amplitude threshold.

[0021] In one possible implementation, during the process of the target motor rotating a preset number of revolutions in a sensorless drag mode, the motor production testing device also includes a detection module (not shown). This detection module: collects the FPGA temperature and the motor board temperature in real time; calculates the temperature difference between the FPGA temperature and the motor board temperature; and triggers an abnormal alarm and controls the target motor to stop rotating in response to the temperature difference not being within a preset threshold range.

[0022] In one possible implementation, the motor production testing device further includes a testing module (not shown) for automatically testing the dihedral angle and perpendicular angle of the target rotating mirror based on a preset communication protocol and preset data query instructions. The target rotating mirror is integrated on the target motor after self-calibration.

[0023] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;

[0024] The memory stores the instructions that the computer executes;

[0025] The processor executes computer execution instructions stored in memory to implement the motor production testing method provided in the first aspect above.

[0026] Fourthly, this application provides a motor, which includes an encoder and a controller. The controller is communicatively connected to the encoder and has built-in encoder self-calibration compensation data obtained using the motor production testing method provided in the first aspect above. The controller is used to dynamically correct the real-time collected encoder data based on the encoder self-calibration compensation data.

[0027] Fifthly, this application provides a sensor including a motor as described in the fourth aspect above.

[0028] In a sixth aspect, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the motor production testing method provided in the first aspect above.

[0029] In a seventh aspect, this application provides a computer program product, including a computer program that, when executed by a processor, implements the motor production testing method provided in the first aspect above.

[0030] The motor production testing method, electronic equipment, motor, and sensor provided in this application acquire real encoder data and preset theoretical encoder data of the target motor, and generate encoder self-calibration compensation data based on the real encoder data and preset theoretical encoder data. The encoder self-calibration compensation data is then loaded into the controller of the target motor to dynamically correct the real-time acquired encoder data during the sensor-driven closed-loop control process of the target motor. The real encoder data is the encoder signal data obtained from the optocoupler sensor integrated on the target motor during the target motor's rotation of a preset number of revolutions under sensorless drag. The encoder self-calibration compensation data is used to correct optocoupler signal deviation and encoder physical deviation. This application employs an optocoupler voltage calibration compensation method. By generating encoder self-calibration compensation data based on real encoder data collected from the target motor under sensorless drive mode and preset theoretical encoder data, the encoder self-calibration compensation data is dynamically corrected in the sensor-controlled closed-loop control process of the target motor according to the encoder self-calibration compensation data. This improves the accuracy of encoder data acquisition and thus enhances the precision, stability, and robustness of the sensor-controlled closed-loop control of the target motor. Attached Figure Description

[0031] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0032] Figure 1 This is a schematic diagram of the structure of the motor production and testing system provided in the embodiments of this application;

[0033] Figure 2 A flowchart illustrating the motor production testing method provided in this application embodiment. Figure 1 ;

[0034] Figure 3 A flowchart illustrating the motor production testing method provided in this application embodiment. Figure 2 ;

[0035] Figure 4 This is a schematic diagram of the structure of the motor production testing device provided in the embodiments of this application;

[0036] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0037] The accompanying drawings have illustrated specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to specific embodiments. Detailed Implementation

[0038] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0039] Based on the technical problems existing in related technologies, the embodiments of this application adopt an optocoupler voltage calibration compensation method. By generating encoder self-calibration compensation data based on the real encoder data collected by the target motor in the sensorless drive mode and the preset theoretical encoder data, the encoder self-calibration compensation data is generated. During the sensory closed-loop control of the target motor, the real-time collected encoder data is dynamically corrected according to the encoder self-calibration compensation data, thereby improving the accuracy of encoder data collection and thus improving the precision, stability and robustness of the sensory closed-loop control of the target motor.

[0040] The application scenarios of the embodiments of this application will be described below first.

[0041] The motor production testing method provided in this application is applicable to the production process of equipment such as lidar that relies on high-precision motors, and is specifically applicable to the production testing scenario of motors (such as rotating mirror motors) in lidar systems.

[0042] The following is a combination of... Figure 1 The motor production and testing system provided in the embodiments of this application will be described in detail.

[0043] Figure 1 This is a schematic diagram of the structure of the motor production and testing system provided in an embodiment of this application. Figure 1 As shown, the motor production testing system includes a host computer, a signal adapter board, a test board, fixtures, an accelerometer, a data acquisition card, and a programmable power supply. The signal adapter board is equipped with at least one radar connection interface for connecting to a radar.

[0044] The host computer is used to issue test commands, receive motor operation data sent by the data acquisition card, and analyze the test results of the received operation data; the signal adapter board is used to transmit test commands, that is, to be responsible for communication between the host computer and the test board. The test board is used to control the power supply and operation of the motor based on the received test commands; the fixture is used to hold the motor; the accelerometer and the data acquisition card are used to collect the motor operation data (such as speed, encoder data, and vibration data) and feed the operation data back to the host computer.

[0045] like Figure 1As shown, in this motor production testing system, the host computer sends test commands (such as controlling the motor to rotate at 200 rpm) to the signal adapter board (communication equipment). After receiving the test commands from the host computer, the signal adapter board forwards the test commands to the auxiliary test board. After receiving the test commands, the auxiliary test board parses the test commands and converts them into corresponding drive parameters. Then, it controls the programmable power supply to provide stable power to the motor and outputs drive signals to make the motor run according to the test commands. During the motor rotation, the motor's operating data can be collected in real time through the accelerometer and data acquisition card, and the operating data is fed back to the host computer, which then performs data analysis and determines the test results.

[0046] For example, in one possible implementation, the circuit board of a motor product (e.g., the motor drive circuit board of a LiDAR product) can be directly used as a... Figure 1 The test board shown is part of a motor production testing system. On one hand, it ensures that the testing environment for motor production testing is consistent with the actual operating scenario of the motor product, effectively improving the accuracy of the test results; on the other hand, it eliminates the need for an additional test board, saving testing costs.

[0047] The following is based on the above. Figure 1 The motor production and testing system shown, or the host computer within that system, serves as the execution entity. Specific embodiments are used to describe the technical solution of this application and how it solves the aforementioned technical problems. The following specific embodiments can be combined with each other; similar or identical concepts or processes may not be repeated in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0048] Figure 2 A flowchart illustrating the motor production testing method provided in this application embodiment. Figure 1 .like Figure 2 As shown, a specific implementation of this motor production testing method may include the following steps:

[0049] S201, acquire the actual encoder data and the preset theoretical encoder data of the target motor. The actual encoder data is the encoder signal data obtained by the optocoupler sensor integrated on the target motor during the process of the target motor rotating a preset number of revolutions in a sensorless dragging mode.

[0050] Understandably, sensorless motor drive refers to removing position or speed sensors (such as encoders, Hall sensors, etc.) from the motor shaft. Based on the motor's mathematical model and dedicated observation algorithms, it calculates the real-time position and speed of the motor rotor by detecting electrical signals such as voltage and current in the motor windings, thereby achieving precise speed and torque control. This is equivalent to equipping the motor with "electronic eyes," allowing it to sense the motor rotor's state without physical sensors.

[0051] For example, the target motor can adopt a 128-pair code disk design, which includes 1 pair of zero-position teeth (1 white tooth and 1 black tooth) and 127 pairs of ordinary teeth (127 white teeth and 127 black teeth), that is, the total number of tooth position numbers of the code disk of the target motor is 256.

[0052] For example, the preset theoretical code disk data may include the known theoretical angle of each code disk scale in the code disk design, and the theoretical pulse width time of each code disk scale calculated based on the theoretical angle of each code disk scale.

[0053] For example, the theoretical angle of each code wheel scale can be expressed by the following formula:

[0054]

[0055] in, This represents the theoretical angle of each graduation on the code wheel. This indicates the encoder resolution of the target motor.

[0056] For example, the theoretical pulse width time for each code wheel scale can be expressed by the following formula:

[0057]

[0058] in, This represents the theoretical pulse width time for each code mark. This represents the angular velocity of the target motor.

[0059] For example, the real code disk data includes the real pulse width time of each code disk scale within a preset number of revolutions, and the real angle based on each code disk scale within a preset number of revolutions.

[0060] For example, the preset number of revolutions can be 50. This application does not limit the preset number of revolutions; it can be determined based on actual application requirements.

[0061] In this step, one possible implementation is as follows: control the target motor to rotate a preset number of revolutions at a working speed (e.g., 200 rpm) by using a pulse width modulation (PWM) signal. During the rotation, the actual pulse width time corresponding to the encoder scale in each revolution is collected in real time by an optocoupler sensor integrated on the target motor. Based on the actual pulse width time corresponding to the encoder scale in each revolution, the actual angle corresponding to the encoder scale in each revolution is calculated to obtain the actual encoder data.

[0062] S202 generates self-calibration compensation data for the code disk based on the actual code disk data and the preset theoretical code disk data.

[0063] Among them, the code disk self-calibration compensation data is used to correct the optical coupler signal deviation and the code disk physical deviation.

[0064] For example, the encoder self-calibration compensation data may include angle compensation data and pulse width time compensation data.

[0065] For example, pulse width time compensation data is generated based on the actual pulse width time and the theoretical pulse width time, and angle compensation data is generated based on the actual angle and the theoretical angle.

[0066] Optionally, this step may include the following steps:

[0067] S2021 determines whether the code disk of the target motor needs to be intercepted based on the actual angle of the code disk scale in each revolution for each code disk graduation.

[0068] For example, one possible implementation could be:

[0069] 1) For each encoder scale, determine whether the actual angle of the zero-position encoder scale (0, 255) is within the preset 50% zero-position defect interception threshold, and whether the actual angle of the non-zero-position encoder scale (1-254) is within the preset 50% non-zero-position defect interception threshold. If at least one zero-position encoder scale has an actual angle that is not within the preset 50% zero-position defect interception threshold, or at least one non-zero-position encoder scale has an actual angle that is not within the preset 50% non-zero-position defect interception threshold, then the encoder of the target motor is intercepted. If the actual angles of all zero-position encoder scales are within the preset 50% zero-position defect interception threshold, and the actual angles of all non-zero-position encoder scales are within the preset 50% non-zero-position defect interception threshold, then the encoder of the target motor is not intercepted, and the following step 2) is executed.

[0070] 2) Count the number of encoder scales whose actual angles of non-zero position encoder scales (1-254) are not within the preset non-zero position reminder threshold range, and the number of encoder scales whose actual angles of zero position encoder scales (0, 255) are not within the preset zero position reminder threshold range. If the number of encoder scales whose actual angles of non-zero position encoder scales (1-254) are not within the preset non-zero position reminder threshold range is greater than or equal to the first preset threshold and less than the second preset threshold, and the number of encoder scales whose actual angles of zero position encoder scales (0, 255) are not within the preset zero position reminder threshold range is equal to 0, then the encoder of the target motor is not intercepted, and the corresponding non-zero position encoder scale is recorded for later use. The user is reminded that if the number of encoder scales whose actual angles of the non-zero tooth encoder scales (1-254) are not within the preset non-zero tooth reminder threshold is less than the first preset threshold, and the number of encoder scales whose actual angles of the zero tooth encoder scales (0, 255) are not within the preset zero tooth reminder threshold is equal to 0, then the encoder of the target motor will not be blocked; if the number of encoder scales whose actual angles of the non-zero tooth encoder scales (1-254) are not within the preset non-zero tooth reminder threshold is greater than or equal to the second preset threshold, or the number of encoder scales whose actual angles of the zero tooth encoder scales (0, 255) are not within the preset zero tooth reminder threshold is greater than 0, then the encoder of the target motor will be blocked.

[0071] For example, the upper and lower limits of the preset 50% zero-position tooth defect interception threshold range can be 0.5 times and 1.5 times the theoretical angle of 3.47° corresponding to the zero-position tooth encoder scale, respectively, i.e. [1.735°, 5.205°]; the upper and lower limits of the preset 50% non-zero-position tooth defect interception threshold range can be 0.5 times and 1.5 times the theoretical angle of 1.39° corresponding to the non-zero-position tooth encoder scale, respectively, i.e. [0.695°, 2.085°].

[0072] For example, the preset non-zero tooth reminder threshold range can be ±0.05° of the theoretical angle corresponding to the non-zero tooth encoder scale of 1.39°, i.e. [1.34°, 1.44°]; the preset zero tooth reminder threshold range can be ±0.1° of the theoretical angle corresponding to the zero tooth encoder scale of 3.47°, i.e. [3.37°, 3.57°].

[0073] For example, the first preset threshold can be 10, and the second preset threshold can be 20. This application embodiment does not limit the size of the first and second preset thresholds; they can be determined according to actual application requirements.

[0074] In other embodiments, step 2) may involve the following: if the number of encoder scales whose actual angles of the non-zero tooth encoder scales (1-254) are not within the preset non-zero tooth reminder threshold is less than a second preset threshold, and the number of encoder scales whose actual angles of the zero tooth encoder scales (0, 255) are not within the preset zero tooth reminder threshold is equal to 0, then the encoder of the target motor is not intercepted, and the corresponding non-zero tooth encoder scale is recorded for use in reminding the user; if the number of encoder scales whose actual angles of the non-zero tooth encoder scales (1-254) are not within the preset non-zero tooth reminder threshold is greater than or equal to the second preset threshold, or the number of encoder scales whose actual angles of the zero tooth encoder scales (0, 255) are not within the preset zero tooth reminder threshold is greater than 0, then the encoder of the target motor is intercepted.

[0075] In some embodiments, the order of steps 1) and 2) above can be reversed. First, the alert threshold range and quantity threshold in step 2) are used to confirm whether the target motor encoder is to be intercepted. Then, the encoders that have passed the screening in step 2) are screened again by the 50% defective interception threshold in step 1) to improve the accuracy of encoder calibration.

[0076] S2022, in response to the fact that the encoder does not need to be intercepted, calculates the pulse width time deviation for each revolution based on the actual pulse width time and theoretical pulse width time of the encoder scale for each revolution, and obtains the target pulse width time deviation of the encoder scale within a preset number of revolutions based on the pulse width time deviation for each revolution.

[0077] For example, in one possible implementation, the total time for the target motor to rotate one revolution is calculated based on the actual pulse width time of the encoder scale in each revolution; then, data whose total duration is not within the preset total duration range are removed to eliminate invalid pulse width data caused by the speed fluctuation of the target motor, thus obtaining the filtered actual pulse width time of the encoder scale in each revolution; finally, based on the filtered actual pulse width time and theoretical pulse width time of the encoder scale in each revolution, the pulse width time deviation of each revolution is calculated.

[0078] For example, when the target motor rotates a preset number of revolutions at 200 rpm, the theoretical total time for each revolution can be 0.3 seconds.

[0079] For example, the preset duration range can be [299850us, 300150us]. The preset duration range can be ±0.05% of the theoretical total duration of 0.3s.

[0080] For example, the target pulse width time deviation can be the average of all pulse width time deviations within a preset number of cycles.

[0081] S2023 calculates the angle deviation for each revolution based on the actual and theoretical angles of the code disk scale for each revolution, and obtains the target angle deviation of the code disk scale within a preset number of revolutions based on the angle deviation for each revolution.

[0082] For example, in one possible implementation, firstly, based on a preset angle requirement, the actual angle of the code disk scale in each revolution is filtered. The actual angle of the code disk scale in each revolution that meets the preset angle requirement is taken as the filtered actual angle of the code disk scale in each revolution. The angle deviation of each revolution is calculated based on the filtered actual angle and the theoretical angle of the code disk scale in each revolution. The angle deviations that are greater than the preset angle deviation threshold among all angle deviations within a preset number of revolutions are removed to obtain multiple filtered angle deviations. The average of the multiple filtered angle deviations is used to determine the target angle deviation.

[0083] For example, the actual angle of the encoder scale that does not meet the preset angle requirement is recorded in the log for each revolution, so as to support the traceability of the motor production and testing process, anomaly analysis, and optimization of the motor self-calibration scheme.

[0084] For example, the preset angle requirement can be that the actual angle of the code disk scale in each revolution must be within the range of 1.1 to 1.3 times its theoretical angle. For instance, the theoretical angle corresponding to the non-zero code disk scale (1-254) is 1.39°, and the range of the actual angle of the corresponding non-zero code disk scale (1-254) in each revolution can be [1.529°, 1.807°]; the theoretical angle corresponding to the zero code disk scale (0, 255) is 3.47°, and the range of the actual angle of the corresponding zero code disk scale (0, 255) in each revolution can be [3.818°, 4.511°]. For example, the preset angle deviation threshold can be 0.08°. This application embodiment does not limit the size of the preset angle deviation threshold; it can be determined according to the actual application requirements.

[0085] Optionally, in the motor production testing method provided in this application embodiment, the number of angle deviations greater than a preset angle deviation threshold is counted among all angle deviations within a preset number of revolutions. If the number is greater than a preset number (e.g., 10), the target motor is marked as a defective part, and the production testing of the target motor is stopped, so as to ensure the accuracy of the motor and improve the testing efficiency.

[0086] It should be noted that there is no specific order between steps S2022 and S2023.

[0087] S2024 generates code disk self-calibration compensation data based on the target pulse width time deviation and target angle deviation of all code disk scales.

[0088] For example, the set consisting of the target pulse width time deviation and the target angle deviation is determined as the code disk self-calibration compensation data.

[0089] S203 loads the encoder self-calibration compensation data into the controller of the target motor, and dynamically corrects the real-time collected encoder data based on the encoder self-calibration compensation data during the sensor-controlled closed-loop control process of the target motor.

[0090] One possible implementation of this step is to store the encoder self-calibration compensation data in a preset format file (such as CSV format) in the controller's non-volatile memory chip (such as Flash). During the sensing closed-loop control of the target motor, the high-speed processing chip (such as FPGA) in the controller reads the preset format file from the memory chip, parses the encoder self-calibration compensation data, and caches it in the on-chip storage unit. This allows the encoder data to be dynamically corrected based on the encoder self-calibration compensation data each time it is collected during the sensing closed-loop control of the target motor.

[0091] In this embodiment, an optocoupler voltage calibration compensation method is adopted. By generating encoder self-calibration compensation data based on the real encoder data collected by the target motor in the sensorless drive mode and the preset theoretical encoder data, the encoder self-calibration compensation data is generated. During the sensor-controlled closed-loop control of the target motor, the real-time collected encoder data is dynamically corrected according to the encoder self-calibration compensation data, thereby improving the accuracy of encoder data acquisition and thus improving the accuracy, stability and robustness of the sensor-controlled closed-loop control of the target motor.

[0092] Optionally, in the motor production testing method provided in this application embodiment, before performing encoder self-calibration on the target motor, it further includes calibrating the initial bias of the optocoupler of the target motor. The following is in conjunction with... Figure 3 This application provides a detailed description of a specific implementation of the calibration of the initial bias of the optocoupler for the target motor.

[0093] Figure 3 A flowchart illustrating the motor production testing method provided in this application embodiment. Figure 2 .like Figure 3 As shown, in this motor production testing method, before obtaining the actual encoder data and the preset theoretical encoder data of the target motor, the initial bias of the optocoupler is calibrated. The specific implementation method may include the following steps:

[0094] S301 controls the target motor to start a preset number of times and obtains the mechanical angle and electrical angle corresponding to each start.

[0095] For example, the mechanical angle can be the physical rotation angle of the motor rotor during the rotation of the target motor, that is, the angle of the encoder disk rotation, and the electrical angle can be the electrical periodic angle of the motor rotor during the rotation of the target motor, that is, the periodic angle of the magnetic field formed by the interaction between the stator winding and the rotor magnetic pole (which is calculated by converting the mechanical angle and the number of motor pole pairs).

[0096] For example, the preset number of times can be 3. This application embodiment does not limit this, and the specific number can be determined according to the actual application requirements.

[0097] One possible implementation method for this step is to use a contactless dragging method to control the target motor to start a preset number of times, and after each start, control the target motor to rotate a preset number of revolutions, and collect the mechanical angle and electrical angle corresponding to each start.

[0098] S302 generates initial bias compensation data for the optocoupler based on the mechanical and electrical angles.

[0099] For example, one possible implementation is as follows: First, calculate the difference between the mechanical angle and the electrical angle for each start-up. Then, determine whether the difference for each start-up exceeds the preset difference range. If the difference for at least one start-up exceeds the preset difference range, the target motor self-calibration is determined to have failed. If the difference for a preset number of starts (e.g., 3 times) does not exceed the preset difference range, calculate the average of all differences and determine the average as the initial bias compensation data for the optocoupler.

[0100] For example, the preset difference range can be [n 0.785 0.92, n 0.785 [1.08], where n is an integer. This application does not limit the value of n; it can be determined based on actual application requirements.

[0101] S303 loads the initial bias compensation data of the optocoupler into the controller, and dynamically corrects the real-time collected encoder data based on the encoder self-calibration compensation data during the sensing closed-loop control process of the target motor, and dynamically corrects the initial bias of the optocoupler based on the initial bias compensation data of the optocoupler.

[0102] One possible implementation of this step is as follows: the initial bias compensation data of the optocoupler and the self-calibration compensation data of the encoder disk are stored in a non-volatile memory chip (such as Flash) of the controller in a preset format file (such as CSV format). During the sensing closed-loop control of the target motor, the high-speed processing chip (such as FPGA) in the controller reads the preset format file from the memory chip, parses out the initial bias compensation data of the optocoupler and the self-calibration compensation data of the encoder disk, and caches it in the on-chip storage unit. So that during the sensing closed-loop control of the target motor, each time the encoder disk data and optocoupler signal are collected, the real-time collected encoder disk data is dynamically corrected based on the self-calibration compensation data of the encoder disk, and the initial bias of the optocoupler is dynamically corrected based on the initial bias compensation data of the optocoupler.

[0103] In this embodiment, after loading the encoder self-calibration compensation data into the controller of the target motor, the mechanical angle and electrical angle corresponding to each start are obtained by controlling the target motor to start a preset number of times. Based on the mechanical angle and electrical angle, the initial bias compensation data of the optocoupler is generated. The initial bias compensation data of the optocoupler is further loaded into the controller. During the sensing closed-loop control of the target motor, the real-time collected encoder data is dynamically corrected based on the encoder self-calibration compensation data, and the initial bias of the optocoupler is dynamically corrected based on the initial bias compensation data of the optocoupler. This improves the accuracy of the acquisition of encoder data and optocoupler signals, thereby improving the accuracy, stability and robustness of the sensing closed-loop control of the target motor.

[0104] Optionally, in the motor production testing method provided in this application embodiment, after loading the optocoupler initial bias compensation data and the encoder self-calibration compensation data into the controller, the method further includes: using at least two different preset speeds to control the target motor to perform sensed closed-loop operation, and obtaining the speed deviation corresponding to each preset speed, the speed deviation including the average speed deviation and the maximum speed deviation; and verifying whether the sensed closed-loop control performance of the target motor meets the preset requirements based on the speed deviations under all preset speeds.

[0105] For example, at least two different preset speeds can be 200 rpm and 1000 rpm, or 200 rpm, 500 rpm, and 1000 rpm, etc. This application embodiment does not limit the number of preset speed gradients or the magnitude of the preset speeds in the at least two different preset speeds; the specific values ​​can be determined according to actual application requirements.

[0106] For example, the speed deviation can be the deviation between the actual speed and the preset speed. If the target motor is controlled at 200 rpm during sensor-controlled closed-loop operation, the speed deviation can be the deviation between the actual speed collected during operation and the preset speed of 200 rpm.

[0107] In this embodiment, one possible implementation is as follows: The target motor is controlled to operate in a sensed closed-loop manner for a preset duration at speeds of 200 rpm and 1000 rpm, respectively. During operation, the actual operating speed of the target motor is collected in real time. The average and maximum speed deviations at 200 rpm are calculated based on the actual operating speed of 200 rpm, and the average and maximum speed deviations at 1000 rpm are calculated based on the actual operating speed of 1000 rpm. Further, it is determined whether the average and maximum speed deviations at 200 rpm are both within a preset speed range of 200 rpm, and whether the average and maximum speed deviations at 1000 rpm are within a preset speed range of 1. Within the preset speed range of 000 rpm, if both the average speed deviation and maximum speed deviation at 200 rpm are within the preset speed range, and both the average speed deviation and maximum speed deviation at 1000 rpm are within the preset speed range, it indicates that the sensor-controlled closed-loop performance of the target motor meets the preset requirements. If either the average speed deviation at 200 rpm or the maximum speed deviation at 1000 rpm is outside the preset speed range, it indicates that the sensor-controlled closed-loop performance of the target motor does not meet the preset requirements, i.e., its stability is poor.

[0108] For example, the preset speed range of 200 rpm can be 198 rpm to 202 rpm, meaning that at the preset speed of 200 rpm, the speed deviation can be less than or equal to 1%; the preset speed range of 1000 rpm can be 950 rpm to 1050 rpm, meaning that at the preset speed of 1000 rpm, the speed deviation can be less than or equal to 5%. This application does not limit the preset speed range of 200 rpm and 1000 rpm; the specific range can be determined according to actual application requirements.

[0109] It is understandable that by controlling the target motor to operate in a sensed closed loop at 200 rpm, the low-speed stability of the target motor can be verified, and by controlling the target motor to operate in a sensed closed loop at 1000 rpm, the high-speed stability of the target motor can be verified.

[0110] For example, the preset requirements for the sensing closed-loop control performance of the target motor may include the stability requirements of the sensing closed-loop control of the target motor. This application embodiment does not specifically limit the preset requirements for the sensing closed-loop control performance of the target motor; these requirements can be determined based on actual application needs.

[0111] Compared to related technologies, which only test at a single speed after motor self-calibration and do not cover stability assessment at different speed gradients (such as 200 rpm and 1000 rpm), this approach cannot comprehensively verify the motor's control performance in actual working scenarios. In this embodiment, after completing encoder self-calibration and optocoupler initial bias self-calibration of the target motor, the target motor is controlled to perform sensed closed-loop operation using at least two different preset speeds. The speed deviation corresponding to each preset speed is obtained, and further, based on the speed deviations at all preset speeds, the sensed closed-loop control performance of the target motor is verified to ensure it meets preset requirements. This achieves stability assessment of the target motor during sensed closed-loop operation based on different speed gradients, thereby comprehensively verifying the target motor's control performance and ensuring its stability and robustness in actual working scenarios.

[0112] In summary, the motor production testing method provided in this application, when performing self-calibration on the target motor and verifying the sensory closed-loop control performance of the target motor, can specifically include the following steps:

[0113] S1, Perform initial optocoupler bias calibration on the target motor:

[0114] 1) Switch the test mode in the host computer to the debugging mode of the bias calibration mode (such as e_bias_calib mode).

[0115] 2) Check the version and working mode of the test board to ensure that the test board is in the correct software version and running state;

[0116] 3) Employing a contactless dragging method, the target motor is controlled to power off and restart multiple times, and the mechanical and electrical angles corresponding to each start are obtained to ensure accurate zero position;

[0117] 4) Generate the initial bias compensation data of the optocoupler based on the mechanical angle and electrical angle, and write the initial bias compensation data of the optocoupler into the non-volatile memory chip (such as Flash) of the controller.

[0118] S2, calibrate the target motor using an encoder:

[0119] 1) Switch the test mode in the host computer to the debug mode of the code disk calibration mode (such as e_enc_calib mode).

[0120] 2) Check whether the initial bias compensation data of the optocoupler has been written accurately;

[0121] 3) Using a seamless dragging method, the target motor is controlled to rotate a preset number of revolutions, and the real encoder data during the operation of the target motor is acquired;

[0122] 4) Based on the actual encoder data and the preset theoretical encoder data of the target motor, generate encoder self-calibration compensation data, and write the encoder self-calibration compensation data and the optocoupler initial bias compensation data into the controller's non-volatile memory chip (such as Flash).

[0123] S3 verifies the sensor-controlled closed-loop performance of the target motor:

[0124] 1) Switch the test mode in the host computer to the sensor speed control mode (such as e_motor_speed_ctrl mode);

[0125] 2) Check whether the code disk self-calibration compensation data and the optocoupler initial bias compensation data are written accurately;

[0126] 3) Double-check the version and operating mode of the test board to ensure that it is in the correct software version and running state;

[0127] 4) Use at least two different preset speeds to verify the stability of the target motor during the sensed closed-loop operation at different speeds.

[0128] Optionally, in the motor production testing method provided in this application embodiment, after loading the encoder self-calibration compensation data and optocoupler initial bias compensation data into the controller, during the sensing closed-loop control process of the target motor, the method further includes: after the target motor is running stably, collecting multi-dimensional vibration data of the target motor within a preset sampling time based on a preset sampling frequency, wherein the multi-dimensional vibration data includes the vibration frequency and vibration acceleration amplitude of each dimension; and screening whether the target motor belongs to a vibration abnormality component based on the multi-dimensional vibration data and a preset amplitude threshold.

[0129] For example, stable operation of the target motor means that during the sensor-controlled closed-loop process, the core operating parameters of the target motor, such as speed, encoder scale angle, and zero position fluctuations, are all within the allowable error range, and there are no abnormal vibrations or noises. For instance, a preset waiting time or preset number of rotations can be set. After the target motor starts and rotates for the preset waiting time or preset number of rotations, it can be considered that the target motor is operating stably. The preset waiting time or preset number of rotations can be set according to the target motor speed; for example, a preset waiting time of 40 seconds can be set when the speed is 200 rpm, and a preset waiting time of 10 seconds can be set when the speed is 1000 rpm.

[0130] For example, the preset sampling duration can be 10 seconds. This application does not limit the preset sampling duration; it can be determined based on actual application requirements.

[0131] For example, the preset sampling frequency can be 5000Hz. This application does not limit the preset sampling frequency; it can be determined based on actual application requirements.

[0132] For example, multidimensional vibration data may include vibration frequency and vibration acceleration amplitude on the X-axis, vibration frequency and vibration acceleration amplitude on the Y-axis, and vibration frequency and vibration acceleration amplitude on the Z-axis.

[0133] For example, the preset amplitude threshold can be 0.1 m / s². This application does not limit the preset amplitude threshold; it can be determined based on actual application requirements.

[0134] In this embodiment, one possible implementation is as follows: After the target motor is running stably, based on a preset sampling frequency, the vibration frequency and vibration acceleration amplitude of the X-axis, the vibration frequency and vibration acceleration amplitude of the Y-axis, and the vibration frequency and vibration acceleration amplitude of the Z-axis of the target motor are collected within a preset sampling time. It is then determined whether the vibration acceleration amplitude of the X-axis, the vibration acceleration amplitude of the Y-axis, and the vibration acceleration amplitude of the Z-axis are greater than a preset amplitude threshold. If the vibration acceleration amplitude of the X-axis, the vibration acceleration amplitude of the Y-axis, and the vibration acceleration amplitude of the Z-axis are all less than or equal to the preset amplitude threshold, the target motor is determined to be a normal component. If the vibration acceleration amplitude of the X-axis is greater than the preset amplitude threshold, or the vibration acceleration amplitude of the Y-axis is greater than the preset amplitude threshold, or the vibration acceleration amplitude of the Z-axis is greater than the preset amplitude threshold, the target motor is determined to be a component with abnormal vibration.

[0135] Compared to related technologies, motor vibration testing lacks clearly defined and unified amplitude thresholds (e.g., amplitudes in each frequency band must be less than 0.1 m / s²) and sampling durations (e.g., sampling for 10 seconds after the motor stabilizes). This results in a lack of comparability in test results and makes it difficult to effectively screen for abnormal vibration components. In the motor production testing method provided in this application, after loading the encoder self-calibration compensation data and optocoupler initial bias compensation data into the controller, during the sensor-controlled closed-loop control of the target motor, after the target motor has stabilized, multi-dimensional vibration data of the target motor is collected within a preset sampling duration based on a preset sampling frequency. Based on the multi-dimensional vibration data and the preset amplitude threshold, the method screens whether the target motor belongs to an abnormal vibration component, clearly defining the criteria for judging abnormal vibration components. This effectively intercepts abnormal vibration components and improves the efficiency of screening for abnormal vibration components.

[0136] Optionally, one possible implementation of the motor production testing method provided in this application embodiment is as follows: At least two different preset speeds are used to control the target motor in a sensed closed-loop operation. After the target motor is running stably, the speed deviation of the target motor and the multidimensional vibration data of the target motor within a preset sampling time are collected at each preset speed. Furthermore, based on the speed deviation and multidimensional vibration data, production experience values ​​are used to determine whether the target motor has obvious abnormalities, thereby intercepting defective parts. The production experience values ​​can be determined based on data such as the speed deviation threshold and vibration amplitude threshold of historically qualified motors.

[0137] Understandably, by conducting vibration testing and speed testing of the target motor simultaneously, testing steps can be saved and testing efficiency improved.

[0138] Optionally, in the motor production testing method provided in this application embodiment, during the process of the target motor rotating a preset number of revolutions in a sensorless drag mode, the method further includes: real-time acquisition of FPGA temperature and motor board temperature; calculation of the temperature difference between FPGA temperature and motor board temperature; and triggering an abnormal alarm and controlling the target motor to stop rotating in response to the temperature difference not being within a preset threshold range.

[0139] For example, the preset temperature threshold range can be 0℃-10℃. This application does not limit the preset temperature threshold range; it can be determined based on actual application requirements.

[0140] For example, FPGA temperature and motor board temperature can be acquired in real time using temperature sensors such as negative temperature coefficient thermistors (NTC) or digital temperature sensors.

[0141] Compared to related technologies, the lack of a threshold value (motor_ntc_temp) for the temperature difference between the FPGA and the motor board during motor self-calibration makes it impossible to identify the interference of temperature anomalies on motor performance, potentially leading to unreliable calibration results. In this embodiment, during the code disk self-calibration and initial bias calibration of the target motor, the FPGA and motor board temperatures are collected in real time, and the temperature difference between them is calculated. Furthermore, if the temperature difference is not within a preset temperature threshold range, an anomaly alarm is triggered, and the target motor is stopped. This achieves real-time monitoring of temperature anomalies during the target motor self-calibration process, avoiding invalid calibration data due to temperature distortion and improving the reliability of the calibration results.

[0142] Optionally, the motor production testing method provided in this application embodiment further includes: automatically testing the dihedral angle and perpendicular angle of the target rotating mirror based on a preset communication protocol and preset data query instructions, wherein the target rotating mirror is integrated on the target motor after self-calibration.

[0143] For example, the default communication protocol can be the User Datagram Protocol (UDP).

[0144] For example, the default data query command could be "sn=7,1".

[0145] It is understandable that after the target rotating mirror is attached to the self-calibrated target motor mirror, there will be assembly errors in the dihedral angle and perpendicular angle of the adjacent mirrors. These errors will affect the field of view (FOV) and angular resolution of the LiDAR product, which will cause lateral jitter in the inter-frame point cloud output by the LiDAR. Therefore, it is necessary to test the dihedral angle and perpendicular angle of the target rotating mirror in order to screen out products with deviations exceeding the specifications.

[0146] For example, the testing principle for the dihedral angle and perpendicular angle of a target rotating mirror can be as follows: After light passes through the reticle located at the focal plane of the objective lens, it forms parallel light through the objective lens; this parallel light is incident on the mirror under test (the mirror surface of the target rotating mirror), is reflected, and then passes through the collimating lens, and is split and deflected by the beam splitter (the beam splitter transmits light in two paths, one emitting parallel light and the other receiving reflected light), converging on the surface of the charge-coupled device (CCD) located at the conjugate focal plane to form a reticle image; when the mirror tilts at a small angle, the reflected light beam will produce a corresponding tilt angle, and the reticle image on the CCD detection surface will produce a linear displacement; since the displacement of the reticle image is proportional to the angular displacement of the mirror, the angular displacement of the mirror can be determined by interpreting and converting the displacement of the reticle image by the CCD. For example, based on a preset communication protocol and preset data query instructions, a possible implementation of automated testing of the dihedral angle and perpendicular angle of a target rotating mirror may include the following steps:

[0147] 1) The host computer automatically finds the zero position of the target motor and aligns the motor zero position with the left mirror of the target rotating mirror, that is, the left mirror of the target rotating mirror is used as the initial test reference.

[0148] 2) The host computer scans the serial number (SN) of the target motor to check the status of the target motor in the production testing system to confirm the accuracy of the testing station;

[0149] 3) Starting from the zero position in step 1), control the target motor to rotate counterclockwise by 120°, and then use a dihedral angle measuring instrument to test the angles of the three lenses of the target rotating mirror (the rotating mirror is usually a 3-piece type, with each piece corresponding to a 120° mechanical angle).

[0150] 4) Send a preset data query command (such as “sn=7,1,”) to the communication port (such as port 5567) of the dihedral angle measuring instrument via the UDP protocol, so that the dihedral angle measuring instrument responds to the preset data query command and returns data including dihedral angle data and perpendicular angle data to the host computer;

[0151] 5) The host computer verifies the dihedral angle data and the perpendicular angle data based on the preset dihedral angle threshold range, the preset perpendicular angle threshold range, and the perpendicular angle error, in order to filter out products with low rotation mirror accuracy.

[0152] For example, the preset dihedral angle threshold range can be 59.8° to 60.2°; the preset perpendicular angle threshold range can be 89.8° to 90.2°; and the perpendicular angle error can be 0 to 0.2°. This application embodiment does not limit the preset dihedral angle threshold range, the preset perpendicular angle threshold range, or the perpendicular angle error; these can be determined according to actual application requirements.

[0153] Compared to related technologies, traditional methods for measuring the dihedral angle and perpendicular angle of rotating mirrors rely on manual operation, lack standardized communication commands and data interpretation processes, resulting in slow testing speeds and susceptibility to human factors. This leads to low efficiency in rotating mirror accuracy testing, failing to meet the demands of mass production. The motor production testing method provided in this application, based on a preset communication protocol and preset data query commands, automates the testing of the dihedral angle and perpendicular angle of the target rotating mirror, improving the efficiency of target rotating mirror accuracy testing. Furthermore, by verifying the dihedral angle and perpendicular angle data based on preset dihedral angle threshold ranges, preset perpendicular angle threshold ranges, and perpendicular angle errors, products with low rotating mirror accuracy are screened out, preventing the performance of the lidar from being affected by rotating mirror errors.

[0154] Optionally, the motor production testing method provided in this application also standardizes the naming, format, uploading, and downloading verification process of calibration files, which facilitates data traceability and problem troubleshooting during the production process, while reducing human error and improving the efficiency of mass production testing of motors.

[0155] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.

[0156] Figure 4 This is a schematic diagram of the structure of the motor production testing device provided in an embodiment of this application. Figure 4As shown, the motor production testing device 40 includes an acquisition module 410, a generation module 420, and a correction module 430.

[0157] The acquisition module 410 is used to acquire the actual encoder data and the preset theoretical encoder data of the target motor. The actual encoder data is the encoder signal data obtained by the optocoupler sensor integrated on the target motor during the process of the target motor rotating a preset number of times in a non-sensitive dragging mode.

[0158] The generation module 420 is used to generate code disk self-calibration compensation data based on real code disk data and preset theoretical code disk data. This code disk self-calibration compensation data is used to correct the optical coupler signal deviation and code disk physical deviation.

[0159] The correction module 430 is used to load the encoder self-calibration compensation data into the controller of the target motor, and dynamically correct the real-time collected encoder data according to the encoder self-calibration compensation data during the sensor-controlled closed-loop control process of the target motor.

[0160] In one possible implementation, the real encoder data includes the real pulse width time and real angle of each encoder scale in each revolution within a preset number of revolutions, and the preset theoretical encoder data includes the theoretical pulse width time and theoretical angle of each encoder scale. The generation module 420 is specifically used for: determining whether the encoder of the target motor needs to be intercepted for each encoder scale based on the real angle of the encoder scale in each revolution; in response to the encoder not needing interception, calculating the pulse width time deviation for each revolution based on the real and theoretical pulse width times of the encoder scale in each revolution, and obtaining the target pulse width time deviation of the encoder scale within the preset number of revolutions based on the pulse width time deviation of each revolution; calculating the angle deviation for each revolution based on the real and theoretical angles of the encoder scale in each revolution, and obtaining the target angle deviation of the encoder scale within the preset number of revolutions based on the angle deviation of each revolution; and generating encoder self-calibration compensation data based on the target pulse width time deviation and target angle deviation of all encoder scales.

[0161] In one possible implementation, before acquiring the actual encoder data and the preset theoretical encoder data of the target motor, the acquisition module 410 is further configured to control the target motor to start a preset number of times and acquire the mechanical angle and electrical angle corresponding to each start; the generation module is further configured to generate optocoupler initial bias compensation data based on the mechanical angle and electrical angle; the correction module is further configured to load the optocoupler initial bias compensation data into the controller and dynamically correct the optocoupler initial bias based on the optocoupler initial bias compensation data during the sensing closed-loop control process of the target motor.

[0162] In one possible implementation, after loading the initial bias compensation data of the optocoupler and the self-calibration compensation data of the encoder into the controller, the motor production testing device also includes a verification module (not shown). This verification module is used to: control the target motor to perform sensed closed-loop operation using at least two different preset speeds, and obtain the speed deviation corresponding to each preset speed, including the average speed deviation and the maximum speed deviation; and verify whether the sensed closed-loop control performance of the target motor meets the preset requirements based on the speed deviations under all preset speeds.

[0163] In one possible implementation, during the sensing closed-loop control process of the target motor, the motor production testing device further includes a screening module (not shown). This screening module is used to: after the target motor is running stably, collect multidimensional vibration data of the target motor within a preset sampling time based on a preset sampling frequency. The multidimensional vibration data includes the vibration frequency and vibration acceleration amplitude of each dimension; and screen whether the target motor belongs to a vibration abnormality component based on the multidimensional vibration data and a preset amplitude threshold.

[0164] In one possible implementation, during the process of the target motor rotating a preset number of revolutions in a sensorless drag mode, the motor production testing device also includes a detection module (not shown). This detection module: collects the FPGA temperature and the motor board temperature in real time; calculates the temperature difference between the FPGA temperature and the motor board temperature; and triggers an abnormal alarm and controls the target motor to stop rotating in response to the temperature difference not being within a preset threshold range.

[0165] In one possible implementation, the motor production testing device further includes a testing module (not shown) for automatically testing the dihedral angle and perpendicular angle of the target rotating mirror based on a preset communication protocol and preset data query instructions. The target rotating mirror is integrated on the target motor after self-calibration.

[0166] The motor production testing device provided in this application can be used to execute the method steps of the above method embodiments. The specific implementation and technical effects are similar, and will not be described again here.

[0167] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 5 As shown, the electronic device 50 provided in this embodiment includes at least one processor 501 and a memory 502. Optionally, the electronic device 50 further includes a communication component 503. The processor 501, memory 502, and communication component 503 are connected via a bus 504.

[0168] In a specific implementation, at least one processor 501 executes computer execution instructions stored in memory 502, causing at least one processor 501 to perform the above-described method.

[0169] The specific implementation process of processor 501 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0170] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0171] The memory may include random access memory (RAM) and non-volatile memory (NVM), such as at least one disk storage device.

[0172] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0173] This application embodiment also provides a motor, which includes an encoder and a controller. The controller is communicatively connected to the encoder and has built-in encoder self-calibration compensation data obtained using the motor production testing method described in the above embodiment. The controller is used to dynamically correct the real-time collected encoder data based on the encoder self-calibration compensation data.

[0174] This application also provides a sensor, including a motor as described in the above embodiments.

[0175] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0176] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.

[0177] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0178] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0179] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0180] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0181] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0182] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0183] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0184] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A method for testing the production of an electric motor, characterized in that, include: Acquire the actual encoder data and the preset theoretical encoder data of the target motor. The actual encoder data is the encoder signal data obtained based on the optocoupler sensor integrated on the target motor during the process of the target motor rotating a preset number of times in a non-sensitive dragging mode. Based on the actual code disk data and the preset theoretical code disk data, code disk self-calibration compensation data is generated. The code disk self-calibration compensation data is used to correct the optical coupler signal deviation and the code disk physical deviation. The self-calibration compensation data of the encoder is loaded into the controller of the target motor, and during the sensor-controlled closed-loop control of the target motor, the real-time collected encoder data is dynamically corrected based on the self-calibration compensation data of the encoder.

2. The motor production testing method according to claim 1, characterized in that, The actual code disk data includes the actual pulse width time and actual angle of each code disk scale in each of the preset number of cycles, and the preset theoretical code disk data includes the theoretical pulse width time and theoretical angle of each code disk scale. The step of generating code disk self-calibration compensation data based on the actual code disk data and the preset theoretical code disk data includes: For each code disk scale, determine whether the code disk of the target motor needs to be intercepted based on the actual angle of the code disk scale in each revolution; Since the encoder does not need to be intercepted, the pulse width time deviation of each circle is calculated based on the actual pulse width time and theoretical pulse width time of the encoder scale in each circle, and the target pulse width time deviation of the encoder scale within the preset number of circles is obtained based on the pulse width time deviation of each circle. The angle deviation for each revolution is calculated based on the actual angle and theoretical angle of the code disk scale for each revolution, and the target angle deviation of the code disk scale within the preset number of revolutions is obtained based on the angle deviation for each revolution. Based on the target pulse width time deviation and target angle deviation of all encoder scales, the self-calibration compensation data of the encoder is generated.

3. The motor production testing method according to claim 1, characterized in that, Before obtaining the actual encoder data and the preset theoretical encoder data of the target motor, the following steps are also included: The target motor is started a preset number of times, and the mechanical and electrical angles corresponding to each start are obtained; Based on the mechanical angle and the electrical angle, generate initial bias compensation data for the optocoupler; The initial bias compensation data of the optocoupler is loaded into the controller, and the initial bias of the optocoupler is dynamically corrected according to the initial bias compensation data during the sensing closed-loop control process of the target motor.

4. The motor production testing method according to claim 3, characterized in that, After loading the initial bias compensation data of the optical coupler and the self-calibration compensation data of the code disk into the controller, the method further includes: Using at least two different preset speeds, the target motor is controlled to perform sensed closed-loop operation, and the speed deviation corresponding to each preset speed is obtained, the speed deviation including the average speed deviation and the maximum speed deviation; Based on the speed deviation at all preset speeds, verify whether the sensing closed-loop control performance of the target motor meets the preset requirements.

5. The motor production testing method according to claim 3, characterized in that, The inductive closed-loop control process of the target motor also includes: After the target motor is running stably, multidimensional vibration data of the target motor is collected within a preset sampling time based on a preset sampling frequency. The multidimensional vibration data includes the vibration frequency and vibration acceleration amplitude of each dimension. Based on the multidimensional vibration data and the preset amplitude threshold, the target motor is screened to determine whether it belongs to an abnormal vibration component.

6. The method for testing the production of an electric motor according to any one of claims 1 to 3, characterized in that, During the process of the target motor rotating a preset number of revolutions in a sensorless drag mode, the following is also included: Real-time acquisition of FPGA temperature and motor board temperature; Calculate the temperature difference between the FPGA temperature and the motor board temperature; In response to the temperature difference not being within the preset temperature threshold range, an abnormal alarm is triggered and the target motor is controlled to stop rotating.

7. The motor production testing method according to any one of claims 1 to 3, characterized in that, Also includes: Based on a preset communication protocol and preset data query instructions, the dihedral angle and perpendicular angle of the target rotating mirror are automatically tested. The target rotating mirror is integrated on the target motor after self-calibration.

8. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes the computer execution instructions stored in the memory to implement the motor production testing method as described in any one of claims 1 to 7.

9. An electric motor, characterized in that, The motor includes an encoder and a controller. The controller is communicatively connected to the encoder. The controller has built-in encoder self-calibration compensation data obtained using the motor production testing method as described in any one of claims 1 to 7. The controller is used to dynamically correct the real-time collected encoder data based on the encoder self-calibration compensation data.

10. A sensor, characterized in that, include: The motor as described in claim 9.