Dual-encoder speed measurement method and device, computer equipment and storage medium

Through the dual-encoder speed measurement method and weighted least squares fusion technology, combined with the adaptive adjustment of the transmission gap, the problems of high-resolution encoder interference and low-resolution encoder accuracy are solved, and the speed measurement accuracy under low-speed conditions is improved. and motion control accuracy.

CN118731406APending Publication Date: 2024-10-01WUHAN UNITED IMAGING HEALTHCARE SURGICAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310345011.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-31
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

In the existing technology, high-resolution encoders are susceptible to interference during servo motor control, resulting in low speed measurement accuracy. Low-resolution encoders also have insufficient measurement accuracy under low-speed working conditions, making it difficult to meet low-speed and high-precision control requirements.

Method used

The dual-encoder speed measurement method is used to obtain the measurement speed of the target object through the first encoder and the second encoder respectively, and perform weighted least squares fusion, combined with adaptive adjustment of the transmission gap, to optimize the measurement speed to improve accuracy.

Benefits of technology

The speed measurement accuracy under low-speed working conditions is improved, the problems of high-resolution encoder interference and low-resolution encoder measurement inaccuracy are avoided, and high-precision motion control of the target object is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118731406A_ABST
    Figure CN118731406A_ABST
Patent Text Reader

Abstract

The invention relates to a double-encoder speed measurement method and device, computer equipment and a storage medium. The method comprises the following steps: acquiring a first measurement speed of a target object by using a first encoder; acquiring a second measurement speed of the target object by using a second encoder; the resolution of the first encoder is smaller than that of the second encoder; acquiring a fusion speed according to the first measurement speed and the second measurement speed; and determining the target measurement speed of the target object according to the first measurement speed and the fusion speed. According to the method, speed fusion is performed on the encoders with different resolutions, and the target measurement speed of the target object is determined from the fusion speed and the first measurement speed with relatively low resolution, so that the problem of low resolution in low-speed measurement can be avoided, and the speed measurement precision under the condition of low-speed measurement is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of control, and in particular to a dual-encoder speed measurement method, device, computer equipment and storage medium. Background Art

[0002] In the prior art, encoders are usually used in servo motor control to achieve digital speed measurement, or encoders are used to achieve precise angular position measurement of a target object, and closed-loop control is performed through the speed and angular position measured and fed back by the encoder.

[0003] At present, if an encoder with high angle resolution is used for speed measurement, the measured angle position needs to be converted by differential calculation to obtain the measured speed. If the measured value of the high-resolution encoder is unstable after being disturbed, it may bring large differential noise in the differential calculation process, resulting in low speed measurement accuracy of the high-resolution encoder for the target object. If an encoder that can directly measure speed is used, it can directly calculate the rotation speed through a digital pulse sequence to achieve speed measurement of the target object, but its single-turn grating number is limited, so the speed measurement resolution is not high, which also results in low speed measurement accuracy for the target object.

[0004] In the process of realizing closed-loop control, the target object is often required to work under low-speed conditions, and speed control must also meet low-speed and high-precision indicators. Under low-speed conditions, using a low-resolution encoder for speed measurement will result in low-precision speed measurement results. Summary of the invention

[0005] Based on this, it is necessary to provide a dual-encoder speed measurement method, device, computer equipment and storage medium that can improve the speed measurement accuracy of the target object in order to solve the above technical problems.

[0006] In a first aspect, the present application provides a dual encoder speed measurement method, the method comprising:

[0007] acquiring a first measured velocity of the target object using a first encoder;

[0008] Obtaining a second measured speed of the target object using a second encoder; the resolution of the first encoder is less than the resolution of the second encoder;

[0009] Acquire a fusion speed according to a first measurement speed and a second measurement speed;

[0010] A target measurement velocity of the target object is determined according to the first measurement velocity and the fused velocity.

[0011] In one embodiment, determining a target measurement speed of the target object according to the first measurement speed and the fusion speed includes:

[0012] When the first measured speed is less than the speed threshold, determining a target measured speed of the target object based on the fused speed;

[0013] When the first measured speed is greater than or equal to a speed threshold, a target measured speed of the target object is determined based on the first measured speed; the speed threshold is related to a resolution of the first encoder.

[0014] In one embodiment, obtaining the fusion speed according to the first measurement speed and the second measurement speed includes:

[0015] The first measurement speed and the second measurement speed are fused by using weighted least squares to obtain a fused speed.

[0016] In one embodiment, the first encoder is disposed on the motor; the second encoder is disposed on the load; the motor is used to drive the load to move;

[0017] Acquiring a fusion speed according to the first measurement speed and the second measurement speed also includes:

[0018] Get the transmission gap between the motor and the load;

[0019] The fusion speed is adaptively adjusted based on the comparison between the transmission gap between the motor and the load and the preset transmission gap threshold.

[0020] In one embodiment, the first encoder obtains the first measurement speed according to a preset sampling period, and the second encoder obtains the second measurement speed according to the sampling period;

[0021] Get the transmission gap between the motor and the load, including:

[0022] Obtaining a first code value corresponding to each sampling period of the first encoder and a second code value corresponding to each sampling period of the second encoder;

[0023] According to each first code value, obtain a first code value change amount corresponding to the first encoder, and according to each second code value, obtain a second code value change amount corresponding to the second encoder;

[0024] Obtaining a difference between a first code value change and a second code value change, and using a ratio of the difference between the change and each second code value as a sub-transmission gap corresponding to each sampling period;

[0025] The average value of the sub-transmission gap in each sampling period is taken as the transmission gap.

[0026] In one embodiment, the fusion speed is adaptively adjusted according to the comparison between the transmission gap between the motor side and the load side and the preset transmission gap threshold, including:

[0027] When the transmission gap is not less than the preset transmission gap threshold, the fusion speed is the first measurement speed;

[0028] When the transmission gap is less than the preset transmission gap threshold, the weight parameter in the fusion speed calculation is corrected to obtain the target measurement speed.

[0029] In one embodiment, according to the transmission gap and the transmission gap threshold, the weight parameter in the fusion speed calculation is corrected to obtain the target measurement speed, including:

[0030] According to the difference between the transmission gap and the transmission gap threshold, a correction parameter for the fusion speed is obtained;

[0031] Based on the correction parameters, the fusion speed is corrected to obtain the target measurement speed.

[0032] In one embodiment, the method further comprises:

[0033] When the first measurement speed switches from satisfying the first preset condition to satisfying the second preset condition, or when the first measurement speed switches from satisfying the second preset condition to satisfying the first preset condition, obtaining a speed difference between the first measurement speed and the fusion speed; the first preset condition is that the first measurement speed is less than a speed threshold; the second preset condition is that the first measurement speed is greater than or equal to the speed threshold;

[0034] When the speed difference is greater than a preset difference threshold, obtaining a preset switching period;

[0035] Obtaining an optimization parameter for a fusion speed according to a difference between a mean square error of the first encoder and a mean square error of the second encoder;

[0036] Based on the optimization parameters, the fusion speed is optimized to obtain the target measurement speed within the switching period.

[0037] In one embodiment, the first encoder obtains the first measurement speed according to a preset sampling period, and the second encoder obtains the second measurement speed according to the sampling period; the switching period includes a plurality of sampling periods;

[0038] According to the difference between the mean square error of the first encoder and the mean square error of the second encoder, the optimization parameters for the fusion speed are obtained, including:

[0039] The ratio of the difference between the mean square error of the first encoder and the mean square error of the second encoder to the number of sub-cycles is used as a linear averaging parameter;

[0040] According to the linear averaging parameters and the order of each sub-period in the switching period, the optimization parameters corresponding to each sub-period are obtained;

[0041] Based on the optimization parameters, the fusion speed is optimized to obtain the target measurement speed within the switching cycle, including:

[0042] Based on the optimization parameters corresponding to each sub-period, the fusion speed of each sub-period is optimized to obtain the target measurement speed corresponding to each sub-period.

[0043] In one embodiment, obtaining a second measured speed of the target object using a second encoder includes:

[0044] acquiring an angular position of the target object at a second resolution by a second encoder;

[0045] The angular position is differentiated to obtain a second measured velocity of the target object.

[0046] In a second aspect, the present application also provides a dual encoder speed measuring device, the device comprising:

[0047] A first measurement speed acquisition module, used for acquiring a first measurement speed of a target object using a first encoder;

[0048] A second measurement speed acquisition module is used to acquire a second measurement speed of the target object using a second encoder; the resolution of the first encoder is smaller than the resolution of the second encoder;

[0049] A fusion speed acquisition module, used to acquire a fusion speed according to the first measurement speed and the second measurement speed;

[0050] The target speed determination module is used to determine the target measurement speed of the target object according to the first measurement speed and the fusion speed.

[0051] In a third aspect, the present application further provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0052] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0053] In a fifth aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0054] The above-mentioned dual-encoder speed measurement method, device, computer equipment and storage medium obtain the first measurement speed of the target object by using the first encoder; and obtain the second measurement speed of the target object by using the second encoder; wherein the resolution of the first encoder is smaller than the resolution of the second encoder; further, the fusion speed can be obtained according to the first measurement speed and the second measurement speed; and the target measurement speed of the target object is determined according to the first measurement speed and the fusion speed. Compared with the conventional technology, the present application can avoid the low resolution problem existing in low-speed measurement by fusing the speeds of encoders with different resolutions, and determining the target measurement speed of the target object from the fusion speed and the first measurement speed with relatively low resolution, thereby improving the speed measurement accuracy of the target object under low-speed measurement conditions. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 A schematic diagram of a flow chart of a dual encoder speed measurement method in one embodiment;

[0056] Figure 2 A schematic diagram of a flow chart of a step of determining a target measurement speed of a target object in one embodiment;

[0057] Figure 3 A schematic diagram of a flow chart of a step of obtaining a fusion speed in one embodiment;

[0058] Figure 4 It is a schematic diagram of a flow chart of a step of adaptively adjusting the fusion speed in one embodiment;

[0059] Figure 5 A schematic diagram of a flow chart of a dual encoder speed measurement method in another embodiment;

[0060] Figure 6 A schematic diagram of a joint motion control architecture of a dual-axis robot in one embodiment;

[0061] Figure 7 It is a schematic diagram of the speed measurement results of the unfused dual encoders in one embodiment;

[0062] Figure 8 A schematic diagram of the speed result of the dual encoder fusion provided by the present application in one embodiment;

[0063] Fig. 9 A schematic diagram of a dual encoder fusion speed result corresponding to a switching period in one embodiment;

[0064] Fig.10 A schematic diagram of a result of adaptively adjusting the fusion speed in one embodiment;

[0065] Fig.11 is a structural block diagram of a dual encoder speed measuring device in one embodiment;

[0066] Fig.12 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0067] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0068] In one embodiment, Figure 1 As shown, a dual encoder speed measurement method is provided. This embodiment uses the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server.

[0069] In this embodiment, the method includes the following steps:

[0070] S102: Acquire a first measured speed of the target object using a first encoder.

[0071] The first encoder may be a pre-set encoder for measuring the speed of the target object. The first encoder may be set on the motor corresponding to the target object to measure the speed of the motor; for example, the first encoder may be an incremental encoder. The target object may be an object for control, for example, a multi-axis robot, and the single joint of the multi-axis robot may be controlled by a servo motor to achieve the posture movement of the robot. The first measurement speed may be a feedback speed obtained by real-time monitoring of the target object during the closed-loop control of the target object, that is, the first measurement speed measured by the first encoder is used for closed-loop control.

[0072] Exemplarily, the speed of the target object (e.g., a robot) can be measured by a first encoder installed on the target object to obtain a first measured speed, and the first measured speed can be used for closed-loop feedback control. For example, the motor of the robot can be digitally measured by the first encoder to obtain a feedback speed measured by the first encoder, and the feedback speed can be used as the first measured speed. In this way, by measuring the target object and using the measured feedback speed for closed-loop feedback control, the motion control of the target object can be achieved, and the accuracy of the motion control of the target object can be improved.

[0073] Optionally, the first encoder may digitally measure the speed of the target object using methods such as M-method speed measurement, T-method speed measurement, and M / T-method speed measurement.

[0074] S104, using a second encoder to obtain a second measured speed of the target object; the resolution of the first encoder is smaller than the resolution of the second encoder.

[0075] Among them, the second encoder can be an encoder pre-set on the target object, for example, it can be set on the robot load, and the robot load can be a robot joint; for example, the load position can be measured to obtain the feedback position of the load, so as to perform closed-loop control on the robot through the feedback position; at the same time, the load position measured by the second encoder can be converted and calculated to obtain the speed of the robot motor, that is, the second measurement speed can be the speed after the angular position measured by the second encoder is converted. The second encoder can be an absolute encoder. The resolution of the first encoder and the resolution of the second encoder can both be attributes associated with the encoder, and the number of open or dark lines provided by the encoder for each 360-degree rotation can be called resolution.

[0076] For example, the angular position of the target object (e.g., a robot) can be measured by a second encoder installed on the target object, and the second measurement speed can be obtained by converting the angular position; for example, the angular position measured by the second encoder can be differentiated to obtain the second measurement speed. In this way, the speed of the target object can be obtained by an encoder with a higher resolution, which can improve the speed measurement accuracy in low-speed measurement.

[0077] S106, obtaining a fusion speed according to the first measurement speed and the fusion speed.

[0078] The fusion speed may be a speed obtained by fusing the first measurement speed and the second measurement speed.

[0079] Exemplarily, by obtaining a second encoder corresponding to a relatively high resolution and fusing the second encoder with the first measured speed to obtain a fused speed, the resolution corresponding to the fused speed can be improved, thereby improving the accuracy. When the resolution of the first encoder is less than the resolution of the second encoder, it can be considered that the resolution of the first encoder is low resolution and the resolution of the second encoder is high resolution.

[0080] S108: Determine a target measurement speed of the target object according to the first measurement speed and the fusion speed.

[0081] The target measurement speed may be a speed finally determined for closed-loop control of the target object. For example, the target measurement speed may be used as a final feedback speed to implement closed-loop control of the target object.

[0082] Exemplarily, the target measurement speed of the target object can be obtained from the first measurement speed and the fusion speed by preset conditions. For example, the first measurement speed can be used as the target measurement speed, or the fusion speed can be used as the target measurement speed. As an example, the fusion speed can be used as the target measurement speed in the case of low speed, and the first measurement speed can be used as the target measurement speed in the case of high speed, so that the accuracy of the speed measurement result of the target object in the case of low speed can be improved. The distinction between low speed and high speed can be divided by a preset speed threshold.

[0083] Optionally, the speed of the robot's motor can be measured by incremental encoding to obtain a first measurement speed, and the position of the robot's joints can be measured by an absolute encoder to obtain an angular position, and the angular position obtained by the absolute encoder is differentiated to obtain a second measurement speed. The first measurement speed and the second measurement speed are fused using the weighted least squares method to obtain a fused speed. In the case of low speed, the fused speed is used as the target measurement speed, and in the case of high speed, the first measurement speed is used as the target measurement speed. In this way, the accuracy of the speed measurement result of the target object can be improved in the case of low speed. The distinction between low speed and high speed can be divided by a preset speed threshold.

[0084] In this embodiment, a first measurement speed of a target object is obtained by using a first encoder; and a second measurement speed of the target object is obtained by using a second encoder; wherein the resolution of the first encoder is smaller than the resolution of the second encoder; further, a fusion speed can be obtained according to the first measurement speed and the second measurement speed; and the target measurement speed of the target object is determined according to the first measurement speed and the fusion speed. Compared with the conventional technology, the present application can avoid the low resolution problem existing in low-speed measurement by fusing the speeds of encoders with different resolutions, and determining the target measurement speed of the target object from the fusion speed and the first measurement speed with relatively low resolution, thereby improving the speed measurement accuracy of the target object under low-speed measurement conditions.

[0085] In one embodiment, Figure 2 As shown, determining a target measurement speed of the target object according to the first measurement speed and the fusion speed includes:

[0086] S202, determining a target measurement speed of the target object based on the fusion speed when the first measurement speed is less than a speed threshold;

[0087] S204, determining a target measurement speed of the target object based on the first measurement speed when the first measurement speed is greater than or equal to a speed threshold; the speed threshold is related to a resolution of the first encoder.

[0088] The speed threshold may be a preset threshold, and the speed threshold may be used to classify whether the target object is in high-speed motion or in low-speed motion. The speed threshold is related to the resolution of the first encoder and may be obtained according to the resolution of the first encoder. For example, an integer multiple of the resolution may be used as the speed threshold.

[0089] For example, if the first measured speed is less than the speed threshold, the target measured speed of the target object can be obtained based on the fused speed. If the first measured speed is greater than or equal to the speed threshold, the target measured speed of the target object can be obtained based on the first measured speed. In this way, by using the fused speed to obtain the target measured speed under low speed conditions, the resolution corresponding to the target measured speed is improved, thereby improving the speed measurement accuracy of the target object.

[0090] For example, the target measurement speed of the target object can be determined by the following formula (1):

[0091]

[0092] Among them, V out Measure the speed of the target; is the fusion speed; V1 is the fusion speed; T s is the sampling period; N is an integer, and N can be 3 to 10.

[0093] In this embodiment, segmented speed measurement can be used to fuse the speed information measured by the dual encoders under low-speed conditions, which can improve the resolution of speed measurement under relatively low-speed conditions and avoid the problem of inaccurate speed measurement using a high-resolution second encoder under relatively high-speed conditions, thereby improving the accuracy of speed measurement of the target object and further enabling the low-speed motion control accuracy of the target object.

[0094] In one embodiment, obtaining the fusion speed according to the first measurement speed and the second measurement speed includes:

[0095] The first measurement speed and the second measurement speed are fused by using weighted least squares to obtain a fused speed.

[0096] For example, the weighted least square method can be used to perform velocity fusion processing on the first measurement velocity and the second measurement velocity to obtain a fused velocity. In this way, by weighted fusion of the first measurement velocity and the second measurement velocity, the accuracy of the fused velocity can be improved, thereby improving the measurement accuracy of the target measurement velocity of the target object.

[0097] Optionally, a weighted least square method of Markov estimation may be used to fuse the first measurement speed and the second measurement speed.

[0098] Assume that the first measurement speed measured by the first encoder is V1, the mean square error of the first encoder is R1, the second measurement speed measured by the second encoder is V2, the mean square error of the second encoder is R2, and R1>R2, indicating that the resolution of the first encoder is low and the measurement noise is large.

[0099] Let the state variable Measurement matrix: The corresponding measurement equation is: Z = HV + U; where U is the random noise of the measurement value, with a mean of zero, and the error variance matrix is:

[0100] With W = R -1 For the unbiased estimation weight design, according to the weighted least squares method of Markov estimation, the state quantity estimation can be obtained as formula (2):

[0101]

[0102] The estimated error is: Then the mean square error of state estimation is:

[0103] Optionally, velocity fusion can take the inverse of the error variance matrix as the estimation weight, so that the measurement value with large error accounts for a small proportion in the estimation, and the measurement value with small error accounts for a large proportion in the estimation.

[0104] In this embodiment, the first measurement speed and the second measurement speed can be fused by weighted least squares, and the fused speed can be determined based on the proportion of the first measurement speed and the second measurement speed in the fused speed, which can improve the fused speed measurement accuracy and thus improve the target measurement speed accuracy of the target object.

[0105] In one embodiment, Figure 3 As shown, the first encoder is arranged on the motor; the second encoder is arranged on the load; the motor is used to drive the load to move;

[0106] Acquiring a fusion speed according to the first measurement speed and the second measurement speed also includes:

[0107] S302, obtaining a transmission gap between the motor and the load;

[0108] S304, adaptively adjusting the fusion speed according to the comparison between the transmission gap between the motor and the load and the preset transmission gap threshold.

[0109] The transmission gap may be a gap existing in the transmission mechanism between the motor and the load. The preset transmission gap threshold may be a preset threshold for judging the transmission gap.

[0110] For example, since the first encoder is installed on the motor and the second encoder is installed on the load, there may be a transmission gap between the first encoder and the second encoder through the transmission mechanism. The transmission gap can be compared with a preset transmission gap threshold, and the fusion speed can be adaptively adjusted according to the comparison result of the transmission gap with the preset transmission gap threshold.

[0111] In this embodiment, the fusion speed is adaptively adjusted to reduce the influence of the possible transmission gap on the speed measurement accuracy, so that the fusion speed measurement accuracy can be improved, thereby improving the target measurement speed accuracy of the target object.

[0112] In one embodiment, the first encoder obtains the first measurement speed according to a preset sampling period, and the second encoder obtains the second measurement speed according to the sampling period;

[0113] Get the transmission gap between the motor and the load, including:

[0114] A first code value corresponding to each sampling period of the first encoder and a second code value corresponding to each sampling period of the second encoder are obtained.

[0115] The sampling period may be a preset period, and both the first encoder and the second encoder may measure the speed according to the preset sampling period.

[0116] Exemplarily, the encoding value corresponding to each sampling period of the first encoder can be used as the first encoding value, and the encoding value corresponding to each sampling period of the second encoder can be used as the encoding value; the transmission gap can be obtained according to the first encoding value and the second encoding value.

[0117] According to each first code value, a change amount of the first code value corresponding to the first encoder is obtained, and according to each second code value, a change amount of the second code value corresponding to the second encoder is obtained.

[0118] Among them, each m cycles can be regarded as a group, and the code value change of the first encoder in each group is calculated according to each first code value; and the second code value change of the second encoder in each group is calculated according to each second code value. For example, the average of the difference between each first code value can be used as the code value change of each group of first encoders; and the average of the difference between each second code value can be used as the second code value change of each group of second encoders.

[0119] The difference between the first code value change and the second code value change is obtained, and the ratio of the difference between the change and each second code value is used as the sub-transmission gap corresponding to each sampling period.

[0120] For example, by continuously taking j groups of change values, i=1, 2...j, the sub-transmission clearance can be obtained by the following formula (3):

[0121]

[0122] Among them, σ′(i) is the sub-transmission gap corresponding to each group of sampling periods; ΔM1(i) is the change of the first coding value of each group of sampling periods; ΔM2(i) is the change of the second coding value of each group of sampling periods; M is the ratio of the first coding value to the second coding value; M2 is the second coding value.

[0123] The average value of the sub-transmission gap in each sampling period is taken as the transmission gap.

[0124] For example, the transmission clearance can be obtained according to the following formula (4):

[0125]

[0126] Among them, σ is the transmission clearance.

[0127] In this embodiment, the transmission gap ratio is obtained based on the difference in change between the first code value change and the second code value change, and the ratio between the first code and the second code, and the transmission gap ratio is used as the sub-transmission gap. The transmission gap is obtained based on each transmission gap ratio. In this way, the transmission gap can be conveniently compared with the transmission gap threshold, thereby improving the accuracy of transmission gap judgment.

[0128] In one embodiment, Figure 4 As shown, according to the comparison between the transmission gap between the motor side and the load side and the preset transmission gap threshold, the fusion speed is adaptively adjusted, including:

[0129] S402, when the transmission gap is not less than a preset transmission gap threshold, the fusion speed is a first measurement speed;

[0130] S404: When the transmission gap is less than the preset transmission gap threshold, the weight parameter in the fusion speed calculation is corrected according to the transmission gap and the transmission gap threshold to obtain the target measurement speed.

[0131] Exemplarily, if the transmission gap is not less than a preset transmission gap threshold, the first measured speed can be used as the fusion speed. If the transmission gap is less than the preset transmission gap threshold, the weight parameter of the state estimation in the fusion speed calculation can be adjusted according to the transmission gap and the transmission gap threshold, and the fusion speed can be further adaptively adjusted based on the adjusted weight parameter to obtain the target measurement speed.

[0132] In this embodiment, by judging the transmission gap and the preset transmission gap threshold, if the transmission gap is not less than the preset transmission gap threshold, the fusion speed is the first measurement speed, which can avoid a larger speed measurement error caused by a large transmission gap; if the transmission gap is less than the preset transmission gap threshold, the fusion speed can be adjusted according to the transmission gap and the transmission gap threshold, which can improve the speed measurement accuracy, thereby improving the target measurement speed accuracy of the target object.

[0133] In one embodiment, according to the transmission gap and the transmission gap threshold, the weight parameter in the fusion speed calculation is corrected to obtain the target measurement speed, including:

[0134] According to the difference between the transmission gap and the transmission gap threshold, a correction parameter for the fusion speed is obtained;

[0135] Based on the correction parameters, the fusion speed is corrected to obtain the target measurement speed.

[0136] Exemplarily, if the transmission gap is less than a preset transmission gap threshold, a correction parameter of the fusion speed can be obtained according to the difference between the transmission gap and the transmission gap threshold. Based on the correction parameter, a weight parameter in the fusion speed calculation is corrected, and the fusion speed is corrected based on the corrected weight parameter to obtain the target measurement speed.

[0137] For example, adaptive correction processing can be performed according to the following formula (5):

[0138]

[0139] Among them, R″ is the corrected error variance matrix, σ thr is the preset transmission gap threshold, σ is the transmission gap, and R1 is the mean square error of the first encoder.

[0140] The modified weight parameter using Markov estimation is: W = (R″) -1 .

[0141] The adaptively adjusted fusion speed can be obtained according to formula (6):

[0142]

[0143] in, is the fusion speed after adaptive adjustment.

[0144] When the transmission gap between the motor and the load of the target object is within a certain range, the motor low-speed estimation changes adaptively with the gap ratio. If the gap is larger within the threshold range, the weight of the first encoder is about half. If the gap is smaller, the measurement value of the second encoder can be trusted.

[0145] In this embodiment, by using the preset transmission gap threshold and the transmission gap to correct the weight parameter, and further using the corrected weight parameter to obtain the corrected fusion speed, the speed measurement accuracy can be improved, thereby improving the motion control accuracy of the target object.

[0146] In one embodiment, Figure 5 As shown, the method also includes:

[0147] S502, when the first measurement speed switches from satisfying the first preset condition to satisfying the second preset condition, or when the first measurement speed switches from satisfying the second preset condition to satisfying the first preset condition, obtaining a speed difference between the first measurement speed and the fusion speed; the first preset condition is that the first measurement speed is less than a speed threshold; the second preset condition is that the first measurement speed is greater than or equal to the speed threshold.

[0148] The first preset condition may be that the first measured speed is less than a speed threshold; the second preset condition may be that the first measured speed is greater than or equal to the speed threshold.

[0149] Exemplarily, the first measurement speed switches from satisfying the first preset condition to satisfying the second preset condition, which can be regarded as switching from low speed to high speed; the first measurement speed switches from satisfying the second preset condition to satisfying the first preset condition, which can be regarded as switching from high speed to low speed. In the case of switching from low speed to high speed or high speed to low speed, if the fusion speed and the first measurement speed of the first encoder differ greatly, switching jumps will be caused. At this time, the speed control error may cause a jump in current control, and switching handover processing is required to make the switching process smooth and reliable. The speed difference between the first measurement speed and the fusion speed can be used to perform switching handover processing to avoid direct jumps between the fusion speed and the first measurement speed, so as to achieve smooth conversion between speed switching and improve the accuracy of motion control of the target object.

[0150] S504: When the speed difference is greater than a preset difference threshold, a preset switching period is obtained.

[0151] The speed difference is the difference between the first measured speed and the fused speed in step S502. The preset difference threshold may be a preset threshold for judging the speed difference.

[0152] For example, if the speed difference is greater than a preset difference threshold, it can be considered that there will be a large speed jump when the speed is directly switched between the first measurement speed and the fusion speed, and a switching period can be set. In this way, the speed within the switching period can be adjusted to achieve a smooth change in the speed switch between the first measurement speed and the fusion speed.

[0153] S506, obtaining an optimization parameter for a fusion speed according to a difference between a mean square error of the first encoder and a mean square error of the second encoder;

[0154] S508, optimizing the fusion speed based on the optimization parameters to obtain the target measurement speed within the switching period.

[0155] Among them, the optimization parameter can be obtained according to the difference between the mean square error of the first encoder and the mean square error of the second encoder, and the fusion speed can be optimized to reduce the difference between the fusion speed and the first measurement speed. Based on the optimization parameter, the fusion speed within the switching period is optimized to obtain the fusion speed within the switching period, and the fusion speed within the switching period can be used as the target measurement speed within the switching period.

[0156] Optionally, the optimization parameters can be obtained according to the following formula (7):

[0157] r=(R1-R 2 ) / n(7)

[0158] Wherein, r is the optimization parameter, n is the switching period, and the switching period can be obtained according to n sampling periods.

[0159] In this embodiment, when switching from low speed to high speed or from high speed to low speed, the fusion speed is optimized by utilizing the difference between the mean square error of the first encoder and the mean square error of the second encoder, and the optimized fusion speed can be obtained as the target measurement speed, avoiding speed jumps within the switching cycle, thereby improving the control accuracy of the target object.

[0160] In one embodiment, the first encoder obtains the first measurement speed according to a preset sampling period, and the second encoder obtains the second measurement speed according to the sampling period; the switching period includes multiple sampling periods;

[0161] According to the difference between the mean square error of the first encoder and the mean square error of the second encoder, the optimization parameters for the fusion speed are obtained, including:

[0162] The ratio of the difference between the mean square error of the first encoder and the mean square error of the second encoder to the number of sub-cycles is used as a linear averaging parameter.

[0163] According to the linear averaging parameters and the order of each sub-period in the switching period, the optimization parameters corresponding to each sub-period are obtained.

[0164] The linear averaging parameter refers to the parameter for linearly averaging the mean square error difference within the switching period. By optimizing each sub-period within the switching period through the linear averaging parameter, it is possible to ensure that the speed of each sub-period is smoothly transitioned.

[0165] Exemplarily, a linear averaging parameter is obtained according to the ratio of the difference between the mean square error of the first encoder and the mean square error of the second encoder to the number of sub-periods. Further, an optimization parameter of each sub-period is obtained according to the linear averaging parameter and the order of each sub-period in the switching period.

[0166] Based on the optimization parameters, the fusion speed is optimized to obtain the target measurement speed within the switching cycle, including:

[0167] Based on the optimization parameters corresponding to each sub-period, the fusion speed of each sub-period is optimized to obtain the target measurement speed corresponding to each sub-period.

[0168] Exemplarily, based on the optimization parameters corresponding to each sub-cycle, the fusion speed of each sub-cycle is estimated and optimized to obtain the fusion speed corresponding to each sub-cycle, and the fusion speed corresponding to each sub-cycle is used as the target measurement speed corresponding to each sub-cycle.

[0169] Optionally, starting from the switching time k=1, 2, ..., n, the optimization parameters corresponding to each sub-period can be obtained according to the following formula (8):

[0170]

[0171] Wherein, R′(k) is the optimization parameter corresponding to the kth sub-period, k is the order of the sub-period in the switching period, R1 is the mean square error of the first encoder, R2 is the mean square error of the second encoder, and r is the linear averaging parameter.

[0172] The fusion speed of each sub-period can be optimized according to the following formula (9):

[0173]

[0174] in, is the optimized fusion speed corresponding to each sub-period.

[0175] In this embodiment, by taking the ratio of the difference between the mean square error of the first encoder and the mean square error of the second encoder to the number of sub-periods as a linear averaging parameter, and optimizing the fusion speed of each sub-period based on the linear averaging parameter, speed jumps within the switching period can be avoided, thereby improving the speed measurement accuracy of the target object, and further improving the motion control accuracy of the target object.

[0176] In one embodiment, obtaining a second measured speed of the target object using a second encoder includes:

[0177] acquiring an angular position of the target object at a second resolution by a second encoder;

[0178] The angular position is differentiated to obtain a second measured velocity of the target object.

[0179] Exemplarily, the position of the joint of the robot may be measured by an absolute encoder to obtain an angular position, and the second measurement speed may be obtained by performing differentiation processing on the angular position measured by the absolute encoder.

[0180] In this embodiment, the high-resolution second encoding is applied to the speed measurement, which can improve the resolution of the fused speed, thereby improving the accuracy of the speed measurement of the target object.

[0181] In one embodiment, a dual encoder speed measurement method is provided, such as Figure 6 The joint motion control architecture of the dual-axis robot and the joint motion control of the multi-axis robot are shown in a closed loop formed by a driver 610, a servo motor 620, a transmission mechanism 630, a load 640, and a sensor. The present embodiment provides dual encoders (a first encoder (encoder one) 650 and a second encoder 660 (encoder two)) as sensor closed loops to measure the motor angular velocity and the load angular position, respectively.

[0182] In this embodiment, the method includes the following steps:

[0183] like Figure 6 As shown, the first encoder uses an incremental rotary encoder to perform pulse sequence digital speed measurement. Suppose the single-turn encoding value of the first encoder is M1=2 b1 The second encoder uses a high-resolution absolute encoder to feedback the real-time position of the load. The single-turn encoding value of the second encoder is M2=2 b2 , and b1 <b2。

[0184] The incremental encoder (first encoder) uses the digital pulse sequence M / T method to measure speed. When the sampling period is T s , corresponding to a velocity resolution of 1 / T s The speed unit is cnt / s. The slower the sampling period, the higher the resolution of the corresponding speed. In the control system, the sampling period is related to the control period, which is usually several hundred or several thousand Hz.

[0185] The absolute encoder (second encoder) can obtain the corresponding load speed through differential calculation under the sampling period condition, and then the load speed is calculated through the encoder resolution ratio M=2 b1 / 2 b2, M<1, converted to the motor side speed. If the absolute encoder (second encoder) measurement value is stable, the differential speed resolution is higher; if the encoder measurement value itself fluctuates, the differential speed will have a large noise, which can be applied to low-speed fusion after a certain degree of filtering.

[0186] Assume that the first measurement speed measured by the first encoder is V1, the mean square error is R1, the second measurement speed measured by the second encoder is V2, the mean square error is R2, and R1>R2, which means that the incremental encoder has low resolution and large measurement noise.

[0187] Let the state variable Measurement matrix: The corresponding measurement equation is: Z = HV + U; where U is the random noise of the measurement value, with a mean of zero, and the error variance matrix is:

[0188] With W = R -1 For the unbiased estimation weight design, according to the weighted least squares method of Markov estimation, the state quantity estimation can be obtained as formula (2):

[0189]

[0190] The estimated error is: Then the mean square error of state estimation is:

[0191] Optionally, velocity fusion can take the inverse of the error variance matrix as the estimation weight, so that the measurement value with large error accounts for a small proportion in the estimation, and the measurement value with small error accounts for a large proportion in the estimation.

[0192] When the servo motor is moving at low speed, the speed information V2 of the absolute encoder has a higher resolution, and the weight of V2 in the feedback information of speed control can be set to be larger. In the case of high-speed movement, the incremental encoder is used to measure and feedback the speed, and the corresponding segmented speed measurement is shown in formula (1):

[0193]

[0194] Among them, V out Measure the speed of the target; is the fusion speed; V1 is the fusion speed; T s is the sampling period; N is an integer, and N can be 3 to 10.

[0195] The speed switching threshold from low speed to high speed (or, the speed switching threshold from high speed to low speed) is the incremental encoder speed resolution 1 / T sThe integer multiple N can be taken as N=3~10 according to the actual situation. However, at the moment of feedback speed switching (switching from low speed to high speed or from high speed to low speed), if the fusion speed and the first measurement speed of the first encoder differ greatly, it will cause switching jump. The speed control error at this time may cause the current control jump, and switching handover processing is required to make the switching process smooth and reliable. According to the difference in the mean square error of the dual encoders, the n sampling calculation cycles after the speed switching can be designed as the switching cycle.

[0196] According to formula (7), the difference between the mean square error of the first encoder and the mean square error of the second encoder is linearly averaged within the switching period: r = (R1-R2) / n (7).

[0197] Starting from the switching time k=1, 2, ..., n, the optimization parameters corresponding to each sub-period included in the switching period can be obtained according to the following formula (8): Wherein, R′(k) is the optimization parameter corresponding to the kth sub-period, k is the order of the sub-period in the switching period, R1 is the mean square error of the first encoder, R2 is the mean square error of the second encoder, and r is the linear averaging parameter.

[0198] The estimated speed within n sub-periods can be obtained according to the following formula (9): in, is the optimized fusion speed corresponding to each sub-period.

[0199] When switching from low speed to high speed, after entering the switching cycle for several cycles (k>2), if the actual measurement speed (first measurement speed) is always at the switching threshold N / T s In the case of jumping up and down nearby without quickly entering high speed, the fusion speed accuracy is still higher. The condition for judging whether the actual measured speed (first measured speed) jumps is when k=1,2,3, (N-1) / T s ≤V1(k)≤(N+1) / T s At this time, k=1 is reset, and V1(k) is the (first measurement speed) in the kth cycle.

[0200] The second encoder is installed at the load end. Assuming the mechanical transmission ratio is 1:1, there may be a transmission gap between mechanical transmissions. Taking the code value M1 of the first encoder installed on the motor output shaft as the benchmark, within a specific sampling period of m, if ΔM1 / M≠ΔM2, it is judged that there is a gap in the transmission mechanism, and the fusion speed measurement needs to be adaptively adjusted.

[0201] Every m cycles T from the beginning of sampling sAs a group, calculate the code value changes ΔM1 and ΔM2 of each encoder in each group, take j groups of change values ​​continuously, i = 1, 2...j, and obtain the gap proportion sequence (sub-transmission gap of each group) through the following formula (3):

[0202] The transmission clearance can be obtained by the following formula (4): Among them, σ represents the mean value of multiple groups of sub-transmission clearances.

[0203] If the transmission gap σ≈0, the dual encoder fusion speed remains unchanged.

[0204] If the transmission clearance σ≥σ thr , the preset transmission gap threshold σ thr ≤1%, the feedback speed is the speed value of the first encoder on the motor side.

[0205] If the transmission clearance is within a certain threshold, that is, 0<σ<σ thr , the least squares weighting using Markov estimation is improved by the following formula (5), and the weight can be adaptively calculated according to the gap ratio: In formula (5), the Markov estimation weight is: W = (R″) -1 .

[0206] The fusion speed is as shown in formula (6):

[0207] When the transmission gap between the motor and the load of the robot joint is within a certain range, the motor low-speed estimation changes adaptively with the gap ratio. If the gap is larger within the threshold range, the weight of the first encoder is about half. If the gap is smaller, the measurement value of the second encoder can be trusted.

[0208] like Figure 7 The figure shows the unfused encoder speed measurement information. The number of bits per turn of the first encoder (encoder 1) is set to b1 = 12, the number of bits per turn of the second encoder (encoder 2) is set to b2 = 17, and the sampling period is T s =0.001s, the motor given speed is V ref =10000cnt / s, we get Figure 7 (a) and (b) are encoder sampling speed values ​​shown; Figure 7 (a) is the encoder speed output; Figure 7 (b) is the encoder second speed output. Figure 7 (a) and (b) show that the speed resolution of the first encoder is about 1000cnt / s, and the second encoder has a higher resolution and a smaller speed measurement error. The measurement mean square error of the two sensors satisfies R1>R2.

[0209] The weighted least squares method of Markov estimation provided in this embodiment is used to fuse the dual encoding speed information. Figure 8 As shown by Figure 8 It can be seen that the fused speed estimation has low noise and high accuracy, which is more conducive to the speed closed-loop control of the motor.

[0210] If the fusion speed needs to be cut out and transitioned to the measurement value of the first encoder, n = 20 handover cycles are designed. Fig. 9 As shown, it can be seen that the improved fusion speed measurement smoothly transitions to the value of the first measurement speed V1 during the handover process.

[0211] Assume the threshold of mechanical transmission clearance is σ thr =1%. When the actual gaps obtained by sampling are σ=0.001 and σ=0.01, the adaptive fusion speed measurement output is as follows: Fig.10 As shown in (a) and (b), 10(a) is the adaptive fusion speed measurement output when σ = 0.001; 10(b) is the adaptive fusion speed measurement output when σ = 0.01. Fig.10 (a) and (b) show that when the transmission gap is very small, the high-resolution encoder speed value still accounts for a large proportion in the output fusion speed, which is beneficial to improving the accuracy of speed feedback information; when the gap tends to the reference critical gap, the low-resolution speed value accounts for half of the estimation weight.

[0212] In this embodiment, segmented speed measurement is adopted to fuse the speed information measured by the dual encoders under low-speed conditions, improve the resolution of low-speed speed measurement, and make the low-speed motion control of the joint motor highly accurate. Speed ​​measurement handover is designed at the low and high speed segments to make the speed measurement continuous and highly reliable. In view of the possible transmission gap problem in the intermediate transmission mechanism from the motor output to the load, an adaptive adjustment factor is designed in the fusion speed measurement algorithm to reduce the impact of the gap on the fusion speed accuracy.

[0213] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0214] Based on the same inventive concept, the embodiment of the present application also provides a dual encoder speed measuring device for implementing the dual encoder speed measuring method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more dual encoder speed measuring device embodiments provided below can refer to the limitations of the dual encoder speed measuring method above, and will not be repeated here.

[0215] In one embodiment, Fig.11 As shown, a dual encoder speed measuring device 900 is provided, comprising: a first measurement speed acquisition module 910, a second measurement speed acquisition module 920, a fusion speed acquisition module 930 and a target speed determination module 940, wherein:

[0216] The first measurement speed acquisition module 910 is used to acquire a first measurement speed of the target object using a first encoder.

[0217] The second measurement speed acquisition module 920 is used to acquire the second measurement speed of the target object using a second encoder; the resolution of the first encoder is smaller than the resolution of the second encoder.

[0218] The fusion speed acquisition module 930 is used to acquire the fusion speed according to the first measurement speed and the second measurement speed.

[0219] The target speed determination module 940 is used to determine the target measurement speed of the target object according to the first measurement speed and the fusion speed.

[0220] In one embodiment, the fusion speed acquisition module includes a first condition unit and a second condition unit.

[0221] The first condition unit is used to determine the target measurement speed of the target object based on the fusion speed when the first measurement speed is less than the speed threshold. The second condition unit is used to determine the target measurement speed of the target object based on the first measurement speed when the first measurement speed is greater than or equal to the speed threshold; the speed threshold is related to the resolution of the first encoder.

[0222] In one embodiment, the fused speed acquisition module includes a least squares unit. The least squares unit is used to fuse the first measured speed and the second measured speed using weighted least squares to obtain the fused speed.

[0223] In one embodiment, the first encoder is disposed on the motor; the second encoder is disposed on the load; and the motor is used to drive the load to move.

[0224] The fusion speed acquisition module includes a transmission gap acquisition unit and an adaptive adjustment unit. The transmission gap acquisition unit is used to acquire the transmission gap between the motor and the load. The adaptive adjustment unit is used to adaptively adjust the fusion speed according to the comparison between the transmission gap between the motor and the load and the preset transmission gap threshold.

[0225] In one embodiment, the first encoder obtains the first measurement speed according to a preset sampling period, and the second encoder obtains the second measurement speed according to the sampling period. The transmission gap acquisition unit includes an encoding value acquisition unit, an encoding value variation unit, a sub-transmission gap determination unit and a transmission gap determination unit.

[0226] The encoding value acquisition unit is used to obtain the first encoding value corresponding to each sampling period of the first encoder, and the second encoding value corresponding to each sampling period of the second encoder. The encoding value variation unit is used to obtain the first encoding value variation corresponding to the first encoder according to each first encoding value, and to obtain the second encoding value variation corresponding to the second encoder according to each second encoding value. The sub-transmission gap determination unit is used to obtain the variation difference between the first encoding value variation and the second encoding value variation, and use the ratio of the variation difference to each second encoding value as the sub-transmission gap corresponding to each sampling period. The transmission gap determination unit is used to use the average of the sub-transmission gaps of each sampling period as the transmission gap.

[0227] In one embodiment, the adaptive adjustment unit includes a third condition unit and a fourth condition unit.

[0228] The third condition unit is used to, when the transmission gap is not less than the preset transmission gap threshold, fuse the speed to the first measurement speed. The fourth condition unit is used to, when the transmission gap is less than the preset transmission gap threshold, correct the weight parameter in the fusion speed calculation to obtain the target measurement speed.

[0229] In one embodiment, the fourth condition unit includes a correction parameter determination unit and a correction processing unit.

[0230] The correction parameter determination unit is used to obtain the correction parameter for the fusion speed according to the difference between the transmission gap and the transmission gap threshold. The correction processing unit is used to perform correction processing on the fusion speed based on the correction parameter to obtain the target measurement speed.

[0231] In one embodiment, the device further includes a conditional switching module, a switching cycle acquisition module, an optimization parameter determination module and an optimization processing module.

[0232] The conditional switching module is used to obtain the speed difference between the first measurement speed and the fusion speed when the first measurement speed switches from satisfying the first preset condition to satisfying the second preset condition, or when the first measurement speed switches from satisfying the second preset condition to satisfying the first preset condition; the first preset condition is that the first measurement speed is less than the speed threshold; the second preset condition is that the first measurement speed is greater than or equal to the speed threshold. The switching cycle acquisition module is used to obtain a preset switching cycle when the speed difference is greater than a preset difference threshold. The optimization parameter determination module is used to obtain the optimization parameters for the fusion speed based on the difference between the mean square error of the first encoder and the mean square error of the second encoder. The optimization processing module is used to optimize the fusion speed based on the optimization parameters to obtain the target measurement speed within the switching cycle.

[0233] In one embodiment, the optimization parameter determination module includes a linear averaging parameter unit and a sub-period parameter unit. The optimization processing module includes a sub-period optimization unit.

[0234] The linear averaging parameter unit is used to use the ratio of the difference between the mean square error of the first encoder and the mean square error of the second encoder to the number of sub-periods as a linear averaging parameter. The linear averaging parameter unit is used to obtain the optimization parameters corresponding to each sub-period according to the linear averaging parameter and the order of each sub-period in the switching period. The sub-period optimization unit is used to optimize the fusion speed of each sub-period based on the optimization parameters corresponding to each sub-period to obtain the target measurement speed corresponding to each sub-period.

[0235] In one embodiment, the second measurement speed acquisition module includes an angle position acquisition unit and a differential processing unit. The angle position acquisition unit is used to acquire the angle position of the target object with a second resolution through a second encoder. The differential processing unit is used to perform differential processing on the angle position to obtain the second measurement speed of the target object.

[0236] Each module in the dual encoder speed measuring device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0237] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.12As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the first measurement speed and the second measurement speed data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a dual encoder speed measurement method is implemented.

[0238] Those skilled in the art will understand that Fig.12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0239] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0240] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

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

[0242] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0243] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0244] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A dual encoder speed measurement method, characterized in that: The method comprises: acquiring a first measured velocity of the target object using a first encoder; Using a second encoder to obtain a second measured speed of the target object; the resolution of the first encoder is smaller than the resolution of the second encoder; Acquire a fusion speed according to the first measurement speed and the second measurement speed; A target measurement speed of the target object is determined according to the first measurement speed and the fusion speed.

2. The method according to claim 1, characterized in that The determining the target measurement speed of the target object according to the first measurement speed and the fusion speed includes: When the first measured speed is less than a speed threshold, determining a target measured speed of the target object based on the fused speed; In a case where the first measurement speed is greater than or equal to the speed threshold, a target measurement speed of the target object is determined based on the first measurement speed; the speed threshold is related to a resolution of the first encoder.

3. The method according to claim 1, characterized in that The acquiring the fusion speed according to the first measurement speed and the second measurement speed includes: The first measurement speed and the second measurement speed are fused by using weighted least squares to obtain a fused speed.

4. The method according to claim 1, characterized in that: The first encoder is arranged on the motor; the second encoder is arranged on the load; the motor is used to drive the load to move; The acquiring of the fusion speed according to the first measurement speed and the second measurement speed further includes: Obtaining a transmission gap between the motor and the load; The fusion speed is adaptively adjusted according to the comparison between the transmission gap between the motor and the load and the preset transmission gap threshold.

5. The method according to claim 4, characterized in that The first encoder acquires the first measurement speed according to a preset sampling period, and the second encoder acquires the second measurement speed according to the sampling period; The obtaining of the transmission clearance between the motor and the load comprises: Obtaining a first encoding value corresponding to each sampling period of the first encoder and a second encoding value corresponding to each sampling period of the second encoder; According to each of the first coding values, obtain a first coding value change amount corresponding to the first encoder, and according to each of the second coding values, obtain a second coding value change amount corresponding to the second encoder; Obtaining a difference between the first code value change and the second code value change, and using a ratio of the difference to each of the second code values ​​as a sub-transmission gap corresponding to each of the sampling periods; The average value of the sub-transmission gaps in each of the sampling periods is taken as the transmission gap.

6. The method according to claim 4, characterized in that The step of adaptively adjusting the fusion speed according to comparing the transmission gap between the motor side and the load side with a preset transmission gap threshold comprises: When the transmission gap is not less than a preset transmission gap threshold, the fusion speed is the first measurement speed; When the transmission gap is less than a preset transmission gap threshold, the weight parameter in the fusion speed calculation is corrected according to the transmission gap and the transmission gap threshold to obtain the target measurement speed.

7. The method according to claim 6, characterized in that The step of correcting the weight parameter in the fusion speed calculation according to the transmission gap and the transmission gap threshold to obtain the target measurement speed includes: Obtaining a correction parameter for the fusion speed according to a difference between the transmission gap and the transmission gap threshold; Based on the correction parameter, the fusion speed is corrected to obtain the target measurement speed.

8. The method according to claim 2, characterized in that: The method further comprises: When the first measurement speed switches from satisfying the first preset condition to satisfying the second preset condition, or when the first measurement speed switches from satisfying the second preset condition to satisfying the first preset condition, obtaining a speed difference between the first measurement speed and the fusion speed; the first preset condition is that the first measurement speed is less than the speed threshold; the second preset condition is that the first measurement speed is greater than or equal to the speed threshold; When the speed difference is greater than a preset difference threshold, obtaining a preset switching period; Obtaining an optimization parameter for the fusion speed according to a difference between a mean square error of the first encoder and a mean square error of the second encoder; Based on the optimization parameters, the fusion speed is optimized to obtain a target measurement speed within the switching period.

9. The method according to claim 8, characterized in that The first encoder acquires the first measurement speed according to a preset sampling period, and the second encoder acquires the angle position according to the sampling period; the switching period includes a plurality of sampling periods; The step of obtaining an optimization parameter for the fusion speed according to a difference between a mean square error of the first encoder and a mean square error of the second encoder includes: taking a ratio of a difference between a mean square error of the first encoder and a mean square error of the second encoder to the number of the sub-periods as a linear averaging parameter; According to the linear averaging parameter and the order of each sub-period in the switching period, obtaining the optimization parameter corresponding to each sub-period; The optimizing the fusion speed based on the optimization parameter to obtain the target measurement speed within the switching period includes: Based on the optimization parameters corresponding to the sub-periods, the fusion speeds of the sub-periods are optimized to obtain the target measurement speeds corresponding to the sub-periods.

10. The method according to claim 1, characterized in that The obtaining a second measured speed of the target object by using a second encoder comprises: acquiring the angular position of the target object with a second resolution by the second encoder; The angular position is differentiated to obtain a second measured velocity of the target object.

11. A dual encoder speed measuring device, characterized in that: The device comprises: A first measurement speed acquisition module, used for acquiring a first measurement speed of a target object using a first encoder; A second measurement speed acquisition module, used for acquiring a second measurement speed of the target object using a second encoder; the resolution of the first encoder is smaller than the resolution of the second encoder; a fusion speed acquisition module, configured to acquire a fusion speed according to the first measurement speed and the second measurement speed; A target speed determination module is used to determine a target measurement speed of the target object according to the first measurement speed and the fusion speed.

12. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 10 are implemented.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.

14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.