Speed calculation method and device based on magnetic encoder, robot
By dynamically adjusting the velocity filter window length according to the filtered acceleration value, the lack of anti-interference and speed response capabilities of the speed calculation method based on the absolute magnetic encoder is solved, and high-precision speed feedback and fast response capabilities are achieved in different scenarios, improving the closed-loop control performance of the robot.
Patent Information
- Application Number
- CN202210778560.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-30
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2042-06-30
AI Technical Summary
The speed calculation method based on absolute magnetic encoder has shortcomings in its anti-interference ability and speed response ability, especially when noise exists, there is a large deviation from the real speed, and the speed changes cannot be accurately identified during speed change, which cannot meet the rapid response needs of the robot's periodic motion to speed.
The second velocity filter window length is determined based on the filtered acceleration value of each sampling time, and the filtered speed at the current sampling time is determined based on the second velocity filter window length and the original speed value of each sampling time. The length of the filter window is determined according to the acceleration value. A longer filter window is used when the acceleration value is small to ensure the speed measurement accuracy in the constant speed state; a shorter filter window is used when the acceleration value is large to ensure the speed response capability in the variable speed state.
It can meet the speed feedback requirements in different scenarios, which not only ensures the speed measurement accuracy in constant speed state, but also ensures the speed response capability in variable speed state, and improves the closed-loop control performance and operation stability of the robot.
Smart Images

Figure CN114986513B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of speed detection, and in particular to a speed calculation method and device based on a magnetic encoder, and a robot. Background Art
[0002] In a robot motion control system, an absolute magnetic encoder is usually used as a position sensor for each joint of the robot to provide speed feedback to achieve closed-loop control of each joint.
[0003] At present, the speed calculation based on absolute magnetic encoder mostly adopts the following two methods:
[0004] The first method is to calculate the current speed according to the formula V = (P-P') / T, where V is the current speed, P is the current sampling position, P' is the previous sampling position, and T is the position sampling period (i.e., the time difference between two sampling positions);
[0005] However, since the position feedback of the magnetic encoder generally contains noise, the first method mentioned above has poor anti-interference ability, resulting in a large deviation between the calculated speed and the actual speed;
[0006] The second method is to introduce Figure 1 The filter window (FIFO) shown in the figure stores the sampling positions P1, P2, ..., PN in the filter window in chronological order, updates the sampling positions in the filter window by shifting the data left, and calculates the current speed according to the formula V = (PN-P1) / (N*T), wherein V is the current speed, PN is the Nth sampling position, P1 is the 1st sampling position, N is the length of the filter window, and T is the position sampling period.
[0007] Although the second method smoothes the position noise, due to the long filter window, the sudden and rapid changes in speed cannot be accurately identified when the filter window is long, and the rapid speed tracking during speed change cannot be met. There is a situation where the calculated speed seriously lags behind the actual speed, and thus the robot's periodic motion cannot meet the rapid response requirements for speed; when the filter window is short, the speed noise suppression ability is poor, and the high-precision requirements of speed cannot be met, and thus the low-noise requirements of speed when the robot is stationary or at low speed cannot be met. Summary of the invention
[0008] The present invention aims to solve one of the technical problems in the related art to at least a certain extent. To this end, the first purpose of the present invention is to propose a speed calculation method based on a magnetic encoder, by determining the second speed filter window length according to the filtered acceleration value at each sampling moment, and determining the filtered speed at the current sampling moment according to the second speed filter window length and the original speed value at each sampling moment. Since the filter window length is determined according to the acceleration value, when the acceleration value is small, a longer filter window can be used to obtain more speed values to calculate the speed at the current moment, ensuring the speed measurement accuracy under the constant speed state, and when the acceleration value is large, a shorter filter window can be used to obtain fewer speed values to calculate the speed at the current moment, ensuring the speed response capability under the variable speed state, thereby meeting the speed feedback requirements in various scenarios.
[0009] The second object of the present invention is to provide a speed calculation device based on a magnetic encoder.
[0010] The third object of the present invention is to provide a robot.
[0011] To achieve the above-mentioned purpose, the first embodiment of the present invention proposes a speed calculation method based on a magnetic encoder, including: calculating the original speed value at each sampling moment according to the position information detected by the magnetic encoder; storing the original speed values in a first speed filter window in sequence; calculating the original acceleration value at each sampling moment according to the original speed value at each sampling moment; filtering the original acceleration value to obtain a filtered acceleration value at each sampling moment; determining the length of the second speed filter window according to the filtered acceleration value; and determining the filtered speed value at the current sampling moment according to the original speed value at each sampling moment within the second speed filter window length.
[0012] According to the speed calculation method based on the magnetic encoder of the embodiment of the present invention, the original speed value at each sampling moment is determined according to the position information detected by the magnetic encoder, and the filtered acceleration value at each sampling moment is calculated according to the original speed value at each sampling moment, and the second speed filter window length is determined according to the filtered acceleration value at each sampling moment, and the filtered speed value at the current sampling moment is determined according to the second speed filter window length and the original speed value at each sampling moment. Since the filter window length is determined according to the acceleration value, when the acceleration value is small, a longer filter window can be used to obtain more speed values to calculate the speed at the current moment, ensuring the speed measurement accuracy under the constant speed state, and when the acceleration value is large, a shorter filter window can be used to obtain less speed values to calculate the speed at the current moment, ensuring the speed response capability under the variable speed state, thereby meeting the speed feedback requirements in various scenarios.
[0013] According to one embodiment of the present invention, the original speed values are stored in the first speed filter window in sequence, including: storing the original speed values in the first speed filter window in sequence according to the speed update index, wherein when the index value of the speed update index is greater than the length of the first speed filter window, the index value of the speed update index is reset to 1.
[0014] According to one embodiment of the present invention, filtering the original acceleration value to obtain the filtered acceleration value at each sampling moment includes: determining a filter type; determining a filtering formula according to the filter type, and filtering the original acceleration value according to the filtering formula to obtain the filtered acceleration value at each sampling moment, wherein when the filter type is a first-order low-pass filter, the filtered acceleration value at the current sampling moment is calculated according to the following formula:
[0015]
[0016] in, is the filtered acceleration value at the current sampling moment, is the original acceleration value at the last sampling moment, is the original acceleration value at the current sampling moment, i a is the acceleration update index, ε1 and ε2 are first-order low-pass filter coefficients, and N is an integer greater than or equal to 2.
[0017] According to one embodiment of the present invention, the second speed filter window length is calculated according to the following formula:
[0018]
[0019] in, is the second speed filter window length, ε3 is the filter window coefficient, is the filtered acceleration value at the current sampling moment, i a The acceleration update index, where N is an integer greater than or equal to 2.
[0020] According to one embodiment of the present invention, the filtered speed value at the current sampling moment is calculated according to the following formula:
[0021]
[0022] Among them, V is the filtered speed value at the current sampling time, V k is the kth original velocity value, is the second speed filter window length, i a The acceleration update index, where N is an integer greater than or equal to 2.
[0023] To achieve the above-mentioned purpose, the second embodiment of the present invention proposes a speed calculation device based on a magnetic encoder, including: a first processing module, used to calculate the original speed value at each sampling moment according to the position information detected by the magnetic encoder, and store the original speed value in a first speed filter window in sequence; a second processing module, used to calculate the original acceleration value at each sampling moment according to the original speed value at each sampling moment, and filter the original acceleration value to obtain a filtered acceleration value at each sampling moment; a third processing module, used to determine the length of the second speed filter window according to the filtered acceleration value, and determine the filtered speed value at the current sampling moment according to the original speed value at each sampling moment within the second speed filter window length.
[0024] According to the speed calculation device based on the magnetic encoder of the embodiment of the present invention, the original speed value at each sampling moment is calculated by the first processing module according to the position information detected by the magnetic encoder, and the filtered acceleration value at each sampling moment is obtained by the second processing module after calculation according to the original speed value at each sampling moment, and the second speed filter window length is determined according to the filtered acceleration value by the third processing module, and the filtered speed at the current sampling moment is determined according to the second speed filter window length and the original speed value at each sampling moment. Since the filter window length is determined according to the acceleration value, when the acceleration value is small, a longer filter window can be used to obtain more speed values to calculate the speed at the current moment, ensuring the speed measurement accuracy in the constant speed state, and when the acceleration value is large, a shorter filter window can be used to obtain less speed values to calculate the speed at the current moment, ensuring the speed response capability in the variable speed state, thereby meeting the speed feedback requirements in various scenarios.
[0025] According to one embodiment of the present invention, the first processing module is specifically used to: store the original speed values in the first speed filtering window in sequence according to the speed update index, wherein when the index value of the speed update index is greater than the length of the first speed filtering window, the index value of the speed update index is reset to 1.
[0026] According to one embodiment of the present invention, the second processing module is specifically used to: determine the filter type; determine the filtering formula according to the filter type, and filter the original acceleration value according to the filtering formula to obtain the filtered acceleration value at each sampling moment, wherein when the filter type is a first-order low-pass filter, the filtered acceleration value at the current sampling moment is calculated according to the following formula:
[0027]
[0028] in, is the filtered acceleration value at the current sampling moment, is the original acceleration value at the last sampling moment, is the original acceleration value at the current sampling moment, i a is the acceleration update index, ε1 and ε2 are first-order low-pass filter coefficients, and N is an integer greater than or equal to 2.
[0029] According to one embodiment of the present invention, the third processing module is specifically used to calculate the second speed filter window length according to the following formula:
[0030]
[0031] in, is the second speed filter window length, ε3 is the filter window coefficient, is the filtered acceleration value at the current sampling moment, i a The acceleration update index, where N is an integer greater than or equal to 2.
[0032] According to one embodiment of the present invention, the third processing module is specifically used to calculate the filtered speed value at the current sampling moment according to the following formula:
[0033]
[0034] Among them, V is the filtered speed value at the current sampling time, V k is the kth original velocity value, is the second speed filter window length, i a The acceleration update index, where N is an integer greater than or equal to 2.
[0035] To achieve the above-mentioned objectives, the third aspect of the present invention proposes a robot, comprising a memory, a processor, and a speed calculation program based on a magnetic encoder stored in the memory and executable on the processor. When the processor executes the speed calculation program based on the magnetic encoder, the speed calculation method based on the magnetic encoder is implemented.
[0036] The robot according to the embodiment of the present invention can ensure the speed measurement accuracy under constant speed state and the speed response capability under variable speed state through the aforementioned speed calculation method based on magnetic encoder, thereby meeting the low noise requirement of the robot when it is stationary or at low speed and the rapid response requirement of the robot's periodic motion to speed, effectively improving the closed-loop control performance of the robot and further improving the stability of the robot's operation.
[0037] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A schematic diagram of a filter window of a speed calculation method in the related art;
[0039] Figure 2 is a flow chart of a speed calculation method based on a magnetic encoder according to an embodiment of the present invention;
[0040] Figure 3 is a schematic structural diagram of a first speed filter window according to an embodiment of the present invention;
[0041] Figure 4 is a schematic diagram of the structure of an acceleration filter window according to an embodiment of the present invention;
[0042] Figure 5 2 is a schematic diagram of the structure of a speed calculation device based on a magnetic encoder according to an embodiment of the present invention;
[0043] Figure 6 Schematic diagram of the structure of a robot according to an embodiment of the present invention. DETAILED DESCRIPTION
[0044] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0045] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent components are only used to facilitate the description of the present invention, and have no specific meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.
[0046] See also Figure 2 , is a flow chart of a speed calculation method based on a magnetic encoder according to an embodiment of the present invention. The speed calculation method based on a magnetic encoder may include the following steps:
[0047] S1, calculates the original speed value at each sampling moment according to the position information detected by the magnetic encoder.
[0048] Specifically, the magnetic encoder can be an absolute magnetic encoder. When in use, the magnetic encoder is installed on the object to be measured (such as a robot joint) to detect the position information of the object to be measured, and then the original speed value at each sampling moment is calculated based on the detected position information. For example, the position difference between the position information at the current sampling moment and the position information at the previous sampling moment can be calculated first, and the time difference between the two sampling moments can be calculated, and then the ratio of the position difference to the time difference can be calculated to obtain the original speed value at the current sampling moment, and the original speed value contains noise interference.
[0049] S2, storing the original speed values in the first speed filter window in sequence;
[0050] Specifically, a filter window with a length of N (N is a fixed value, specifically an integer greater than or equal to 2, and a larger value can be selected) is introduced as the first speed filter window. The structure of the first speed filter window is as follows: Figure 3 As shown, it is used to store the original speed value at each sampling moment, such as V1, V2, ..., V N .
[0051] In some embodiments, storing the original speed values in the first speed filter window in sequence includes: storing the original speed values in the first speed filter window in sequence according to the speed update index, wherein when the index value of the speed update index is greater than the length of the first speed filter window, the index value of the speed update index is reset to 1.
[0052] That is, we can introduce a speed update index i v , update index i according to speed v The original speed value of each sampling moment calculated in the above steps is stored in the first speed filter window in turn. v When the index value of is greater than the length of the first speed filter window, the speed is updated to index i v The index value is reset to 1 (for the sake of clarity and simplicity, this application assumes that the index is in the appropriate position and there is no overflow after index addition and subtraction calculations), and the index i is updated by introducing the speed v There is no need to perform a cyclic shift operation when the first speed filter window is updated, thereby reducing the amount of calculation for updating the filter window.
[0053] S3, calculating the original acceleration value at each sampling moment according to the original velocity value at each sampling moment.
[0054] Specifically, there are multiple ways to calculate the original acceleration value at each sampling moment based on the original speed value at each sampling moment. For example, the original acceleration at the current sampling moment can be calculated based on the original speed value at the previous sampling moment and the original speed value at the current sampling moment, that is, the speed difference between the original speed value at the current sampling moment and the original speed value at the previous sampling moment is first calculated, and the time difference between the two sampling moments is calculated, and then the ratio of the speed difference to the time difference is calculated to obtain the original acceleration at the current sampling moment.
[0055] S4, filtering the original acceleration value to obtain a filtered acceleration value at each sampling moment;
[0056] Specifically, since the original acceleration contains noise interference, in order to further improve the accuracy of the acceleration value at each sampling moment, the original acceleration may be filtered to obtain a filtered acceleration value at each sampling moment.
[0057] In some embodiments, filtering the original acceleration value to obtain the filtered acceleration value at each sampling moment includes: determining the filter type; determining the filtering formula according to the filter type, and filtering the original acceleration value according to the filtering formula to obtain the filtered acceleration value at each sampling moment.
[0058] That is to say, the original acceleration at each sampling moment can be filtered by a filter and software to obtain a more accurate acceleration value at each sampling moment. Optionally, the filter can be a first-order low-pass filter, a second-order low-pass filter, etc., which can be selected based on actual needs. For example, under the condition of meeting the accuracy requirements, a low-pass filter with a smaller order can be selected to reduce the amount of calculation, such as a first-order low-pass filter.
[0059] As an example, when the filter type is a first-order low-pass filter, the filtered acceleration value at the current sampling moment is calculated according to the following formula (1):
[0060]
[0061] in, is the filtered acceleration value at the current sampling moment, is the original acceleration value at the last sampling moment, is the original acceleration value at the current sampling moment, i a is the acceleration update index, ε1 and ε2 are first-order low-pass filter coefficients, which can be calculated based on the acceleration noise spectrum. N is an integer greater than or equal to 2.
[0062] It should be noted that, in this example, the calculation of the filtered acceleration value at the current sampling moment includes the original acceleration value at the previous sampling moment and the original acceleration value at the current sampling moment, so an acceleration filter window with a length of N can be introduced. The structure of the acceleration filter window is as follows: Figure 4 As shown, it is used to store the original acceleration values at each sampling moment, such as a1, a2, ..., a N , and the acceleration filter window corresponds to the first velocity filter window one by one to ensure that the original velocity value at each sampling moment corresponds to the original acceleration value one by one. At the same time, the acceleration acceleration update index i can be introduced a , used to indicate the storage location of the original acceleration value at the current sampling moment in the corresponding filter window, i v =i a It should be noted that the acceleration update index i a The working method of the speed update index is similar to that of the velocity update index, which will not be described here. By introducing the acceleration update index i a It can reduce the amount of calculation for updating the acceleration filter window.
[0063] In the above embodiment, by filtering the original acceleration to eliminate noise interference, a relatively accurate acceleration value at each sampling moment can be obtained, so that the subsequently determined second velocity filter window length is more accurate.
[0064] S5, determining a second velocity filter window length according to the filtered acceleration value.
[0065] Specifically, the second speed filter window refers to the filter window corresponding to the original speed value when the filtered speed value at the current sampling moment is selected from the fixed first speed filter window. The length of the second speed filter window is variable, and the specific length is determined by the filtered acceleration value at each sampling moment. For example, when the filtered acceleration value is large, the length of the second speed filter window can be set shorter; when the filtered acceleration value decreases, the length of the second speed filter window can be set longer. That is, the filtered acceleration value is inversely proportional to the length of the second speed filter window.
[0066] In some embodiments, the second speed filter window length may be calculated according to the following formula (2):
[0067]
[0068] in, is the second speed filter window length, ε3 is the filter window coefficient, is the filtered acceleration value at the current sampling moment, i a Update the index for acceleration, ε4 is the minimum filter window length, which is determined by the characteristics of the magnetic encoder.
[0069] S6, determining the filtered speed value at the current sampling moment according to the original speed value at each sampling moment within the second speed filtering window length.
[0070] Specifically, the speed values at all sampling moments within the second speed filter window length can be averaged to obtain the filtered speed value at the current sampling moment. Since the second speed filter window length is determined by the filtered acceleration value, when the filtered acceleration value is large, the second speed filter window length is short, so that the original speed values involved in the calculation of the filtered speed value at the current sampling moment are relatively small, that is, the calculation of the filtered speed value at the current sampling moment is less affected by the previous original speed value, so that a fast speed response can be achieved to meet the speed response capability during speed change; when the filtered acceleration value is small, the second speed filter window length is long, so that the original speed values involved in the calculation of the filtered speed value at the current sampling moment are relatively large, and more original speed values can better offset most of the noise interference, so that the filtered speed value at the current sampling moment is more accurate, meeting the speed measurement accuracy during constant speed.
[0071] In some embodiments, the filtered speed value at the current sampling moment may be calculated according to the following formula (3):
[0072]
[0073] Among them, V is the filtered speed value at the current sampling time, V k is the kth original velocity value, is the second speed filter window length, i a Update the index for acceleration.
[0074] It can be seen from the above formula (3) that the filtered speed value V at the current sampling time is obtained by calculating the second speed filter window length The velocity value V at all sampling moments within k The average is obtained, and the current filter window length Determines the original speed value V involved in the calculation k And from the above formula (2), it can be seen that the second speed filter window length The filtered acceleration value at the current sampling time is inversely proportional, so when the acceleration value after filtering When the speed changes slowly, the second speed filter window length becomes larger, the original speed value V involved in the calculation k The number of speed values increases, and more speed values can make the filtered speed value V calculated at the current sampling moment more accurate and less affected by noise; when the filtered acceleration value When the speed increases, that is, the speed changes faster, the second speed filter window length becomes smaller, the original speed value V involved in the calculation k The number of is reduced, so that the filtered speed value V calculated at the current sampling moment is more sensitive to the speed value change, achieving high dynamic response. In this way, the calculation accuracy of the current speed in the constant speed state can be improved, and the response speed of the current speed in the variable speed state can be improved, meeting different speed feedback requirements.
[0075] In the above embodiment, since the filter window length is determined according to the acceleration value, when the acceleration value is small, a longer filter window can be used to obtain more speed values to calculate the current speed, thereby ensuring the speed measurement accuracy under the constant speed state; and when the acceleration value is large, a shorter filter window can be used to obtain fewer speed values to calculate the current speed, thereby ensuring the speed response capability under the variable speed state, thereby meeting the speed feedback requirements in various scenarios.
[0076] In summary, according to the speed calculation method based on the magnetic encoder in the embodiment of the present invention, the second speed filter window length is determined according to the filtered acceleration value at each sampling moment, and the filtered speed at the current sampling moment is determined according to the second speed filter window length and the original speed value at each sampling moment. Since the filter window length is determined according to the acceleration value, when the acceleration value is small, a longer filter window can be used to obtain more speed values to calculate the speed at the current moment, thereby ensuring the speed measurement accuracy under the constant speed state; and when the acceleration value is large, a shorter filter window can be used to obtain fewer speed values to calculate the speed at the current moment, thereby ensuring the speed response capability under the variable speed state, thereby meeting the speed feedback requirements in various scenarios; at the same time, by filtering the original acceleration to obtain the filtered acceleration value at each sampling moment, the accuracy of the acceleration value can be improved, thereby improving the accuracy of the second speed filter window length, and improving the accuracy of the speed at the current sampling moment.
[0077] In addition, the embodiment of the present invention also proposes a speed calculation device based on a magnetic encoder, referring to Figure 5 As shown, the speed calculation device 100 based on the magnetic encoder includes: a first processing module 110 , a second processing module 120 and a third processing module 130 .
[0078] Among them, the first processing module 110 is used to calculate the original speed value at each sampling moment according to the position information detected by the magnetic encoder, and store the original speed value in the first speed filter window in sequence; the second processing module 120 is used to calculate the original acceleration value at each sampling moment according to the original speed value at each sampling moment, and filter the original acceleration value to obtain the filtered acceleration value at each sampling moment; the third processing module 130 is used to determine the second speed filter window length according to the filtered acceleration value, and determine the filtered speed value at the current sampling moment according to the original speed value at each sampling moment within the second speed filter window length. .
[0079] According to one embodiment of the present invention, the first processing module is specifically used to: store the original speed values in the first speed filtering window in sequence according to the speed update index, wherein when the index value of the speed update index is greater than the length of the first speed filtering window, the index value of the speed update index is reset to 1.
[0080] According to one embodiment of the present invention, the second processing module is specifically used to: determine the filter type; determine the filtering formula according to the filter type, and filter the original acceleration value according to the filtering formula to obtain the filtered acceleration value at each sampling moment, wherein when the filter type is a first-order low-pass filter, the filtered acceleration value at the current sampling moment is calculated according to the following formula:
[0081]
[0082] in, is the filtered acceleration value at the current sampling moment, is the original acceleration value at the last sampling moment, is the original acceleration value at the current sampling moment, i a is the acceleration update index, ε1 and ε2 are first-order low-pass filter coefficients, and N is an integer greater than or equal to 2.
[0083] According to one embodiment of the present invention, the third processing module is specifically used to calculate the second speed filter window length according to the following formula:
[0084]
[0085] in, is the second speed filter window length, ε3 is the filter window coefficient, is the filtered acceleration value at the current sampling moment, i a The acceleration update index, where N is an integer greater than or equal to 2.
[0086] According to one embodiment of the present invention, the third processing module is specifically used to calculate the filtered speed value at the current sampling moment according to the following formula:
[0087]
[0088] Among them, V is the filtered speed value at the current sampling time, V k is the kth original velocity value, is the second speed filter window length, i a The acceleration update index, where N is an integer greater than or equal to 2.
[0089] The extended content of the specific implementation of the speed calculation device 100 based on the magnetic encoder according to the embodiment of the present invention is basically the same as the various embodiments of the speed calculation method based on the magnetic encoder described above, and will not be elaborated here.
[0090] According to the speed calculation device based on the magnetic encoder of the embodiment of the present invention, the second speed filter window length is determined according to the filtered acceleration value at each sampling moment, and the filtered speed at the current sampling moment is determined according to the second speed filter window length and the original speed value at each sampling moment. Since the filter window length is determined according to the acceleration value, when the acceleration value is small, a longer filter window can be used to obtain more speed values to calculate the speed at the current moment, ensuring the speed measurement accuracy under the constant speed state, and when the acceleration value is large, a shorter filter window can be used to obtain fewer speed values to calculate the speed at the current moment, ensuring the speed response capability under the variable speed state, thereby meeting the speed feedback requirements in various scenarios; at the same time, by filtering the original acceleration to obtain the acceleration value at each sampling moment, the accuracy of the acceleration value can be improved, thereby improving the accuracy of the second speed filter window length, and improving the accuracy of the speed at the current moment.
[0091] In addition, an embodiment of the present invention further provides a robot, referring to Figure 6 As shown, the robot 200 includes a memory 210, a processor 220, and a speed calculation program based on a magnetic encoder stored in the memory 210 and executable on the processor 220. When the processor 220 executes the speed calculation program based on the magnetic encoder, the speed calculation method based on the magnetic encoder is implemented.
[0092] The extended contents of the specific implementation of the robot 200 of the embodiment of the present invention are basically the same as the embodiments of the speed calculation method based on the magnetic encoder described above, and will not be elaborated here.
[0093] The robot according to the embodiment of the present invention can ensure the speed measurement accuracy under constant speed state and the speed response capability under variable speed state through the aforementioned speed calculation method based on magnetic encoder, thereby meeting the speed low noise requirement when the robot is stationary or at low speed, and meeting the robot's periodic motion fast response requirement to speed, effectively improving the closed-loop control performance of the robot, and further improving the stability of the robot's operation.
[0094] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0095] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0096] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0097] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the enlightenment of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the purpose of the present invention and the claims, which all fall within the protection of the present invention.
Claims
1. A speed calculation method based on a magnetic encoder, characterized in that: include: Calculating the original speed value at each sampling moment according to the position information detected by the magnetic encoder; The original speed values are sequentially stored in a first speed filter window; Calculate the original acceleration value at each sampling moment according to the original speed value at each sampling moment; Filtering the original acceleration value to obtain a filtered acceleration value at each sampling moment; Determine the second velocity filter window length according to the filtered acceleration value; The filtered speed value at the current sampling moment is determined according to the original speed value at each sampling moment within the second speed filtering window length.
2. The speed calculation method according to claim 1, characterized in that: The storing the original speed values in the first speed filtering window in sequence comprises: The original speed values are sequentially stored in the first speed filtering window according to a speed update index, wherein when an index value of the speed update index is greater than a length of the first speed filtering window, the index value of the speed update index is reset to 1.
3. The speed calculation method according to claim 1, characterized in that: The filtering process of the original acceleration value to obtain the filtered acceleration value at each sampling moment includes: Determine the filter type; A filtering formula is determined according to the filter type, and the original acceleration value is filtered according to the filtering formula to obtain a filtered acceleration value at each sampling moment, wherein when the filter type is a first-order low-pass filter, the filtered acceleration value at the current sampling moment is calculated according to the following formula: in, is the filtered acceleration value at the current sampling moment, is the original acceleration value at the last sampling moment, is the original acceleration value at the current sampling moment, i a is the acceleration update index, ε1 and ε2 are first-order low-pass filter coefficients, and N is an integer greater than or equal to 2.
4. The speed calculation method according to any one of claims 1 to 3, characterized in that: The second speed filter window length is calculated according to the following formula: in, is the second speed filter window length, ε3 is the filter window coefficient, is the filtered acceleration value at the current sampling moment, i a The acceleration update index, where N is an integer greater than or equal to 2.
5. The speed calculation method according to claim 4, characterized in that: The filtered speed value at the current sampling moment is calculated according to the following formula: Wherein, V is the filtered speed value at the current sampling moment, V k is the kth original velocity value, is the second speed filter window length, i a The acceleration update index, where N is an integer greater than or equal to 2.
6. A speed calculation device based on a magnetic encoder, characterized in that: include: A first processing module, used for calculating the original speed value at each sampling moment according to the position information detected by the magnetic encoder, and storing the original speed value in a first speed filtering window in sequence; A second processing module, used to calculate the original acceleration value at each sampling moment according to the original velocity value at each sampling moment, and filter the original acceleration value to obtain a filtered acceleration value at each sampling moment; The third processing module is used to determine the second speed filter window length according to the filtered acceleration value, and determine the filtered speed value at the current sampling moment according to the original speed value at each sampling moment within the second speed filter window length.
7. The speed calculation device according to claim 6, characterized in that: The first processing module is specifically used for: The original speed values are sequentially stored in the first speed filtering window according to a speed update index, wherein when an index value of the speed update index is greater than a length of the first speed filtering window, the index value of the speed update index is reset to 1.
8. The speed calculation device according to claim 6, characterized in that: The second processing module is specifically used for: Determine the filter type; A filtering formula is determined according to the filter type, and the original acceleration value is filtered according to the filtering formula to obtain a filtered acceleration value at each sampling moment, wherein when the filter type is a first-order low-pass filter, the filtered acceleration value at the current sampling moment is calculated according to the following formula: in, is the filtered acceleration value at the current sampling moment, is the original acceleration value at the last sampling moment, is the original acceleration value at the current sampling moment, i a is the acceleration update index, ε1 and ε2 are first-order low-pass filter coefficients, and N is an integer greater than or equal to 2.
9. The speed calculation device according to any one of claims 6 to 8, characterized in that: The third processing module is specifically used to calculate the second speed filter window length according to the following formula: in, is the second speed filter window length, ε3 is the filter window coefficient, is the filtered acceleration value at the current sampling moment, i a The acceleration update index, where N is an integer greater than or equal to 2.
10. The speed calculation device according to claim 9, characterized in that: The third processing module is specifically used to calculate the filtered speed value at the current sampling moment according to the following formula: Wherein, V is the filtered speed value at the current sampling moment, V k is the kth original velocity value, is the second speed filter window length, i a The acceleration update index, where N is an integer greater than or equal to 2.
11. A robot, characterized in that: The invention comprises a memory, a processor and a speed calculation program based on a magnetic encoder which is stored in the memory and can be run on the processor. When the processor executes the speed calculation program based on the magnetic encoder, the speed calculation method based on the magnetic encoder according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Path planning method and device for egg liquid brushing manipulator
CN112091992A
Propagation delay compensation and interpolation filter
US10855303B1