Encoder position signal estimation method based on time stamp

文档序号:1154661 发布日期:2020-09-15 浏览:26次 中文

阅读说明:本技术 一种基于时间戳的编码器位置信号估计方法 (Encoder position signal estimation method based on time stamp ) 是由 徐晓强 胡宏伟 王向红 贺湘宇 易可夫 于 2020-06-12 设计创作,主要内容包括:一种基于时间戳的编码器位置信号估计方法,令控制系统的编码器采集模块工作在高低两个频率下:在高频率下检视编码器位置变化,当编码器位置变化时对编码器事件进行记录,并在寄存器中保存最近的编码器事件序列;在低频率下对编码器位置信号进行采集,对寄存器中的编码器事件序列进行多项式拟合求解,进而对位置信号进做出修正。本发明方法可以对编码器位置信号进行实时有效修正,减小量化误差的影响,提高低分辨率编码器的测试精度。(An encoder position signal estimation method based on a timestamp enables an encoder acquisition module of a control system to work under two frequencies, namely a high frequency and a low frequency: the method comprises the steps of inspecting the position change of an encoder at high frequency, recording encoder events when the position of the encoder changes, and storing a latest encoder event sequence in a register; and collecting the position signal of the encoder at low frequency, and performing polynomial fitting solution on the event sequence of the encoder in the register so as to correct the position signal. The method can effectively correct the position signal of the encoder in real time, reduce the influence of quantization error and improve the test precision of the low-resolution encoder.)

1. A method of time stamp based encoder position signal estimation, comprising the steps of:

firstly, encoder signals are collected and analyzed under high and low frequencies, and the sampling interval of the high frequency is TeWith a low frequency sampling interval of Tc,Te<<Tc

And step two, the high-frequency (typically 1MHz) sampled signal does not store the complete sequence of the signal, but continuously checks whether the current position is changed compared with the last sampling point, and if the current position is changed, the current position is marked as an encoder event. Each encoder event is recorded as (t)k,xk) K is the event number, tkThe time stamp of the position change of the encoder is taken as the average value of the adjacent sampling points, xkAnd taking the value of the corresponding encoder position as the average value of the positions of the adjacent sampling points.

Step three, the latest N encoder events (t)1,…,N,x1,…,N) According to the period TcThe transfer is held in a register and the proposed value of N is 5.

Whenever a new encoder event occurs, the most recent event (t) will be1,x1) Deleting, subtracting 1 from the sequence number k of other events, supplementing the new event to the end of the register, and recording as (t)N,xN)。

Fourthly, the encoder signal collected by low frequency (typical value is 1kHz) is the position signal to be corrected, and the latest N encoder events (t) are processed1,…,N,x1,…,N) A polynomial fit of order M (M is the order, suggested value 2) is performed to achieve the correction of the position signal, k is 1, …, and N is the sequence number of the event. The position signal is corrected in a control period TcAnd after internal calculation is finished, sending the internal calculation to a control system for real-time feedback. The specific calculation process is as follows:

and constructing a timestamp matrix A, a polynomial coefficient matrix P and a position matrix B, wherein AP is B.

Figure FDA0002535825910000011

P=[pMpM-1…p0]T(2)

B=[x1…xN-1xN]T(3)

Solving the polynomial coefficient matrix P by a least square method:

P=(ATA)-1ATB (4)

then at tcTime of day sampling locationIs modified as

Figure FDA0002535825910000014

T can be further calculatedcVelocity and acceleration at the moment of time ofAcceleration of

Technical Field

The invention relates to an encoder position signal estimation method based on a timestamp, and belongs to the field of position measurement.

Background

Encoders are widely used in automation equipment (machine tools, industrial robots, radars, etc.) as a type of position sensor for position feedback of control systems. The physical resolution of the encoder is determined by the spacing of the grating lines, the greater the spacing, the lower the resolution. The encoder position signal has a quantization error caused by the grating line spacing, which may be up to half the grating line spacing. To improve the accuracy of the encoder position signal, measures are often taken to reduce the grating line spacing or to add post-processing subdivision circuitry, but this can add significantly to the hardware cost of the test. How to reduce the quantization error without increasing the test cost is a big problem in the industry to improve the accuracy of the encoder testing position signal.

Patent application No. 201711324569.3 proposes a method for improving the accuracy of the position of an encoder, which corrects the measured value of the encoder by the reference position of a high-accuracy turntable, and which can overcome the accuracy degradation caused by the manufacturing and installation errors of the encoder to some extent, but still cannot reduce the influence of quantization errors.

Disclosure of Invention

The patent aims to provide an encoder position signal estimation method based on a timestamp, which utilizes the encoder signal acquisition function, the register function and the calculation capacity of a control system, reduces the quantization error caused by physical resolution in a signal processing mode, and does not increase extra hardware cost.

In order to achieve the purpose, the invention adopts the technical scheme that:

a method of time stamp based encoder position signal estimation, comprising the steps of:

firstly, encoder signals are collected and analyzed under high and low frequencies, and the sampling interval of the high frequency is TeWith a low frequency sampling interval of Tc,Te<<Tc

And step two, the high-frequency (typically 1MHz) sampled signal does not store the complete sequence of the signal, but continuously checks whether the current position is changed compared with the last sampling point, and if the current position is changed, the current position is marked as an encoder event. Each encoder event is recorded as (t)k,xk) K is the event number, tkThe time stamp of the position change of the encoder is taken as the average value of the adjacent sampling points, xkAnd taking the value of the corresponding encoder position as the average value of the positions of the adjacent sampling points.

Step three, the latest N encoder events (t)1,…,N,x1,…,N) According to the period TcThe transfer is held in a register and the proposed value of N is 5.

Whenever a new encoder event occurs, the most recent event (t) will be1,x1) Deleting, subtracting 1 from the sequence number k of other events, supplementing the new event to the end of the register, and recording as (t)N,xN)。

Fourthly, the encoder signal collected by low frequency (typical value is 1kHz) is the position signal to be corrected, and the latest N encoder events (t) are processed1,…,N,x1,…,N) A polynomial fit of order M (M is the order, suggested value 2) is performed to achieve the correction of the position signal, k is 1, …, and N is the sequence number of the event. The position signal is corrected in a control period TcAnd finishing internal calculation and sending the internal calculation to a control system for real-time feedback. The specific calculation process is as follows:

and constructing a timestamp matrix A, a polynomial coefficient matrix P and a position matrix B, wherein AP is B.

Figure BDA0002535825920000021

P=[pMpM-1… p0]T(2)

B=[x1… xN-1xN]T(3)

Solving the polynomial coefficient matrix P by a least square method:

P=(ATA)-1ATB (4)

then at tcTime of day sampling location

Figure BDA0002535825920000022

Is modified as

T can be further calculatedcTime of dayVelocity and acceleration ofAcceleration of

Figure BDA0002535825920000026

The invention has the following beneficial effects:

a) the method can effectively correct the position signal of the encoder in real time, reduce the influence of quantization error and improve the test precision of the low-resolution encoder.

b) The register occupies small space, the calculation efficiency is high, and the position signal can be fed back to the control system in real time.

c) The method is realized through a software algorithm without adding extra testing hardware, and is beneficial to popularization and application of the method.

Drawings

FIG. 1 is a flow chart of the method of the present invention.

FIG. 2 is a block diagram of an encoder with uncorrected position signals, a reference position signal, and a corrected position signal, according to an embodiment of the present invention.

Fig. 3 is a partial enlarged view of fig. 2 at time 40 seconds to 40.05 seconds.

FIG. 4 is a diagram illustrating an error of the position signals before and after correction according to an embodiment of the present invention.

Detailed Description

The invention is described in detail below with reference to the figures and examples.

Taking the estimation of encoder position signals in the circular motion process of an X servo shaft of a certain numerical control machine tool as an example, the related parameters are as follows: 1) the physical resolution of the linear encoder is 0.02 mm; 2) the high-frequency sampling frequency is 1MHz and is used for inspecting the event of the encoder; 3) the low-frequency sampling frequency is set to be 1kHz, and the sampling time length is 90 seconds; 4) the diameter of the circular motion is 100mm, and the feeding speed is 100 mm/min. 5) The encoder signal is acquired as a reference position signal (i.e., the actual position signal) using a post-processing circuit that can subdivide adjacent grating lines by a factor of 4096.

The method is applied to estimate the position signal of the X-axis encoder.

As shown in fig. 1, the encoder position signal estimation method based on time stamps includes the steps of:

firstly, encoder signals are collected and analyzed under high and low frequencies, and the sampling interval of the high frequency is Te1 microsecond, low frequency sampling interval Tc1 ms, Te<<Tc

And step two, the high-frequency (1MHz) sampled signal does not store the complete sequence of the signal, and only continuously checks whether the current position is changed compared with the last sampling point, and if the current position is changed, the current position is marked as an encoder event. Each encoder event is recorded as (t)k,xk) K is the event number, tkThe time stamp of the position change of the encoder is taken as the average value of the adjacent sampling points, xkAnd taking the value of the corresponding encoder position as the average value of the positions of the adjacent sampling points.

Step three, the latest N encoder events (t)1,…,N,x1,…,N) According to the period TcThe transfer is held in a register, N being 5 in this embodiment.

Whenever a new encoder event occurs, the most recent event (t) will be1,x1) Deleting, subtracting 1 from the sequence number k of other events, supplementing the new event to the end of the register, and recording as (t)N,xN)。

Fourthly, the encoder signal collected by low frequency (typical value is 1kHz) is the position signal to be corrected, and the latest N encoder events (t) are processed1,…,N,x1,…,N) Correction of the position signal is achieved by performing an M-th order polynomial fit (M is the order, M is 2 in the example), k is 1, …, and N is the sequence number of the event. The position signal is corrected in a control period TcAnd after internal calculation is finished, sending the internal calculation to a control system for real-time feedback. The specific calculation process is as follows:

and constructing a timestamp matrix A, a polynomial coefficient matrix P and a position matrix B, wherein AP is B.

P=[pMpM-1… p0]T(2)

B=[x1… xN-1xN]T(3)

Solving the polynomial coefficient matrix P by a least square method:

P=(ATA)-1ATB (4)

then at tcTime of day sampling locationIs modified as

Figure BDA0002535825920000042

Figure BDA0002535825920000043

In the embodiment shown in fig. 2, the X-axis servo axis completes a half-circle stroke within 90 seconds, and the uncorrected position signal, the reference position signal and the corrected position signal are respectively shown by a dotted line, a dotted line and a solid line in the figure, and the three signals cannot be differentiated as a whole because the physical resolution of the encoder is 0.02 mm. Here, as shown in fig. 3, the data from time 40 seconds to time 40.05 seconds is partially amplified, and it can be seen that the position signal before correction has a large deviation from the actual position due to the quantization error, but the position signal after correction according to the present invention is compared with the actual position. Fig. 4 shows the error of the position signal before and after correction in the full stroke process, and it can be seen that the quantization error of the position signal before correction is greatly reduced by the method of the present invention, and the estimation error is reduced from 5.8 micrometers in root mean square to 0.33 micrometers in size, so that the overall error is reduced by one magnitude.

The encoder position signal estimation method based on the timestamp can effectively correct the encoder position signal in real time, reduce the influence of quantization error and improve the test precision of a low-resolution encoder.

7页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种具有多种测量模式为一体的高性能测试仪器

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类