WO2024066472A1 - Error compensation method for sine-cosine signal, and storage medium - Google Patents

Error compensation method for sine-cosine signal, and storage medium Download PDF

Info

Publication number
WO2024066472A1
WO2024066472A1 PCT/CN2023/099490 CN2023099490W WO2024066472A1 WO 2024066472 A1 WO2024066472 A1 WO 2024066472A1 CN 2023099490 W CN2023099490 W CN 2023099490W WO 2024066472 A1 WO2024066472 A1 WO 2024066472A1
Authority
WO
WIPO (PCT)
Prior art keywords
sine
cosine
signal
sin
error
Prior art date
Application number
PCT/CN2023/099490
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 WO2024066472A1 publication Critical patent/WO2024066472A1/en

Links

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
    • G01D18/001Calibrating encoders

Abstract

An error compensation method for a sine-cosine signal, which method is applied to a sine-cosine encoder. The method comprises: collecting an initial absolute sine-cosine signal, which is generated by a sine-cosine encoder at the current moment (S10); acquiring an error correction parameter set, wherein the error correction parameter set includes error correction parameters determined in advance according to an incremental sine-cosine signal, a zero position signal and an absolute sine-cosine signal, which are generated by means of one rotation of the sine-cosine encoder (S20); and performing error compensation on the initial absolute sine-cosine signal according to the error correction parameter set, so as to obtain a target sine-cosine signal, wherein the target sine-cosine signal is used for determining current position information of the sine-cosine encoder (S30). Further disclosed is a storage medium.

Description

正余弦信号的误差补偿方法及存储介质Error compensation method and storage medium for sine and cosine signals
相关申请Related Applications
本申请要求于2022年9月28日申请的、申请号为202211194356.4的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to Chinese patent application No. 202211194356.4 filed on September 28, 2022, the entire contents of which are incorporated by reference into this application.
技术领域Technical Field
本申请涉及编码器技术领域,尤其涉及一种正余弦信号的误差补偿方法及存储介质。The present application relates to the technical field of encoders, and in particular to a sine and cosine signal error compensation method and storage medium.
背景技术Background technique
目前的正余弦编码器系统当中,做法是通过光电池和码盘的相对位置变化产生原始的正余弦信号,这其中包括一组分辨率较高的正余弦信号,比如2048个脉冲每圈,还包括编码器每旋转一圈产生一个周期的正余弦信号,这个原始的正余弦信号一般会在后续的电路当中对这个信号的幅值、偏移量做些调整,比如通过电位器或其它可编程器件。上述方案的缺点是编码器的输出信号如果用一些可编程器件来进行调整,一般可以调整正余弦信号的幅值、偏移量、相位差,但可调整范围也很有限。因此,如何在不依赖外部校正设备的同时,精确地对编码器产生的正余弦信号进行误差补偿,成为一个亟待解决的问题。In the current sine-cosine encoder system, the original sine-cosine signal is generated by the relative position change of the photocell and the code disk, which includes a set of sine-cosine signals with higher resolution, such as 2048 pulses per circle, and a sine-cosine signal with one cycle generated per rotation of the encoder. This original sine-cosine signal is generally used in the subsequent circuit to adjust the amplitude and offset of the signal, such as through a potentiometer or other programmable device. The disadvantage of the above scheme is that if the output signal of the encoder is adjusted by some programmable devices, the amplitude, offset and phase difference of the sine-cosine signal can generally be adjusted, but the adjustable range is also very limited. Therefore, how to accurately compensate the error of the sine-cosine signal generated by the encoder without relying on external correction equipment has become a problem to be solved.
上述内容仅用于辅助理解本申请的技术方案,并不代表承认上述内容是现有技术。The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art.
技术解决方案Technical Solutions
本申请的主要目的在于提供了一种正余弦信号的误差补偿方法及存储介质,旨在解决如何在不依赖外部校正设备的同时,精确地对编码器产生的正余弦信号进行误差补偿的技术问题。The main purpose of the present application is to provide a method and storage medium for error compensation of sine and cosine signals, aiming to solve the technical problem of how to accurately compensate for the errors of sine and cosine signals generated by an encoder without relying on external correction equipment.
为实现上述目的,本申请提供了一种正余弦信号的误差补偿方法,所述正余弦信号的误差补偿方法包括以下步骤:To achieve the above object, the present application provides a method for compensating errors of sine and cosine signals, and the method for compensating errors of sine and cosine signals comprises the following steps:
采集所述正余弦编码器当前时刻生成的初始绝对正余弦信号;Collecting the initial absolute sine and cosine signals generated by the sine and cosine encoder at the current moment;
获取误差校正参数集,其中,所述误差校正参数集中包含预先根据所述正余弦编码器旋转一圈生成的增量正余弦信号、零位信号和绝对正余弦信号确定的误差校正参数;以及Acquire an error correction parameter set, wherein the error correction parameter set includes error correction parameters pre-determined based on incremental sine-cosine signals, zero position signals, and absolute sine-cosine signals generated by one rotation of the sine-cosine encoder; and
根据所述误差校正参数集对所述初始绝对正余弦信号进行误差补偿,得到目标正余弦信号,所述目标正余弦信号用于确定所述正余弦编码器的当前位置信息。The initial absolute sin-cos signal is error compensated according to the error correction parameter set to obtain a target sin-cos signal, and the target sin-cos signal is used to determine the current position information of the sin-cos encoder.
在一实施例中,在获取误差校正参数集之前,还包括:In one embodiment, before acquiring the error correction parameter set, the method further includes:
获取所述正余弦编码器旋转一周生成的增量正余弦信号、零位信号和绝对正余弦信号;以及Acquire incremental sine and cosine signals, zero position signals and absolute sine and cosine signals generated by one rotation of the sine and cosine encoder; and
根据所述增量正余弦信号、所述零位信号和所述绝对正余弦信号,确定所述误差校正参数集。The error correction parameter set is determined based on the incremental sin-cos signals, the zero position signal and the absolute sin-cos signals.
在一实施例中,所述根据所述增量正余弦信号、所述零位信号和所述绝对正余弦信号,确定所述误差校正参数集的步骤,包括:In one embodiment, the step of determining the error correction parameter set according to the incremental sin-cos signals, the zero position signal and the absolute sin-cos signals comprises:
根据所述增量正余弦信号和所述零位信号,确定第一单圈绝对位置;Determining a first single-turn absolute position according to the incremental sine and cosine signals and the zero position signal;
根据所述绝对正余弦信号,确定第二单圈绝对位置;Determining a second single-turn absolute position according to the absolute sine and cosine signals;
以所述第一单圈绝对位置为基准,确定所述第二单圈绝对位置的误差数据;以及Determining error data of the second single-turn absolute position based on the first single-turn absolute position; and
基于所述第二单圈绝对位置的误差数据,生成所述误差校正参数集。The error correction parameter set is generated based on the error data of the second single-turn absolute position.
在一实施例中,所述根据所述增量正余弦信号和所述零位信号,确定第一单圈绝对位置的步骤,包括:In one embodiment, the step of determining the first single-turn absolute position according to the incremental sine and cosine signals and the zero position signal comprises:
根据所述零位信号确定所述正余弦编码器的单圈零位信号;Determine a single-turn zero-position signal of the sine-cosine encoder according to the zero-position signal;
根据所述单圈零位信号对所述增量信号进行周期计数,获得计数结果;以及Performing period counting on the incremental signal according to the single-turn zero position signal to obtain a counting result; and
根据所述计数结果确定第一单圈绝对位置。The first single-turn absolute position is determined according to the counting result.
在一实施例中,所述误差校正参数集中包含多组误差校正参数,每组误差校正参数中包含正余弦信号幅值和对应的角度误差,或者每组误差校正参数中包含正余弦信号角度值和对应的角度误差。In one embodiment, the error correction parameter set includes multiple groups of error correction parameters, each group of error correction parameters includes sine and cosine signal amplitudes and corresponding angle errors, or each group of error correction parameters includes sine and cosine signal angle values and corresponding angle errors.
在一实施例中,在根据所述增量正余弦信号、所述零位信号和所述绝对正余弦信号,确定所述误差校正参数集之后,还包括:In one embodiment, after determining the error correction parameter set according to the incremental sin-cos signals, the zero position signal and the absolute sin-cos signals, the method further comprises:
将所述误差校正参数集存储在所述正余弦编码器中存储器的预设位置处。The error correction parameter set is stored at a preset location in a memory in the sine-cosine encoder.
在一实施例中,所述根据所述误差校正参数集对所述初始绝对正余弦信号进行误差补偿,得到目标正余弦信号,所述目标正余弦信号用于确定所述正余弦编码器的当前位置信息的步骤,包括:In one embodiment, the step of performing error compensation on the initial absolute sin-cosine signal according to the error correction parameter set to obtain a target sin-cosine signal, wherein the target sin-cosine signal is used to determine the current position information of the sin-cosine encoder, comprises:
获取所述初始绝对正余弦信号对应的信号角度;Obtaining a signal angle corresponding to the initial absolute sine and cosine signals;
从所述误差校正参数集中选取所述信号角度对应的角度误差;以及Selecting an angle error corresponding to the signal angle from the error correction parameter set; and
根据所述角度误差对所述初始绝对正余弦信号进行误差补偿,得到目标正余弦信号,所述目标正余弦信号用于确定所述正余弦编码器的当前位置信息。The initial absolute sine and cosine signals are error compensated according to the angle error to obtain target sine and cosine signals, and the target sine and cosine signals are used to determine the current position information of the sine and cosine encoder.
在一实施例中,所述根据所述误差校正参数集对所述初始绝对正余弦信号进行误差补偿,得到目标正余弦信号,所述目标正余弦信号用于确定所述正余弦编码器的当前位置信息的步骤,包括:In one embodiment, the step of performing error compensation on the initial absolute sin-cosine signal according to the error correction parameter set to obtain a target sin-cosine signal, wherein the target sin-cosine signal is used to determine the current position information of the sin-cosine encoder, comprises:
获取所述初始绝对正余弦信号对应的信号幅值;Obtaining a signal amplitude corresponding to the initial absolute sine and cosine signals;
从所述误差校正参数集中选取所述信号幅值对应的角度误差;以及Selecting the angle error corresponding to the signal amplitude from the error correction parameter set; and
根据所述角度误差对所述初始绝对正余弦信号进行误差补偿,得到目标正余弦信号,所述目标正余弦信号用于确定所述正余弦编码器的当前位置信息。The initial absolute sine and cosine signals are error compensated according to the angle error to obtain target sine and cosine signals, and the target sine and cosine signals are used to determine the current position information of the sine and cosine encoder.
在一实施例中,在根据所述误差校正参数集对所述初始绝对正余弦信号进行误差补偿,得到目标正余弦信号,所述目标正余弦信号用于确定所述正余弦编码器的当前位置信息之后,还包括:In one embodiment, after performing error compensation on the initial absolute sin-cosine signal according to the error correction parameter set to obtain a target sin-cosine signal, and the target sin-cosine signal is used to determine the current position information of the sin-cosine encoder, the method further includes:
在所述当前位置信息不符合预设位置条件时,获取当前时刻下的所述正余弦编码器旋转一周生成的当前增量正余弦信号、当前零位信号和当前绝对正余弦信号;When the current position information does not meet the preset position condition, obtaining the current incremental sine-cosine signal, the current zero position signal and the current absolute sine-cosine signal generated by the sine-cosine encoder rotating one circle at the current moment;
根据所述当前增量正余弦信号、所述当前零位信号和所述当前绝对正余弦信号,确定当前误差校正参数集;以及Determining a current error correction parameter set based on the current incremental sin-cos signal, the current zero signal, and the current absolute sin-cos signal; and
根据所述当前误差校正参数集对所述误差校正参数集进行更新。The error correction parameter set is updated according to the current error correction parameter set.
此外,为实现上述目的,本申请还提出一种存储介质,所述存储介质上存储有正余弦信号的误差补偿程序,所述正余弦信号的误差补偿程序被处理器执行时实现如上文所述的正余弦信号的误差补偿方法的步骤。In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, on which an error compensation program for sine and cosine signals is stored. When the error compensation program for sine and cosine signals is executed by a processor, the steps of the error compensation method for sine and cosine signals as described above are implemented.
本申请通过采集正余弦编码器当前时刻生成的初始绝对正余弦信号,然后获取误差校正参数集,误差校正参数集中包含预先根据正余弦编码器旋转一圈生成的增量正余弦信号、零位信号和绝对正余弦信号确定的误差校正参数,再根据误差校正参数集对初始绝对正余弦信号进行误差补偿,得到目标正余弦信号,目标正余弦信号用于确定正余弦编码器的当前位置信息。本申请通过采集正余弦编码器当前时刻生成的初始绝对正余弦信号,然后获取误差校正参数集,误差校正参数集中可包括对绝对正余弦信号进行误差校正的参数,再根据误差校正参数集中的参数对初始绝对正余弦信号进行误差补偿,相较于现有的通过电位器或其它可编程器件对编码器产生的正余弦信号的幅值和偏移量进行调整,本申请上述方式能够根据误差校正参数集对初始绝对正余弦信号进行误差补偿,从而能够在不依赖外部校正设备的同时,精确地对编码器产生的正余弦信号进行误差补偿,能够对正余弦编码器的固定误差进行校正。The present application acquires the initial absolute sine-cosine signal generated by the sine-cosine encoder at the current moment, and then acquires the error correction parameter set, the error correction parameter set includes the error correction parameters determined in advance according to the incremental sine-cosine signal, the zero position signal and the absolute sine-cosine signal generated by the sine-cosine encoder rotating one circle, and then performs error compensation on the initial absolute sine-cosine signal according to the error correction parameter set to obtain the target sine-cosine signal, which is used to determine the current position information of the sine-cosine encoder. The present application acquires the initial absolute sine-cosine signal generated by the sine-cosine encoder at the current moment, and then acquires the error correction parameter set, the error correction parameter set may include parameters for error correction of the absolute sine-cosine signal, and then performs error compensation on the initial absolute sine-cosine signal according to the parameters in the error correction parameter set. Compared with the existing method of adjusting the amplitude and offset of the sine-cosine signal generated by the encoder through a potentiometer or other programmable devices, the above-mentioned method of the present application can perform error compensation on the initial absolute sine-cosine signal according to the error correction parameter set, so that the sine-cosine signal generated by the encoder can be accurately compensated for without relying on external correction equipment, and the fixed error of the sine-cosine encoder can be corrected.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为本申请正余弦信号的误差补偿方法第一实施例的流程示意图;FIG1 is a flow chart of a first embodiment of a method for compensating errors of sine and cosine signals of the present application;
图2为本申请正余弦信号的误差补偿方法一实施例的正余弦信号的波形图;FIG2 is a waveform diagram of sine and cosine signals according to an embodiment of a method for compensating sine and cosine signals of the present application;
图3为本申请正余弦信号的误差补偿方法第二实施例的流程示意图;FIG3 is a flow chart of a second embodiment of a method for compensating errors of sine and cosine signals of the present application;
图4为本申请正余弦信号的误差补偿方法一实施例的正余弦编码器的内部结构示意图;FIG4 is a schematic diagram of the internal structure of a sine-cosine encoder according to an embodiment of a method for error compensation of sine-cosine signals of the present application;
图5为本申请正余弦信号的误差补偿方法第三实施例的流程示意图。FIG. 5 is a flow chart of a third embodiment of a method for compensating errors of sine and cosine signals of the present application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings.
本发明的实施方式Embodiments of the present invention
应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
本申请实施例提供了一种正余弦信号的误差补偿方法,参照图1,图1为本申请正余弦信号的误差补偿方法第一实施例的流程示意图。An embodiment of the present application provides a method for compensating errors of sine and cosine signals. Referring to FIG. 1 , FIG. 1 is a flow chart of a first embodiment of the method for compensating errors of sine and cosine signals of the present application.
本实施例中,所述正余弦信号的误差补偿方法包括以下步骤:In this embodiment, the error compensation method of the sine and cosine signals includes the following steps:
步骤S10:采集所述正余弦编码器当前时刻生成的初始绝对正余弦信号。Step S10: collecting the initial absolute sine and cosine signals generated by the sine and cosine encoder at the current moment.
需要说明的是,本实施例的执行主体可以是一种具有数据处理、网络通信以及程序运行功能的计算服务设备,例如中央处理器(central processing unit,CPU)、个人电脑等,或者是一种能够实现上述功能的电子设备或正余弦信号的误差补偿设备。以下以所述CPU为例,对本实施例及下述各实施例进行说明。It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a central processing unit (CPU), a personal computer, etc., or an electronic device capable of realizing the above functions or a sine and cosine signal error compensation device. The CPU is taken as an example to illustrate this embodiment and the following embodiments.
正余弦编码器是一种采用模拟输出的增量编码器,其输出为正余弦信号。参考图2,图2为本申请正余弦信号的误差补偿方法一实施例的正余弦信号的波形图,如图2所示,本实施例中的正余弦信号可包括一圈产生多个周期(比如2048个周期)的增量正余弦信号(A、B)、一圈可产生一个脉冲的零位信号(Z)、一圈产生一个周期的绝对正余弦信号(C、D)。正余弦编码器输出的A、B、C、D、Z信号,是由在相对应的码盘上刻有对应的码道,并配以相对应的光电池芯片生成的。The sine-cosine encoder is an incremental encoder with analog output, and its output is a sine-cosine signal. Referring to Figure 2, Figure 2 is a waveform diagram of the sine-cosine signal of an embodiment of the error compensation method of the sine-cosine signal of the present application. As shown in Figure 2, the sine-cosine signal in this embodiment may include an incremental sine-cosine signal (A, B) that generates multiple cycles (for example, 2048 cycles) in one circle, a zero position signal (Z) that generates a pulse in one circle, and an absolute sine-cosine signal (C, D) that generates one cycle in one circle. The A, B, C, D, and Z signals output by the sine-cosine encoder are generated by corresponding code channels engraved on the corresponding code disk and equipped with corresponding photocell chips.
本实施例中的正余弦编码器内部可包括光电池芯片和码盘,正余弦信号是指光电池芯片产生的信号,正余弦信号可包括增量正余弦信号、零位信号和绝对正余弦信号,初始绝对正余弦信号是指在正余弦编码器内部的光电池芯片在当前时刻生成的绝对正余弦信号,并且初始绝对正余弦信号是在正余弦编码器出厂后采集的。The sine-cosine encoder in this embodiment may include a photocell chip and a code disk. The sine-cosine signal refers to the signal generated by the photocell chip. The sine-cosine signal may include an incremental sine-cosine signal, a zero-position signal and an absolute sine-cosine signal. The initial absolute sine-cosine signal refers to the absolute sine-cosine signal generated by the photocell chip inside the sine-cosine encoder at the current moment, and the initial absolute sine-cosine signal is collected after the sine-cosine encoder leaves the factory.
步骤S20:获取误差校正参数集,其中,所述误差校正参数集中包含预先根据所述正余弦编码器旋转一圈生成的增量正余弦信号、零位信号和绝对正余弦信号确定的误差校正参数。Step S20: Acquire an error correction parameter set, wherein the error correction parameter set includes error correction parameters that are pre-determined based on incremental sine-cosine signals, zero position signals, and absolute sine-cosine signals generated when the sine-cosine encoder rotates one circle.
在本实施例中,误差校正参数可以在正余弦编码器出厂前确定并存储的,也可在正余弦编码器出厂后确定并存储的,具体的可以根据实际需求选择,本实施例对此不做具体限制。In this embodiment, the error correction parameters can be determined and stored before the sine-cosine encoder leaves the factory, or can be determined and stored after the sine-cosine encoder leaves the factory. The specific parameters can be selected according to actual needs, and this embodiment does not impose specific restrictions on this.
在具体实现中,误差校正参数集可预先根据正余弦编码器旋转一圈生成的增量正余弦信号、零位信号和绝对正余弦信号确定,误差校正参数集中可以包括绝对正余弦信号对应的误差校正参数,从而根据绝对正余弦信号对应的误差校正参数可对初始绝对正余弦信号进行误差补偿。In a specific implementation, the error correction parameter set can be determined in advance based on the incremental sin-cosine signal, zero position signal and absolute sin-cosine signal generated by one rotation of the sin-cosine encoder. The error correction parameter set may include error correction parameters corresponding to the absolute sin-cosine signal, so that the initial absolute sin-cosine signal can be error compensated according to the error correction parameters corresponding to the absolute sin-cosine signal.
步骤S30:根据所述误差校正参数集对所述初始绝对正余弦信号进行误差补偿,得到目标正余弦信号,所述目标正余弦信号用于确定所述正余弦编码器的当前位置信息。Step S30: performing error compensation on the initial absolute sin-cosine signal according to the error correction parameter set to obtain a target sin-cosine signal, wherein the target sin-cosine signal is used to determine the current position information of the sin-cosine encoder.
在本实施例中,误差校正参数集中可包括绝对正余弦信号中对应的误差校正参数,以对初始绝对正余弦信号进行误差补偿。具体误差补偿方法可以是从误差校正参数集中获取绝对正余弦信号对应的误差校正参数,然后根据误差校正参数对初始绝对正余弦信号进行调整,得到目标正余弦信号,校正得到目标正余弦信号可以用于确定正余弦编码器的当前位置信息,从而使得确定的位置信息精确度更高。In this embodiment, the error correction parameter set may include the error correction parameters corresponding to the absolute sin-cosine signal to perform error compensation on the initial absolute sin-cosine signal. A specific error compensation method may be to obtain the error correction parameters corresponding to the absolute sin-cosine signal from the error correction parameter set, and then adjust the initial absolute sin-cosine signal according to the error correction parameters to obtain the target sin-cosine signal. The corrected target sin-cosine signal can be used to determine the current position information of the sin-cosine encoder, thereby making the determined position information more accurate.
在本实施例中,在对初始绝对正余弦信号进行误差补偿后,可以得到目标正余弦信号,目标正余弦信号可以包括正余弦编码器当前时刻生成的增量正余弦信号、零位正余弦信号以及补偿后的绝对正余弦信号,当然可以理解的是,上述目标正余弦信号中也可以仅包含校正后的绝对正余弦信号,具体的可以基于实际需求确定,本说明书实施例对此不作限定。In this embodiment, after error compensation is performed on the initial absolute sin-cosine signal, a target sin-cosine signal can be obtained. The target sin-cosine signal can include an incremental sin-cosine signal generated by the sin-cosine encoder at the current moment, a zero-position sin-cosine signal, and a compensated absolute sin-cosine signal. Of course, it can be understood that the above-mentioned target sin-cosine signal may also only include the corrected absolute sin-cosine signal, which can be determined based on actual needs, and the embodiments of this specification are not limited to this.
本实施例通过采集正余弦编码器当前时刻生成的初始绝对正余弦信号,然后获取误差校正参数集,误差校正参数集中包含预先根据正余弦编码器旋转一圈生成的增量正余弦信号、零位信号和绝对正余弦信号确定的误差校正参数,再根据误差校正参数集对初始绝对正余弦信号进行误差补偿,得到目标正余弦信号,目标正余弦信号用于确定正余弦编码器的当前位置信息。本实施例通过采集正余弦编码器当前时刻生成的初始绝对正余弦信号,然后获取误差校正参数集,误差校正参数集中可包括对绝对正余弦信号进行误差校正的参数,再根据误差校正参数集中的参数对初始绝对正余弦信号进行误差补偿,相较于现有的通过电位器或其它可编程器件对编码器产生的正余弦信号的幅值和偏移量进行调整,本实施例上述方式能够根据误差校正参数集对初始绝对正余弦信号进行误差补偿,从而能够在不依赖外部校正设备的同时,精确地对编码器产生的正余弦信号进行误差补偿,能够对正余弦编码器的固定误差进行校正。In this embodiment, the initial absolute sin-cosine signal generated by the sin-cosine encoder at the current moment is collected, and then an error correction parameter set is obtained, wherein the error correction parameter set includes error correction parameters determined in advance according to the incremental sin-cosine signal, the zero position signal and the absolute sin-cosine signal generated by the sin-cosine encoder rotating one circle, and then the initial absolute sin-cosine signal is error compensated according to the error correction parameter set to obtain the target sin-cosine signal, which is used to determine the current position information of the sin-cosine encoder. In this embodiment, the initial absolute sin-cosine signal generated by the sin-cosine encoder at the current moment is collected, and then an error correction parameter set is obtained, wherein the error correction parameter set may include parameters for error correction of the absolute sin-cosine signal, and then the initial absolute sin-cosine signal is error compensated according to the parameters in the error correction parameter set. Compared with the existing method of adjusting the amplitude and offset of the sin-cosine signal generated by the encoder through a potentiometer or other programmable devices, the above method of this embodiment can perform error compensation on the initial absolute sin-cosine signal according to the error correction parameter set, so that the sin-cosine signal generated by the encoder can be accurately error compensated without relying on external correction equipment, and the fixed error of the sin-cosine encoder can be corrected.
参考图4,图4为本申请正余弦信号的误差补偿方法第二实施例的流程示意图。Refer to FIG. 4 , which is a flow chart of a second embodiment of a method for compensating errors of sine and cosine signals of the present application.
基于上述第一实施例,在本实施例中,在步骤S20之前,还包括:Based on the above first embodiment, in this embodiment, before step S20, the following is further included:
步骤S01:获取所述正余弦编码器旋转一周生成的增量正余弦信号、零位信号和绝对正余弦信号;Step S01: Acquire incremental sine and cosine signals, zero position signals and absolute sine and cosine signals generated by one rotation of the sine and cosine encoder;
本实施例可在正余弦编码器出厂前得到误差校正参数集,首先可以获取正余弦编码器旋转一周产生的增量正余弦信号、零位信号和绝对正余弦信号。In this embodiment, the error correction parameter set can be obtained before the sine-cosine encoder leaves the factory. First, the incremental sine-cosine signal, the zero position signal and the absolute sine-cosine signal generated by one rotation of the sine-cosine encoder can be obtained.
增量正余弦信号、零位信号以及绝对正余弦信号可以由正余弦编码器内部的光电池芯片产生,增量正余弦信号为图2中的正余弦信号(A、B),零位信号为图2中的Z信号,绝对正余弦信号为图2中的正余弦信号(C、D)。The incremental sine and cosine signals, the zero position signal and the absolute sine and cosine signals can be generated by the photocell chip inside the sine and cosine encoder. The incremental sine and cosine signals are the sine and cosine signals (A, B) in Figure 2, the zero position signal is the Z signal in Figure 2, and the absolute sine and cosine signals are the sine and cosine signals (C, D) in Figure 2.
步骤S02:根据所述增量正余弦信号、所述零位信号和所述绝对正余弦信号确定误差校正参数集。Step S02: determining an error correction parameter set according to the incremental sin-cos signals, the zero position signal and the absolute sin-cos signals.
在本实施例中,可根据增量正余弦信号(A、B)、零位正余弦信号(Z)以及绝对正余弦信号(C、D)确定误差校正参数集,具体方式可以是根据增量正余弦信号和零位信号对绝对正余弦信号确定绝对正余弦信号的误差,从而得到误差校正参数集。In this embodiment, the error correction parameter set can be determined based on the incremental sin-cosine signal (A, B), the zero-position sin-cosine signal (Z) and the absolute sin-cosine signal (C, D). The specific method can be to determine the error of the absolute sin-cosine signal based on the incremental sin-cosine signal and the zero-position signal to obtain the error correction parameter set.
参照图4,图4为本申请正余弦信号的误差补偿方法一实施例的正余弦编码器的内部结构示意图。如图4所示,正余弦编码器输出的A、B、C、D、Z信号,是由在相对应的码盘上刻有对应的码道,并配以相对应的光电池芯片生成的,在正余弦编码器出厂前,可将由光电池芯片出来的原始信号(A+、A-、B+、B-、Z+、Z-、C+、C-、D+、D-)输入外置CPU当中,然后经过误差补偿后,即可得到对应的A1+、A1-、B1+、B1-、Z1+、Z1-、C1+、C1-、D1+、D1-,然后将C1+、C1-、D1+、D1-经过C、D信号单端转差分后,可得到C2+、C2-、D2+、D2-,最后根据A1+、A1-、B1+、B1-、Z1+、Z1-、C1+、C2+、C1-、C2-、D1+、D2+、D1-、D2-可得到最终的驱动信号A+out、A-out、B+out、B-out、Z+out、Z-out、C+out、C-out、D+out、D-out。Referring to Figure 4, Figure 4 is a schematic diagram of the internal structure of a sine-cosine encoder according to an embodiment of the error compensation method for sine-cosine signals of the present application. As shown in Figure 4, the A, B, C, D, and Z signals output by the sine-cosine encoder are generated by corresponding code channels engraved on the corresponding code disk and equipped with corresponding photocell chips. Before the sine-cosine encoder leaves the factory, the original signals (A+, A-, B+, B-, Z+, Z-, C+, C-, D+, and D-) output by the photocell chip can be input into an external CPU, and then after error compensation, the corresponding A1+, A1-, B1+, B1-, Z1+, Z1-, C1+, C1-, D1+, and D 1-, then convert C1+, C1-, D1+, D1- into differential signals through C and D to get C2+, C2-, D2+, D2-. Finally, according to A1+, A1-, B1+, B1-, Z1+, Z1-, C1+, C2+, C1-, C2-, D1+, D2+, D1-, D2-, the final driving signals A+out, A-out, B+out, B-out, Z+out, Z-out, C+out, C-out, D+out, D-out can be obtained.
为了实现对误差校正参数集进行存储,在本实施例中,在步骤S02之后,还可以包括:将所述误差校正参数集存储在所述正余弦编码器中存储器的预设位置处。In order to store the error correction parameter set, in this embodiment, after step S02, the method may further include: storing the error correction parameter set at a preset position of a memory in the sine-cosine encoder.
本实施例可将误差校正参数集存储在正余弦编码器中存储器的预设位置处,例如图4中的EEPROM,也可以通过其他存储器进行存储,例如flash ROM、CPU内部的存储器、NVRAN等存储器。外置CPU可以替换为其他用于采样、计算和输出的运算处理单元,例如FPGA、CPLD、MCU等具备数据采集、处理的单元。In this embodiment, the error correction parameter set can be stored in a preset position of the memory in the sine-cosine encoder, such as the EEPROM in FIG4 , or can be stored in other memories, such as flash ROM, CPU internal memory, NVRAN and other memories. The external CPU can be replaced by other operation processing units for sampling, calculation and output, such as FPGA, CPLD, MCU and other units capable of data acquisition and processing.
为了实现对误差校正参数值进行更新,在本实施例中,在步骤S30之后,还可以包括:在所述当前位置信息不符合预设位置条件时,获取当前时刻下的所述正余弦编码器旋转一周生成的当前增量正余弦信号、当前零位信号和当前绝对正余弦信号;根据所述当前增量正余弦信号、所述当前零位信号和所述当前绝对正余弦信号,确定当前误差校正参数集;根据所述当前误差校正参数集对所述误差校正参数集进行更新。In order to update the error correction parameter value, in this embodiment, after step S30, it can also include: when the current position information does not meet the preset position condition, obtaining the current incremental sin-cosine signal, the current zero position signal and the current absolute sin-cosine signal generated by the sin-cosine encoder rotating one circle at the current moment; determining the current error correction parameter set according to the current incremental sin-cosine signal, the current zero position signal and the current absolute sin-cosine signal; and updating the error correction parameter set according to the current error correction parameter set.
在正余弦编码器出厂后,随着正余弦编码器使用次数的增多,正余弦编码器的误差可能会变大,由于上述得到的误差校正参数集可以对正余弦编码器的固定误差进行补偿,因此本实施例还需要在正余弦编码器出厂后,也就是在使用后对误差校正参数集进行更新,以根据更新后的误差校正参数集对正余弦编码器产生的绝对正余弦信号进行误差补偿。After the sine-cosine encoder leaves the factory, as the number of times the sine-cosine encoder is used increases, the error of the sine-cosine encoder may become larger. Since the error correction parameter set obtained above can compensate for the fixed error of the sine-cosine encoder, this embodiment also needs to update the error correction parameter set after the sine-cosine encoder leaves the factory, that is, after use, so as to compensate for the error of the absolute sine-cosine signal generated by the sine-cosine encoder according to the updated error correction parameter set.
在当前位置信息不符合预设位置条件时,预设位置条件可以是预先设置的位置条件,例如:可以是当前时刻下正余弦编码器产生的绝对正余弦信号与正余弦编码器在第一次产生的绝对正余弦信号之间存在较大差别时,或者是当前时刻下正余弦编码器的绝对正余弦信号的实际误差比误差校正参数集记录的理论误差大于某个阈值时,需要对误差校正参数集进行更新。当然上述预设位置条件还可以为其它可能的条件,具体的可以根据实际需求确定,具体的可以根据实际情况确定,本说明书实施例对此不作限定。When the current position information does not meet the preset position condition, the preset position condition may be a pre-set position condition, for example: when there is a large difference between the absolute sine-cosine signal generated by the sine-cosine encoder at the current moment and the absolute sine-cosine signal generated by the sine-cosine encoder for the first time, or when the actual error of the absolute sine-cosine signal of the sine-cosine encoder at the current moment is greater than a certain threshold than the theoretical error recorded in the error correction parameter set, the error correction parameter set needs to be updated. Of course, the above-mentioned preset position condition may also be other possible conditions, which may be determined according to actual needs and actual conditions, and the embodiments of this specification do not limit this.
在具体实现中,在对误差校正参数集进行更新时,可以控制正余弦编码器低速旋转一周,此时需要获取当前时刻下的正余弦编码器生成的当前增量正余弦信号、当前零位信号和当前绝对正余弦信号,然后根据当前增量正余弦信号、所述零位信号和当前绝对正余弦信号,确定当前误差校正参数集,具体确定当前误差校正参数集与上述确定误差校正参数集的方式基本一致,本实施例对此不过多赘述。再根据当前误差校正参数集对误差校正参数集进行更新,即将误差校正参数集替换为当前误差校正参数集,后续在正余弦编码器的使用过程中可根据当前误差校正参数集进行误差补偿。In a specific implementation, when the error correction parameter set is updated, the sine-cosine encoder can be controlled to rotate at a low speed for one circle. At this time, it is necessary to obtain the current incremental sine-cosine signal, the current zero-position signal and the current absolute sine-cosine signal generated by the sine-cosine encoder at the current moment, and then determine the current error correction parameter set based on the current incremental sine-cosine signal, the zero-position signal and the current absolute sine-cosine signal. The specific determination of the current error correction parameter set is basically consistent with the above-mentioned method of determining the error correction parameter set, and this embodiment will not elaborate on this. Then, the error correction parameter set is updated according to the current error correction parameter set, that is, the error correction parameter set is replaced with the current error correction parameter set, and error compensation can be performed according to the current error correction parameter set during the subsequent use of the sine-cosine encoder.
本实施例通过获取正余弦编码器旋转一周生成的增量正余弦信号、零位信号和绝对正余弦信号,然后根据增量正余弦信号、零位信号和绝对正余弦信号确定误差校正参数集。本实施例根据增量正余弦信号、零位信号以及绝对正余弦信号确定误差校正参数集,能够不依赖外部校正设备即可确定误差校正参数集,然后对初始绝对正余弦信号进行误差补偿,从而能够精确地对编码器产生的正余弦信号进行误差补偿。This embodiment obtains the incremental sine-cosine signal, the zero position signal and the absolute sine-cosine signal generated by one rotation of the sine-cosine encoder, and then determines the error correction parameter set according to the incremental sine-cosine signal, the zero position signal and the absolute sine-cosine signal. This embodiment determines the error correction parameter set according to the incremental sine-cosine signal, the zero position signal and the absolute sine-cosine signal, and can determine the error correction parameter set without relying on an external correction device, and then performs error compensation on the initial absolute sine-cosine signal, so that the error compensation of the sine-cosine signal generated by the encoder can be accurately performed.
参考图5,图5为本申请正余弦信号的误差补偿方法第三实施例的流程示意图。Refer to FIG. 5 , which is a flow chart of a third embodiment of a method for compensating errors of sine and cosine signals of the present application.
基于上述各实施例,在本实施例中,所述步骤S02包括:Based on the above embodiments, in this embodiment, step S02 includes:
步骤S021:根据所述增量正余弦信号和所述零位信号,确定第一单圈绝对位置。Step S021: determining a first single-turn absolute position according to the incremental sine and cosine signals and the zero position signal.
本实施例中,可根据增量正余弦信号和零位信号确定第一单圈绝对位置,增量正余弦信号是指A+、A-、B+、B-信号,零位信号是指Z+、Z-信号。In this embodiment, the first single-turn absolute position can be determined according to the incremental sine and cosine signals and the zero position signal, the incremental sine and cosine signals refer to A+, A-, B+, B- signals, and the zero position signal refers to Z+, Z- signals.
为了精确确定第一单圈绝对位置,在本实施例中,所述步骤S021可以包括:根据所述零位信号确定所述正余弦编码器的单圈零位信号;根据所述单圈零位信号对所述增量信号进行周期计数,获得计数结果;根据所述计数结果确定第一单圈绝对位置。In order to accurately determine the first single-turn absolute position, in this embodiment, the step S021 may include: determining the single-turn zero position signal of the sine-cosine encoder according to the zero position signal; performing period counting of the incremental signal according to the single-turn zero position signal to obtain a counting result; and determining the first single-turn absolute position according to the counting result.
零位信号,即Z信号在正余弦编码器旋转一周时,可产生一个脉冲,因此可通过单圈零位信号判断正余弦编码器是否进行下一周。The zero position signal, that is, the Z signal, can generate a pulse when the sine-cosine encoder rotates one circle. Therefore, the single-turn zero position signal can be used to determine whether the sine-cosine encoder will perform the next circle.
应理解的是,可获取一个单圈零位信号到下一个单圈零位信号之间的增量正余弦信号,即A+、A-、B+、B-信号,然后获得A信号和B信号,A信号为A+信号减去A-信号,B信号为B+信号减去B-信号。此时即可对增量正余弦信号进行周期计数,也就是位于A信号和B信号中的第几个周期。It should be understood that the incremental sine and cosine signals between one single-turn zero position signal and the next single-turn zero position signal, i.e., A+, A-, B+, and B- signals, can be obtained, and then the A signal and the B signal are obtained, where the A signal is the A+ signal minus the A- signal, and the B signal is the B+ signal minus the B- signal. At this point, the incremental sine and cosine signals can be cycle counted, that is, the number of cycles in the A signal and the B signal.
在具体实现中,在获得计数结果后,可根据计数结果确定第一单圈绝对位置,例如:A信号和B信号在一个正余弦编码器旋转一周内会产生2048个周期,此时计数结果为1024,则第一单圈绝对位置为(1024/2048)*360度=180度。也就是说,第一单圈绝对位置=(计数结果/总周期数)*360度。In a specific implementation, after obtaining the counting result, the first single-turn absolute position can be determined according to the counting result. For example, the A signal and the B signal will generate 2048 cycles in one rotation of the sine-cosine encoder. At this time, the counting result is 1024, and the first single-turn absolute position is (1024/2048)*360 degrees=180 degrees. In other words, the first single-turn absolute position = (counting result/total number of cycles)*360 degrees.
步骤S022:根据所述绝对正余弦信号,确定第二单圈绝对位置。Step S022: Determine a second single-turn absolute position according to the absolute sine and cosine signals.
在本实施例中,第二单圈绝对位置可以是利用编码器输出的绝对正余弦信号,即C+、C-、D+、D-信号确定的绝对位置。In this embodiment, the second single-turn absolute position may be an absolute position determined by using the absolute sine and cosine signals output by the encoder, that is, C+, C−, D+, and D− signals.
本实施例可根据绝对正余弦信号中的正弦值和余弦值确定第二单圈绝对位置。根据C+、C-、D+、D-信号可确定C信号和D信号,C信号为C+信号减去C-信号,D信号为D+信号减去D-信号。在绝对正余弦信号中的余弦值,即在C信号中的值;在绝对正余弦信号中的余弦值,即在D信号中的值,正切值为正弦值/余弦值。In this embodiment, the second single-turn absolute position can be determined according to the sine value and cosine value in the absolute sine and cosine signals. The C signal and the D signal can be determined according to the C+, C-, D+, and D- signals. The C signal is the C+ signal minus the C- signal, and the D signal is the D+ signal minus the D- signal. The cosine value in the absolute sine and cosine signals is the value in the C signal; the cosine value in the absolute sine and cosine signals is the value in the D signal, and the tangent value is the sine value/cosine value.
在本实施例中,在获得正切值后,可根据正切值确定第二单圈绝对位置,具体可通过求反函数的方法,例如:正切值为1时,第二单圈绝对位置为arctan1=45度。In this embodiment, after the tangent value is obtained, the second single-turn absolute position can be determined according to the tangent value, specifically by the method of finding the inverse function. For example, when the tangent value is 1, the second single-turn absolute position is arctan1=45 degrees.
步骤S023:以所述第一单圈绝对位置为基准,确定所述第二单圈绝对位置的误差数据。Step S023: Determine error data of the second single-turn absolute position based on the first single-turn absolute position.
在本实施例中,由于利用增量正余弦信号和零位信号确定的第一单圈绝对位置的精确度更高,接近与理论值,因此,可以将第一单圈绝对位置作为理论值,并以此为基准,对第二单圈位置进行误差补偿,从而可以更加便捷的确定出误差数据。In this embodiment, since the accuracy of the first single-turn absolute position determined by using the incremental sine and cosine signals and the zero position signal is higher and closer to the theoretical value, the first single-turn absolute position can be used as the theoretical value, and based on this, the error compensation of the second single-turn position is performed, so that the error data can be determined more conveniently.
在具体实现中,可根据第一单圈绝对位置确定第二单圈绝对位置对应的误差数据,例如:在同一电压幅值(例如0V)对应的第一单圈绝对位置为180度,第二单圈绝对位置为181度,此时确定误差数据为-1度。误差校正参数集中可存储:在第二单圈绝对位置为181度时,对应的误差数据为-1度;或者,0V处的为误差为-1度;或者,也可以根据单圈的误差数据拟合得到误差曲线或者误差公式存储至误差校正参数集中以进行校正,具体的可以根据实际情况确定,本说明书对此不作限定。In a specific implementation, the error data corresponding to the second single-turn absolute position can be determined based on the first single-turn absolute position. For example, the first single-turn absolute position corresponding to the same voltage amplitude (such as 0V) is 180 degrees, and the second single-turn absolute position is 181 degrees. At this time, the error data is determined to be -1 degree. The error correction parameter set can store: when the second single-turn absolute position is 181 degrees, the corresponding error data is -1 degree; or, the error at 0V is -1 degree; or, the error curve or error formula obtained by fitting the single-turn error data can be stored in the error correction parameter set for correction. The specific can be determined according to the actual situation, and this specification does not limit this.
步骤S024:基于所述第二单圈绝对位置的误差数据,生成所述误差校正参数集。Step S024: generating the error correction parameter set based on the error data of the second single-turn absolute position.
本实施例中的误差校正参数集中可包括所有第二单圈绝对位置对应的位置偏差。The error correction parameter set in this embodiment may include position deviations corresponding to all second single-turn absolute positions.
在本实施例中,所述误差校正参数集中包含多组误差校正参数,每组误差校正参数包含正余弦信号幅值和对应的角度误差,或者每组误差校正参数中包含正余弦信号角度值和对应的角度误差。In this embodiment, the error correction parameter set includes multiple groups of error correction parameters, each group of error correction parameters includes the amplitude of the sine and cosine signals and the corresponding angle error, or each group of error correction parameters includes the angle value of the sine and cosine signals and the corresponding angle error.
在本实施例中,误差校正参数集可包括正余弦信号角度值和对应的角度误差,即上述第二单圈绝对位置和对应的误差数据。In this embodiment, the error correction parameter set may include the sine and cosine signal angle values and the corresponding angle errors, that is, the above-mentioned second single-turn absolute position and the corresponding error data.
在具体实现中,每组误差校正参数集还可包括正余弦信号幅值和对应的角度误差,也就是每一个信号幅值都会有对应的角度误差,例如信号幅值为4时,对应的角度应该是90度,但是正余弦编码器出厂前在信号幅值为4时,测得的角度为89度,此时正余弦信号幅值对应的角度误差为+1度。In a specific implementation, each set of error correction parameter sets may also include the sine and cosine signal amplitudes and corresponding angular errors, that is, each signal amplitude will have a corresponding angular error. For example, when the signal amplitude is 4, the corresponding angle should be 90 degrees. However, when the sine and cosine encoder is produced before leaving the factory, when the signal amplitude is 4, the measured angle is 89 degrees. At this time, the angular error corresponding to the sine and cosine signal amplitude is +1 degree.
为了精确进行误差补偿,在本实施例中,所述步骤S30可以包括:获取所述初始绝对正余弦信号对应的信号角度;从所述误差校正参数集中选取所述信号角度对应的角度误差;根据所述角度误差对所述初始绝对正余弦信号进行误差补偿,得到目标正余弦信号,所述目标正余弦信号用于确定所述正余弦编码器的当前位置信息。In order to accurately perform error compensation, in this embodiment, the step S30 may include: obtaining the signal angle corresponding to the initial absolute sin-cosine signal; selecting the angle error corresponding to the signal angle from the error correction parameter set; performing error compensation on the initial absolute sin-cosine signal according to the angle error to obtain a target sin-cosine signal, and the target sin-cosine signal is used to determine the current position information of the sin-cosine encoder.
在获取初始绝对正余弦信号对应的信号角度后,可根据绝对正余弦信号中的C、D信号获取对应的第二单圈绝对位置,此时可根据第二单圈绝对位置从误差校正参数集中选取对应的角度误差,例如:第二单圈绝对位置为181度时,角度误差为-1度。After obtaining the signal angle corresponding to the initial absolute sine and cosine signals, the corresponding second single-turn absolute position can be obtained according to the C and D signals in the absolute sine and cosine signals. At this time, the corresponding angle error can be selected from the error correction parameter set according to the second single-turn absolute position. For example, when the second single-turn absolute position is 181 degrees, the angle error is -1 degree.
在得到角度误差后,可对初始绝对正余弦信号进行误差补偿,例如:角度误差为-1度时,对角度误差对应的C信号和D信号都进行-1度处理,在对各个信号角度都进行误差补偿后,即可对整个初始绝对正余弦信号进行误差补偿,得到目标正余弦信号。After obtaining the angle error, the initial absolute sine and cosine signals can be error compensated. For example, when the angle error is -1 degree, the C signal and D signal corresponding to the angle error are both processed by -1 degree. After error compensation is performed on each signal angle, the entire initial absolute sine and cosine signal can be error compensated to obtain the target sine and cosine signals.
为了精确进行误差补偿,在本实施例中,所述步骤S30可以包括:获取所述初始绝对正余弦信号对应的信号幅值;从所述误差校正参数集中选取所述信号幅值对应的角度误差;根据所述角度误差对所述初始绝对正余弦信号进行误差补偿,得到目标正余弦信号,所述目标正余弦信号用于确定所述正余弦编码器的当前位置信息。In order to accurately perform error compensation, in this embodiment, the step S30 may include: obtaining the signal amplitude corresponding to the initial absolute sin-cosine signal; selecting the angle error corresponding to the signal amplitude from the error correction parameter set; performing error compensation on the initial absolute sin-cosine signal according to the angle error to obtain a target sin-cosine signal, and the target sin-cosine signal is used to determine the current position information of the sin-cosine encoder.
除了通过根据正余弦信号角度进行误差补偿之外,还可通过正余弦信号幅值进行误差补偿。In addition to performing error compensation based on the angle of the sine and cosine signals, error compensation can also be performed based on the amplitude of the sine and cosine signals.
在获取初始绝对正余弦信号对应的信号幅值后,从误差校正参数集中选取对应的角度误差,例如:信号幅值为4时,角度误差为+1度。After obtaining the signal amplitude corresponding to the initial absolute sine and cosine signals, the corresponding angle error is selected from the error correction parameter set. For example, when the signal amplitude is 4, the angle error is +1 degree.
在得到角度误差后,可对初始绝对正余弦信号进行误差补偿,例如:角度误差为+1度时,对角度误差对应的C信号和D信号都进行+1度处理,在对各个信号幅值都进行误差补偿后,即可对整个初始绝对正余弦信号进行误差补偿,得到目标正余弦信号。After obtaining the angle error, the initial absolute sine and cosine signals can be error compensated. For example, when the angle error is +1 degree, the C signal and D signal corresponding to the angle error are both processed by +1 degree. After the error compensation is performed on the amplitude of each signal, the error compensation can be performed on the entire initial absolute sine and cosine signal to obtain the target sine and cosine signals.
具体地,本实施例除了可以应用于正余弦编码器之外,还可应用于输出信号(A+、A-、B+、B-)是方波的,也可以采用上述方案来提高编码器的精度。Specifically, in addition to being applicable to sine-cosine encoders, this embodiment can also be applied to output signals (A+, A-, B+, B-) that are square waves, and the above solution can also be used to improve the accuracy of the encoder.
本实施例通过根据增量正余弦信号和零位信号第一单圈绝对位置,然后根据绝对正余弦信号确定第二单圈绝对位置,再以第一单圈绝对位置为基准,确定第二单圈绝对位置的误差数据,再基于第二单圈绝对位置的误差数据生成误差校正参数集。本实施例根据第一单圈绝对位置和第二单圈绝对位置确定误差校正参数集,能够以第一单圈绝对位置为基准,对第二单圈绝对位置进行误差补偿,从而能够在不依赖外部校正设备的同时,精确地对编码器产生的正余弦信号进行误差补偿。This embodiment determines the first single-turn absolute position according to the incremental sine-cosine signal and the zero-position signal, and then determines the second single-turn absolute position according to the absolute sine-cosine signal, and then determines the error data of the second single-turn absolute position based on the first single-turn absolute position, and then generates an error correction parameter set based on the error data of the second single-turn absolute position. This embodiment determines the error correction parameter set according to the first single-turn absolute position and the second single-turn absolute position, and can perform error compensation on the second single-turn absolute position based on the first single-turn absolute position, so that the error compensation of the sine-cosine signal generated by the encoder can be accurately performed without relying on external correction equipment.
此外,本申请实施例还提出一种存储介质,所述存储介质上存储有正余弦信号的误差补偿程序,所述正余弦信号的误差补偿程序被处理器执行时实现如上文所述的正余弦信号的误差补偿方法的步骤。In addition, an embodiment of the present application further proposes a storage medium, on which an error compensation program for sine and cosine signals is stored. When the error compensation program for sine and cosine signals is executed by a processor, the steps of the error compensation method for sine and cosine signals described above are implemented.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如只读存储器/随机存取存储器、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory/random access memory, a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims (10)

  1. 一种正余弦信号的误差补偿方法,应用于正余弦编码器,其中,所述正余弦信号的误差补偿方法包括:A method for compensating an error of a sine-cosine signal is applied to a sine-cosine encoder, wherein the method for compensating an error of a sine-cosine signal comprises:
    采集所述正余弦编码器当前时刻生成的初始绝对正余弦信号;Collecting the initial absolute sine and cosine signals generated by the sine and cosine encoder at the current moment;
    获取误差校正参数集,其中,所述误差校正参数集中包含预先根据所述正余弦编码器旋转一圈生成的增量正余弦信号、零位信号和绝对正余弦信号确定的误差校正参数;以及Acquire an error correction parameter set, wherein the error correction parameter set includes error correction parameters pre-determined based on incremental sine-cosine signals, zero position signals, and absolute sine-cosine signals generated by one rotation of the sine-cosine encoder; and
    根据所述误差校正参数集对所述初始绝对正余弦信号进行误差补偿,得到目标正余弦信号,所述目标正余弦信号用于确定所述正余弦编码器的当前位置信息。The initial absolute sin-cos signal is error compensated according to the error correction parameter set to obtain a target sin-cos signal, and the target sin-cos signal is used to determine the current position information of the sin-cos encoder.
  2. 如权利要求1所述的正余弦信号的误差补偿方法,其中,在获取误差校正参数集之前,还包括:The error compensation method for sine and cosine signals according to claim 1, wherein before obtaining the error correction parameter set, it also includes:
    获取所述正余弦编码器旋转一周生成的增量正余弦信号、零位信号和绝对正余弦信号;以及Acquire incremental sine and cosine signals, zero position signals and absolute sine and cosine signals generated by one rotation of the sine and cosine encoder; and
    根据所述增量正余弦信号、所述零位信号和所述绝对正余弦信号,确定所述误差校正参数集。The error correction parameter set is determined based on the incremental sin-cos signals, the zero position signal and the absolute sin-cos signals.
  3. 如权利要求2所述的正余弦信号的误差补偿方法,其中,所述根据所述增量正余弦信号、所述零位信号和所述绝对正余弦信号,确定所述误差校正参数集的步骤,包括:The error compensation method for sin-cos signals according to claim 2, wherein the step of determining the error correction parameter set according to the incremental sin-cos signals, the zero position signal and the absolute sin-cos signals comprises:
    根据所述增量正余弦信号和所述零位信号,确定第一单圈绝对位置;Determining a first single-turn absolute position according to the incremental sine and cosine signals and the zero position signal;
    根据所述绝对正余弦信号,确定第二单圈绝对位置;Determining a second single-turn absolute position according to the absolute sine and cosine signals;
    以所述第一单圈绝对位置为基准,确定所述第二单圈绝对位置的误差数据;以及Determining error data of the second single-turn absolute position based on the first single-turn absolute position; and
    基于所述第二单圈绝对位置的误差数据,生成所述误差校正参数集。The error correction parameter set is generated based on the error data of the second single-turn absolute position.
  4. 如权利要求3所述的正余弦信号的误差补偿方法,其中,所述根据所述增量正余弦信号和所述零位信号,确定第一单圈绝对位置的步骤,包括:The error compensation method of the sine and cosine signals according to claim 3, wherein the step of determining the first single-turn absolute position according to the incremental sine and cosine signals and the zero position signal comprises:
    根据所述零位信号确定所述正余弦编码器的单圈零位信号;Determine a single-turn zero-position signal of the sine-cosine encoder according to the zero-position signal;
    根据所述单圈零位信号对所述增量信号进行周期计数,获得计数结果;以及Performing period counting on the incremental signal according to the single-turn zero position signal to obtain a counting result; and
    根据所述计数结果确定第一单圈绝对位置。The first single-turn absolute position is determined according to the counting result.
  5. 如权利要求3所述的正余弦信号的误差补偿方法,其中,所述误差校正参数集中包含多组误差校正参数,每组误差校正参数中包含正余弦信号幅值和对应的角度误差,或者每组误差校正参数中包含正余弦信号角度值和对应的角度误差。The error compensation method for sine and cosine signals as described in claim 3, wherein the error correction parameter set includes multiple groups of error correction parameters, each group of error correction parameters includes the amplitude of the sine and cosine signals and the corresponding angle error, or each group of error correction parameters includes the angle value of the sine and cosine signals and the corresponding angle error.
  6. 如权利要求2所述的正余弦信号的误差补偿方法,其中,在根据所述增量正余弦信号、所述零位信号和所述绝对正余弦信号,确定所述误差校正参数集之后,还包括:The error compensation method of the sine and cosine signals according to claim 2, wherein after determining the error correction parameter set according to the incremental sine and cosine signals, the zero position signal and the absolute sine and cosine signals, it further comprises:
    将所述误差校正参数集存储在所述正余弦编码器中存储器的预设位置处。The error correction parameter set is stored at a preset location in a memory in the sine-cosine encoder.
  7. 如权利要求5所述的正余弦信号的误差补偿方法,其中,所述根据所述误差校正参数集对所述初始绝对正余弦信号进行误差补偿,得到目标正余弦信号,所述目标正余弦信号用于确定所述正余弦编码器的当前位置信息的步骤,包括:The error compensation method for sin-cosine signals according to claim 5, wherein the step of performing error compensation on the initial absolute sin-cosine signal according to the error correction parameter set to obtain a target sin-cosine signal, and the target sin-cosine signal is used to determine the current position information of the sin-cosine encoder, comprises:
    获取所述初始绝对正余弦信号对应的信号角度;Obtaining a signal angle corresponding to the initial absolute sine and cosine signals;
    从所述误差校正参数集中选取所述信号角度对应的角度误差;以及Selecting an angle error corresponding to the signal angle from the error correction parameter set; and
    根据所述角度误差对所述初始绝对正余弦信号进行误差补偿,得到目标正余弦信号,所述目标正余弦信号用于确定所述正余弦编码器的当前位置信息。The initial absolute sine and cosine signals are error compensated according to the angle error to obtain target sine and cosine signals, and the target sine and cosine signals are used to determine the current position information of the sine and cosine encoder.
  8. 如权利要求5所述的正余弦信号的误差补偿方法,其中,所述根据所述误差校正参数集对所述初始绝对正余弦信号进行误差补偿,得到目标正余弦信号,所述目标正余弦信号用于确定所述正余弦编码器的当前位置信息的步骤,包括:The error compensation method for sin-cosine signals according to claim 5, wherein the step of performing error compensation on the initial absolute sin-cosine signal according to the error correction parameter set to obtain a target sin-cosine signal, and the target sin-cosine signal is used to determine the current position information of the sin-cosine encoder, comprises:
    获取所述初始绝对正余弦信号对应的信号幅值;Obtaining a signal amplitude corresponding to the initial absolute sine and cosine signals;
    从所述误差校正参数集中选取所述信号幅值对应的角度误差;以及Selecting the angle error corresponding to the signal amplitude from the error correction parameter set; and
    根据所述角度误差对所述初始绝对正余弦信号进行误差补偿,得到目标正余弦信号,所述目标正余弦信号用于确定所述正余弦编码器的当前位置信息。The initial absolute sine and cosine signals are error compensated according to the angle error to obtain target sine and cosine signals, and the target sine and cosine signals are used to determine the current position information of the sine and cosine encoder.
  9. 如权利要求1所述的正余弦信号的误差补偿方法,其中,在根据所述误差校正参数集对所述初始绝对正余弦信号进行误差补偿,得到目标正余弦信号,所述目标正余弦信号用于确定所述正余弦编码器的当前位置信息之后,还包括:The error compensation method for sin-cosine signals according to claim 1, wherein after performing error compensation on the initial absolute sin-cosine signal according to the error correction parameter set to obtain a target sin-cosine signal, and the target sin-cosine signal is used to determine the current position information of the sin-cosine encoder, it further comprises:
    在所述当前位置信息不符合预设位置条件时,获取当前时刻下的所述正余弦编码器旋转一周生成的当前增量正余弦信号、当前零位信号和当前绝对正余弦信号;When the current position information does not meet the preset position condition, obtaining the current incremental sine-cosine signal, the current zero position signal and the current absolute sine-cosine signal generated by the sine-cosine encoder rotating one circle at the current moment;
    根据所述当前增量正余弦信号、所述当前零位信号和所述当前绝对正余弦信号,确定当前误差校正参数集;以及Determining a current error correction parameter set based on the current incremental sin-cos signal, the current zero signal, and the current absolute sin-cos signal; and
    根据所述当前误差校正参数集对所述误差校正参数集进行更新。The error correction parameter set is updated according to the current error correction parameter set.
  10. 一种存储介质,其中,所述存储介质上存储有正余弦信号的误差补偿程序,所述正余弦信号的误差补偿程序被处理器执行时实现如权利要求1至9中任一项所述的正余弦信号的误差补偿方法的步骤。A storage medium, wherein an error compensation program for sine and cosine signals is stored on the storage medium, and when the error compensation program for sine and cosine signals is executed by a processor, the steps of the error compensation method for sine and cosine signals as described in any one of claims 1 to 9 are implemented.
PCT/CN2023/099490 2022-09-28 2023-06-09 Error compensation method for sine-cosine signal, and storage medium WO2024066472A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211194356.4A CN115388930A (en) 2022-09-28 2022-09-28 Error compensation method for sine and cosine signals and storage medium
CN202211194356.4 2022-09-28

Publications (1)

Publication Number Publication Date
WO2024066472A1 true WO2024066472A1 (en) 2024-04-04

Family

ID=84129258

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/099490 WO2024066472A1 (en) 2022-09-28 2023-06-09 Error compensation method for sine-cosine signal, and storage medium

Country Status (2)

Country Link
CN (1) CN115388930A (en)
WO (1) WO2024066472A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115388930A (en) * 2022-09-28 2022-11-25 长春汇通光电技术有限公司 Error compensation method for sine and cosine signals and storage medium
CN116046044B (en) * 2022-12-29 2024-02-23 苏州汇川技术有限公司 Error correction method, terminal device and computer readable storage medium

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101709983A (en) * 2009-10-30 2010-05-19 大连光洋科技工程有限公司 On-line actual error compensation system of sine and cosine encoder
CN101718976A (en) * 2009-10-30 2010-06-02 大连科德数控有限公司 Structure for achieving double-spindle synchronization in machining center
CN101726320A (en) * 2009-10-30 2010-06-09 大连光洋科技工程有限公司 Precision compensation system of sine-cosine output type encoder
CN201548256U (en) * 2009-10-30 2010-08-11 大连光洋科技工程有限公司 Accuracy compensating device for sine-cosine encoder
CN102564462A (en) * 2011-12-27 2012-07-11 华中科技大学 Error compensation device for sin/cos encoder
JP2014013209A (en) * 2012-07-05 2014-01-23 Keihin Corp Angle detection device
CN109945819A (en) * 2019-04-08 2019-06-28 中国科学院电工研究所 A kind of permanent-magnet synchronous motor rotor position measurement method
RU2741075C1 (en) * 2020-05-26 2021-01-22 Общество с Ограниченной Ответственностью "ИДМ-Плюс" Tracking sine-cosine angle-to-code converter with built-in digital conversion error correction
CN112985325A (en) * 2021-04-21 2021-06-18 天津飞旋科技股份有限公司 Position decoding method and device of sine and cosine encoder and computer readable medium
CN113091774A (en) * 2021-03-17 2021-07-09 陈权 Sine and cosine coding method based on absolute value encoder
US20220024517A1 (en) * 2019-01-22 2022-01-27 Mitsubishi Electric Corporation Rotation angle detection device, and electric power steering device including same rotation angle detection device
CN114396967A (en) * 2021-11-30 2022-04-26 浙江西子富沃德电机有限公司 Sine and cosine encoder, signal processing method thereof and elevator control system
CN217424403U (en) * 2021-11-30 2022-09-13 浙江西子富沃德电机有限公司 Error compensation circuit of sine and cosine encoder and sine and cosine encoder
CN115388930A (en) * 2022-09-28 2022-11-25 长春汇通光电技术有限公司 Error compensation method for sine and cosine signals and storage medium

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101718976A (en) * 2009-10-30 2010-06-02 大连科德数控有限公司 Structure for achieving double-spindle synchronization in machining center
CN101726320A (en) * 2009-10-30 2010-06-09 大连光洋科技工程有限公司 Precision compensation system of sine-cosine output type encoder
CN201548256U (en) * 2009-10-30 2010-08-11 大连光洋科技工程有限公司 Accuracy compensating device for sine-cosine encoder
CN101709983A (en) * 2009-10-30 2010-05-19 大连光洋科技工程有限公司 On-line actual error compensation system of sine and cosine encoder
CN102564462A (en) * 2011-12-27 2012-07-11 华中科技大学 Error compensation device for sin/cos encoder
JP2014013209A (en) * 2012-07-05 2014-01-23 Keihin Corp Angle detection device
US20220024517A1 (en) * 2019-01-22 2022-01-27 Mitsubishi Electric Corporation Rotation angle detection device, and electric power steering device including same rotation angle detection device
CN109945819A (en) * 2019-04-08 2019-06-28 中国科学院电工研究所 A kind of permanent-magnet synchronous motor rotor position measurement method
RU2741075C1 (en) * 2020-05-26 2021-01-22 Общество с Ограниченной Ответственностью "ИДМ-Плюс" Tracking sine-cosine angle-to-code converter with built-in digital conversion error correction
CN113091774A (en) * 2021-03-17 2021-07-09 陈权 Sine and cosine coding method based on absolute value encoder
CN112985325A (en) * 2021-04-21 2021-06-18 天津飞旋科技股份有限公司 Position decoding method and device of sine and cosine encoder and computer readable medium
CN114396967A (en) * 2021-11-30 2022-04-26 浙江西子富沃德电机有限公司 Sine and cosine encoder, signal processing method thereof and elevator control system
CN217424403U (en) * 2021-11-30 2022-09-13 浙江西子富沃德电机有限公司 Error compensation circuit of sine and cosine encoder and sine and cosine encoder
CN115388930A (en) * 2022-09-28 2022-11-25 长春汇通光电技术有限公司 Error compensation method for sine and cosine signals and storage medium

Also Published As

Publication number Publication date
CN115388930A (en) 2022-11-25

Similar Documents

Publication Publication Date Title
WO2024066472A1 (en) Error compensation method for sine-cosine signal, and storage medium
US7496462B2 (en) Encoding signal processing device and signal processing method therefor
CN104038134B (en) A kind of permanent-magnet synchronous motor rotor position error calibration method based on linear Hall
US9857203B2 (en) Resolver device
CN103837169A (en) Self-correcting device and method for magneto-electricity encoder and magneto-electricity encoder
CN1712889A (en) Encoder and signal adjustment method for the same
CN109000702A (en) Encoder corrects system and method
CN115355937B (en) Self-calibration method of magnetic encoder and motor
JP2005257565A (en) Resolver digital angle conversion device, method, and program
CN114003045A (en) Target tracking method of photoelectric tracker, terminal and readable storage medium
CN116358619B (en) Signal error correction method, magnetic encoder and optical encoder
Linxiang et al. Full-harmonic error separation technique
US20200218226A1 (en) Instant correction method for encoder and system thereof
JP2839341B2 (en) Calibration device for position signal
CN111089610A (en) Signal processing method and device of encoder and related components
CN112873209B (en) Positioning sensor time delay calibration method and device, computer equipment and storage medium
CN115940726A (en) Method, system, device and medium for improving motor parameter identification dynamic performance
CN115459773A (en) Method and model for processing VADC sampling signal of rotary transformer
Shen et al. High-precision magnetic encoder module design based on real-time error compensation algorithm
CN112104292A (en) Motor control method and device, terminal equipment and storage medium
JP3092100B2 (en) Position detector with error correction function
JPS63256814A (en) Position detector
CN111207723B (en) Demodulation method of differential circular induction synchronizer
CN112067218B (en) Method, device and equipment for realizing optical anti-shake vibration generator
JPS62172218A (en) Method for detecting position by resolver/digital converter