CN113630105B - Filtering method and device for output pulse signal of encoder and encoder - Google Patents
Filtering method and device for output pulse signal of encoder and encoder Download PDFInfo
- Publication number
- CN113630105B CN113630105B CN202110842964.0A CN202110842964A CN113630105B CN 113630105 B CN113630105 B CN 113630105B CN 202110842964 A CN202110842964 A CN 202110842964A CN 113630105 B CN113630105 B CN 113630105B
- Authority
- CN
- China
- Prior art keywords
- encoder
- filtering
- pulse signal
- output pulse
- predicted value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000001914 filtration Methods 0.000 title claims abstract description 154
- 238000000034 method Methods 0.000 title claims abstract description 62
- 230000001133 acceleration Effects 0.000 claims description 35
- 230000008569 process Effects 0.000 claims description 17
- 238000004364 calculation method Methods 0.000 claims description 10
- 238000005259 measurement Methods 0.000 claims description 5
- 238000004590 computer program Methods 0.000 claims description 3
- 230000002159 abnormal effect Effects 0.000 abstract description 6
- 230000008859 change Effects 0.000 abstract description 4
- 230000000694 effects Effects 0.000 abstract description 3
- 230000000737 periodic effect Effects 0.000 description 6
- 230000006870 function Effects 0.000 description 3
- 238000003491 array Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000002708 enhancing effect Effects 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 238000005070 sampling Methods 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000013139 quantization Methods 0.000 description 1
- 230000002441 reversible effect Effects 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03H—IMPEDANCE NETWORKS, e.g. RESONANT CIRCUITS; RESONATORS
- H03H17/00—Networks using digital techniques
- H03H17/02—Frequency selective networks
- H03H17/0248—Filters characterised by a particular frequency response or filtering method
- H03H17/0255—Filters based on statistics
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01D—MEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
- G01D5/00—Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable
- G01D5/12—Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable using electric or magnetic means
- G01D5/244—Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable using electric or magnetic means influencing characteristics of pulses or pulse trains; generating pulses or pulse trains
- G01D5/249—Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable using electric or magnetic means influencing characteristics of pulses or pulse trains; generating pulses or pulse trains using pulse code
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03H—IMPEDANCE NETWORKS, e.g. RESONANT CIRCUITS; RESONATORS
- H03H17/00—Networks using digital techniques
- H03H17/02—Frequency selective networks
- H03H17/0248—Filters characterised by a particular frequency response or filtering method
- H03H17/0255—Filters based on statistics
- H03H17/0257—KALMAN filters
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Probability & Statistics with Applications (AREA)
- Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Mathematical Physics (AREA)
- Transmission And Conversion Of Sensor Element Output (AREA)
Abstract
The application relates to a filtering method and a device for an encoder output pulse signal and the encoder, wherein the filtering method for the encoder output pulse signal comprises the steps of obtaining the output pulse signal, calculating a Kalman filtering predicted value of a rotating shaft connected with the encoder in a uniform speed state according to the output pulse signal, and comparing the Kalman filtering predicted value with the actual measured value in the constant speed state to obtain the actual motion state of the rotating shaft connected with the encoder, and determining a filtering result according to the actual motion state of the rotating shaft connected with the encoder. The application can effectively filter Gaussian noise of the pulse signal output by the encoder, still maintain good filtering effect and following performance under the condition of abrupt change of the speed of the encoder, and can solve the problem of larger abnormal value of the encoder due to accidental dirt influence to a certain extent.
Description
Technical Field
The application belongs to the technical field of encoders, and particularly relates to a filtering method and device for an encoder output pulse signal and an encoder.
Background
The encoder is a sensor for converting rotation angle of a rotation shaft into a computer usable digital quantity, and is widely used in the field of automatic control. With the development of modern technology, encoder measurements are required to be more accurate and less fluctuating. However, the encoder typically measures angles with errors including occasional errors caused by electrical noise, quantization errors, non-periodic runout, interference of light, etc., and periodic errors caused by code wheel pattern errors, code wheel process accuracy, code wheel to shaft eccentricity, periodic runout, etc. The main compensation mode for the error is to compensate amplitude, phase and DC component on the subdivided sine and cosine signal and to obtain accurate measurement angle on the output pulse signal by means of specific device. The compensation method can only process noise in data with uniform speed change, and in practice, conditions such as uniform acceleration, variable acceleration and the like are frequently encountered in the running process of the encoder, the result after the compensation by using the fixed compensation method and the device still has larger aperiodic fluctuation and partial residual periodic error, and the encoder can have larger abnormal value if accidental stains appear, so that the output result of the encoder is distorted, and the speed fluctuation of a motor where the encoder is positioned is larger, the positioning is inaccurate and the like.
Disclosure of Invention
In order to overcome the problems that the result after the compensation of the traditional fixed compensation method and device still has larger aperiodic fluctuation and partial residual periodic error and has large pollution influence to cause the output distortion of the encoder at least to a certain extent, the application provides a filtering method and device for the output pulse signal of the encoder and the encoder.
In a first aspect, the present application provides a method for filtering an output pulse signal of an encoder, including:
acquiring an output pulse signal;
calculating a Kalman filtering predicted value of a rotating shaft connected with the encoder in a uniform speed state according to the output pulse signal;
Comparing the Kalman filtering predicted value with the actual measured value in the constant speed state to obtain the actual motion state of a rotating shaft connected with the encoder;
And determining a filtering result according to the actual motion state of the rotating shaft connected with the encoder.
Further, the calculating the kalman filter predicted value of the rotation axis connected to the encoder in the constant speed state according to the output pulse signal includes:
kalman filtering predicted value Y (k) =X (k-1) + [ X (k-1) -X (k-n) ]/n in constant speed state;
wherein k represents the current time, k-1 represents the last time, X (k-1) represents the filtering result of the last time, X (k-n) represents the filtering result of a certain time in the history, and n is more than or equal to 2.
Further, the method further comprises the following steps:
Calculating covariance of a predicted value according to the output pulse signal;
Calculating a first Kalman gain according to the covariance of the predicted value;
And calculating a filtering result according to the first Kalman gain.
Further, the calculating the covariance of the predicted value according to the output pulse signal includes:
covariance of predicted values P' (k) =p (k-1) +q
Where P (k-1) represents the covariance of the predicted value at the previous time and Q represents the covariance of the noise of the uniform state prediction process.
Further, the calculating the first kalman gain according to the covariance of the predicted value includes:
first kalman gain kg=p' (k)/[ P (k) +r ]
Where P' (k) represents the covariance of the predicted value, P (k) is the initial value of the covariance of the predicted value, and R represents the covariance of the constant-speed state measurement noise.
Further, the calculating the filtering result according to the first kalman gain includes:
Filtering result X (k) =y (k) +kg [ Y (k) -Z (k) ]
Wherein Y (k) represents a Kalman filtering predicted value in a constant speed state, kg represents a first Kalman gain, and Z (k) represents an output pulse signal.
Further, the comparing the kalman filter predicted value with the actual measured value in the constant speed state to obtain the actual motion state of the rotating shaft connected with the encoder includes:
calculating the difference A (k) =Y (k) -Z (k) between the Kalman filtering predicted value and the actual measured value at each moment in a uniform speed state, wherein Z (k) represents an output pulse signal;
judging whether the absolute value of the difference A (k) between the Kalman filtering predicted value and the actual measured value in the constant speed state is in a first threshold range or not;
if yes, the filtering result solution in a uniform speed state is entered.
Further, the determining the filtering result according to the actual motion state of the rotating shaft connected with the encoder includes:
Acquiring a second Kalman gain p of the unit after a period of operation;
constant state filtering result X (k) =y (k) +p×a (k)
Wherein Y (k) represents a Kalman filtering predicted value in a constant speed state, and A (k) represents a difference between the Kalman filtering predicted value in the constant speed state and an actual measured value at the current moment and the previous moment.
Further, the first threshold range is that the Gaussian noise of the output pulse signal of the constant-speed state encoder approximately accords withThree times the boundary value of (2)Range.
Further, the comparing the kalman filter predicted value with the actual measured value in the constant speed state to obtain the actual motion state of the rotating shaft connected with the encoder further includes:
If the absolute value of the difference A (k) between the Kalman filtering predicted value and the actual measured value in the constant speed state is not in the first threshold range, calculating the increment A' (k) =A (k) -A (k-1) of the difference between the Kalman filtering predicted value and the actual measured value in the constant speed state at the current moment and the previous moment;
Judging whether the absolute value of the increment A' (k) is in a second threshold range or not;
If yes, the filtering result of the uniform acceleration state is solved.
Further, the determining the filtering result according to the actual motion state of the rotating shaft connected with the encoder includes:
calculating a third Kalman gain q=p+ { [ atan (a (k)/m) ]/(PI/2) } (1-p), wherein p is a second Kalman gain of the unit after running for a period of time, a (k) represents acceleration, and m represents a convergence speed coefficient of a third Kalman gain value along with the increase of the acceleration;
homogeneous acceleration state filtering result X (k) =y (k) +a (k) ×q
Wherein Y (k) represents a Kalman filtering predicted value in a constant speed state, and A (k) represents a difference between the Kalman filtering predicted value in the constant speed state and an actual measured value at the current moment and the previous moment.
Further, the second threshold range is that the Gaussian noise of the output pulse signal approximately accords with the uniform acceleration stateThree times the boundary value of (2)Range.
Further, the method further comprises the following steps:
and if the absolute value of the increment A' (k) is not in the second threshold range, entering into a variable acceleration state filtering result solution.
Further, the determining the filtering result according to the actual motion state of the rotating shaft connected with the encoder includes:
variable acceleration state filtering result X (k) =z (k)
Wherein Z (k) represents an output pulse signal.
In a second aspect, the present application provides a filtering apparatus for an encoder output pulse signal, comprising:
the acquisition module is used for acquiring an output pulse signal;
the calculation module is used for calculating a Kalman filtering predicted value of the rotating shaft connected with the encoder in a uniform speed state according to the output pulse signal;
The comparison module is used for comparing the Kalman filtering predicted value with the actual measured value in the constant speed state to obtain the actual motion state of the rotating shaft connected with the encoder;
And the determining module is used for determining a filtering result according to the actual motion state of the rotating shaft connected with the encoder.
In a third aspect, the present application provides an encoder comprising:
A processor and a memory, the processor being configured to execute a computer program stored in the memory to implement a method of filtering an encoder output pulse signal according to any one of the first aspects.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects:
The filtering method and device for the output pulse signal of the encoder and the encoder provided by the embodiment of the invention comprise the steps of obtaining the output pulse signal, calculating a Kalman filtering predicted value of a rotating shaft connected with the encoder in a uniform speed state according to the output pulse signal, comparing the Kalman filtering predicted value with an actual measured value in the uniform speed state to obtain the actual motion state of the rotating shaft connected with the encoder, determining a filtering result according to the actual motion state of the rotating shaft connected with the encoder, effectively filtering Gaussian noise of the output pulse signal of the encoder, keeping good filtering effect and followability under the condition of abrupt change of the encoder speed, and solving the problem of larger abnormal value of the encoder due to accidental stain influence to a certain extent.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
Fig. 1 is a flowchart of a filtering method of an encoder output pulse signal according to an embodiment of the present application.
Fig. 2 is a flowchart of a filtering method of an encoder output pulse signal according to another embodiment of the present application.
Fig. 3 is a flowchart of another method for filtering an output pulse signal of an encoder according to an embodiment of the present application.
Fig. 4 is a functional block diagram of a filtering device for an encoder output pulse signal according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail below. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. All other embodiments, based on the examples herein, which are within the scope of the application as defined by the claims, will be within the scope of the application as defined by the claims.
Fig. 1 is a flowchart of a filtering method of an output pulse signal of an encoder according to an embodiment of the present application, as shown in fig. 1, the filtering method of the output pulse signal of the encoder includes:
s11: acquiring an output pulse signal;
s12: calculating a Kalman filtering predicted value of a rotating shaft connected with the encoder in a constant speed state according to an output pulse signal;
S13: comparing the Kalman filtering predicted value with the actual measured value in a uniform speed state to obtain the actual motion state of a rotating shaft connected with the encoder;
s14: the filtering result is determined according to the actual motion state of the rotation shaft to which the encoder is connected.
The traditional method for compensating the output pulse signal of the encoder can only process noise in data with uniform speed change, and in practice, conditions such as uniform acceleration, variable acceleration and the like are frequently encountered in the running process of the encoder, the result compensated by using a fixed compensation method and a fixed compensation device still has larger aperiodic fluctuation and partial residual periodic error, and the encoder can have larger abnormal value if accidental stains appear, so that the output result of the encoder is distorted, the speed fluctuation of a motor is larger, the positioning is inaccurate and the like.
The filtering method of the encoder output pulse signal provided by the embodiment is different from the traditional method for compensating according to the difference between the reference encoder and the correction encoder, and the method is based on the Kalman filtering predicted value prediction filtering result, so that the linearity and the precision of the encoder position can be effectively improved.
In this embodiment, the filtering method for the output pulse signal of the encoder includes obtaining the output pulse signal, calculating a kalman filtering predicted value of a rotating shaft connected to the encoder in a constant speed state according to the output pulse signal, comparing the kalman filtering predicted value with an actual measured value in the constant speed state to obtain an actual motion state of the rotating shaft connected to the encoder, and determining a filtering result according to the actual motion state of the rotating shaft connected to the encoder.
An embodiment of the present invention provides another filtering method for an output pulse signal of an encoder, as shown in a flowchart in fig. 2, where the filtering method for the output pulse signal of the encoder includes:
s21: acquiring an output pulse signal;
s22: calculating a Kalman filtering predicted value of a rotating shaft connected with the encoder in a constant speed state according to an output pulse signal;
the method specifically comprises the following steps:
kalman filtering predicted value Y (k) =X (k-1) + [ X (k-1) -X (k-n) ]/n in constant speed state;
wherein k represents the current time, k-1 represents the last time, X (k-1) represents the filtering result of the last time, X (k-n) represents the filtering result of a certain time in the history, and n is more than or equal to 2.
In the traditional Kalman filtering calculation process, the predicted value
Y (k) =X (k-1) + [ (v (k) +a (k): T0.5 ]. Times.T, wherein X (k-1) represents a filtering result at time k-1, v (k) is a rotating speed, a (k) is an acceleration, T is a sampling period of the encoder, and it is seen that the predicted value Y (k) is related to the speed and the acceleration, and the speed and the acceleration are relatively complex in calculation, have higher requirements on the chip computing capability and longer calculation time, and cannot meet the requirements of the response speed of the encoder, so that the application optimizes the calculation mode of the predicted value Y (k) by the following formula:
Y(k)=X(k-1)+[X(k-1)-X(k-n)]/n
wherein n is more than or equal to 2, the difference between X (k-1) and X (k-n) is a position difference, and the time difference between X (k-1) and X (k-n) is T which is n times, and the speed and acceleration prediction effect can be reflected by the difference between X (k-1) and X (k-n) because the sampling period T of the encoder is fixed in the whole processing process, so that the accuracy of the Kalman prediction value can be ensured by calculating the prediction value, the calculation process is reduced, and the requirement of the filtering process on the chip calculation force is effectively reduced.
Wherein X (k-1) represents the filtering result of the last moment, and X (k-n) represents the calculation process of the filtering result of a certain moment in the history, which comprises the following steps:
s221: calculating covariance of the predicted value according to the output pulse signal;
covariance of predicted values P' (k) =p (k-1) +q
Where P (k-1) represents the covariance of the predicted value at the previous time and Q represents the covariance of the noise of the uniform state prediction process.
S222: calculating a first Kalman gain according to the covariance of the predicted value;
first kalman gain kg=p' (k)/[ P (k) +r ]
Where P' (k) represents the covariance of the predicted value, P (k) is the initial value of the covariance of the predicted value, and R represents the covariance of the constant-speed state measurement noise.
S223: and calculating a filtering result according to the first Kalman gain.
Filtering result X (k) =y (k) +kg [ Y (k) -Z (k) ]
Wherein Y (k) represents a Kalman filtering predicted value in a constant speed state, kg represents a first Kalman gain, and Z (k) represents an output pulse signal.
S23: comparing the Kalman filtering predicted value with the actual measured value in the constant speed state to obtain the actual motion state of the rotating shaft connected with the encoder, wherein the actual motion state comprises a constant speed state, a uniform acceleration state and a variable acceleration state;
As shown in fig. 3, in some embodiments, comparing the kalman filter predicted value with the actual measured value in the constant speed state to obtain the actual motion state of the rotation shaft connected to the encoder includes:
s231: calculating the difference A (k) =Y (k) -Z (k) between the Kalman filtering predicted value and the actual measured value at each moment in a uniform speed state, wherein Z (k) represents an output pulse signal;
s232: judging whether the absolute value of the difference A (k) between the Kalman filtering predicted value and the actual measured value in the constant speed state is in a first threshold range;
In some embodiments, the first threshold range is a constant velocity state encoder output pulse signal Gaussian noise approximation Three times the boundary value of (2)Range.
S233: if yes, the filtering result solution in a uniform speed state is entered.
S234: otherwise, calculating the increment A' (k) =A (k) -A (k-1) of the difference between the Kalman filtering predicted value and the actual measured value in the constant speed state at the current moment and the previous moment;
s235: judging whether the absolute value of the increment A' (k) is within a second threshold range;
in some embodiments, the second threshold range is where the gaussian noise of the pulse signal output by the even acceleration state encoder approximately corresponds to Three times the boundary value of (2)Range.
S236: if yes, the filtering result of the uniform acceleration state is solved.
S237: otherwise, solving the filtering result in the variable acceleration state.
S24: determining a filtering result according to an actual motion state of a rotating shaft connected with the encoder:
if the uniform state filtering result is entered, solving:
Acquiring a second Kalman gain p of the unit after a period of operation;
constant state filtering result X (k) =y (k) +p×a (k)
Wherein Y (k) represents a Kalman filtering predicted value in a constant speed state, and A (k) represents a difference between the Kalman filtering predicted value in the constant speed state and an actual measured value at the current moment and the previous moment.
If the uniform acceleration state filtering result is entered, solving:
calculating a third Kalman gain q=p+ { [ atan (a (k)/m) ]/(PI/2) } (1-p), wherein p is a second Kalman gain of the unit after running for a period of time, a (k) represents acceleration, and m represents a convergence speed coefficient of a third Kalman gain value along with the increase of the acceleration;
It should be noted that q gradually transitions from p to 1 as a (k) increases, and those skilled in the art can adjust the value of m according to the actual situation. And (3) solving a filtering result in a uniform acceleration state, wherein the faster the acceleration is, the less reliable the predicted value obtained through the first Kalman gain is, so that the third Kalman gain q value is used for replacing the first Kalman gain, and the filtering result is more biased towards the measured value.
Homogeneous acceleration state filtering result X (k) =y (k) +a (k) ×q
Wherein Y (k) represents a Kalman filtering predicted value in a constant speed state, and A (k) represents a difference between the Kalman filtering predicted value in the constant speed state and an actual measured value at the current moment and the previous moment.
If the variable acceleration state filtering result is solved:
variable acceleration state filtering result X (k) =z (k)
Wherein Z (k) represents an output pulse signal.
In this embodiment, for the operation condition of the encoder, the calculation process of the kalman filter is simplified first, then different motion states of the encoder are determined, different gain coefficient curves and different filtering schemes are adopted for the output pulse of the encoder according to the different motion states, compared with the traditional kalman filter, the response of the system to process real-time signals is faster, the adaptation condition is wider, the improvement of the precision and stability of the encoder and the improvement of the performance of a servo system are facilitated, the problem of aperiodic fluctuation of the output pulse signal of the encoder can be solved, the problem of larger abnormal values of the encoder due to accidental dirt influence is solved to a certain extent, and the purpose of enhancing the resolution and the precision of the encoder is achieved.
An embodiment of the present invention provides a filtering device for an encoder output pulse signal, as shown in a functional block diagram in fig. 4, where the filtering device for an encoder output pulse signal includes:
an acquisition module 41 for acquiring an output pulse signal;
The calculating module 42 is configured to calculate a kalman filter predicted value of the rotation axis connected to the encoder in a constant speed state according to the output pulse signal;
the comparison module 43 is configured to compare the kalman filter predicted value with the actual measured value in the constant speed state to obtain an actual motion state of the rotating shaft connected to the encoder;
a determining module 44 for determining a filtering result based on an actual motion state of a rotation shaft to which the encoder is connected.
In this embodiment, the output pulse signal is obtained by the obtaining module, the calculating module calculates the kalman filtering predicted value of the rotating shaft connected with the encoder in the constant speed state according to the output pulse signal, the comparing module compares the kalman filtering predicted value with the actual measured value in the constant speed state to obtain the actual motion state of the rotating shaft connected with the encoder, and the determining module determines the filtering result according to the actual motion state of the rotating shaft connected with the encoder, so that the problem of aperiodic fluctuation of the output pulse signal of the encoder can be solved, the problem of larger abnormal value of the encoder due to accidental dirt is solved to a certain extent, and the purpose of enhancing the resolution and the precision of the encoder is achieved.
An embodiment of the present invention provides an encoder including:
a processor and a memory, the processor being configured to execute a computer program stored in the memory to implement the method of filtering the encoder output pulse signal as described in the above embodiments.
It is to be understood that the same or similar parts in the above embodiments may be referred to each other, and that in some embodiments, the same or similar parts in other embodiments may be referred to.
It should be noted that in the description of the present application, the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Furthermore, in the description of the present application, unless otherwise indicated, the meaning of "plurality" means at least two.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and further implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
It is to be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
Those of ordinary skill in the art will appreciate that all or a portion of the steps carried out in the method of the above-described embodiments may be implemented by a program to instruct related hardware, where the program may be stored in a computer readable storage medium, and where the program, when executed, includes one or a combination of the steps of the method embodiments.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules may also be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product.
The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, or the like.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present application have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the application, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the application.
It should be noted that the present application is not limited to the above-mentioned preferred embodiments, and those skilled in the art can obtain other products in various forms without departing from the scope of the present application, however, any changes in shape or structure of the present application, and all technical solutions that are the same or similar to the present application, fall within the scope of the present application.
Claims (12)
1. A method for filtering an output pulse signal of an encoder, comprising:
acquiring an output pulse signal;
calculating a Kalman filtering predicted value of a rotating shaft connected with the encoder in a uniform speed state according to the output pulse signal;
Comparing the Kalman filtering predicted value with the actual measured value in the constant speed state to obtain the actual motion state of a rotating shaft connected with the encoder;
Determining a filtering result according to an actual motion state of a rotating shaft connected with the encoder;
The comparing the kalman filter predicted value with the actual measured value in the constant speed state to obtain the actual motion state of the rotating shaft connected with the encoder comprises the following steps:
calculating the difference A (k) =Y (k) -Z (k) between the Kalman filtering predicted value and the actual measured value at each moment in a uniform speed state, wherein Z (k) represents an output pulse signal;
judging whether the absolute value of the difference A (k) between the Kalman filtering predicted value and the actual measured value in the constant speed state is in a first threshold range or not;
if yes, a uniform state filtering result is obtained;
If the absolute value of the difference A (k) between the Kalman filtering predicted value and the actual measured value in the constant speed state is not in the first threshold range, calculating the increment A' (k) =A (k) -A (k-1) of the difference between the Kalman filtering predicted value and the actual measured value in the constant speed state at the current moment and the previous moment;
Judging whether the absolute value of the increment A' (k) is in a second threshold range or not;
If yes, the filtering result of the uniform acceleration state is solved.
2. The method according to claim 1, wherein calculating a kalman filter predicted value of a rotation axis to which the encoder is connected in a constant speed state based on the output pulse signal, comprises:
kalman filtering predicted value Y (k) =X (k-1) + [ X (k-1) -X (k-n) ]/n in constant speed state;
wherein k represents the current time, k-1 represents the last time, X (k-1) represents the filtering result of the last time, X (k-n) represents the filtering result of a certain time in the history, and n is more than or equal to 2.
3. The method of filtering an output pulse signal of an encoder of claim 2, further comprising:
Calculating covariance of a predicted value according to the output pulse signal;
Calculating a first Kalman gain according to the covariance of the predicted value;
And calculating a filtering result according to the first Kalman gain.
4. A method of filtering an output pulse signal of an encoder according to claim 3, wherein said calculating a covariance of a predicted value from said output pulse signal comprises:
covariance of predicted values P' (k) =p (k-1) +q
Where P (k-1) represents the covariance of the predicted value at the previous time and Q represents the covariance of the noise of the uniform state prediction process.
5. A method of filtering an encoder output pulse signal according to claim 3, wherein said calculating a first kalman gain from a covariance of said predicted values comprises:
first kalman gain kg=p' (k)/[ P (k) +r ]
Where P' (k) represents the covariance of the predicted value, P (k) is the initial value of the covariance of the predicted value, and R represents the covariance of the constant-speed state measurement noise.
6. A method of filtering an encoder output pulse signal according to claim 3, wherein said calculating a filtering result based on said first kalman gain comprises:
Filtering result X (k) =y (k) +kg [ Y (k) -Z (k) ]
Wherein Y (k) represents a Kalman filtering predicted value in a constant speed state, kg represents a first Kalman gain, and Z (k) represents an output pulse signal.
7. The method of filtering an output pulse signal of an encoder according to claim 1, wherein said determining a filtering result based on an actual motion state of a rotation shaft to which the encoder is connected comprises:
Acquiring a second Kalman gain p of the unit after a period of operation;
constant state filtering result X (k) =y (k) +p×a (k)
Wherein Y (k) represents a Kalman filtering predicted value in a constant speed state, and A (k) represents a difference between the Kalman filtering predicted value in the constant speed state and an actual measured value at the current moment and the previous moment.
8. The method of filtering an output pulse signal of an encoder according to claim 1, wherein said determining a filtering result based on an actual motion state of a rotation shaft to which the encoder is connected comprises:
calculating a third Kalman gain q=p+ { [ atan (a (k)/m) ]/(PI/2) } (1-p), wherein p is a second Kalman gain of the unit after running for a period of time, a (k) represents acceleration, and m represents a convergence speed coefficient of a third Kalman gain value along with the increase of the acceleration;
homogeneous acceleration state filtering result X (k) =y (k) +a (k) ×q
Wherein Y (k) represents a Kalman filtering predicted value in a constant speed state, and A (k) represents a difference between the Kalman filtering predicted value in the constant speed state and an actual measured value at the current moment and the previous moment.
9. The method of filtering an output pulse signal of an encoder of claim 1, further comprising:
and if the absolute value of the increment A' (k) is not in the second threshold range, entering into a variable acceleration state filtering result solution.
10. The method of filtering an output pulse signal of an encoder according to claim 9, wherein said determining a filtering result based on an actual motion state of a rotation shaft to which the encoder is connected comprises:
variable acceleration state filtering result X (k) =z (k)
Wherein Z (k) represents an output pulse signal.
11. A filtering apparatus for an encoder output pulse signal, comprising:
the acquisition module is used for acquiring an output pulse signal;
the calculation module is used for calculating a Kalman filtering predicted value of the rotating shaft connected with the encoder in a uniform speed state according to the output pulse signal;
The comparison module is used for comparing the Kalman filtering predicted value with the actual measured value in the constant speed state to obtain the actual motion state of the rotating shaft connected with the encoder;
the determining module is used for determining a filtering result according to the actual motion state of the rotating shaft connected with the encoder;
the comparison module is specifically configured to:
calculating the difference A (k) =Y (k) -Z (k) between the Kalman filtering predicted value and the actual measured value at each moment in a uniform speed state, wherein Z (k) represents an output pulse signal;
judging whether the absolute value of the difference A (k) between the Kalman filtering predicted value and the actual measured value in the constant speed state is in a first threshold range or not;
if yes, a uniform state filtering result is obtained;
If the absolute value of the difference A (k) between the Kalman filtering predicted value and the actual measured value in the constant speed state is not in the first threshold range, calculating the increment A' (k) =A (k) -A (k-1) of the difference between the Kalman filtering predicted value and the actual measured value in the constant speed state at the current moment and the previous moment;
Judging whether the absolute value of the increment A' (k) is in a second threshold range or not;
If yes, the filtering result of the uniform acceleration state is solved.
12. An encoder is provided, which is used for encoding a data signal, characterized by comprising the following steps:
a processor and a memory for executing a computer program stored in the memory to implement a method of filtering an encoder output pulse signal as claimed in any one of claims 1 to 10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110842964.0A CN113630105B (en) | 2021-07-26 | 2021-07-26 | Filtering method and device for output pulse signal of encoder and encoder |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110842964.0A CN113630105B (en) | 2021-07-26 | 2021-07-26 | Filtering method and device for output pulse signal of encoder and encoder |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113630105A CN113630105A (en) | 2021-11-09 |
CN113630105B true CN113630105B (en) | 2024-10-29 |
Family
ID=78380991
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110842964.0A Active CN113630105B (en) | 2021-07-26 | 2021-07-26 | Filtering method and device for output pulse signal of encoder and encoder |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113630105B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111121827A (en) * | 2019-12-19 | 2020-05-08 | 杭州电子科技大学 | TMR magnetic encoder system based on Kalman filtering |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103517789B (en) * | 2011-05-12 | 2015-11-25 | 株式会社Ihi | motion prediction control device and method |
EP2544450B1 (en) * | 2011-07-07 | 2016-04-13 | Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. | Model parameter estimation for a rate- or distortion-quantization model function |
CN104809333B (en) * | 2015-04-03 | 2017-08-29 | 百度在线网络技术(北京)有限公司 | Capacity prediction methods and system based on Kalman filter |
CN106597470B (en) * | 2016-12-22 | 2019-01-18 | 中国矿业大学 | A kind of three dimensional point cloud coordinate transformation method based on three dimensional point cloud acquisition device |
CN111856282B (en) * | 2019-04-19 | 2022-08-26 | 武汉理工大学 | Vehicle-mounted lithium battery state estimation method based on improved genetic unscented Kalman filtering |
CN111649766B (en) * | 2020-06-01 | 2022-02-01 | 哈尔滨理工大学 | Method and device for actively suppressing noise of angle value of magnetoelectric encoder |
CN112050809B (en) * | 2020-10-08 | 2022-06-17 | 吉林大学 | Wheel type odometer and gyroscope information fusion unmanned vehicle directional positioning method |
CN112584306B (en) * | 2020-11-27 | 2022-06-10 | 巢湖学院 | Indoor robot positioning algorithm based on Kalman filtering |
-
2021
- 2021-07-26 CN CN202110842964.0A patent/CN113630105B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111121827A (en) * | 2019-12-19 | 2020-05-08 | 杭州电子科技大学 | TMR magnetic encoder system based on Kalman filtering |
Non-Patent Citations (4)
Title |
---|
优化的卡尔曼滤波算法在UWB定位系统中的仿真研究;李婕;《河南工学院学报》;20201115;第28卷(第6期);第28-33页 * |
基于卡尔曼滤波的增量式光电编码器测速方法的研究;徐张旗;《中国优秀硕士学位论文全文数据库信息科技辑》;20181215;第I135-333页 * |
基于多传感器融合的移动机器人定位控制研究;秦天宝;《中国优秀硕士学位论文全文数据库信息科技辑》;20120715;第I140-535页 * |
基于海洋石油生产平台巡检机器人的定位方法研究;苏天水;《中国优秀硕士学位论文全文数据库工程科技Ⅰ辑》;20200115;第B019-657页 * |
Also Published As
Publication number | Publication date |
---|---|
CN113630105A (en) | 2021-11-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107607037B (en) | Magnetoelectric encoder calibration method based on arc tangent trans-interval tabulation method | |
US6556153B1 (en) | System and method for improving encoder resolution | |
CN101271007B (en) | Calibration compensation method for rotating transformer angle observation error based on velocity rotating platform | |
JP2003254785A (en) | Signal processor for encoder | |
CN113630105B (en) | Filtering method and device for output pulse signal of encoder and encoder | |
CN108801127B (en) | Solar wing sailboard rotation precision calibration method based on single Hall sensor | |
CN116182924A (en) | Phase compensation method, device and magnetic encoder | |
US8706269B2 (en) | Controller and machining apparatus with position encoder compensation | |
CN117705164B (en) | Error compensation method, system and device for magneto-optical encoder | |
JPH10311743A (en) | Offset correction circuit of encoder | |
US20210164767A1 (en) | Process for Determining the Total Pitch Deviation of a Position Sensor | |
CN111089610B (en) | Signal processing method and device of encoder and related components | |
US10175260B2 (en) | Apparatus and method for measuring motor speed | |
CN115589180B (en) | Quadrature error compensation method based on sine and cosine position encoder | |
US20100004888A1 (en) | Measurement apparatus | |
US10761507B2 (en) | Instant correction method for encoder and system thereof | |
CN112013892B (en) | Encoder ranging correction method and device, electronic equipment and storage medium | |
CN114001768A (en) | Self-calibration device of magnetoelectric encoder | |
US11378419B2 (en) | Angle sensor and method for operating an angle sensor | |
CN1120396C (en) | Control system, driving system and control method, appts. including driving system | |
CN113418544A (en) | QEP-based automatic calibration method for initial position of encoder | |
CN115876242A (en) | Angle compensation method and device of magnetic angle encoder and magnetic angle encoder | |
US20110192225A1 (en) | method for the dnyanmically adapted recording of an angular velocity using a digital angular position transducer | |
CN111256744A (en) | Calibration method of linear output position sensor | |
US7091884B2 (en) | Analog position encoder |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant |