WO2021103231A1 - Encoder measurement and calibration method, device and apparatus, as well as storage medium - Google Patents

Encoder measurement and calibration method, device and apparatus, as well as storage medium Download PDF

Info

Publication number
WO2021103231A1
WO2021103231A1 PCT/CN2019/127794 CN2019127794W WO2021103231A1 WO 2021103231 A1 WO2021103231 A1 WO 2021103231A1 CN 2019127794 W CN2019127794 W CN 2019127794W WO 2021103231 A1 WO2021103231 A1 WO 2021103231A1
Authority
WO
WIPO (PCT)
Prior art keywords
deviation
encoder
waveform
fitting
linear regression
Prior art date
Application number
PCT/CN2019/127794
Other languages
French (fr)
Chinese (zh)
Inventor
夏一帆
Original Assignee
浙江禾川科技股份有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 浙江禾川科技股份有限公司 filed Critical 浙江禾川科技股份有限公司
Publication of WO2021103231A1 publication Critical patent/WO2021103231A1/en

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01DMEASURING 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
    • G01D18/00Testing or calibrating apparatus or arrangements provided for in groups G01D1/00 - G01D15/00

Definitions

  • the present invention relates to the technical field of encoder accuracy calibration, in particular to an encoder measurement calibration method, device, equipment and computer readable storage medium.
  • the encoder is a measuring device that converts angular displacement and linear displacement into electrical signals, and performs analog-to-digital conversion of the electrical signals to generate digital position information.
  • encoders There are many types of encoders, including magnetic encoders, electrical encoders, etc. according to different measurement principles, and can be divided into absolute encoders and incremental encoders according to different decoding principles.
  • the encoder needs to be calibrated for accuracy based on the standard encoder before leaving the factory.
  • the calibration of the encoder mainly includes two methods: segmented calibration and integrated calibration.
  • the segmented type has the problem of poor calibration accuracy
  • the integrated type has the problem that the fitting function obtained by the calibration is complicated and the calculation amount of the encoder is increased.
  • the purpose of the present invention is to provide an encoder measurement calibration method, device, equipment and computer readable storage medium, which is beneficial to improve the accuracy of encoder calibration.
  • the present invention provides an encoder measurement calibration method, including: obtaining in advance the deviation curve function of the encoder relative to the standard encoder; wherein, the deviation curve function is a comparison between the encoder and the encoder.
  • linear regression processing is performed on the deviation waveforms of the measured deviation values of the encoder and the standard encoder that vary with the position points within a measurement period to obtain multiple linear regression curves. Fitting points, including:
  • a fitting point is selected on the linear regression function in each waveform section.
  • the performing a linear regression operation on the deviation waveform in each of the waveform segments to obtain a linear regression function corresponding to each of the waveform segments includes:
  • the process of performing curve fitting on each of the fitting points to obtain the deviation curve function includes:
  • a cubic spline interpolation algorithm is used to perform curve fitting on each of the fitting points, and the fitting obtains the deviation curve function passing through each of the fitting points.
  • the dividing the deviation waveform into a plurality of waveform segments according to position points includes:
  • the selection of a fitting point on the linear regression function in each of the waveform segments includes:
  • the fitting point is selected in the middle section of the waveform section, and the middle section is a middle-third section of the waveform section.
  • the application also provides a measurement calibration device for an encoder, including:
  • the obtaining function module is used to obtain the deviation curve function of the encoder relative to the standard encoder in advance; wherein the deviation curve function is the measurement deviation value of the encoder and the standard encoder in a measurement period with position After performing linear regression processing on the deviation waveform of the point change to obtain multiple fitting points on the linear regression curve, perform curve fitting on each of the fitting points to obtain the curve function;
  • Data collection module used to collect test data at each test location
  • the data calibration module is used to calibrate each of the test data according to the deviation curve function, and obtain the calibrated test data corresponding to each test position point.
  • a function calculation module is included for dividing the deviation waveform into a number of waveform sections according to position points; performing linear regression operations on the deviation waveforms in each of the waveform sections to obtain A linear regression function corresponding to each of the waveform sections; a fitting point is selected on the linear regression function in each of the waveform sections.
  • the function operation module is specifically configured to perform a first-order linear regression operation on the deviation waveforms in each of the waveform segments to obtain a first-order linear regression function.
  • the application also provides a measurement and calibration equipment for an encoder, including:
  • Memory used to store computer programs
  • the processor is used to implement the steps of the measurement calibration method of the encoder as described in any one of the preceding items when the computer program is executed.
  • the present application also provides a computer-readable storage medium with a computer program stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the encoder measurement calibration method as described in any of the above are implemented .
  • the method for measuring and calibrating an encoder includes obtaining the deviation curve function of the encoder relative to the standard encoder in advance; wherein, the deviation curve function is the measurement deviation value of the encoder and the standard encoder in one measurement period. After performing linear regression processing to obtain multiple fitting points on the linear regression curve, perform the linear regression processing on the deviation waveform that varies with the position point, and perform curve fitting on each fitting point to obtain the curve function; collect the test data of each test position point; The deviation curve function calibrates each test data, and obtains the calibrated test data corresponding to each test position point.
  • a deviation curve function that can characterize the deviation change trend between the measured value of the encoder and the measured value of the standard encoder is obtained; and this A deviation curve function is a curve function obtained by first performing linear regression processing on the deviation waveform, and then fitting the fitting points on the linear regression function to avoid the more serious sampling points in the deviation waveform, and to simulate the subsequent curve.
  • the combination produces interference, thereby improving the accuracy of the deviation curve function obtained by the subsequent curve fitting, thereby improving the accuracy of the encoder accuracy calibration.
  • the present application also provides a measurement and calibration device, equipment and computer-readable storage medium for an encoder, which have the above-mentioned beneficial effects.
  • FIG. 1 is a schematic flowchart of a measurement and calibration method for an encoder provided by an embodiment of the application
  • Figure 2 is a schematic diagram of the deviation waveform of the encoder to be tested
  • FIG. 3 is a schematic flowchart of a process of obtaining a deviation curve function provided by an embodiment of the application
  • Fig. 4 is a structural block diagram of an encoder measurement and calibration device provided by an embodiment of the present invention.
  • FIG. 1 is a schematic flowchart of a measurement and calibration method for an encoder provided by an embodiment of the application, and the measurement and calibration method may include:
  • Step S11 Obtain in advance the deviation curve function of the encoder relative to the standard encoder.
  • the deviation curve function is the deviation waveform of the measurement deviation value of the encoder and the standard encoder that changes with the position point in a measurement period. After linear regression processing is performed to obtain multiple fitting points on the linear regression curve, each simulation is performed. The curve function obtained by curve fitting at the junction point.
  • Step S12 Collect test data of each test location point.
  • Step S13 Calibrate each test data according to the deviation curve function, and obtain the calibrated test data corresponding to each test position point.
  • obtaining the deviation curve function of the encoder relative to the standard encoder is by obtaining in advance the deviation waveform of the deviation between the measured value and the accurate value of the encoder at each position point, where the deviation
  • the waveform is based on the position data measured by the encoder as the abscissa, and the deviation value corresponding to the position data is the waveform where the discrete point of the ordinate is located.
  • the deviation waveform fitting obtains the deviation curve function that can characterize the change trend of the encoder measurement deviation .
  • FIG. 2 is a schematic diagram of the deviation waveform of the encoder under test.
  • the deviation waveform of the rotary encoder is taken as an example for description. Therefore, the abscissa is the position angle value, and the ordinate is the deviation value corresponding to each position value, where the position angle value and the deviation value form the discrete point It falls on two realization curves.
  • the deviation curve function that needs to be fitted is the function of the dashed curve in the figure.
  • Algorithms such as Fourier series or Lagrangian expansion can be used to fit the discrete points on the entire waveform as a whole, so that the fitted curve function passes through as much as possible Every discrete point on the deviation waveform; although the fitting function obtained by this method has a high degree of fit with each discrete point, it is also prone to overfitting, although it has a good fit with the current deviation waveform , But it cannot accurately reflect the overall deviation trend of the encoder; in addition, the fitting function obtained by this fitting method is relatively complicated. If it is applied to the encoder, it must be solved by the encoder's MCU according to the fitting function. The position data will increase the computing pressure of the MCU to a certain extent.
  • the other is segmented fitting.
  • the waveform is first divided into multiple equally divided waveform sections, a discrete point is selected as the fitting point in each waveform section, and each fitting point is simulated by interpolation. Together, the fitting curve passing through each fitting point is obtained.
  • This fitting method greatly reduces the number of discrete points on the deviation waveform, which can reduce the over-fitting problem to a certain extent, and the obtained fitting function is relatively simpler.
  • the deviation waveform obtained for each data acquisition of the encoder is not constant, and the discrete points on the deviation waveform should fluctuate near the deviation curve, which is a curve that accurately reflects the deviation change trend of the encoder.
  • FIG. 3 is a schematic flowchart of a process of obtaining a deviation curve function provided by an embodiment of the application, and the process may include:
  • Step S21 Collect and obtain the deviation waveform of the encoder to be calibrated.
  • the deviation waveform is the waveform of the measurement deviation value of the encoder to be calibrated and the standard encoder varying with the position point within a measurement period;
  • the encoder to be calibrated and the standard encoder can be measured at the same time.
  • record the reading of the encoder to be calibrated and the standard encoder and take the reading of the encoder to be calibrated as Position data
  • the difference between the readings of the encoder to be calibrated and the standard encoder is the deviation data;
  • the position data and deviation data corresponding to each position point of the encoder in one cycle can be obtained; and then measured by the encoder to be calibrated
  • the position data corresponding to each position point of is the abscissa
  • the deviation data is the ordinate
  • the obtained multiple discrete points the waveform formed by each discrete point is the deviation waveform.
  • Step S22 Divide the deviation waveform into several waveform sections according to the position points.
  • the deviation waveform is divided into a plurality of waveform sections whose width difference between any two waveform sections is not greater than a preset difference value.
  • Step S23 Perform a linear regression operation on the deviation waveform in each waveform section to obtain a linear regression function corresponding to each waveform section.
  • linear regression operation is a statistical analysis method that uses regression analysis operations in mathematical statistics to determine the quantitative relationship between two or more variables.
  • the principle of linear regression operation is to make each discrete point as far as possible to be distributed on both sides of the linear regression curve, that is to say, it is not necessarily required that each discrete point is located on the regression curve, thereby eliminating some serious deviations from the discrete point curve.
  • the influence of the fitting further improves the accuracy of the calibration of the encoder by the fitting curve function, wherein the fitting curve function is also the above-mentioned deviation curve function.
  • a first-order linear regression operation may be performed on each waveform segment to obtain a first-order linear function.
  • a second-order linear regression operation may be performed on each waveform segment to obtain a first-order linear function.
  • Step S24 a fitting point is selected from the linear regression function in each waveform section, and curve fitting is performed on the fitting point to obtain a deviation curve function passing through each fitting point.
  • obtaining the fitting points on the linear regression function in each waveform segment may specifically include:
  • the fitting point is selected in the middle section of the waveform section, and the middle section is the middle one-third section of the waveform section.
  • the fitting points in this embodiment are points on the linear regression function, which can avoid this problem.
  • the point at the center of the linear regression function is selected as the fitting point, which is beneficial to the calibration accuracy of a high deviation curve function.
  • the points on the linear regression function are used as fitting points to perform curve fitting, so that the fitted curve passes through each fitting point.
  • the fitting points in this embodiment are closer to the fluctuation of the deviation waveform than the discrete points in the prior art.
  • the center using this as the reference for fitting the deviation curve, can further improve the accuracy of the obtained fitting curve function.
  • each fitting point there are many ways to perform curve fitting on each fitting point.
  • the simplest one is to connect each adjacent fitting point with a straight line.
  • the function expression of each straight line is the deviation curve function.
  • the deviation curve function obtained by this method has the advantages of simple function formula and reducing the difficulty of mcu operation of the encoder.
  • the cubic spline interpolation algorithm can also be used to fit each fitting point. Compared with the deviation curve function obtained by directly connecting the fitting points, the cubic spline interpolation algorithm also has the advantage of simple function. At the same time, it is also closer to the fluctuation center of the deviation waveform, that is, the deviation curve function obtained by the cubic spline interpolation algorithm, as the calibration curve function of the encoder, has a higher calibration accuracy.
  • a deviation curve function that can characterize the deviation change trend between the measured value of the encoder and the measured value of the standard encoder is obtained; and this A deviation curve function is a curve function obtained by first performing linear regression processing on the deviation waveform and then fitting the fitting points on the linear regression function.
  • the linear regression algorithm is used to perform linear regression on each waveform section of the deviation waveform.
  • the obtained linear regression function largely excludes the collection of data, and based on the point on the linear regression function as the fitting point, the deviation curve function is obtained by fitting, so that the obtained deviation curve function is closer to the deviation
  • the fluctuation center of the waveform also avoids the problem of the accuracy of the fitting function caused by the abnormal fluctuation deviation of the discrete points on the deviation waveform, which is beneficial to improve the calibration accuracy when the deviation curve function is used to calibrate the encoder.
  • the measurement and calibration device for the encoder provided by the embodiment of the present invention will be introduced below.
  • the measurement and calibration device for the encoder described below and the measurement and calibration method for the encoder described above can be referred to each other.
  • FIG. 4 is a structural block diagram of an encoder measurement and calibration device provided by an embodiment of the present invention.
  • the encoder measurement and calibration device may include:
  • the obtaining function module 100 is used to obtain the deviation curve function of the encoder relative to the standard encoder in advance; wherein the deviation curve function is the measurement deviation value of the encoder and the standard encoder within a measurement period. After performing linear regression processing to obtain a plurality of fitting points on the linear regression curve, the deviation waveform of the change of the position point is curve function obtained by performing curve fitting on each of the fitting points;
  • the data collection module 200 is used to collect test data at various test locations
  • the data calibration module 300 is configured to calibrate each of the test data according to the deviation curve function, and obtain the calibrated test data corresponding to each test position point.
  • it may further include:
  • the function calculation module is used to divide the deviation waveform into a number of waveform sections according to the position points; perform linear regression operations on the deviation waveforms in each of the waveform sections to obtain the linear regression function corresponding to each of the waveform sections ; Select a fitting point on the linear regression function in each waveform section.
  • it may further include:
  • the function calculation module is used to perform a first-order linear regression operation on the deviation waveforms in each of the waveform sections to obtain a first-order linear regression function.
  • it may further include:
  • the function calculation module is configured to use a cubic spline interpolation algorithm to perform curve fitting on each of the fitting points, and to obtain the deviation curve function by fitting.
  • it may further include:
  • the function calculation module is specifically configured to divide the deviation waveform into a plurality of the waveform sections whose width difference between any two of the waveform sections is not greater than a preset difference; and within the waveform section The fitting point is selected in the middle section, and the middle section is the middle one-third section of the waveform section.
  • the encoder measurement and calibration device of this embodiment is used to implement the aforementioned encoder measurement and calibration method. Therefore, the specific implementation of the encoder measurement and calibration device can be seen in the previous embodiment of the encoder measurement and calibration method, for example ,
  • the data acquisition module 100, the section division module 200, the regression calculation module 300, and the curve fitting module 400 are respectively used to implement steps S11, S12, S13 and S14 in the measurement calibration method of the encoder, so the specific implementation Reference can be made to the descriptions of the respective parts of the embodiments, which will not be repeated here.
  • This application also provides an embodiment of an encoder measurement and calibration equipment, including:
  • Memory used to store computer programs
  • the processor is used to implement the steps of the measurement calibration method of the encoder as described below when the computer program is executed:
  • the deviation curve function is a deviation waveform of the measured deviation value of the encoder and the standard encoder that changes with position points within a measurement period, After performing linear regression processing to obtain multiple fitting points on the linear regression curve, perform curve fitting on each of the fitting points to obtain the curve function;
  • the processor in this embodiment executes the computer program stored in the memory, and uses the deviation curve function obtained in advance to calibrate the measured measurement data, which is simple, convenient and easy to implement, and the deviation curve function is used to calibrate each waveform area of the deviation waveform.
  • the fitting point is obtained based on the linear regression function, and then the deviation curve function obtained by curve fitting is performed according to the fitting point, so that the deviation curve function can be used to a certain extent when the deviation curve function is used for the calibration of the encoder.
  • Improve the calibration accuracy of the encoder and then improve the measurement accuracy of the encoder.
  • the present application also provides a computer-readable storage medium with a computer program stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the encoder measurement calibration method as described in any of the above are implemented .
  • the computer-readable storage medium may be random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM , Or any other form of storage medium known in the technical field.
  • RAM random access memory
  • ROM read-only memory
  • EEPROM electrically programmable ROM
  • erasable programmable ROM register
  • hard disk hard disk
  • removable disk CD-ROM

Abstract

Provided are an encoder measurement and calibration method, device, and apparatus as well as a storage medium, wherein the method comprises: obtaining in advance a deviation curve function of an encoder relative to a standard encoder; wherein, the deviation curve function is a curve function obtained by curve fitting for each fitting point after performing linear regression processing on the deviation waveform of the measurement deviation value of the encoder and the standard encoder that changes with the position point in a measurement period, to obtain multiple fitting points on the linear regression curve; and calibrating all test data according to the deviation curve function. The method obtains in advance a deviation curve function that can characterize a deviation change trend between the measured value of the encoder and the measured value of the standard encoder, and calibrate the measurement value of the encoder on the basis of the deviation curve function, and thus improve the accuracy of the encoder.

Description

编码器的测量校准方法、装置、设备及存储介质Measurement and calibration method, device, equipment and storage medium of encoder
本申请要求于2019年11月29日提交中国专利局、申请号为201911204611.7、发明名称为“编码器的测量校准方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on November 29, 2019, the application number is 201911204611.7, and the invention title is "Encoder measurement and calibration method, device, equipment, and storage medium". The entire content of the application is approved. The reference is incorporated in this application.
技术领域Technical field
本发明涉及编码器精度校准技术领域,特别是涉及一种编码器的测量校准方法、装置、设备以及计算机可读存储介质。The present invention relates to the technical field of encoder accuracy calibration, in particular to an encoder measurement calibration method, device, equipment and computer readable storage medium.
背景技术Background technique
编码器是将角度位移和直线位移转化成电信号,并将电信号进行模数转换,生成数字位置信息的测量设备。编码器的种类较多,根据测量原理的不同包括磁编码器、电编码器等,根据解码原理不同可以分为绝对型编码器和增量型编码器。The encoder is a measuring device that converts angular displacement and linear displacement into electrical signals, and performs analog-to-digital conversion of the electrical signals to generate digital position information. There are many types of encoders, including magnetic encoders, electrical encoders, etc. according to different measurement principles, and can be divided into absolute encoders and incremental encoders according to different decoding principles.
因为编码器的设计和制作过程中,均不可避免的会存在设计缺陷和制作误差,这就不可避免的导致编码器测得的位置信息相应地存在误差。因此,编码器在出厂前需要以标准编码器为基准进行精度校准。Because in the design and production of the encoder, design defects and production errors are unavoidable, which inevitably leads to corresponding errors in the position information measured by the encoder. Therefore, the encoder needs to be calibrated for accuracy based on the standard encoder before leaving the factory.
目前对编码器的校准主要包括分段式校准和整体式校准两种方式,分段式存在校准精度差的问题,而整体式存在校准获得的拟合函数复杂增加编码器的运算量的问题。At present, the calibration of the encoder mainly includes two methods: segmented calibration and integrated calibration. The segmented type has the problem of poor calibration accuracy, while the integrated type has the problem that the fitting function obtained by the calibration is complicated and the calculation amount of the encoder is increased.
发明内容Summary of the invention
本发明的目的是提供一种编码器的测量校准方法、装置、设备以及计算机可读存储介质,有利于提高编码器校准的精度。The purpose of the present invention is to provide an encoder measurement calibration method, device, equipment and computer readable storage medium, which is beneficial to improve the accuracy of encoder calibration.
为解决上述技术问题,本发明提供一种编码器的测量校准方法,包括:预先获得编码器相对于标准编码器的偏差曲线函数;其中,所述偏差曲线函数为对所述编码器和所述标准编码器的测量偏差值在一个测量周期内随位置点变化的偏差波形,进行线性回归处理获得线性回归曲线上的多个拟合点后,对各个所述拟合点进行曲线拟合获得的曲线函数;In order to solve the above technical problems, the present invention provides an encoder measurement calibration method, including: obtaining in advance the deviation curve function of the encoder relative to the standard encoder; wherein, the deviation curve function is a comparison between the encoder and the encoder. The deviation waveform of the measurement deviation value of the standard encoder that changes with the position point in a measurement period, after performing linear regression processing to obtain multiple fitting points on the linear regression curve, the curve fitting is obtained by performing curve fitting on each of the fitting points Curve function
采集各个测试位置点的测试数据;Collect test data at each test location;
根据所述偏差曲线函数对各个所述测试数据进行校准,获得各个测试位置点对应的校准后的测试数据。Calibrate each of the test data according to the deviation curve function, and obtain the calibrated test data corresponding to each test position point.
在一种可选的实施例中,对所述编码器和所述标准编码器的测量偏差值在一个测量周期内随位置点变化的偏差波形,进行线性回归处理获得线性回归曲线上的多个拟合点,包括:In an optional embodiment, linear regression processing is performed on the deviation waveforms of the measured deviation values of the encoder and the standard encoder that vary with the position points within a measurement period to obtain multiple linear regression curves. Fitting points, including:
按照位置点将所述偏差波形划分为若干个波形区段;Dividing the deviation waveform into a number of waveform sections according to position points;
对各个所述波形区段内的偏差波形进行线性回归运算,获得各个所述波形区段对应的线性回归函数;Perform a linear regression operation on the deviation waveform in each of the waveform sections to obtain a linear regression function corresponding to each of the waveform sections;
在每个所述波形区段内的线性回归函数上个选取一个拟合点。A fitting point is selected on the linear regression function in each waveform section.
在一种可选的实施例中,所述将每个所述波形区段内的偏差波形进行线性回归运算,获得各个所述波形区段对应的线性回归函数包括:In an optional embodiment, the performing a linear regression operation on the deviation waveform in each of the waveform segments to obtain a linear regression function corresponding to each of the waveform segments includes:
对各个所述波形区段内的偏差波形进行一阶线性回归运算,获得一阶线性回归函数。Perform a first-order linear regression operation on the deviation waveforms in each of the waveform sections to obtain a first-order linear regression function.
在一种可选的实施例中,所述对各个所述拟合点进行曲线拟合获得的偏差曲线函数的过程包括:In an optional embodiment, the process of performing curve fitting on each of the fitting points to obtain the deviation curve function includes:
采用三次样条插值算法对各个所述拟合点进行曲线拟合,拟合获得经过各个所述拟合点所述偏差曲线函数。A cubic spline interpolation algorithm is used to perform curve fitting on each of the fitting points, and the fitting obtains the deviation curve function passing through each of the fitting points.
在一种可选的实施例中,所述按照位置点将所述偏差波形划分为若干个波形区段包括:In an optional embodiment, the dividing the deviation waveform into a plurality of waveform segments according to position points includes:
将所述偏差波形划分为任意两个所述波形区段的宽度差值不大于预设差值的多个所述波形区段;Dividing the deviation waveform into a plurality of the waveform sections whose width difference between any two of the waveform sections is not greater than a preset difference;
所述在各个所述波形区段内的线性回归函数上个选取一个拟合点包括:The selection of a fitting point on the linear regression function in each of the waveform segments includes:
在所述波形区段内中间区段部分选取所述拟合点,所述中间区段为所述波形区段中间三分一区段部分。The fitting point is selected in the middle section of the waveform section, and the middle section is a middle-third section of the waveform section.
本申请还提供了一种编码器的测量校准装置,包括:The application also provides a measurement calibration device for an encoder, including:
获取函数模块,用于预先获得编码器相对于标准编码器的偏差曲线函数;其中,所述偏差曲线函数为对所述编码器和所述标准编码器的测量偏 差值在一个测量周期内随位置点变化的偏差波形,进行线性回归处理获得线性回归曲线上的多个拟合点后,对各个所述拟合点进行曲线拟合获得的曲线函数;The obtaining function module is used to obtain the deviation curve function of the encoder relative to the standard encoder in advance; wherein the deviation curve function is the measurement deviation value of the encoder and the standard encoder in a measurement period with position After performing linear regression processing on the deviation waveform of the point change to obtain multiple fitting points on the linear regression curve, perform curve fitting on each of the fitting points to obtain the curve function;
数据采集模块,用于采集各个测试位置点的测试数据;Data collection module, used to collect test data at each test location;
数据校准模块,用于根据所述偏差曲线函数对各个所述测试数据进行校准,获得各个测试位置点对应的校准后的测试数据。The data calibration module is used to calibrate each of the test data according to the deviation curve function, and obtain the calibrated test data corresponding to each test position point.
在一种可选的实施例中,包括函数运算模块,用于按照位置点将所述偏差波形划分为若干个波形区段;对各个所述波形区段内的偏差波形进行线性回归运算,获得各个所述波形区段对应的线性回归函数;在每个所述波形区段内的线性回归函数上个选取一个拟合点。In an optional embodiment, a function calculation module is included for dividing the deviation waveform into a number of waveform sections according to position points; performing linear regression operations on the deviation waveforms in each of the waveform sections to obtain A linear regression function corresponding to each of the waveform sections; a fitting point is selected on the linear regression function in each of the waveform sections.
在一种可选的实施例中,所述函数运算模块具体用于对各个所述波形区段内的偏差波形进行一阶线性回归运算,获得一阶线性回归函数。In an optional embodiment, the function operation module is specifically configured to perform a first-order linear regression operation on the deviation waveforms in each of the waveform segments to obtain a first-order linear regression function.
本申请还提供了一种编码器的测量校准设备,包括:The application also provides a measurement and calibration equipment for an encoder, including:
存储器,用于存储计算机程序;Memory, used to store computer programs;
处理器,用于执行所述计算机程序时实现如上任一项所述编码器的测量校准方法的步骤。The processor is used to implement the steps of the measurement calibration method of the encoder as described in any one of the preceding items when the computer program is executed.
本申请还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上任一项所述编码器的测量校准方法的步骤。The present application also provides a computer-readable storage medium with a computer program stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the encoder measurement calibration method as described in any of the above are implemented .
本发明所提供的一种编码器的测量校准方法,包括预先获得编码器相对于标准编码器的偏差曲线函数;其中,偏差曲线函数为对编码器和标准编码器的测量偏差值在一个测量周期内随位置点变化的偏差波形,进行线性回归处理获得线性回归曲线上的多个拟合点后,对各个拟合点进行曲线拟合获得的曲线函数;采集各个测试位置点的测试数据;根据偏差曲线函数对各个测试数据进行校准,获得各个测试位置点对应的校准后的测试数据。The method for measuring and calibrating an encoder provided by the present invention includes obtaining the deviation curve function of the encoder relative to the standard encoder in advance; wherein, the deviation curve function is the measurement deviation value of the encoder and the standard encoder in one measurement period. After performing linear regression processing to obtain multiple fitting points on the linear regression curve, perform the linear regression processing on the deviation waveform that varies with the position point, and perform curve fitting on each fitting point to obtain the curve function; collect the test data of each test position point; The deviation curve function calibrates each test data, and obtains the calibrated test data corresponding to each test position point.
本申请中预先基于对编码器和标准编码器之间测量的偏差波形进行分析处理,获得能够表征编码器的测量值和标准编码器的测量值之间的偏差变化趋势的偏差曲线函数;且这一偏差曲线函数是偏差波形先经过线性回 归处理后,再经过对线性回归函数上的拟合点进行拟合获得的曲线函数,避免了偏差波形中偏离较为严重的采样点,对后续的曲线拟合产生干扰,进而提高了后续进行曲线拟合获得的偏差曲线函数的精度,进而提高编码器精度校准的精度。In this application, based on the analysis and processing of the deviation waveform measured between the encoder and the standard encoder in advance, a deviation curve function that can characterize the deviation change trend between the measured value of the encoder and the measured value of the standard encoder is obtained; and this A deviation curve function is a curve function obtained by first performing linear regression processing on the deviation waveform, and then fitting the fitting points on the linear regression function to avoid the more serious sampling points in the deviation waveform, and to simulate the subsequent curve. The combination produces interference, thereby improving the accuracy of the deviation curve function obtained by the subsequent curve fitting, thereby improving the accuracy of the encoder accuracy calibration.
本申请还提供了一种编码器的测量校准装置、设备以及计算机可读存储介质,具有上述有益效果。The present application also provides a measurement and calibration device, equipment and computer-readable storage medium for an encoder, which have the above-mentioned beneficial effects.
附图说明Description of the drawings
为了更清楚的说明本发明实施例或现有技术的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单的介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions of the prior art more clearly, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are merely For some of the embodiments of the present invention, those of ordinary skill in the art can obtain other drawings based on these drawings without creative work.
图1为本申请实施例提供的编码器的测量校准方法的流程示意图;FIG. 1 is a schematic flowchart of a measurement and calibration method for an encoder provided by an embodiment of the application;
图2为待测编码器的偏差波形的示意图;Figure 2 is a schematic diagram of the deviation waveform of the encoder to be tested;
图3为本申请实施例提供的获得偏差曲线函数的过程的流程示意图;FIG. 3 is a schematic flowchart of a process of obtaining a deviation curve function provided by an embodiment of the application;
图4为本发明实施例提供的编码器的测量校准装置的结构框图。Fig. 4 is a structural block diagram of an encoder measurement and calibration device provided by an embodiment of the present invention.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本发明方案,下面结合附图和具体实施方式对本发明作进一步的详细说明。显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to enable those skilled in the art to better understand the solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
如图1所示,图1为本申请实施例提供的编码器的测量校准方法的流程示意图,该测量校准方法可以包括:As shown in FIG. 1, FIG. 1 is a schematic flowchart of a measurement and calibration method for an encoder provided by an embodiment of the application, and the measurement and calibration method may include:
步骤S11:预先获得编码器相对于标准编码器的偏差曲线函数。Step S11: Obtain in advance the deviation curve function of the encoder relative to the standard encoder.
其中,偏差曲线函数为对编码器和标准编码器的测量偏差值在一个测量周期内随位置点变化的偏差波形,进行线性回归处理获得线性回归曲线 上的多个拟合点后,对各个拟合点进行曲线拟合获得的曲线函数。Among them, the deviation curve function is the deviation waveform of the measurement deviation value of the encoder and the standard encoder that changes with the position point in a measurement period. After linear regression processing is performed to obtain multiple fitting points on the linear regression curve, each simulation is performed. The curve function obtained by curve fitting at the junction point.
步骤S12:采集各个测试位置点的测试数据。Step S12: Collect test data of each test location point.
步骤S13:根据偏差曲线函数对各个测试数据进行校准,获得各个测试位置点对应的校准后的测试数据。Step S13: Calibrate each test data according to the deviation curve function, and obtain the calibrated test data corresponding to each test position point.
需要说明的是,获得编码器相对于标准编码器的偏差曲线函数,是通过预先获得编码器各个位置点的测量值和准确值之间的偏差值随位置点变化的偏差波形,其中,该偏差波形是以编码器各个测量的位置数据为横坐标,该位置数据对应的偏差值为纵坐标的离散点所在的波形,该偏差波形拟合获得能够表征编码器测量偏差的变化趋势的偏差曲线函数。It should be noted that obtaining the deviation curve function of the encoder relative to the standard encoder is by obtaining in advance the deviation waveform of the deviation between the measured value and the accurate value of the encoder at each position point, where the deviation The waveform is based on the position data measured by the encoder as the abscissa, and the deviation value corresponding to the position data is the waveform where the discrete point of the ordinate is located. The deviation waveform fitting obtains the deviation curve function that can characterize the change trend of the encoder measurement deviation .
具体地,可参考图2,图2为待测编码器的偏差波形的示意图。在图2中,是以旋转编码器的偏差波形为例进行说明,因此横坐标为位置角度值,而纵坐标是每个位置值对应的偏差值,其中位置角度值和偏差值形成的离散点即是落在两条实现曲线上。而需要拟合的偏差曲线函数为图中的虚线曲线的函数。Specifically, refer to FIG. 2, which is a schematic diagram of the deviation waveform of the encoder under test. In Figure 2, the deviation waveform of the rotary encoder is taken as an example for description. Therefore, the abscissa is the position angle value, and the ordinate is the deviation value corresponding to each position value, where the position angle value and the deviation value form the discrete point It falls on two realization curves. The deviation curve function that needs to be fitted is the function of the dashed curve in the figure.
现有技术中对由离散点形成的波形进行拟合主要有两种方式:In the prior art, there are mainly two ways to fit the waveform formed by discrete points:
一种是整体式拟合,可以采用傅里叶级数或者拉格朗日展开式等算法,将整个波形上的离散点当作一个整体进行拟合,使得拟合的曲线函数尽可能的经过偏差波形上的每个离散点;采用该方法获得的拟合函数尽管和各个离散点的拟合度高,但是也易出现过拟合的问题,尽管和当前的偏差波形具有较好的拟合,但却不能准确反应编码器整体偏差趋势;另外,该拟合方式获得的拟合函数相对复杂,若应用于编码器中,要通过编码器的MCU根据该拟合函数解算出更为精准的位置数据,会在一定程度上提高MCU的运算压力。One is integral fitting. Algorithms such as Fourier series or Lagrangian expansion can be used to fit the discrete points on the entire waveform as a whole, so that the fitted curve function passes through as much as possible Every discrete point on the deviation waveform; although the fitting function obtained by this method has a high degree of fit with each discrete point, it is also prone to overfitting, although it has a good fit with the current deviation waveform , But it cannot accurately reflect the overall deviation trend of the encoder; in addition, the fitting function obtained by this fitting method is relatively complicated. If it is applied to the encoder, it must be solved by the encoder's MCU according to the fitting function. The position data will increase the computing pressure of the MCU to a certain extent.
另一种是分段式拟合,先将波形划分为多个等分的波形区段,在每一个波形区段内选取一个离散点作为拟合点,采用插值法对各个拟合点进行拟合,获得经过各个拟合点的拟合曲线。这种拟合方式因为经过偏差波形上的离散点的数量大大减少,能够在一定程度上减小过拟合的问题,并且获得的拟合函数也相对更为简单。The other is segmented fitting. The waveform is first divided into multiple equally divided waveform sections, a discrete point is selected as the fitting point in each waveform section, and each fitting point is simulated by interpolation. Together, the fitting curve passing through each fitting point is obtained. This fitting method greatly reduces the number of discrete points on the deviation waveform, which can reduce the over-fitting problem to a certain extent, and the obtained fitting function is relatively simpler.
而对于编码器的每一次采集数据获得偏差波形并非不是恒定的,且偏 差波形上的离散点应当是在偏差曲线附近波动,该偏差曲线即为准确反应编码器偏差变化趋势的曲线。The deviation waveform obtained for each data acquisition of the encoder is not constant, and the discrete points on the deviation waveform should fluctuate near the deviation curve, which is a curve that accurately reflects the deviation change trend of the encoder.
由此可见,对于偏差曲线而言,其应当是趋近于偏差波形的波动中心的曲线,是更为准确的,而并非是经过偏差波形上离散点最多的曲线。但现有技术中对波形的拟合无论是整体式拟合还是分段式拟合获得的拟合曲线函数,均是经过离散点进行拟合的,基于该拟合曲线对编码器精度进行校准,明显会降低校准精度;并且若是某些离散点因为测量或者其他原因产生较大的偏差,以这些离散点为基准获得的拟合曲线函数的准确度会进一步的降低。It can be seen that, for the deviation curve, it should be a curve approaching the fluctuation center of the deviation waveform, which is more accurate, rather than the curve that passes through the most discrete points on the deviation waveform. However, in the prior art, whether the fitting curve function obtained by the integral fitting or the segmented fitting of the waveform fitting in the prior art is fitted through discrete points, the encoder accuracy is calibrated based on the fitting curve , It will obviously reduce the calibration accuracy; and if some discrete points have large deviations due to measurement or other reasons, the accuracy of the fitting curve function obtained on the basis of these discrete points will be further reduced.
为了进一步说明本申请中的技术方案,下面将以具体实施例对本申请中获得偏差曲线函数的过程进行详细说明。In order to further illustrate the technical solution in the present application, the process of obtaining the deviation curve function in the present application will be described in detail below with specific embodiments.
如图3所示,图3为本申请实施例提供的获得偏差曲线函数的过程的流程示意图,该过程可以包括:As shown in FIG. 3, FIG. 3 is a schematic flowchart of a process of obtaining a deviation curve function provided by an embodiment of the application, and the process may include:
步骤S21:采集获得待校准编码器的偏差波形。Step S21: Collect and obtain the deviation waveform of the encoder to be calibrated.
其中,偏差波形为待校准编码器和标准编码器的测量偏差值在一个测量周期内随位置点变化的波形;Among them, the deviation waveform is the waveform of the measurement deviation value of the encoder to be calibrated and the standard encoder varying with the position point within a measurement period;
为了获得该偏差波形,可以将待校准编码器和标准编码器同时进行位置测量,当测量同一个位置点时,记录待校准编码器和标准编码器的读数,并以待校准编码器的读数为位置数据,待校准编码器和标准编码器的读数差值为偏差数据;按照类似原理,即可获得编码器一个周期内各个位置点对应的位置数据和偏差数据;再以待校准编码器测得的各个位置点对应的位置数据为横坐标,偏差数据为纵坐标,获得的多个离散点,各个离散点形成的波形即为偏差波形。In order to obtain the deviation waveform, the encoder to be calibrated and the standard encoder can be measured at the same time. When measuring the same position point, record the reading of the encoder to be calibrated and the standard encoder, and take the reading of the encoder to be calibrated as Position data, the difference between the readings of the encoder to be calibrated and the standard encoder is the deviation data; according to similar principles, the position data and deviation data corresponding to each position point of the encoder in one cycle can be obtained; and then measured by the encoder to be calibrated The position data corresponding to each position point of is the abscissa, the deviation data is the ordinate, and the obtained multiple discrete points, the waveform formed by each discrete point is the deviation waveform.
需要说明的是,对于旋转编码器而言,一般旋转一圈也即是一个周期,其测得的位置值的偏差应当是重复的,因此,在实际校准过程中,只要将编码器旋转一圈内的各个位置点进行校准即可。It should be noted that for a rotary encoder, generally one rotation is also a cycle, and the deviation of the measured position value should be repeated. Therefore, in the actual calibration process, only one rotation of the encoder Calibration can be done at each position point within.
但是对于直线型编码器而言,因为只有一个周期,因此需要测得整个量程内所有位置点的偏差数据。But for the linear encoder, because there is only one cycle, it is necessary to measure the deviation data of all the position points in the entire range.
步骤S22:将偏差波形按照位置点划分为若干个波形区段。Step S22: Divide the deviation waveform into several waveform sections according to the position points.
可选地,将偏差波形划分为任意两个波形区段的宽度差值不大于预设差值的多个波形区段。Optionally, the deviation waveform is divided into a plurality of waveform sections whose width difference between any two waveform sections is not greater than a preset difference value.
现有技术中对波形采用分段式的拟合中,在对波形进行波形区段划分时,一般严格按照均分的方式进行划分。本实施例中对偏差波形区段划分的均匀性不存在要求。各个波形区段之间的宽度可以不完全相同,避免某些临界点难以取值的问题。但是为了运算方便,可以保证各个波形区段的宽度大致相同。In the prior art segmented fitting of the waveform, when the waveform is divided into waveform sections, the division is generally performed strictly in a manner of equal division. In this embodiment, there is no requirement for the uniformity of the division of the deviation waveform section. The width between the various waveform sections may not be exactly the same, to avoid the problem that some critical points are difficult to obtain. However, for the convenience of calculation, it can be ensured that the width of each waveform segment is approximately the same.
步骤S23:将每个波形区段内的偏差波形进行线性回归运算,获得各个波形区段对应的线性回归函数。Step S23: Perform a linear regression operation on the deviation waveform in each waveform section to obtain a linear regression function corresponding to each waveform section.
需要说明的是,线性回归运算是利用数理统计中的回归分析运算,来确定两种或两种以上变量间相互依赖的定量关系的一种统计分析方法。线性回归运算的原则是使得各个离散点尽可能的分布在线性回归曲线的两侧,也即是说并不必然要求各个离散点位于回归曲线上,从而排除了某些偏离严重的离散点对曲线拟合的影响,进而提高拟合曲线函数对编码器校准的精度,其中,该拟合曲线函数也即是上述的偏差曲线函数。It should be noted that linear regression operation is a statistical analysis method that uses regression analysis operations in mathematical statistics to determine the quantitative relationship between two or more variables. The principle of linear regression operation is to make each discrete point as far as possible to be distributed on both sides of the linear regression curve, that is to say, it is not necessarily required that each discrete point is located on the regression curve, thereby eliminating some serious deviations from the discrete point curve. The influence of the fitting further improves the accuracy of the calibration of the encoder by the fitting curve function, wherein the fitting curve function is also the above-mentioned deviation curve function.
可选地,为了尽可能的简化运算过程降低拟合偏差曲线函数的复杂程度,可以对每个波形区段进行一阶线性回归运算,获得一阶线性函数。当然,本申请中也并不排除采用二阶线性回归运算获得二阶线性函数的技术方案。Optionally, in order to simplify the calculation process as much as possible to reduce the complexity of fitting the deviation curve function, a first-order linear regression operation may be performed on each waveform segment to obtain a first-order linear function. Of course, the technical solution of obtaining a second-order linear function by using a second-order linear regression operation is not excluded in this application.
步骤S24:在每个波形区段内的线性回归函数上个选取一个拟合点,并对拟合点进行曲线拟合,获得经过各个拟合点的偏差曲线函数。Step S24: a fitting point is selected from the linear regression function in each waveform section, and curve fitting is performed on the fitting point to obtain a deviation curve function passing through each fitting point.
可选地,对于获得每个波形区段内的线性回归函数上的拟合点具体可以包括:Optionally, obtaining the fitting points on the linear regression function in each waveform segment may specifically include:
在波形区段内中间区段部分选取拟合点,中间区段为波形区段中间三分一区段部分。The fitting point is selected in the middle section of the waveform section, and the middle section is the middle one-third section of the waveform section.
一般在每个波形区段内选取离散点时,多选取该区段在横坐标上的中心点对应的离散点。若该离散点是属于相对偏差波形的波动中心存在较大偏移的点,则会降低偏差曲线函数的精度。Generally, when selecting discrete points in each waveform section, select the discrete points corresponding to the center point of the section on the abscissa. If the discrete point is a point where there is a large deviation in the fluctuation center of the relative deviation waveform, the accuracy of the deviation curve function will be reduced.
本实施例中的拟合点时线性回归函数上的点,可以避免这一问题。但 是尽可能的选取线性回归函数中心位置的点作为拟合点,有利于一高偏差曲线函数的校准精度。考虑到各个波形区段的中心点可能不便于取值,可以尽量选取各个波形区段的中心点附近的位置点对应的拟合点,例如位置数据为整数的点(如0度、5度、10度位置对应的拟合点等)。The fitting points in this embodiment are points on the linear regression function, which can avoid this problem. However, as far as possible, the point at the center of the linear regression function is selected as the fitting point, which is beneficial to the calibration accuracy of a high deviation curve function. Considering that the center point of each waveform segment may be inconvenient to obtain a value, you can try to select the fitting point corresponding to the position point near the center point of each waveform segment, such as the point where the position data is an integer (such as 0 degrees, 5 degrees, The fitting point corresponding to the 10 degree position, etc.).
总之,只要能够尽可能的保证拟合点拟合获得的偏差曲线函数的校准精度,并尽可能的降低运算难度即可。In short, as long as it can ensure the calibration accuracy of the deviation curve function obtained by fitting the fitting point as much as possible, and reduce the difficulty of calculation as much as possible.
在获得线性回归函数之后,以该线性回归函数上的点作为拟合点,进行曲线拟合,使得拟合的曲线经过各个拟合点。相对于现有技术中进行拟合时采用的往往是基于实际采集数据获得的离散点而言,本实施例中的拟合点相对于现有技术中的离散点更趋近于偏差波形的波动中心,以此作为拟合偏差曲线的基准,可进一步提高获得的拟合曲线函数的精度。After the linear regression function is obtained, the points on the linear regression function are used as fitting points to perform curve fitting, so that the fitted curve passes through each fitting point. Compared with the discrete points that are often used for fitting in the prior art based on actual collected data, the fitting points in this embodiment are closer to the fluctuation of the deviation waveform than the discrete points in the prior art. The center, using this as the reference for fitting the deviation curve, can further improve the accuracy of the obtained fitting curve function.
具体地,对各个拟合点进行曲线拟合的方法存在多种,最简单的一种即是将各个相邻的拟合点进行直线连接,各个直线的函数表达式即为偏差曲线函数,通过该方法获得的偏差曲线函数具有函数式简单,降低编码器的mcu运算难度的优点。Specifically, there are many ways to perform curve fitting on each fitting point. The simplest one is to connect each adjacent fitting point with a straight line. The function expression of each straight line is the deviation curve function. The deviation curve function obtained by this method has the advantages of simple function formula and reducing the difficulty of mcu operation of the encoder.
另外,还可以采用三次样条插值算法对各个拟合点进行拟合,相对于对拟合点直接连线获得偏差曲线函数而言,三次样条插值算法也同样具有函数式简单的优点,于此同时还更贴近于偏差波形的波动中心,也即是说三次样条插值算法获得的偏差曲线函数,作为编码器的校准曲线函数,具有更高的校准精度。In addition, the cubic spline interpolation algorithm can also be used to fit each fitting point. Compared with the deviation curve function obtained by directly connecting the fitting points, the cubic spline interpolation algorithm also has the advantage of simple function. At the same time, it is also closer to the fluctuation center of the deviation waveform, that is, the deviation curve function obtained by the cubic spline interpolation algorithm, as the calibration curve function of the encoder, has a higher calibration accuracy.
当然本申请中也可以采用其他的拟合算法对拟合点进行拟合,只要能够尽可能的减小偏差曲线函数的复杂度,并尽可能的提高偏差曲线函数对编码器的校准精度即可Of course, other fitting algorithms can also be used in this application to fit the fitting points, as long as the complexity of the deviation curve function can be reduced as much as possible, and the calibration accuracy of the deviation curve function to the encoder can be improved as much as possible.
本申请中预先基于对编码器和标准编码器之间测量的偏差波形进行分析处理,获得能够表征编码器的测量值和标准编码器的测量值之间的偏差变化趋势的偏差曲线函数;且这一偏差曲线函数是偏差波形先经过线性回归处理后,再经过对线性回归函数上的拟合点进行拟合获得的曲线函数,通过采用线性回归算法先对偏差波形的各个波形区段进行线性回归运算,获得的线性回归函数在很大程度上排除了采集数据时,并基于该线性回归 函数上的点作为拟合点,拟合获得偏差曲线函数,使得获得的偏差曲线函数更趋近于偏差波形的波动中心,还避免了偏差波形上的离散点存在不正常的波动偏离造成拟合函数准确的问题,有利于提高采用该偏差曲线函数进行编码器的校准时的校准精度。In this application, based on the analysis and processing of the deviation waveform measured between the encoder and the standard encoder in advance, a deviation curve function that can characterize the deviation change trend between the measured value of the encoder and the measured value of the standard encoder is obtained; and this A deviation curve function is a curve function obtained by first performing linear regression processing on the deviation waveform and then fitting the fitting points on the linear regression function. The linear regression algorithm is used to perform linear regression on each waveform section of the deviation waveform. Operation, the obtained linear regression function largely excludes the collection of data, and based on the point on the linear regression function as the fitting point, the deviation curve function is obtained by fitting, so that the obtained deviation curve function is closer to the deviation The fluctuation center of the waveform also avoids the problem of the accuracy of the fitting function caused by the abnormal fluctuation deviation of the discrete points on the deviation waveform, which is beneficial to improve the calibration accuracy when the deviation curve function is used to calibrate the encoder.
下面对本发明实施例提供的编码器的测量校准装置进行介绍,下文描述的编码器的测量校准装置与上文描述的编码器的测量校准方法可相互对应参照。The measurement and calibration device for the encoder provided by the embodiment of the present invention will be introduced below. The measurement and calibration device for the encoder described below and the measurement and calibration method for the encoder described above can be referred to each other.
图4为本发明实施例提供的编码器的测量校准装置的结构框图,参照图4中编码器的测量校准装置可以包括:FIG. 4 is a structural block diagram of an encoder measurement and calibration device provided by an embodiment of the present invention. Referring to FIG. 4, the encoder measurement and calibration device may include:
获取函数模块100,用于预先获得编码器相对于标准编码器的偏差曲线函数;其中,所述偏差曲线函数为对所述编码器和所述标准编码器的测量偏差值在一个测量周期内随位置点变化的偏差波形,进行线性回归处理获得线性回归曲线上的多个拟合点后,对各个所述拟合点进行曲线拟合获得的曲线函数;The obtaining function module 100 is used to obtain the deviation curve function of the encoder relative to the standard encoder in advance; wherein the deviation curve function is the measurement deviation value of the encoder and the standard encoder within a measurement period. After performing linear regression processing to obtain a plurality of fitting points on the linear regression curve, the deviation waveform of the change of the position point is curve function obtained by performing curve fitting on each of the fitting points;
数据采集模块200,用于采集各个测试位置点的测试数据;The data collection module 200 is used to collect test data at various test locations;
数据校准模块300,用于根据所述偏差曲线函数对各个所述测试数据进行校准,获得各个测试位置点对应的校准后的测试数据。The data calibration module 300 is configured to calibrate each of the test data according to the deviation curve function, and obtain the calibrated test data corresponding to each test position point.
可选地,在本申请的另一具体实施例中,还可以进一步地包括:Optionally, in another specific embodiment of the present application, it may further include:
函数运算模块,用于按照位置点将所述偏差波形划分为若干个波形区段;对各个所述波形区段内的偏差波形进行线性回归运算,获得各个所述波形区段对应的线性回归函数;在每个所述波形区段内的线性回归函数上个选取一个拟合点。The function calculation module is used to divide the deviation waveform into a number of waveform sections according to the position points; perform linear regression operations on the deviation waveforms in each of the waveform sections to obtain the linear regression function corresponding to each of the waveform sections ; Select a fitting point on the linear regression function in each waveform section.
可选地,在本申请的另一具体实施例中,还可以进一步地包括:Optionally, in another specific embodiment of the present application, it may further include:
所述函数运算模块用于对各个所述波形区段内的偏差波形进行一阶线性回归运算,获得一阶线性回归函数。The function calculation module is used to perform a first-order linear regression operation on the deviation waveforms in each of the waveform sections to obtain a first-order linear regression function.
可选地,在本申请的另一具体实施例中,还可以进一步地包括:Optionally, in another specific embodiment of the present application, it may further include:
所述函数运算模块用于采用三次样条插值算法对各个所述拟合点进行曲线拟合,拟合获得所述偏差曲线函数。The function calculation module is configured to use a cubic spline interpolation algorithm to perform curve fitting on each of the fitting points, and to obtain the deviation curve function by fitting.
可选地,在本申请的另一具体实施例中,还可以进一步地包括:Optionally, in another specific embodiment of the present application, it may further include:
所述函数运算模块具体用于将所述偏差波形划分为任意两个所述波形区段的宽度差值不大于预设差值的多个所述波形区段;且在所述波形区段内中间区段部分选取所述拟合点,所述中间区段为所述波形区段中间三分一区段部分。The function calculation module is specifically configured to divide the deviation waveform into a plurality of the waveform sections whose width difference between any two of the waveform sections is not greater than a preset difference; and within the waveform section The fitting point is selected in the middle section, and the middle section is the middle one-third section of the waveform section.
本实施例的编码器的测量校准装置用于实现前述的编码器的测量校准方法,因此编码器的测量校准装置中的具体实施方式可见前文中的编码器的测量校准方法的实施例部分,例如,数据采集模块100,区段划分模块200,回归运算模块300,曲线拟合模块400,分别用于实现上述编码器的测量校准方法中步骤S11,S12,S13和S14,所以,其具体实施方式可以参照相应的各个部分实施例的描述,在此不再赘述。The encoder measurement and calibration device of this embodiment is used to implement the aforementioned encoder measurement and calibration method. Therefore, the specific implementation of the encoder measurement and calibration device can be seen in the previous embodiment of the encoder measurement and calibration method, for example , The data acquisition module 100, the section division module 200, the regression calculation module 300, and the curve fitting module 400 are respectively used to implement steps S11, S12, S13 and S14 in the measurement calibration method of the encoder, so the specific implementation Reference can be made to the descriptions of the respective parts of the embodiments, which will not be repeated here.
本申请还提供了一种编码器的测量校准设备的实施例,包括:This application also provides an embodiment of an encoder measurement and calibration equipment, including:
存储器,用于存储计算机程序;Memory, used to store computer programs;
处理器,用于执行计算机程序时实现如下所述编码器的测量校准方法的步骤:The processor is used to implement the steps of the measurement calibration method of the encoder as described below when the computer program is executed:
预先获得编码器相对于标准编码器的偏差曲线函数;其中,所述偏差曲线函数为对所述编码器和所述标准编码器的测量偏差值在一个测量周期内随位置点变化的偏差波形,进行线性回归处理获得线性回归曲线上的多个拟合点后,对各个所述拟合点进行曲线拟合获得的曲线函数;Obtain in advance the deviation curve function of the encoder relative to the standard encoder; wherein, the deviation curve function is a deviation waveform of the measured deviation value of the encoder and the standard encoder that changes with position points within a measurement period, After performing linear regression processing to obtain multiple fitting points on the linear regression curve, perform curve fitting on each of the fitting points to obtain the curve function;
采集各个测试位置点的测试数据;Collect test data at each test location;
根据所述偏差曲线函数对各个所述测试数据进行校准,获得各个测试位置点对应的校准后的测试数据。Calibrate each of the test data according to the deviation curve function, and obtain the calibrated test data corresponding to each test position point.
本实施例中的处理器执行存储器中存储的计算机程序,采用预先获得的偏差曲线函数对测得的测量数据进行校准,简单方便易于实现,且偏差曲线函数是通过对偏差波形的每个波形区段进行线性回归运算后,基于线性回归函数获得拟合点,再根据该拟合点进行曲线拟合获得的偏差曲线函数,使得该偏差曲线函数用于编码器的校准时,能够在一定程度上提高编码器的校准精度,进而提高编码器的测量精度。The processor in this embodiment executes the computer program stored in the memory, and uses the deviation curve function obtained in advance to calibrate the measured measurement data, which is simple, convenient and easy to implement, and the deviation curve function is used to calibrate each waveform area of the deviation waveform. After the linear regression operation of the segment, the fitting point is obtained based on the linear regression function, and then the deviation curve function obtained by curve fitting is performed according to the fitting point, so that the deviation curve function can be used to a certain extent when the deviation curve function is used for the calibration of the encoder. Improve the calibration accuracy of the encoder, and then improve the measurement accuracy of the encoder.
本申请还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上任一项所述编码器的测量校准方法的步骤。The present application also provides a computer-readable storage medium with a computer program stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the encoder measurement calibration method as described in any of the above are implemented .
具体地,该计算机可读存储介质可以是随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质。Specifically, the computer-readable storage medium may be random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM , Or any other form of storage medium known in the technical field.
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Professionals may further realize that the units and algorithm steps of the examples described in the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of both, in order to clearly illustrate the possibilities of hardware and software. Interchangeability, in the above description, the composition and steps of each example have been generally described in accordance with the function. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered as going beyond the scope of the present invention.

Claims (10)

  1. 一种编码器的测量校准方法,其特征在于,包括:A method for measuring and calibrating an encoder, which is characterized in that it comprises:
    预先获得编码器相对于标准编码器的偏差曲线函数;其中,所述偏差曲线函数为对所述编码器和所述标准编码器的测量偏差值在一个测量周期内随位置点变化的偏差波形,进行线性回归处理获得线性回归曲线上的多个拟合点后,对各个所述拟合点进行曲线拟合获得的曲线函数;Obtain in advance the deviation curve function of the encoder relative to the standard encoder; wherein, the deviation curve function is a deviation waveform of the measured deviation value of the encoder and the standard encoder that changes with position points within a measurement period, After performing linear regression processing to obtain multiple fitting points on the linear regression curve, perform curve fitting on each of the fitting points to obtain the curve function;
    采集各个测试位置点的测试数据;Collect test data at each test location;
    根据所述偏差曲线函数对各个所述测试数据进行校准,获得各个所述测试位置点对应的校准后的测试数据。Calibrate each of the test data according to the deviation curve function, and obtain the calibrated test data corresponding to each of the test position points.
  2. 如权利要求1所述的编码器的测量校准方法,其特征在于,对所述编码器和所述标准编码器的测量偏差值在一个测量周期内随位置点变化的偏差波形,进行线性回归处理获得线性回归曲线上的多个拟合点,包括:The encoder measurement calibration method according to claim 1, characterized in that, linear regression processing is performed on the deviation waveform of the measurement deviation value of the encoder and the standard encoder that varies with the position point within a measurement period Obtain multiple fitting points on the linear regression curve, including:
    按照位置点将所述偏差波形划分为若干个波形区段;Dividing the deviation waveform into a number of waveform sections according to position points;
    对各个所述波形区段内的偏差波形进行线性回归运算,获得各个所述波形区段对应的线性回归函数;Perform a linear regression operation on the deviation waveform in each of the waveform sections to obtain a linear regression function corresponding to each of the waveform sections;
    在每个所述波形区段内的线性回归函数上个选取一个拟合点。A fitting point is selected on the linear regression function in each waveform section.
  3. 如权利要求2所述的编码器的测量校准方法,其特征在于,所述将各个所述波形区段内的偏差波形进行线性回归运算,获得各个所述波形区段对应的线性回归函数包括:3. The method for measuring and calibrating an encoder according to claim 2, wherein the performing linear regression operation on the deviation waveforms in each of the waveform segments to obtain the linear regression function corresponding to each of the waveform segments comprises:
    对各个所述波形区段内的偏差波形进行一阶线性回归运算,获得一阶线性回归函数。Perform a first-order linear regression operation on the deviation waveforms in each of the waveform sections to obtain a first-order linear regression function.
  4. 如权利要求2所述的编码器的测量校准方法,其特征在于,对各个所述拟合点进行曲线拟合获得的偏差曲线函数的过程包括:The method for measuring and calibrating an encoder according to claim 2, wherein the process of performing curve fitting on each of the fitting points to obtain the deviation curve function comprises:
    采用三次样条插值算法对各个所述拟合点进行曲线拟合,拟合获得经过各个所述拟合点所述偏差曲线函数。A cubic spline interpolation algorithm is used to perform curve fitting on each of the fitting points, and the fitting obtains the deviation curve function passing through each of the fitting points.
  5. 如权利要求2至4任一项所述的编码器的测量校准方法,其特征在于,所述按照位置点将所述偏差波形划分为若干个波形区段包括:The method for measuring and calibrating an encoder according to any one of claims 2 to 4, wherein the dividing the deviation waveform into a plurality of waveform sections according to position points comprises:
    将所述偏差波形划分为任意两个所述波形区段的宽度差值不大于预设差值的多个所述波形区段;Dividing the deviation waveform into a plurality of the waveform sections whose width difference between any two of the waveform sections is not greater than a preset difference;
    所述在每个所述波形区段内的线性回归函数上个选取一个拟合点包括:The selecting a fitting point on the linear regression function in each waveform segment includes:
    在所述波形区段内中间区段部分选取所述拟合点,所述中间区段为所述波形区段中间三分一区段部分。The fitting point is selected in a middle section in the waveform section, and the middle section is a middle-third section of the waveform section.
  6. 一种编码器的测量校准装置,其特征在于,包括:A measurement and calibration device for an encoder, which is characterized in that it comprises:
    获取函数模块,用于预先获得编码器相对于标准编码器的偏差曲线函数;其中,所述偏差曲线函数为对所述编码器和所述标准编码器的测量偏差值在一个测量周期内随位置点变化的偏差波形,进行线性回归处理获得线性回归曲线上的多个拟合点后,对各个所述拟合点进行曲线拟合获得的曲线函数;The obtaining function module is used to obtain the deviation curve function of the encoder relative to the standard encoder in advance; wherein, the deviation curve function is the measurement deviation value of the encoder and the standard encoder in a measurement period with position After performing linear regression processing to obtain multiple fitting points on the linear regression curve for the deviation waveform of the point change, perform curve fitting on each of the fitting points to obtain the curve function;
    数据采集模块,用于采集各个测试位置点的测试数据;Data collection module, used to collect test data at each test location;
    数据校准模块,用于根据所述偏差曲线函数对各个所述测试数据进行校准,获得各个测试位置点对应的校准后的测试数据。The data calibration module is used to calibrate each of the test data according to the deviation curve function, and obtain the calibrated test data corresponding to each test position point.
  7. 如权利要求6所述的编码器的测量校准装置,其特征在于,包括函数运算模块,用于按照位置点将所述偏差波形划分为若干个波形区段;对各个所述波形区段内的偏差波形进行线性回归运算,获得各个所述波形区段对应的线性回归函数;在每个所述波形区段内的线性回归函数上个选取一个拟合点。The encoder measurement and calibration device according to claim 6, characterized in that it comprises a function calculation module, which is used to divide the deviation waveform into several waveform sections according to the position points; A linear regression operation is performed on the deviation waveform to obtain a linear regression function corresponding to each of the waveform sections; a fitting point is selected on the linear regression function in each of the waveform sections.
  8. 如权利要求6所述的编码器的测量校准装置,其特征在于,所述函数运算模块具体用于对各个所述波形区段内的偏差波形进行一阶线性回归运算,获得一阶线性回归函数。The encoder measurement calibration device according to claim 6, wherein the function calculation module is specifically configured to perform a first-order linear regression operation on the deviation waveform in each of the waveform sections to obtain a first-order linear regression function .
  9. 一种编码器的测量校准设备,其特征在于,包括:A measurement and calibration equipment for an encoder, which is characterized in that it comprises:
    存储器,用于存储计算机程序;Memory, used to store computer programs;
    处理器,用于执行所述计算机程序时实现如权利要求1至5任一项所述编码器的测量校准方法的步骤。The processor is configured to implement the steps of the encoder measurement calibration method according to any one of claims 1 to 5 when the computer program is executed.
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至5任一项所述编码器的测量校准方法的步骤。A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the measurement of the encoder according to any one of claims 1 to 5 is realized. Steps of the calibration method.
PCT/CN2019/127794 2019-11-29 2019-12-24 Encoder measurement and calibration method, device and apparatus, as well as storage medium WO2021103231A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911204611.7A CN110849406B (en) 2019-11-29 2019-11-29 Measuring and calibrating method, device and equipment of encoder and storage medium
CN201911204611.7 2019-11-29

Publications (1)

Publication Number Publication Date
WO2021103231A1 true WO2021103231A1 (en) 2021-06-03

Family

ID=69606629

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/127794 WO2021103231A1 (en) 2019-11-29 2019-12-24 Encoder measurement and calibration method, device and apparatus, as well as storage medium

Country Status (2)

Country Link
CN (1) CN110849406B (en)
WO (1) WO2021103231A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114136621A (en) * 2020-09-04 2022-03-04 北京福田康明斯发动机有限公司 Method and device for generating process detection curve, storage medium and electronic equipment
CN112325906B (en) * 2020-11-03 2022-08-05 中国人民解放军96963部队 Auxiliary calibration device, method and equipment for electronic theodolite encoder
CN114184994A (en) * 2021-11-30 2022-03-15 苏州维嘉科技股份有限公司 Test machine calibration method, calibration device and test machine

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130253870A1 (en) * 2012-02-07 2013-09-26 Mitsubishi Electric Research Laboratories, Inc. Self-Calibrating Single Track Absolute Rotary Encoder
US20150323354A1 (en) * 2014-05-12 2015-11-12 Faro Technologies, Inc. Robust index correction of an angular encoder in a three-dimensional coordinate measurement device
CN106918795A (en) * 2017-03-21 2017-07-04 哈尔滨工业大学 Precision resister calibration system based on FPGA and the resistance calibrating method using system realization
CN107764458A (en) * 2017-09-25 2018-03-06 中国航空工业集团公司西安飞机设计研究所 A kind of aircraft handing characteristics curve generation method
CN109000702A (en) * 2018-05-16 2018-12-14 苏州汇川技术有限公司 Encoder corrects system and method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4824635B2 (en) * 2007-06-15 2011-11-30 株式会社 ソキア・トプコン Angle correction method for rotary encoder
US20150301183A1 (en) * 2012-11-04 2015-10-22 Eric Derbez Low bandwidth method for ephemeris recovery in over-the-air transmission
CN107449460A (en) * 2017-07-07 2017-12-08 银弗(北京)科技有限公司 A kind of compensation method of rotary encoder and compensation system
CN108871382B (en) * 2018-05-09 2019-11-15 中国科学院长春光学精密机械与物理研究所 A kind of error correcting method and system of the photoelectric encoder based on error fit
CN110375694B (en) * 2019-08-30 2020-12-04 合肥工业大学 Self-calibration method for circular grating angle measurement error based on portable articulated coordinate measuring machine

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130253870A1 (en) * 2012-02-07 2013-09-26 Mitsubishi Electric Research Laboratories, Inc. Self-Calibrating Single Track Absolute Rotary Encoder
US20150323354A1 (en) * 2014-05-12 2015-11-12 Faro Technologies, Inc. Robust index correction of an angular encoder in a three-dimensional coordinate measurement device
CN106918795A (en) * 2017-03-21 2017-07-04 哈尔滨工业大学 Precision resister calibration system based on FPGA and the resistance calibrating method using system realization
CN107764458A (en) * 2017-09-25 2018-03-06 中国航空工业集团公司西安飞机设计研究所 A kind of aircraft handing characteristics curve generation method
CN109000702A (en) * 2018-05-16 2018-12-14 苏州汇川技术有限公司 Encoder corrects system and method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
WEI JIN, ZHIJIE LIU, FENGXUAN JING: "B-Spline curve interpolation based on least squares of approximation", JOURNAL OF GUIZHOU NORMAL UNIVERSITY(NATURAL SCIENCES), vol. 33, no. 1, 1 February 2015 (2015-02-01), pages 98 - 102, XP055815562, ISSN: 1004-5570, DOI: 10.16614/j.cnki.issn1004-5570.2015.01.016 *

Also Published As

Publication number Publication date
CN110849406A (en) 2020-02-28
CN110849406B (en) 2020-09-18

Similar Documents

Publication Publication Date Title
WO2021103231A1 (en) Encoder measurement and calibration method, device and apparatus, as well as storage medium
US8712720B2 (en) Filtering method for improving the data quality of geometric tire measurements
CN110375694B (en) Self-calibration method for circular grating angle measurement error based on portable articulated coordinate measuring machine
WO2017084118A1 (en) Method for correcting measuring-point-free temperature compensation model during online application of near infrared spectrum analyzer
CN102597707B (en) With the angle detector of compound self-correcting function
GB2421802A (en) Two-tier vector network analyser calibration process
CN101846572B (en) Method for decreasing basic error of pressure sensor
CN111998919B (en) Gas meter calibration method and device
CN110568397B (en) Electric energy meter correction method and system based on MCU software
CN103475369B (en) The high-precision ADC test of identification is disposably calibrated based on signal source error
CN103697928A (en) Instrument calibration method and device
CN112946560B (en) Electric energy meter calibration method and device, electric energy meter and electric energy meter system
EA200900029A1 (en) METHOD OF CREATING MULTI-DIMENSIONAL GRADUATION MODELS RESISTANT TO CHANGES IN PROPERTIES AFFECTING THE DEVICE MEASUREMENT RESULTS
CN101566466B (en) Profile analysis system and method
CN102342582B (en) Verification method, verification system and calculation processor for detection precision of scan detection head
KR20170075670A (en) Method of automatically calibrating sensor output characteristic of gas detector
CN104504197A (en) Archimedes spiral planar thread measurement model and eccentric parameter correction method
US20080100483A1 (en) Method of compensating for deterministic jitter due to interleave error
CN109655749B (en) Intelligent tracking and calibrating method and device for collected data matrix
CN108132399B (en) Simplified interpolation method for improving electric energy quality analysis precision of digital substation
CN114050386B (en) Debugging method based on cavity filter scattering parameter and screw mapping extraction
CN112067870B (en) Automatic oscilloscope parameter measuring device and method based on FPGA
CN115436320A (en) Correction method for gas absorption line under mixed gas background
CN105629062A (en) Frequency detection method for variable frequency sine wave
JP2000314679A (en) Method and device for testing gear

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19954040

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19954040

Country of ref document: EP

Kind code of ref document: A1