Measurement and compensation method for internal signal transmission delay of magnetic encoder

文档序号:1907857 发布日期:2021-11-30 浏览:36次 中文

阅读说明:本技术 一种磁编码器内部信号传输延时的测量及补偿方法 (Measurement and compensation method for internal signal transmission delay of magnetic encoder ) 是由 徐纯科 杨海鑫 其他发明人请求不公开姓名 于 2021-09-07 设计创作,主要内容包括:本发明公开了一种磁编码器内部信号传输延时的测量及补偿方法,将光编码器与装有磁编码器的被测电机同轴连接并校正;将磁编码器接入伺服驱动器;DSP读取磁编码器的输出值,并将磁编码器的角度值以模拟信号的方式输出,使用示波器观察DAC输出值以及光编码器Z相输出值,测量DAC输出值零点到光编码器Z相上升沿的时间间隔T-(0)减去DAC固有处理延时,得到磁编码器延时,对多次测量数据进行拟合,建立转速-延时补偿表;再采用Smith预估补偿器对控制系统进行延时补偿。本发明将光编码器与磁编码器同轴安装,以光编码器作为基准,确定出磁编码器的延时值。本方法简单易用,不需要特定的硬件接口,适用性较广,利于工业应用。(The invention discloses a measuring and compensating method for signal transmission delay in a magnetic encoder, which is characterized in that an optical encoder is coaxially connected with a tested motor provided with the magnetic encoder and is corrected; connecting a magnetic encoder to a servo driver; the DSP reads the output value of the magnetic encoder, outputs the angle value of the magnetic encoder in an analog signal mode, observes the DAC output value and the Z-phase output value of the optical encoder by using an oscilloscope, and measures the time from the zero point of the DAC output value to the Z-phase rising edge of the optical encoderSeparate T 0 Subtracting the inherent processing delay of the DAC to obtain the delay of the magnetic encoder, fitting the measured data for multiple times, and establishing a rotating speed-delay compensation table; and then a Smith pre-estimation compensator is adopted to carry out delay compensation on the control system. The optical encoder and the magnetic encoder are coaxially arranged, and the time delay value of the magnetic encoder is determined by taking the optical encoder as a reference. The method is simple and easy to use, does not need a specific hardware interface, has wide applicability and is beneficial to industrial application.)

1. A method for measuring and compensating signal transmission delay inside a magnetic encoder is characterized by comprising the following steps:

step S100, coaxially connecting an optical encoder with a tested motor provided with a magnetic encoder, and correcting the optical encoder;

step S200, connecting a magnetic encoder into a servo driver matched with a tested motor to be used as a feedback signal for speed control;

step S300: the DSP of the servo driver reads the output value of the magnetic encoder, the angle value of the magnetic encoder is output in an analog signal mode through a digital-to-analog converter (DAC), and an oscilloscope is used for simultaneously observing the output value of the DAC and the output value of the DACThe Z-phase output value of the optical encoder is measured, and the time interval T from the zero point of the DAC output value to the Z-phase rising edge of the optical encoder is measured0Obtaining the magnetic encoder delay Tdelay

Tdelay=T0-TDAC

Wherein, TDACInherent processing delays for the DAC;

step S400, repeating the step S300, measuring the time delay of the magnetic encoder of the tested motor at different rotating speeds, fitting the measured data, and establishing a rotating speed-time delay compensation table;

and S500, performing delay compensation on the control system by adopting a Smith pre-estimation compensator according to the rotating speed-delay compensation table.

2. The method of claim 1, wherein the step of calibrating the optical encoder comprises:

step A1: assembling an optical encoder coded disc and an optical encoder coded disc reading head through connecting workpieces and installing the optical encoder coded disc and the optical encoder coded disc reading head on a rotating shaft of a tested motor;

step A2: manually and slowly rotating the motor rotating shaft, adjusting the mounting position of the optical encoder code disc and the verticality of the connecting workpiece and the tested motor rotating shaft, and ensuring that the optical encoder reading head is in contact with and vertical to the optical encoder code disc;

step A3: uniformly running the tested motor at a low speed, and observing the period and the high-level duration of an ABZ three-phase signal output by a light encoder by using an oscilloscope;

step A4: if the period or high level duration time of the output ABZ three-phase signal is unstable, adjusting the code disc installation levelness, and returning to the step A2; otherwise, entering the next step;

step A5: carry out zero correction to optical encoder, specifically include:

electrifying the tested motor according to the directions of the current flowing in from the U-phase winding and the current flowing out from the V-phase winding, wherein the electrified current is the direct current smaller than the rated value;

orienting the rotor to a balance position, adjusting the position of a code disc, observing a Z-phase output signal of the optical encoder by using an oscilloscope, adjusting the relative position of a connecting workpiece and a motor rotating shaft until the Z-phase signal of the optical encoder just generates a high level signal rising edge, stabilizing the high level, and fixing the relative positions of the optical encoder, the connecting workpiece and the motor rotating shaft;

twisting the motor rotating shaft in the forward and reverse directions, loosening the motor rotating shaft to enable the motor rotating shaft to freely recover to a balance position, observing whether a Z-axis rising edge is generated in the process and stabilizing the Z-axis rising edge at a high level, and if not, returning to the step A2; if the position is stable, the position is also used as the zero position of the magnetic encoder, and the next step is carried out;

step A6: and locking and connecting the workpieces.

3. The method of claim 1, wherein the step S400 comprises:

in the low speed section where the motor speed is less than 1000RPM, starting from 50RPM, the motor given speed is increased by 50RPM steps up to 1000RPM, and 5 sets of magnetic encoder delay data are measured at each speed:

starting at 1200RPM, the motor is increased by a given speed in steps of 200RPM until the nominal speed, and 5 sets of magnetic encoder delay data are measured for each speed:

making the fitting function a linear equation of one degreeDefining a loss functionWherein omegakIs the rotation speed;

substituting the measured time delay data of the magnetic encoder into a fitting function to obtain an overdetermined equation set:

solving the least square solution to obtain the solution with the minimum loss functionRewriting the over-determined equation set into a matrix form:

obtaining:

the unique least squares solution of the over-determined system of equations is:

the fitting function isThe fitting function can be regarded as an optimal function expression between the motor rotating speed and the encoder delay;

and substituting the set value of the revolution of the motor into the fitting function to obtain the delay value of the magnetic encoder so as to obtain a rotating speed-delay compensation table.

4. The method of claim 3, wherein the step S500 comprises: and the Smith pre-estimation compensator is adopted to feed forward the controller, and the delay value of the magnetic encoder is substituted into the delay pre-estimation link of the Smith pre-estimation compensator to compensate the influence of delay on a control system.

Technical Field

The invention relates to the technical field of industrial robot control, in particular to the technical field of encoder correction, and specifically relates to a method for measuring and compensating internal signal transmission delay of a magnetic encoder.

Background

The reasons for generating delay in internal signal transmission of the magnetic encoder include internal signal processing, communication transmission and the like, which are equivalent to adding a pure hysteresis link to a feedback loop of a servo control system, thereby affecting the stability of the system and easily causing the divergence of the system state under the condition of large parameters of a controller. In the prior art, most of compensation methods for an encoder are carried out from the angle of precision, measurement compensation is rarely carried out on the time delay of the encoder, the circuit structure of the encoder is improved and the time delay problem is compensated in the Chinese utility model patent with the publication number of CN212620783U and the name of SSI bus magnetic encoder with time delay compensation, the transmission time delay of the encoder is improved by designing a novel encoder structure, but the encoder can not be replaced generally due to the reasons of motor structure, driver, cost and the like of a motor used in an industrial field, so the method is not suitable for the application in the industrial field; in the chinese patent application with publication number CN111831019A and entitled motor position data compensation method and motor control system, a clock signal is sent to an encoder, so that the encoder sends a signal according to a certain frequency, then receives the signal sent by the encoder, and a fixed delay of an encoder communication interface and a random delay of a collector are obtained by recording a time difference between sending and receiving encoder information of reading an encoder signal, thereby compensating for the transmission delay of the encoder. Although the calculation method is accurate, encoder hardware is required to support external clock excitation, many magnetic encoders in the industrial field are fixed schemes of motor manufacturers, the hardware generally does not support the external clock excitation, and signal transmission methods are different, so that the method has no certain universality and is not suitable for industrial field application.

Disclosure of Invention

The invention aims to provide a method for measuring and compensating signal transmission delay inside a magnetic encoder, which is used for solving the problem that the delay of the magnetic encoder cannot be calculated and compensated in industrial field application.

The invention solves the problems through the following technical scheme:

a method for measuring and compensating signal transmission delay inside a magnetic encoder comprises the following steps:

step S100, coaxially connecting an optical encoder with a tested motor provided with a magnetic encoder, and correcting the optical encoder;

step S200, connecting a magnetic encoder into a servo driver matched with a tested motor to be used as a feedback signal for speed control;

step S300: the DSP of the servo driver reads the output value of the magnetic encoder, outputs the angle value of the magnetic encoder in an analog signal mode through a digital-to-analog converter (DAC), simultaneously observes the output value of the DAC and the output value of the Z phase of the optical encoder by using an oscilloscope, and measures the time interval T from the zero point of the output value of the DAC to the rising edge of the Z phase of the optical encoder0Obtaining the magnetic encoder delay Tdelay

Tdelay=T0-TDAC

Wherein, TDACInherent processing delays for the DAC;

step S400, repeating the step S300, measuring the time delay of the magnetic encoder of the tested motor at different rotating speeds, fitting the measured data, and establishing a rotating speed-time delay compensation table;

and S500, performing delay compensation on the control system by adopting a Smith pre-estimation compensator according to the rotating speed-delay compensation table.

The step of correcting the optical encoder comprises:

step A1: assembling an optical encoder coded disc and an optical encoder coded disc reading head through connecting workpieces and installing the optical encoder coded disc and the optical encoder coded disc reading head on a rotating shaft of a tested motor;

step A2: manually and slowly rotating the motor rotating shaft, adjusting the mounting position of the optical encoder code disc and the verticality of the connecting workpiece and the tested motor rotating shaft, and ensuring that the optical encoder reading head is in contact with and vertical to the optical encoder code disc;

step A3: uniformly running the tested motor at a low speed, and observing the period and the high-level duration of an ABZ three-phase signal output by a light encoder by using an oscilloscope;

step A4: if the period or high level duration time of the output ABZ three-phase signal is unstable, adjusting the code disc installation levelness, and returning to the step A2; otherwise, entering the next step;

step A5: carry out zero correction to optical encoder, specifically include:

electrifying the tested motor according to the directions of the current flowing in from the U-phase winding and the current flowing out from the V-phase winding, wherein the electrified current is the direct current smaller than the rated value;

orienting the rotor to a balance position, adjusting the position of a code disc, observing a Z-phase output signal of the optical encoder by using an oscilloscope, adjusting the relative position of a connecting workpiece and a motor rotating shaft until the Z-phase signal of the optical encoder just generates a high level signal rising edge, stabilizing the high level, and fixing the relative positions of the optical encoder, the connecting workpiece and the motor rotating shaft;

twisting the motor rotating shaft in the forward and reverse directions, loosening the motor rotating shaft to enable the motor rotating shaft to freely recover to a balance position, observing whether a Z-axis rising edge is generated in the process and stabilizing the Z-axis rising edge at a high level, and if not, returning to the step A2; if the position is stable, the position is also used as the zero position of the magnetic encoder, and the next step is carried out;

step A6: and locking and connecting the workpieces.

The step S400 includes:

in the low speed section where the motor speed is less than 1000RPM, starting from 50RPM, the motor given speed is increased by 50RPM steps up to 1000RPM, and 5 sets of magnetic encoder delay data are measured at each speed:

starting at 1200RPM, the motor is increased for a given speed in steps of 200RPM up to a nominal speed (e.g., 3000RPM), and 5 sets of magnetic encoder delay data are measured for each speed:

making the fitting function a linear equation of one degreeDefining a loss functionWherein omegakIs the rotation speed;

substituting the measured time delay data of the magnetic encoder into a fitting function to obtain an overdetermined equation set:

solving the least square solution to obtain the solution with the minimum loss functionRewriting the over-determined equation set into a matrix form:

obtaining:

the unique least squares solution of the over-determined system of equations is:

the fitting function isThe fitting function can be regarded as an optimal function expression between the motor rotating speed and the encoder delay;

and substituting the set value of the revolution of the motor into the fitting function to obtain the delay value of the magnetic encoder so as to obtain a rotating speed-delay compensation table.

The step S500 includes: and the Smith pre-estimation compensator is adopted to feed forward the controller, and the delay value of the magnetic encoder is substituted into the delay pre-estimation link of the Smith pre-estimation compensator to compensate the influence of delay on a control system.

Compared with the prior art, the invention has the following advantages and beneficial effects:

(1) the optical encoder and the magnetic encoder are coaxially arranged, the optical encoder is used as a reference, and the low-delay characteristic of an analog signal output by the optical encoder is compared with the measured magnetic encoder, so that the delay value of the magnetic encoder is determined. The method is simple and easy to use, does not need a tested encoder to have a specific hardware interface, has wide applicability and is beneficial to industrial application.

(2) After the time delay is calculated through the optical encoder, the Smith pre-estimation compensator is adopted to feed forward the controller, and the time delay value of the magnetic encoder is substituted into the time delay pre-estimation link of the Smith pre-estimation compensator to compensate the influence of the time delay on a control system.

Drawings

FIG. 1 is a schematic view of an optical encoder-connecting piece-motor under test installation of the present invention;

FIG. 2 is a diagram showing the effect of the installation of the optical encoder, the connecting workpiece and the motor to be tested;

FIG. 3 is a schematic diagram of a delay measurement principle;

FIG. 4 is a schematic structural diagram of a Smith pre-estimation compensator with a delay link in a feedback loop;

wherein, 1-magnetic encoder; 2-the motor to be tested; 3-optical encoder code wheel; 4-optical encoder readhead.

Detailed Description

The present invention will be described in further detail with reference to examples, but the embodiments of the present invention are not limited thereto.

Example 1:

referring to fig. 1 and fig. 2, a method for measuring signal transmission delay inside a magnetic encoder includes:

step S100, coaxially connecting the optical encoder with the tested motor 2 provided with the magnetic encoder 1, and correcting the optical encoder, wherein the correction steps are as follows:

(1) the method comprises the following steps of referring to an optical encoder manual, assembling an optical encoder coded disc 3 and an optical encoder reading head 4 through connecting workpieces, and installing the optical encoder coded disc and the optical encoder reading head on a rotating shaft of a tested motor 2;

(2) manually rotating the motor rotating shaft at a slow speed, observing whether the reading head 4 of the optical encoder is in contact with the coded disc or not and whether the reading head is inclined or not, if so, adjusting the mounting position of the coded disc, and connecting the verticality of the workpiece and the motor rotating shaft;

(3) the tested motor 2 is operated at a uniform low speed, an oscilloscope is used for observing whether the period and the high level duration of an ABZ three-phase signal output by an optical encoder are stable or not, if the period and the high level duration are not stable, the steps (2) and (3) are repeated, and the mounting levelness of a code disc 3 of the optical encoder is adjusted;

(4) and zero correction, namely, a tested motor 2 is energized with direct current smaller than a rated value according to the directions of flowing in from a U-phase winding and flowing out from a V-phase winding, a rotor is oriented to a balance position, the position of a code disc is adjusted, an oscilloscope is used for observing a Z-phase output signal of an optical encoder, the relative position of a connecting workpiece and a motor rotating shaft is adjusted while observing until a Z-phase signal of the optical encoder just generates a high-level signal rising edge, the high level is stabilized, and the relative position of the connecting workpiece and the motor rotating shaft of the encoder is fixed. Twisting the motor rotating shaft in the forward and reverse directions, loosening the motor rotating shaft to enable the motor rotating shaft to freely recover to a balance position, observing whether a Z-axis rising edge is generated in the process, stabilizing the Z-axis rising edge at a high level, if not, repeating the steps (3) and (4), and if so, taking the position as a zero position of the magnetic encoder 1;

(5) and (3) locking the connecting workpiece, and checking whether the optical encoder code disc 3 is firmly connected with the motor shaft through the connecting workpiece or not, so that the phenomenon of looseness exists or not.

Step S200, connecting the magnetic encoder 1 into a servo driver matched with the tested motor 2 to be used as a feedback signal for speed control;

step S300: the DSP of the servo driver reads the output value of the magnetic encoder 1 and converts the angle value of the magnetic encoder 1 through the DACOutputting in the mode of analog signals, observing the output value of the DAC and the output value of the Z phase of the optical encoder by using an oscilloscope at the same time, and measuring the time interval T from the zero point of the output value of the DAC to the rising edge of the Z phase of the optical encoder0As shown in FIG. 3, a time delay T of the magnetic encoder 1 is obtaineddelay

Tdelay=T0-TDAC

Wherein, TDACInherent processing delays for the DAC;

step S400, repeating the step S300, measuring the time delay of the magnetic encoder 1 of the tested motor 2 at different rotating speeds, fitting the measured data, and establishing a rotating speed-time delay compensation table;

the step S400 includes:

in the low speed section where the motor speed is less than 1000RPM, starting from 50RPM, the motor given speed is increased by 50RPM steps up to 1000RPM, and 5 sets of magnetic encoder 1 delay data are measured at each speed:

starting at 1200RPM, the motor is increased by a given speed in steps of 200RPM up to the nominal speed (3000 RPM for example), and 5 sets of magnetic encoder 1 delay data are measured for each speed:

making the fitting function a linear equation of one degreeDefining a loss functionWherein omegakIs the rotation speed;

substituting the measured time delay data of the magnetic encoder 1 into a fitting function to obtain an overdetermined equation set:

solving the least square solution to obtain the solution with the minimum loss functionRewriting the over-determined equation set into a matrix form:

obtaining:

solving the theorem according to least squares: vector X*The only requirement for a least-squares solution of the equation AX B is ATAX*=ATB, and when the column vectors of a are linearly independent, the solution is unique. The only least squares solution of the over-determined system of equations is therefore:

the fitting function isThe fitting function can be regarded as an optimal function expression between the motor rotating speed and the encoder delay;

the delay value of the magnetic encoder 1 can be solved by substituting the set value of the revolution of the motor into the fitting function, and a revolution speed-delay compensation table is obtained.

As shown in fig. 4, the step S500 includes: according to the rotating speed-delay compensation table, the Smith pre-estimation compensator is adopted to feed forward the controller, the delay value of the magnetic encoder 1 is substituted into the delay pre-estimation link of the Smith pre-estimation compensator, the influence of delay on a control system is compensated, and the control performance of the system is improved.

The invention uses the characteristic of low delay of the analog signal output by the optical encoder, takes the Z-phase signal as a reference value, and compares the reference value with the output value of the magnetic encoder of the tested motor, thereby measuring the delay of the signal of the magnetic encoder and carrying out function fitting on the delay under the condition of different rotating speeds. The measuring method is simple and does not need excessive equipment cost. Meanwhile, the optical encoder is convenient to install and high in installation precision by installing the connecting workpiece of the optical encoder on the motor rotating shaft. Aiming at different motor rotating speeds, the corresponding delay values of different rotating speeds can be calculated through a fitting function fitted by measured data, the obtained encoder delay values can be used as an important reference for designing a delay compensation algorithm, and the encoder delay is more intuitively represented. The method can be used as a method for evaluating the time delay of the magnetic encoder, and the measured data can also be directly compensated through a control algorithm, so that the control performance of a servo system based on the magnetic encoder is improved.

Although the present invention has been described herein with reference to the illustrated embodiments thereof, which are intended to be preferred embodiments of the present invention, it is to be understood that the invention is not limited thereto, and that numerous other modifications and embodiments can be devised by those skilled in the art that will fall within the spirit and scope of the principles of this disclosure.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:抗电磁干扰控制方法及电动车用电机控制器集成组件

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!