CN115876242A - Angle Compensation Method and Device for Magnetic Angle Encoder and Magnetic Angle Encoder - Google Patents
Angle Compensation Method and Device for Magnetic Angle Encoder and Magnetic Angle Encoder Download PDFInfo
- Publication number
- CN115876242A CN115876242A CN202211543360.7A CN202211543360A CN115876242A CN 115876242 A CN115876242 A CN 115876242A CN 202211543360 A CN202211543360 A CN 202211543360A CN 115876242 A CN115876242 A CN 115876242A
- Authority
- CN
- China
- Prior art keywords
- angle
- original
- magnetic
- interval
- deviation value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 69
- 230000011218 segmentation Effects 0.000 claims abstract description 135
- 238000004364 calculation method Methods 0.000 claims abstract description 80
- 238000012545 processing Methods 0.000 claims abstract description 31
- 238000007781 pre-processing Methods 0.000 claims description 8
- 230000008569 process Effects 0.000 claims description 6
- 230000002708 enhancing effect Effects 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 15
- 238000004590 computer program Methods 0.000 description 11
- 230000008859 change Effects 0.000 description 7
- 238000003860 storage Methods 0.000 description 7
- 238000004891 communication Methods 0.000 description 5
- 230000005415 magnetization Effects 0.000 description 5
- 238000001514 detection method Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 238000004519 manufacturing process Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 2
- 230000007547 defect Effects 0.000 description 2
- 238000009434 installation Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 241000208125 Nicotiana Species 0.000 description 1
- 235000002637 Nicotiana tabacum Nutrition 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 230000006866 deterioration Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000006073 displacement reaction Methods 0.000 description 1
- 235000013305 food Nutrition 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000006698 induction Effects 0.000 description 1
- 238000007641 inkjet printing Methods 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 238000007639 printing Methods 0.000 description 1
- 239000004753 textile Substances 0.000 description 1
- 238000003466 welding Methods 0.000 description 1
Images
Landscapes
- Transmission And Conversion Of Sensor Element Output (AREA)
Abstract
本发明提供一种磁角度编码器的角度补偿方法、装置及磁角度编码器,涉及磁传感器技术领域,所述方法包括:对磁角度编码器输出的各原始角度对应的原始角度曲线进行分段处理,获取多个分段区间;确定多个分段区间中的目标分段区间对应的偏差值计算公式;基于目标分段区间对应的偏差值计算公式,确定目标分段区间内的各原始角度和与各原始角度对应的旋转角度之间的偏差值;分别基于各偏差值,对目标分段区间内的各原始角度进行补偿。本发明通过将非线性的原始角度曲线进行分段处理,在每一个分段内基于各自对应的偏差值计算公式对该分段内的各原始角度进行补偿,增强了磁角度编码器输出角度的线性化。
The invention provides an angle compensation method and device for a magnetic angle encoder, and the magnetic angle encoder, which relate to the technical field of magnetic sensors. The method includes: segmenting the original angle curve corresponding to each original angle output by the magnetic angle encoder Processing, obtaining multiple segmentation intervals; determining the deviation value calculation formula corresponding to the target segmentation interval in the multiple segmentation intervals; determining each original angle in the target segmentation interval based on the deviation value calculation formula corresponding to the target segmentation interval and the deviation values between the rotation angles corresponding to each original angle; each original angle in the target segmentation interval is compensated based on each deviation value respectively. In the present invention, the nonlinear original angle curve is segmented, and each original angle in each segment is compensated based on the corresponding deviation value calculation formula in each segment, thereby enhancing the accuracy of the output angle of the magnetic angle encoder. linearization.
Description
技术领域technical field
本发明涉及磁传感器技术领域,尤其涉及一种磁角度编码器的角度补偿方法、装置及磁角度编码器。The invention relates to the technical field of magnetic sensors, in particular to an angle compensation method and device for a magnetic angle encoder and the magnetic angle encoder.
背景技术Background technique
近年来随着仪器的快速发展,磁编码器在生产中起到了很大的作用,主要被广泛应用于机器人、电梯、风力发电、数控机床、工程机械、烟草机械、印刷机械、石油天然气、包装机械、纺织机械、食品机械、汽车配件生产流水线、精密喷绘、焊接、精密位置控制工业自动化控制生产线等现代工业领域。磁编码器主要包括磁角度编码器和磁旋转编码器,其中磁旋转编码器用于检测被测对象的旋转方向和旋转速度,而磁旋转编码器不仅能确定被测对象的旋转方向和旋转速度,还能确定被测对象的当前位置,例如需要确定马达停止在什么状态时,就需要使用磁角度编码器。In recent years, with the rapid development of instruments, magnetic encoders have played a great role in production, and are widely used in robots, elevators, wind power, CNC machine tools, engineering machinery, tobacco machinery, printing machinery, oil and gas, packaging Machinery, textile machinery, food machinery, auto parts production lines, precision inkjet printing, welding, precision position control industrial automation control production lines and other modern industrial fields. Magnetic encoders mainly include magnetic angle encoders and magnetic rotary encoders, in which the magnetic rotary encoder is used to detect the rotation direction and rotation speed of the measured object, and the magnetic rotary encoder can not only determine the rotation direction and rotation speed of the measured object, It can also determine the current position of the measured object. For example, when it is necessary to determine the state where the motor stops, it is necessary to use a magnetic angle encoder.
但是在实际安装磁角度编码器时,由于温度、同心度、倾角以及磁铁本身充磁不均匀等原因,使得磁场不均匀,导致磁角度编码器实际检测到的角度线性度变差,这样,会导致让后端上位机读取的难度和时间增加,从而导致检测当前位置不准确的问题。However, when the magnetic angle encoder is actually installed, due to temperature, concentricity, inclination angle, and uneven magnetization of the magnet itself, the magnetic field is uneven, which leads to the deterioration of the angle linearity actually detected by the magnetic angle encoder. This increases the difficulty and time for the back-end host computer to read, which leads to the inaccurate detection of the current location.
发明内容Contents of the invention
针对现有技术存在的问题,本发明提供一种磁角度编码器的角度补偿方法、装置及磁角度编码器。Aiming at the problems existing in the prior art, the present invention provides an angle compensation method and device for a magnetic angle encoder and the magnetic angle encoder.
第一方面,本发明提供一种磁角度编码器的角度补偿方法,包括:In a first aspect, the present invention provides an angle compensation method of a magnetic angle encoder, comprising:
对磁角度编码器输出的各原始角度对应的原始角度曲线进行分段处理,获取多个分段区间;Segmenting the original angle curve corresponding to each original angle output by the magnetic angle encoder to obtain multiple segmented intervals;
确定多个所述分段区间中的目标分段区间对应的偏差值计算公式,所述偏差值计算公式用于表征所述目标分段区间内的各原始角度和与所述各原始角度相对应的旋转角度之间的偏差,所述目标分段区间为所述多个分段区间中的任意一个分段区间;Determine the deviation value calculation formula corresponding to the target segmentation interval in the multiple segmentation intervals, the deviation value calculation formula is used to characterize each original angle in the target segmentation interval and correspond to each original angle The deviation between the rotation angles, the target segment interval is any segment interval in the plurality of segment intervals;
基于所述目标分段区间对应的偏差值计算公式,确定所述目标分段区间内的各原始角度和与所述各原始角度相对应的旋转角度之间的偏差值;Based on the deviation value calculation formula corresponding to the target segmentation interval, determine the deviation value between each original angle in the target segmentation interval and the rotation angle corresponding to each original angle;
分别基于各所述偏差值,对所述目标分段区间内的各所述原始角度进行补偿。Compensating each of the original angles within the target segmentation interval based on each of the deviation values respectively.
可选地,根据本发明提供的一种磁角度编码器的角度补偿方法,所述确定多个所述分段区间中的目标分段区间对应的偏差值计算公式,包括:Optionally, according to an angle compensation method of a magnetic angle encoder provided in the present invention, the determining the deviation value calculation formula corresponding to the target segment interval in the plurality of segment intervals includes:
确定所述目标分段区间的起始点对应的第一原始角度,以及与所述第一原始角度相对应的第一旋转角度,并确定所述目标分段区间的结束点对应的第二原始角度,以及与所述第二原始角度相对应的第二旋转角度;determining a first original angle corresponding to the starting point of the target segmentation interval, and a first rotation angle corresponding to the first original angle, and determining a second original angle corresponding to the end point of the target segmentation interval , and a second rotation angle corresponding to the second original angle;
基于所述第一原始角度、所述第一旋转角度、所述第二原始角度和所述第二旋转角度,确定所述目标分段区间对应的所述偏差值计算公式。Based on the first original angle, the first rotation angle, the second original angle, and the second rotation angle, the deviation value calculation formula corresponding to the target segmentation interval is determined.
可选地,根据本发明提供的一种磁角度编码器的角度补偿方法,所述基于所述第一原始角度、所述第一旋转角度、所述第二原始角度和所述第二旋转角度,确定所述目标分段区间对应的所述偏差值计算公式,包括:Optionally, according to an angle compensation method of a magnetic angle encoder provided in the present invention, the method based on the first original angle, the first rotation angle, the second original angle and the second rotation angle , determining the deviation value calculation formula corresponding to the target segmentation interval, including:
确定所述第一原始角度和所述第一旋转角度之间的第一偏差值,并确定所述第二原始角度和所述第二旋转角度之间的第二偏差值;determining a first offset value between the first original angle and the first rotation angle, and determining a second offset value between the second original angle and the second rotation angle;
基于所述第一原始角度、所述第一偏差值、所述第二原始角度和所述第二偏差值,确定所述目标分段区间对应的所述偏差值计算公式。Based on the first original angle, the first deviation value, the second original angle, and the second deviation value, the deviation value calculation formula corresponding to the target segmentation interval is determined.
可选地,根据本发明提供的一种磁角度编码器的角度补偿方法,所述目标分段区间对应的偏差值计算公式为:Optionally, according to an angle compensation method of a magnetic angle encoder provided by the present invention, the calculation formula of the deviation value corresponding to the target segment interval is:
其中,θ表示所述目标分段区间内的原始角度;Δ表示所述目标分段区间内的原始角度θ和与θ对应的旋转角度之间的偏差值;θN-1表示所述第一原始角度;θN表示所述第二原始角度;ΔN-1表示所述第一偏差值;ΔN表示所述第二偏差值;N表示所述目标分段区间的索引号。Among them, θ represents the original angle in the target segmentation interval; Δ represents the deviation value between the original angle θ in the target segmentation interval and the rotation angle corresponding to θ; θ N-1 represents the first Original angle; θ N represents the second original angle; Δ N-1 represents the first deviation value; Δ N represents the second deviation value; N represents the index number of the target segmentation interval.
可选地,根据本发明提供的一种磁角度编码器的角度补偿方法,在所述对磁角度编码器输出的各原始角度对应的原始角度曲线进行分段处理,获取多个分段区间之前,所述方法还包括:Optionally, according to the angle compensation method of a magnetic angle encoder provided by the present invention, before performing segmentation processing on the original angle curve corresponding to each original angle output by the magnetic angle encoder, and obtaining a plurality of segment intervals , the method also includes:
获取所述磁角度编码器对应的旋转磁场形成的正弦信号和余弦信号;Obtaining a sine signal and a cosine signal formed by a rotating magnetic field corresponding to the magnetic angle encoder;
获取所述正弦信号和所述余弦信号分别对应的数字信号;acquiring digital signals respectively corresponding to the sine signal and the cosine signal;
对所述正弦信号和所述余弦信号分别对应的数字信号进行反正切处理,获得所述磁角度编码器输出的原始角度。Arctangent processing is performed on the digital signals respectively corresponding to the sine signal and the cosine signal to obtain the original angle output by the magnetic angle encoder.
可选地,根据本发明提供的一种磁角度编码器的角度补偿方法,所述获取所述磁角度编码器对应的旋转磁场形成的正弦信号和余弦信号,包括:Optionally, according to an angle compensation method of a magnetic angle encoder provided in the present invention, the acquisition of the sine signal and cosine signal formed by the rotating magnetic field corresponding to the magnetic angle encoder includes:
采用至少两个霍尔元件分别检测所述旋转磁场的变化,获取第一霍尔电压信号和第二霍尔电压信号;Using at least two Hall elements to respectively detect changes in the rotating magnetic field, and obtain a first Hall voltage signal and a second Hall voltage signal;
采用预处理电路,对所述第一霍尔电压信号和所述第二霍尔电压信号分别进行预处理,获取所述磁角度编码器对应的旋转磁场形成的正弦信号和余弦信号。A preprocessing circuit is used to preprocess the first Hall voltage signal and the second Hall voltage signal respectively, and obtain the sine signal and cosine signal formed by the rotating magnetic field corresponding to the magnetic angle encoder.
可选地,根据本发明提供的一种磁角度编码器的角度补偿方法,所述对磁角度编码器输出的各原始角度对应的原始角度曲线进行分段处理,获取多个分段区间,包括:Optionally, according to an angle compensation method of a magnetic angle encoder provided in the present invention, the original angle curve corresponding to each original angle output by the magnetic angle encoder is segmented to obtain a plurality of segmented intervals, including :
获取与所述原始角度曲线相对应的旋转角度曲线;obtaining a rotation angle curve corresponding to the original angle curve;
对所述旋转角度曲线进行均分处理,获得均分处理之后的所述旋转角度曲线上各分割点对应的角度值;Performing an equal division process on the rotation angle curve to obtain an angle value corresponding to each division point on the rotation angle curve after the equal division process;
基于所述旋转角度曲线上各分割点对应的角度值,对所述原始角度曲线进行分段处理,获取所述多个分段区间。Based on the angle values corresponding to the division points on the rotation angle curve, the original angle curve is segmented to obtain the plurality of segment intervals.
第二方面,本发明还提供一种磁角度编码器的角度补偿装置,包括:In the second aspect, the present invention also provides an angle compensation device for a magnetic angle encoder, comprising:
获取模块,用于对磁角度编码器输出的各原始角度对应的原始角度曲线进行分段处理,获取多个分段区间;The obtaining module is used to segment the original angle curve corresponding to each original angle output by the magnetic angle encoder to obtain multiple segmented intervals;
第一确定模块,与所述获取模块连接,用于确定多个所述分段区间中的目标分段区间对应的偏差值计算公式,所述偏差值计算公式用于表征所述目标分段区间内的各原始角度和与所述各原始角度相对应的旋转角度之间的偏差,所述目标分段区间为所述多个分段区间中的任意一个分段区间;A first determination module, connected to the acquisition module, configured to determine a deviation value calculation formula corresponding to a target segment interval in a plurality of the segment intervals, and the deviation value calculation formula is used to characterize the target segment interval The deviation between each original angle within and the rotation angle corresponding to each original angle, and the target segmentation interval is any one segmentation interval in the plurality of segmentation intervals;
第二确定模块,与所述第一确定模块连接,用于基于所述目标分段区间对应的偏差值计算公式,确定所述目标分段区间内的各原始角度和与所述各原始角度相对应的旋转角度之间的偏差值;The second determination module is connected with the first determination module, and is used to determine the original angles in the target segmentation interval and the corresponding original angles based on the deviation value calculation formula corresponding to the target segmentation interval. The deviation value between the corresponding rotation angles;
补偿模块,与所述第二确定模块连接,用于分别基于各所述偏差值,对所述目标分段区间内的各所述原始角度进行补偿。A compensation module, connected to the second determination module, configured to compensate each of the original angles within the target segmentation interval based on each of the deviation values.
可选地,根据本发明提供的一种磁角度编码器的角度补偿装置,所述第一确定模块包括:Optionally, according to an angle compensation device for a magnetic angle encoder provided by the present invention, the first determination module includes:
第一子模块,用于确定所述目标分段区间的起始点对应的第一原始角度,以及与所述第一原始角度相对应的第一旋转角度,并确定所述目标分段区间的结束点对应的第二原始角度,以及与所述第二原始角度相对应的第二旋转角度;The first submodule is configured to determine a first original angle corresponding to the starting point of the target segmentation interval, and a first rotation angle corresponding to the first original angle, and determine the end of the target segmentation interval a second original angle corresponding to the point, and a second rotation angle corresponding to the second original angle;
第二子模块,与所述第一子模块连接,用于基于所述第一原始角度、所述第一旋转角度、所述第二原始角度和所述第二旋转角度,确定所述目标分段区间对应的所述偏差值计算公式。A second submodule, connected to the first submodule, configured to determine the target score based on the first original angle, the first rotation angle, the second original angle, and the second rotation angle The formula for calculating the deviation value corresponding to the segment interval.
第三方面,本发明还提供一种磁角度编码器,包括磁码盘、霍尔元件和信号处理电路,所述信号处理电路用于执行如第一方面所述磁角度编码器的角度补偿方法。In the third aspect, the present invention also provides a magnetic angle encoder, including a magnetic code disc, a Hall element, and a signal processing circuit, the signal processing circuit is used to implement the angle compensation method of the magnetic angle encoder as described in the first aspect .
第四方面,本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如第一方面所述磁角度编码器的角度补偿方法。In a fourth aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the angle compensation method of the magnetic angle encoder as described in the first aspect is implemented.
第五方面,本发明还提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如第一方面所述磁角度编码器的角度补偿方法。In a fifth aspect, the present invention further provides a computer program product, including a computer program, when the computer program is executed by a processor, the angle compensation method of the magnetic angle encoder as described in the first aspect is implemented.
本发明提供的磁角度编码器的角度补偿方法、装置及磁角度编码器,通过将非线性的原始角度曲线进行分段处理,获取多个分段区间,并确定各分段区间分别对应的偏差值计算公式,进而在每一个分段区间内,基于该分段区间对应的偏差值计算公式确定该分段区间内的各原始角度对应的偏差值,基于各偏差值对该分段内的各原始角度进行补偿,增强了磁角度编码器输出角度的线性化。The angle compensation method and device of the magnetic angle encoder provided by the present invention, and the magnetic angle encoder obtain a plurality of segmental intervals by segmenting the nonlinear original angle curve, and determine the respective deviations corresponding to each segmental interval Value calculation formula, and then in each segment interval, based on the deviation value calculation formula corresponding to the segment interval, determine the deviation value corresponding to each original angle in the segment interval, and based on each deviation value for each angle in the segment The original angle is compensated, which enhances the linearization of the output angle of the magnetic angle encoder.
附图说明Description of drawings
为了更清楚地说明本发明或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the present invention or the technical solutions in the prior art, the accompanying drawings that need to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings in the following description are the present invention. For some embodiments of the invention, those skilled in the art can also obtain other drawings based on these drawings without creative effort.
图1是本发明提供的磁角度编码器的角度补偿方法的流程示意图;Fig. 1 is the schematic flow chart of the angle compensation method of the magnetic angle encoder provided by the present invention;
图2是本发明提供的确定多个分段区间中的目标分段区间对应的偏差值计算公式的流程示意图;Fig. 2 is a schematic flow chart of the calculation formula for determining the deviation value corresponding to the target segmentation interval in multiple segmentation intervals provided by the present invention;
图3是本发明提供的基于原始角度和原始角度与旋转角度之间的偏差值确定偏差值计算公式的流程示意图;Fig. 3 is a schematic flow chart of determining the calculation formula of the deviation value based on the original angle and the deviation value between the original angle and the rotation angle provided by the present invention;
图4是本发明提供的获得磁角度编码器输出的原始角度的流程示意图;Fig. 4 is the flow schematic diagram that obtains the original angle of magnetic angle encoder output provided by the present invention;
图5是本发明提供的获取磁角度编码器对应的旋转磁场形成的正弦信号和余弦信号的流程示意图;Fig. 5 is a schematic flow diagram of obtaining the sine signal and cosine signal formed by the rotating magnetic field corresponding to the magnetic angle encoder provided by the present invention;
图6是本发明提供的磁角度编码器输出的原始角度产生原理示意图;Fig. 6 is a schematic diagram of the original angle generation principle output by the magnetic angle encoder provided by the present invention;
图7是本发明提供的对原始角度曲线进行分段处理获取多个分段区间的流程示意图;Fig. 7 is a schematic flow chart of performing segment processing on the original angle curve to obtain multiple segment intervals provided by the present invention;
图8是本发明提供的原始角度曲线大于旋转角度曲线情况下原始角度与旋转角度之间的偏差示意图;Fig. 8 is a schematic diagram of the deviation between the original angle and the rotation angle when the original angle curve provided by the present invention is greater than the rotation angle curve;
图9是本发明提供的原始角度曲线小于旋转角度曲线情况下原始角度与旋转角度之间的偏差示意图;Fig. 9 is a schematic diagram of the deviation between the original angle and the rotation angle when the original angle curve provided by the present invention is smaller than the rotation angle curve;
图10是本发明提供的原始角度曲线与旋转角度曲线不止有一个重合点的情况下原始角度与旋转角度之间的偏差示意图;Fig. 10 is a schematic diagram of the deviation between the original angle and the rotation angle when the original angle curve and the rotation angle curve provided by the present invention have more than one overlapping point;
图11是本发明提供的磁角度编码器的角度补偿装置的结构示意图;Fig. 11 is a schematic structural view of the angle compensation device of the magnetic angle encoder provided by the present invention;
图12是本发明提供的磁角度编码器的角度补偿装置中的第一确定模块的结构示意图;Fig. 12 is a schematic structural diagram of the first determination module in the angle compensation device of the magnetic angle encoder provided by the present invention;
图13是本发明提供的电子设备的实体结构示意图。Fig. 13 is a schematic diagram of the physical structure of the electronic device provided by the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明中的附图,对本发明中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention , but not all examples. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
在本发明实施例的描述中,需要说明的是,术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本发明的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。In the description of the embodiments of the present invention, it should be noted that terms such as "first" and "second" are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms so used are interchangeable under appropriate circumstances such that embodiments of the invention can be practiced in sequences other than those illustrated or described herein, and references to "first," "second," etc. distinguish Objects are generally of one type, and the number of objects is not limited. For example, there may be one or more first objects.
下面结合附图描述本发明提供的磁角度编码器的角度补偿方法、装置及磁角度编码器。The angle compensation method and device of the magnetic angle encoder and the magnetic angle encoder provided by the present invention will be described below with reference to the accompanying drawings.
图1是本发明提供的磁角度编码器的角度补偿方法的流程示意图,如图1所示,该方法包括:Fig. 1 is the schematic flow chart of the angle compensation method of the magnetic angle encoder provided by the present invention, as shown in Fig. 1, the method comprises:
步骤100,对磁角度编码器输出的各原始角度对应的原始角度曲线进行分段处理,获取多个分段区间;
步骤110,确定多个所述分段区间中的目标分段区间对应的偏差值计算公式,所述偏差值计算公式用于表征所述目标分段区间内的各原始角度和与所述各原始角度相对应的旋转角度之间的偏差,所述目标分段区间为所述多个分段区间中的任意一个分段区间;
步骤120,基于所述目标分段区间对应的偏差值计算公式,确定所述目标分段区间内的各原始角度和与所述各原始角度相对应的旋转角度之间的偏差值;
步骤130,分别基于各所述偏差值,对所述目标分段区间内的各所述原始角度进行补偿。Step 130: Compensate each of the original angles within the target segmentation interval based on each of the deviation values.
具体地,为了克服现有技术在实际安装磁角度编码器时,由于温度、同心度、倾角以及磁铁本身充磁不均匀等原因,使得磁场不均匀,导致磁角度编码器实际检测到的角度线性度变差的缺陷,本发明通过将非线性的原始角度曲线进行分段处理,获取多个分段区间,并确定各分段区间分别对应的偏差值计算公式,进而在每一个分段区间内,基于该分段区间对应的偏差值计算公式确定该分段区间内的各原始角度对应的偏差值,基于各偏差值对该分段内的各原始角度进行补偿,增强了磁角度编码器输出角度的线性化。Specifically, in order to overcome the fact that when the magnetic angle encoder is actually installed in the prior art, due to temperature, concentricity, inclination angle, and uneven magnetization of the magnet itself, the magnetic field is not uniform, resulting in the angle linearity actually detected by the magnetic angle encoder. Due to the defect of degree variation, the present invention obtains multiple segment intervals by segmenting the nonlinear original angle curve, and determines the deviation value calculation formulas corresponding to each segment interval, and then in each segment interval , based on the deviation value calculation formula corresponding to the segment interval, the deviation value corresponding to each original angle in the segment interval is determined, and each original angle in the segment is compensated based on each deviation value, which enhances the output of the magnetic angle encoder Linearization of angles.
可选地,在本发明实施例中,可以先获取磁角度编码器输出的各原始角度,进而对获取的各原始角度进行模拟化处理,以获取各离散的原始角度对应的原始角度曲线。Optionally, in this embodiment of the present invention, each original angle output by the magnetic angle encoder may be acquired first, and then simulated for each acquired original angle, so as to obtain an original angle curve corresponding to each discrete original angle.
可选地,在获取到原始角度曲线之后,可以对原始角度曲线进行分段处理,获取多个分段区间,进而确定多个分段区间中每一个分段区间分别对应的偏差值计算公式,其中多个分段区间中的目标分段区间对应的偏差值计算公式用于表征目标分段区间内的各原始角度和与各原始角度相对应的旋转角度之间的偏差,且目标分段区间为多个分段区间中的任意一个分段区间。Optionally, after the original angle curve is obtained, the original angle curve can be segmented to obtain multiple segment intervals, and then determine the deviation value calculation formula corresponding to each segment interval in the plurality of segment intervals, Among them, the deviation value calculation formula corresponding to the target segmentation interval in multiple segmentation intervals is used to characterize the deviation between each original angle in the target segmentation interval and the rotation angle corresponding to each original angle, and the target segmentation interval is any one of the multiple segment intervals.
可以理解的是,在本发明实施例中,旋转角度指的是磁角度编码器对应的被测对象的旋转角度。It can be understood that, in the embodiment of the present invention, the rotation angle refers to the rotation angle of the measured object corresponding to the magnetic angle encoder.
可以理解的是,磁角度编码器输出的原始角度原理上应该与磁角度编码器对应的被测对象的旋转角度相同,但是由于温度、同心度、倾角以及磁铁本身充磁不均匀等原因,使得磁场不均匀,导致磁角度编码器实际检测到的角度与被测对象的旋转角度之间有偏差。It can be understood that the original angle output by the magnetic angle encoder should be the same as the rotation angle of the measured object corresponding to the magnetic angle encoder in principle, but due to reasons such as temperature, concentricity, inclination, and uneven magnetization of the magnet itself, the The magnetic field is not uniform, resulting in a deviation between the angle actually detected by the magnetic angle encoder and the rotation angle of the measured object.
因此,在本发明实施例中,通过对磁角度编码器输出的各原始角度进行分段补偿,以使得磁角度编码器输出的各原始角度更接近于被测对象的旋转角度。Therefore, in the embodiment of the present invention, each original angle output by the magnetic angle encoder is compensated in sections, so that each original angle output by the magnetic angle encoder is closer to the rotation angle of the measured object.
可以理解的是,在本发明实施例中,目标分段区间为多个分段区间中的任意一个分段区间。It can be understood that, in this embodiment of the present invention, the target segmentation interval is any one of the multiple segmentation intervals.
可选地,在确定各分段区间对应的偏差值计算公式之后,可以基于各分段区间对应的偏差值计算公式,分别确定各分段区间内的各原始角度和与各原始角度相对应的旋转角度之间的偏差值。Optionally, after determining the deviation value calculation formula corresponding to each segment interval, each original angle in each segment interval and the angle corresponding to each original angle can be determined based on the deviation value calculation formula corresponding to each segment interval. Bias value between rotation angles.
可选地,在确定各分段区间内的各原始角度对应的偏差值之后,可以基于计算的各偏差值,对各分段区间内的各原始角度进行补偿。Optionally, after the deviation values corresponding to the original angles in each segment interval are determined, the original angles in each segment interval may be compensated based on the calculated deviation values.
本发明提供的磁角度编码器的角度补偿方法,通过将非线性的原始角度曲线进行分段处理,获取多个分段区间,并确定各分段区间分别对应的偏差值计算公式,进而在每一个分段区间内,基于该分段区间对应的偏差值计算公式确定该分段区间内的各原始角度对应的偏差值,基于各偏差值对该分段内的各原始角度进行补偿,增强了磁角度编码器输出角度的线性化。The angle compensation method of the magnetic angle encoder provided by the present invention obtains a plurality of segmental intervals by segmenting the nonlinear original angle curve, and determines the calculation formula of the deviation value corresponding to each segmental interval, and then in each In a segment interval, the deviation value corresponding to each original angle in the segment interval is determined based on the deviation value calculation formula corresponding to the segment interval, and each original angle in the segment is compensated based on each deviation value, which enhances the Linearization of the output angle of a magnetic angle encoder.
可选地,图2是本发明提供的确定多个分段区间中的目标分段区间对应的偏差值计算公式的流程示意图,如图2所示,所述确定多个所述分段区间中的目标分段区间对应的偏差值计算公式,包括:Optionally, FIG. 2 is a schematic flow chart of the calculation formula for determining the deviation value corresponding to the target segmentation interval in multiple segmentation intervals provided by the present invention. As shown in FIG. 2 , the determination of the multiple segmentation intervals The deviation value calculation formula corresponding to the target segmentation interval of , including:
步骤200,确定所述目标分段区间的起始点对应的第一原始角度,以及与所述第一原始角度相对应的第一旋转角度,并确定所述目标分段区间的结束点对应的第二原始角度,以及与所述第二原始角度相对应的第二旋转角度;
步骤210,基于所述第一原始角度、所述第一旋转角度、所述第二原始角度和所述第二旋转角度,确定所述目标分段区间对应的所述偏差值计算公式。
具体地,在本发明实施例中,对于多个分段区间中的目标分段区间,可以首先确定目标分段区间的起始点对应的第一原始角度,以及与第一原始角度相对应的第一旋转角度,并且确定目标分段区间的结束点对应的第二原始角度,以及与第二原始角度相对应的第二旋转角度,进而基于第一原始角度、第一旋转角度、第二原始角度和第二旋转角度,确定目标分段区间对应的偏差值计算公式。Specifically, in this embodiment of the present invention, for a target segment interval among multiple segment intervals, the first original angle corresponding to the starting point of the target segment interval, and the first original angle corresponding to the first original angle can be determined first. A rotation angle, and determine the second original angle corresponding to the end point of the target segmentation interval, and the second rotation angle corresponding to the second original angle, and then based on the first original angle, the first rotation angle, and the second original angle and the second rotation angle to determine a deviation value calculation formula corresponding to the target segmentation interval.
可以理解的是,在本发明实施例中,通过基于各分段区间的起始点对应的第一原始角度、与第一原始角度相对应的第一旋转角度、各分段区间的结束点对应的第二原始角度,以及与第二原始角度相对应的第二旋转角度,确定各个分段区间对应的偏差值计算公式;即通过基于各分段区间内原始角度与旋转角度之间的线性相关性,分别确定各分段区间各自对应的偏差值计算公式,再基于各分段区间各自对应的偏差值计算公式确定各分段区间内的各原始角度对应的偏差值,可以提高偏差值计算的准确性,进而实现对各原始角度的精确补偿,增强磁角度编码器输出角度的线性化。It can be understood that, in the embodiment of the present invention, based on the first original angle corresponding to the starting point of each segmented interval, the first rotation angle corresponding to the first original angle, and the angle corresponding to the end point of each segmented interval The second original angle, and the second rotation angle corresponding to the second original angle, determine the calculation formula of the deviation value corresponding to each segment interval; that is, based on the linear correlation between the original angle and the rotation angle in each segment interval , respectively determine the deviation value calculation formulas corresponding to each segment interval, and then determine the deviation value corresponding to each original angle in each segment interval based on the deviation value calculation formula corresponding to each segment interval, which can improve the accuracy of deviation value calculation In turn, the precise compensation of each original angle can be realized, and the linearization of the output angle of the magnetic angle encoder can be enhanced.
可选地,图3是本发明提供的基于原始角度和原始角度与旋转角度之间的偏差值确定偏差值计算公式的流程示意图,如图3所示,所述基于所述第一原始角度、所述第一旋转角度、所述第二原始角度和所述第二旋转角度,确定所述目标分段区间对应的所述偏差值计算公式,包括:Optionally, FIG. 3 is a schematic flow chart of determining a deviation value calculation formula based on the original angle and the deviation value between the original angle and the rotation angle provided by the present invention. As shown in FIG. 3 , the first original angle, The first rotation angle, the second original angle, and the second rotation angle determine the deviation value calculation formula corresponding to the target segmentation interval, including:
步骤300,确定所述第一原始角度和所述第一旋转角度之间的第一偏差值,并确定所述第二原始角度和所述第二旋转角度之间的第二偏差值;
步骤310,基于所述第一原始角度、所述第一偏差值、所述第二原始角度和所述第二偏差值,确定所述目标分段区间对应的偏差值计算公式。
具体地,在本发明实施例中,在确定出目标分段区间的第一原始角度,以及与第一原始角度相对应的第一旋转角度之后,可以确定第一原始角度和第一旋转角度之间的第一偏差值,并且,在确定出目标分段区间的第二原始角度,以及与第二原始角度相对应的第二旋转角度之后,可以确定第二原始角度和第二旋转角度之间的第二偏差值,进而基于第一原始角度、第一偏差值、第二原始角度和第二偏差值,确定目标分段区间对应的偏差值计算公式。Specifically, in this embodiment of the present invention, after determining the first original angle of the target segmentation interval and the first rotation angle corresponding to the first original angle, the difference between the first original angle and the first rotation angle can be determined. Between the first deviation value, and, after determining the second original angle of the target segmentation interval, and the second rotation angle corresponding to the second original angle, the distance between the second original angle and the second rotation angle can be determined The second deviation value, and then based on the first original angle, the first deviation value, the second original angle and the second deviation value, determine the deviation value calculation formula corresponding to the target segmentation interval.
可选地,所述目标分段区间对应的偏差值计算公式为:Optionally, the formula for calculating the deviation value corresponding to the target segmentation interval is:
其中,θ表示所述目标分段区间内的原始角度;Δ表示所述目标分段区间内的原始角度θ和与θ对应的旋转角度之间的偏差值;θN-1表示所述第一原始角度;θN表示所述第二原始角度;ΔN-1表示所述第一偏差值;ΔN表示所述第二偏差值;N表示所述目标分段区间的索引号。Among them, θ represents the original angle in the target segmentation interval; Δ represents the deviation value between the original angle θ in the target segmentation interval and the rotation angle corresponding to θ; θ N-1 represents the first Original angle; θ N represents the second original angle; Δ N-1 represents the first deviation value; Δ N represents the second deviation value; N represents the index number of the target segmentation interval.
具体地,在本发明实施例中,在目标分段区间内,可以基于偏差值计算公式计算目标分段区间内的各原始角度对应的偏差值Δ,进而基于计算出的偏差值Δ对原始角度进行补偿。Specifically, in the embodiment of the present invention, within the target segmentation interval, the deviation value can be calculated based on the formula The deviation value Δ corresponding to each original angle in the target segmentation interval is calculated, and then the original angle is compensated based on the calculated deviation value Δ.
可选地,图4是本发明提供的获得磁角度编码器输出的原始角度的流程示意图,如图4所示,在所述对磁角度编码器输出的各原始角度对应的原始角度曲线进行分段处理,获取多个分段区间之前,所述方法还包括:Optionally, Fig. 4 is a schematic flow chart of obtaining the original angle output by the magnetic angle encoder provided by the present invention. As shown in Fig. 4, the original angle curve corresponding to each original angle output by the magnetic angle encoder is analyzed. Segment processing, before obtaining a plurality of segmentation intervals, the method also includes:
步骤400,获取所述磁角度编码器对应的旋转磁场形成的正弦信号和余弦信号;
步骤410,获取所述正弦信号和所述余弦信号分别对应的数字信号;
步骤420,对所述正弦信号和所述余弦信号分别对应的数字信号进行反正切处理,获得所述磁角度编码器输出的原始角度。
具体地,在本发明实施例中,在对磁角度编码器输出的各原始角度对应的原始角度曲线进行分段处理,获取多个分段区间之前,可以先通过如下步骤获取磁角度编码器输出的各原始角度:Specifically, in the embodiment of the present invention, before the original angle curves corresponding to the original angles output by the magnetic angle encoder are segmented to obtain multiple segmented intervals, the output of the magnetic angle encoder can be obtained through the following steps: Each original angle of :
步骤1:获取磁角度编码器对应的旋转磁场形成的正弦信号和余弦信号;Step 1: Obtain the sine signal and cosine signal formed by the rotating magnetic field corresponding to the magnetic angle encoder;
步骤2:获取正弦信号和余弦信号分别对应的数字信号;Step 2: Obtain the digital signals corresponding to the sine signal and the cosine signal respectively;
步骤3:对获取的正弦信号和余弦信号分别对应的数字信号进行反正切处理,获得磁角度编码器输出的原始角度。Step 3: Perform arctangent processing on the digital signals respectively corresponding to the acquired sine signal and cosine signal, to obtain the original angle output by the magnetic angle encoder.
可选地,在本发明实施例中,可以通过模数转换器(Analog-to-DigitalConverter,ADC)将正弦信号和余弦信号分别转换为数字信号。Optionally, in this embodiment of the present invention, the sine signal and the cosine signal may be respectively converted into digital signals by using an analog-to-digital converter (Analog-to-Digital Converter, ADC).
可以理解的是,在通过上述方式获取到磁角度编码器输出的各原始角度之后,进而可以对获取的各原始角度进行模拟化处理,以获取各离散的原始角度对应的原始角度曲线。It can be understood that, after obtaining the original angles output by the magnetic angle encoder in the above manner, the obtained original angles can be simulated to obtain the original angle curves corresponding to the discrete original angles.
可选地,图5是本发明提供的获取磁角度编码器对应的旋转磁场形成的正弦信号和余弦信号的流程示意图,如图5所示,所述获取所述磁角度编码器对应的旋转磁场形成的正弦信号和余弦信号,包括:Optionally, FIG. 5 is a schematic flow chart of obtaining the sine signal and cosine signal formed by the rotating magnetic field corresponding to the magnetic angle encoder provided by the present invention. As shown in FIG. 5 , the obtaining of the rotating magnetic field corresponding to the magnetic angle encoder Formed sine and cosine signals, including:
步骤500,采用至少两个霍尔元件分别检测所述旋转磁场的变化,获取第一霍尔电压信号和第二霍尔电压信号;
步骤510,采用预处理电路,对所述第一霍尔电压信号和所述第二霍尔电压信号分别进行预处理,获取所述磁角度编码器对应的旋转磁场形成的正弦信号和余弦信号。
具体地,在本发明实施例中,可以采用至少两个霍尔元件分别检测磁角度编码器对应的旋转磁场的变化,以此获取第一霍尔电压信号和第二霍尔电压信号,进而采用预处理电路对第一霍尔电压信号和第二霍尔电压信号进行预处理,即可获取到磁角度编码器对应的旋转磁场形成的正弦信号和余弦信号。Specifically, in the embodiment of the present invention, at least two Hall elements can be used to respectively detect the change of the rotating magnetic field corresponding to the magnetic angle encoder, so as to obtain the first Hall voltage signal and the second Hall voltage signal, and then use The preprocessing circuit preprocesses the first Hall voltage signal and the second Hall voltage signal to obtain the sine signal and cosine signal formed by the rotating magnetic field corresponding to the magnetic angle encoder.
可以理解的是,通过霍尔元件直接获取到的霍尔电压信号是微弱的正弦信号和余弦信号,则在本发明实施例中,可以通过预处理电路放大霍尔电压信号以及消除霍尔失调电压信号得到较为理想的正弦信号和余弦信号。It can be understood that the Hall voltage signal obtained directly by the Hall element is a weak sine signal and a cosine signal, then in the embodiment of the present invention, the Hall voltage signal can be amplified and the Hall offset voltage can be eliminated by the preprocessing circuit The signal is more ideal sine signal and cosine signal.
可选地,图6是本发明提供的磁角度编码器输出的原始角度产生原理示意图,如图6所示,两路Hall(霍尔元件)610通过检测旋转磁场的变化输出微弱的正弦信号和余弦信号,然后通过预处理电路620放大霍尔信号以及消除霍尔失调电压得到较为理想的正弦信号和余弦信号,进而通过ADC(模数转换器)630将正弦信号和余弦信号转换成数字信号,最后数字信号经过arctan电路(反正切电路)640进行反正切运算得到磁角度编码器输出的原始角度θ。Optionally, Fig. 6 is a schematic diagram of the original angle generation principle output by the magnetic angle encoder provided by the present invention. As shown in Fig. 6, two-way Hall (Hall elements) 610 output weak sinusoidal signals and cosine signal, and then through the
可选地,图7是本发明提供的对原始角度曲线进行分段处理获取多个分段区间的流程示意图,如图7所示,所述对磁角度编码器输出的各原始角度对应的原始角度曲线进行分段处理,获取多个分段区间,包括:Optionally, Fig. 7 is a schematic flow chart of segmenting the original angle curve to obtain a plurality of segmented intervals provided by the present invention. As shown in Fig. 7, the original angle corresponding to each original angle output by the magnetic angle encoder The angle curve is segmented to obtain multiple segment intervals, including:
步骤700,获取与所述原始角度曲线相对应的旋转角度曲线;
步骤710,对所述旋转角度曲线进行均分处理,获得均分处理之后的所述旋转角度曲线上各分割点对应的角度值;
步骤720,基于所述旋转角度曲线上各分割点对应的角度值,对所述原始角度曲线进行分段处理,获取所述多个分段区间。Step 720: Based on the angle values corresponding to the division points on the rotation angle curve, segment the original angle curve to obtain the plurality of segment intervals.
具体地,在本发明实施例中,为了对磁角度编码器输出的各原始角度对应的原始角度曲线进行分段处理,获取多个分段区间,可以在获取到磁角度编码器输出的各原始角度对应的原始角度曲线之后,获取与原始角度曲线相对应的旋转角度曲线,进而对旋转角度曲线进行均分处理,获得均分处理之后的旋转角度曲线上各分割点对应的角度值,进一步基于旋转角度曲线上各分割点对应的角度值,对原始角度曲线进行分段处理,获取多个分段区间。Specifically, in the embodiment of the present invention, in order to segment the original angle curves corresponding to the original angles output by the magnetic angle encoder and obtain multiple segmented intervals, each original angle output by the magnetic angle encoder can be acquired After the original angle curve corresponding to the angle, the rotation angle curve corresponding to the original angle curve is obtained, and then the rotation angle curve is averaged, and the angle value corresponding to each segmentation point on the rotation angle curve after the average processing is obtained, further based on Rotate the angle value corresponding to each segmentation point on the angle curve, perform segment processing on the original angle curve, and obtain multiple segment intervals.
可以理解的是,在本发明实施例中,在对旋转角度曲线进行均分处理之后,可以获得均分处理之后的旋转角度曲线上各分割点对应的旋转角度值,然后基于旋转角度曲线上各分割点对应的旋转角度值,确定各分割点对应的原始角度值,进而基于各分割点对应的原始角度值,对原始角度曲线进行分段处理,获取多个分段区间。It can be understood that, in the embodiment of the present invention, after the average division process is performed on the rotation angle curve, the rotation angle value corresponding to each division point on the rotation angle curve after the equal division process can be obtained, and then based on each division point on the rotation angle curve The rotation angle value corresponding to the division point is determined to determine the original angle value corresponding to each division point, and then based on the original angle value corresponding to each division point, the original angle curve is segmented to obtain multiple segment intervals.
具体地,本发明实施例提供的磁角度编码器的角度补偿方法,可以包括如下步骤:Specifically, the angle compensation method of the magnetic angle encoder provided in the embodiment of the present invention may include the following steps:
步骤一:通过图6所示的电路获取磁角度编码器输出的各原始角度,进而获取各原始角度对应的原始角度曲线;Step 1: Obtain each original angle output by the magnetic angle encoder through the circuit shown in Figure 6, and then obtain the original angle curve corresponding to each original angle;
步骤二:获取原始角度曲线对应的旋转角度曲线,并将旋转角度曲线均分为N段,分割点记为α1,α2…αN-1,αN;其中αN所对应的磁角度编码器输出的原始角度记为θN;Step 2: Obtain the rotation angle curve corresponding to the original angle curve, and divide the rotation angle curve into N segments, and the division points are recorded as α 1 , α 2 ... α N-1 , α N ; where the magnetic angle corresponding to α N The original angle output by the encoder is denoted as θ N ;
可以理解的是,将旋转角度曲线均分为N段之后,对应的原始角度曲线也被分为N段,分割点记为θ1,θ2…θN-1,θN,其中θ1,θ2…θN-1,θN分别与α1,α2…αN-1,αN一一对应。It can be understood that after the rotation angle curve is divided into N segments, the corresponding original angle curve is also divided into N segments, and the division points are recorded as θ 1 , θ 2 ... θ N-1 , θ N , where θ 1 , θ 2 ... θ N-1 , θ N are in one-to-one correspondence with α 1 , α 2 ... α N-1 , α N respectively.
步骤三:计算各分割点处原始角度与旋转角度之间的偏差值,其中ΔN=θN-αN;Step 3: Calculate the deviation value between the original angle and the rotation angle at each division point, where Δ N =θ N -α N ;
步骤四:对于磁角度编码器输出的各原始角度中的任意一个原始角度,判断该原始角度所属的分段区间,基于该分段区间对应的偏差值计算公式计算该原始角度对应的角度误差,并基于计算得出的角度误差对该原始角度进行补偿,其中,目标分段区间的偏差值计算公式为:Step 4: For any one of the original angles output by the magnetic angle encoder, determine the subsection interval to which the original angle belongs, and calculate the angle error corresponding to the original angle based on the deviation value calculation formula corresponding to the subsection interval, The original angle is compensated based on the calculated angle error, where the formula for calculating the deviation value of the target segment interval is:
基于公式θout=θ-Δ对原始角度θ进行补偿,补偿后的角度为θout。The original angle θ is compensated based on the formula θ out =θ-Δ, and the compensated angle is θ out .
可以理解的是,在本发明实施例中,随着N的增大,补偿后的角度输出曲线的线性度越强,但同时所需要的计算量也就越大。It can be understood that, in the embodiment of the present invention, as N increases, the linearity of the compensated angle output curve is stronger, but at the same time, the required calculation amount is also larger.
图8是本发明提供的原始角度曲线大于旋转角度曲线情况下原始角度与旋转角度之间的偏差示意图,如图8所示,坐标轴横坐标表示旋转角度值,纵坐标表示磁角度编码器经过反正切算法得到的原始角度值,理想情况下,旋转角度值与原始角度值应该相同,但由于在实际安装中,温度,同心度,倾角,磁铁本身充磁不均匀等原因,使得磁场不均匀,导致磁角度编码器实际检测到的角度值与旋转角度值有偏差。Fig. 8 is a schematic diagram of the deviation between the original angle and the rotation angle under the condition that the original angle curve provided by the present invention is greater than the rotation angle curve. The original angle value obtained by the arctangent algorithm, ideally, the rotation angle value should be the same as the original angle value, but due to the actual installation, temperature, concentricity, inclination angle, uneven magnetization of the magnet itself, etc., the magnetic field is not uniform , resulting in a deviation between the angle value actually detected by the magnetic angle encoder and the rotation angle value.
因此,为了克服上述缺陷,在本发明实施例中,首先对旋转角度值均匀分成N段,记为α1,α2…αN-1,αN;其中αN所对应的磁角度编码器输出的原始角度记为θN,记原始输出角度θN与旋转角度αN的差值为ΔN;其中ΔN=θN-αN,N为正整数(例如:Δ1=θ1-α1,Δ2=θ2-α2);假设所测原始角度为θ,此时对应的旋转角度值为α,差值Δ=θ-α;因此最终补偿后的输出角度为θout,其中θout=θ-Δ。Therefore, in order to overcome the above defects, in the embodiment of the present invention, firstly, the rotation angle value is evenly divided into N segments, which are denoted as α 1 , α 2 ... α N-1 , α N ; where the magnetic angle encoder corresponding to α N The output original angle is recorded as θ N , and the difference between the original output angle θ N and the rotation angle α N is Δ N ; where Δ N =θ N -α N , and N is a positive integer (for example: Δ 1 =θ 1 - α 1 , Δ 2 = θ 2 -α 2 ); assuming that the measured original angle is θ, the corresponding rotation angle value is α, and the difference Δ=θ-α; therefore, the final output angle after compensation is θ out , where θ out =θ-Δ.
如图8所示,曲线中除了点α1,α2…αN-1,αN所对应的差值Δ1,Δ2…ΔN-1,ΔN是已知的,在每个区间内各点所对应的差值都是未知的,因此需要一个公式计算各点的差值。As shown in Figure 8, except for points α 1 , α 2 ... α N-1 , the difference Δ 1 , Δ 2 ... Δ N-1 , Δ N corresponding to α N in the curve is known, in each interval The difference corresponding to each point in is unknown, so a formula is needed to calculate the difference of each point.
假设计算θ1至θ2区间内各点的差值,首先Δ1,Δ2已知,θ1,θ2之间的角度差为θ2-θ1,差值之间的变化为Δ2-Δ1;假设差值之间的变化是线性的,则在θ1至θ2区间内,角度每变化一度,那么该角度所对应的差值就会变化度,因此在θ1至θ2区间内各点θ所对应的差值Δ可由如下公式推得:Assuming to calculate the difference of each point in the interval from θ 1 to θ 2 , firstly Δ 1 and Δ 2 are known, the angle difference between θ 1 and θ 2 is θ 2 - θ 1 , and the change between the differences is Δ 2 -Δ 1 ; assuming that the change between the differences is linear, then within the range of θ 1 to θ 2 , every time the angle changes by one degree, the difference corresponding to the angle will change degree, so the difference Δ corresponding to each point θ in the interval from θ 1 to θ 2 can be deduced by the following formula:
同理可以证明得到,在θ2至θ3区间内各点θ所对应的差值Δ符合如下公式:In the same way, it can be proved that the difference Δ corresponding to each point θ in the interval from θ 2 to θ 3 conforms to the following formula:
因此,在任意θN-1至θN区间内各点所对应的误差Δ可由如下公式计算得到:Therefore, the error Δ corresponding to each point in any interval from θ N-1 to θ N can be calculated by the following formula:
因此,对非线性角度曲线进行线性化后各点的输出值θout由如下公式计算得到:Therefore, the output value θ out of each point after linearizing the nonlinear angle curve is calculated by the following formula:
θout=θ-Δθ out = θ - Δ
图9是本发明提供的原始角度曲线小于旋转角度曲线情况下原始角度与旋转角度之间的偏差示意图,如图9所示,在原始角度曲线小于旋转角度曲线情况下,各点的误差值Δ小于零(例如:Δ1=θ1-α1,Δ2=θ2-α2,ΔN=θN-αN),表征经过磁角度编码器反正切算法后输出的角度比真实的旋转角度值小,因此Δ为负值,此时根据公式θout=θ-Δ可知,最终输出的角度值θout会变大。Fig. 9 is a schematic diagram of the deviation between the original angle and the rotation angle when the original angle curve is smaller than the rotation angle curve provided by the present invention. As shown in Fig. 9, when the original angle curve is smaller than the rotation angle curve, the error value Δ of each point Less than zero (for example: Δ 1 = θ 1 - α 1 , Δ 2 = θ 2 - α 2 , Δ N = θ N - α N ), indicating that the output angle ratio of the magnetic angle encoder arc tangent algorithm is higher than the real rotation The angle value is small, so Δ is a negative value. At this time, according to the formula θ out = θ-Δ, it can be seen that the final output angle value θ out will become larger.
图10是本发明提供的原始角度曲线与旋转角度曲线不止有一个重合点的情况下原始角度与旋转角度之间的偏差示意图,如图10所示,对于相邻误差值Δ具有不同极性的情况,本发明实施例提供的磁角度编码器的角度补偿方法同样适用,且在此区间内的各点误差值也可由公式计算得出。Fig. 10 is a schematic diagram of the deviation between the original angle and the rotation angle when the original angle curve and the rotation angle curve provided by the present invention have more than one overlapping point. As shown in Fig. 10, for adjacent error values Δ with different polarities situation, the angle compensation method of the magnetic angle encoder provided by the embodiment of the present invention is also applicable, and the error value of each point in this interval can also be calculated by the formula Calculated.
可以理解的是,在本发明实施例中,差值Δ可以为正值,也可以为负值;当Δ为正值时,表征原始输出角度过大,需要对其补偿负值角度;而当Δ为负值时,表征原始输出角度过小,需要对其补偿正值角度使之输出角度变大。It can be understood that, in the embodiment of the present invention, the difference Δ can be a positive value or a negative value; when Δ is a positive value, it indicates that the original output angle is too large and needs to be compensated for a negative angle; and when When Δ is a negative value, it means that the original output angle is too small, and it is necessary to compensate the positive angle to make the output angle larger.
可以理解的是,本发明实施例提供的磁角度编码器的角度补偿方法,其具体原理是:通过两组线性霍尔单元采集磁角度编码器对应的旋转磁场形成的正弦和余弦信号,将采集到的正弦和余弦信号经过ADC转换为数字信号,进而经过数字反正切处理,输出原始角度;然后通过对原始角度对应的原始角度曲线进行分段,在每个分段内,首先计算分段处原始角度与旋转角度值的偏差,进而预测该段内任意原始角度与旋转角度值的偏差,从而实现对非线性角度的补偿,解决了磁角度编码器在实际安装中,由于温度、同心度、倾角和磁铁本身充磁不均匀等原因,使得磁场不均匀,导致磁角度编码器实际检测到的角度线性度变差的难题。It can be understood that, the angle compensation method of the magnetic angle encoder provided by the embodiment of the present invention, its specific principle is: the sine and cosine signals formed by the rotating magnetic field corresponding to the magnetic angle encoder are collected by two sets of linear Hall units, and the collected The received sine and cosine signals are converted into digital signals by ADC, and then processed by digital arctangent to output the original angle; then, by segmenting the original angle curve corresponding to the original angle, in each segment, first calculate the segment position The deviation between the original angle and the rotation angle value, and then predict the deviation between any original angle and the rotation angle value in this section, so as to realize the compensation for the nonlinear angle, and solve the problem of the magnetic angle encoder in the actual installation due to temperature, concentricity, The inclination angle and the uneven magnetization of the magnet itself make the magnetic field uneven, which leads to the problem that the linearity of the angle actually detected by the magnetic angle encoder becomes worse.
可以理解的是,本发明实施例提供的磁角度编码器的角度补偿方法,在用户端的实现简单,需要修调的参数较少,对于非线性输出曲线具有较好的矫正效果,且该方法的可拓展性和可移植性强,适用于任何对非线性曲线进行矫正的场景。It can be understood that the angle compensation method of the magnetic angle encoder provided by the embodiment of the present invention is simple to implement at the user end, requires fewer parameters to be adjusted, and has a better correction effect on the nonlinear output curve, and the method's It has strong scalability and portability, and is suitable for any scene where nonlinear curves are corrected.
本发明提供的磁角度编码器的角度补偿方法,通过将非线性的原始角度曲线进行分段处理,获取多个分段区间,并确定各分段区间分别对应的偏差值计算公式,进而在每一个分段区间内,基于该分段区间对应的偏差值计算公式确定该分段区间内的各原始角度对应的偏差值,基于各偏差值对该分段内的各原始角度进行补偿,增强了磁角度编码器输出角度的线性化。The angle compensation method of the magnetic angle encoder provided by the present invention obtains a plurality of segmental intervals by segmenting the nonlinear original angle curve, and determines the calculation formula of the deviation value corresponding to each segmental interval, and then in each In a segment interval, the deviation value corresponding to each original angle in the segment interval is determined based on the deviation value calculation formula corresponding to the segment interval, and each original angle in the segment is compensated based on each deviation value, which enhances the Linearization of the output angle of a magnetic angle encoder.
下面对本发明提供的磁角度编码器的角度补偿装置进行描述,下文描述的磁角度编码器的角度补偿装置与上文描述的磁角度编码器的角度补偿方法可相互对应参照。The angle compensation device for the magnetic angle encoder provided by the present invention is described below, and the angle compensation device for the magnetic angle encoder described below and the angle compensation method for the magnetic angle encoder described above can be referred to in correspondence.
图11是本发明提供的磁角度编码器的角度补偿装置的结构示意图,如图11所示,该装置包括:获取模块1110、第一确定模块1120、第二确定模块1130和补偿模块1140;其中:Fig. 11 is a schematic structural diagram of the angle compensation device of the magnetic angle encoder provided by the present invention. As shown in Fig. 11, the device includes: an
获取模块1110用于对磁角度编码器输出的各原始角度对应的原始角度曲线进行分段处理,获取多个分段区间;The
第一确定模块1120与所述获取模块1110连接,用于确定多个所述分段区间中的目标分段区间对应的偏差值计算公式,所述偏差值计算公式用于表征所述目标分段区间内的各原始角度和与所述各原始角度相对应的旋转角度之间的偏差,所述目标分段区间为所述多个分段区间中的任意一个分段区间;The
第二确定模块1130与所述第一确定模块1120连接,用于基于所述目标分段区间对应的偏差值计算公式,确定所述目标分段区间内的各原始角度和与所述各原始角度相对应的旋转角度之间的偏差值;The
补偿模块1140与所述第二确定模块1130连接,用于分别基于各所述偏差值,对所述目标分段区间内的各所述原始角度进行补偿。The
本发明提供的磁角度编码器的角度补偿装置,通过将非线性的原始角度曲线进行分段处理,获取多个分段区间,并确定各分段区间分别对应的偏差值计算公式,进而在每一个分段区间内,基于该分段区间对应的偏差值计算公式确定该分段区间内的各原始角度对应的偏差值,基于各偏差值对该分段内的各原始角度进行补偿,增强了磁角度编码器输出角度的线性化。The angle compensation device of the magnetic angle encoder provided by the present invention obtains a plurality of segmental intervals by segmenting the nonlinear original angle curve, and determines the calculation formula of the deviation value corresponding to each segmental interval, and then in each In a segment interval, the deviation value corresponding to each original angle in the segment interval is determined based on the deviation value calculation formula corresponding to the segment interval, and each original angle in the segment is compensated based on each deviation value, which enhances the Linearization of the output angle of a magnetic angle encoder.
可选地,图12是本发明提供的磁角度编码器的角度补偿装置中的第一确定模块的结构示意图,如图12所示,所述第一确定模块1120包括:Optionally, FIG. 12 is a schematic structural diagram of the first determination module in the angle compensation device of the magnetic angle encoder provided by the present invention. As shown in FIG. 12 , the
第一子模块1210,用于确定所述目标分段区间的起始点对应的第一原始角度,以及与所述第一原始角度相对应的第一旋转角度,并确定所述目标分段区间的结束点对应的第二原始角度,以及与所述第二原始角度相对应的第二旋转角度;The first sub-module 1210 is configured to determine the first original angle corresponding to the starting point of the target segmentation interval, and the first rotation angle corresponding to the first original angle, and determine the target segmentation interval a second original angle corresponding to the end point, and a second rotation angle corresponding to the second original angle;
第二子模块1220,与所述第一子模块1210连接,用于基于所述第一原始角度、所述第一旋转角度、所述第二原始角度和所述第二旋转角度,确定所述目标分段区间对应的所述偏差值计算公式。The
可选地,所述第二子模块1220包括:Optionally, the
偏差值确定模块,用于确定所述第一原始角度和所述第一旋转角度之间的第一偏差值,并确定所述第二原始角度和所述第二旋转角度之间的第二偏差值;A deviation value determining module, configured to determine a first deviation value between the first original angle and the first rotation angle, and determine a second deviation between the second original angle and the second rotation angle value;
偏差值计算公式确定模块,与所述偏差值确定模块连接,用于基于所述第一原始角度、所述第一偏差值、所述第二原始角度和所述第二偏差值,确定所述目标分段区间对应的所述偏差值计算公式。A deviation value calculation formula determination module, connected to the deviation value determination module, for determining the The formula for calculating the deviation value corresponding to the target segmentation interval.
可选地,所述目标分段区间对应的偏差值计算公式为:Optionally, the formula for calculating the deviation value corresponding to the target segmentation interval is:
其中,θ表示所述目标分段区间内的原始角度;Δ表示所述目标分段区间内的原始角度θ和与θ对应的旋转角度之间的偏差值;θN-1表示所述第一原始角度;θN表示所述第二原始角度;ΔN-1表示所述第一偏差值;ΔN表示所述第二偏差值;N表示所述目标分段区间的索引号。Among them, θ represents the original angle in the target segmentation interval; Δ represents the deviation value between the original angle θ in the target segmentation interval and the rotation angle corresponding to θ; θ N-1 represents the first Original angle; θ N represents the second original angle; Δ N-1 represents the first deviation value; Δ N represents the second deviation value; N represents the index number of the target segmentation interval.
可选地,所述装置还包括:Optionally, the device also includes:
正余弦信号获取模块:用于在所述对磁角度编码器输出的各原始角度对应的原始角度曲线进行分段处理,获取多个分段区间之前,获取所述磁角度编码器对应的旋转磁场形成的正弦信号和余弦信号;Sine and cosine signal acquisition module: used to segment the original angle curve corresponding to each original angle output by the magnetic angle encoder, and obtain the rotating magnetic field corresponding to the magnetic angle encoder before obtaining a plurality of segmented intervals The sine and cosine signals formed;
数字信号获取模块,与所述正余弦信号获取模块连接,用于获取所述正弦信号和所述余弦信号分别对应的数字信号;A digital signal acquisition module, connected to the sine and cosine signal acquisition module, for acquiring digital signals respectively corresponding to the sine signal and the cosine signal;
反正切处理处理模块,与所述数字信号获取模块连接,用于对所述正弦信号和所述余弦信号分别对应的数字信号进行反正切处理,获得所述磁角度编码器输出的原始角度。The arctangent processing module is connected with the digital signal acquisition module, and is used to perform arctangent processing on the digital signals respectively corresponding to the sine signal and the cosine signal, so as to obtain the original angle output by the magnetic angle encoder.
可选地,所述正余弦信号获取模块包括:Optionally, the sine-cosine signal acquisition module includes:
霍尔检测模块,用于采用至少两个霍尔元件分别检测所述旋转磁场的变化,获取第一霍尔电压信号和第二霍尔电压信号;A Hall detection module, configured to use at least two Hall elements to respectively detect changes in the rotating magnetic field, and obtain a first Hall voltage signal and a second Hall voltage signal;
预处理模块,与所述霍尔检测模块连接,用于采用预处理电路,对所述第一霍尔电压信号和所述第二霍尔电压信号分别进行预处理,获取所述磁角度编码器对应的旋转磁场形成的正弦信号和余弦信号。A preprocessing module, connected to the Hall detection module, is used to use a preprocessing circuit to preprocess the first Hall voltage signal and the second Hall voltage signal respectively to obtain the magnetic angle encoder Corresponding to the sine and cosine signals formed by the rotating magnetic field.
可选地,所述获取模块1110包括:Optionally, the obtaining
旋转角度曲线获取模块,用于获取与所述原始角度曲线相对应的旋转角度曲线;A rotation angle curve acquisition module, configured to acquire a rotation angle curve corresponding to the original angle curve;
均分处理模块,与所述旋转角度曲线获取模块连接,用于对所述旋转角度曲线进行均分处理,获得均分处理之后的所述旋转角度曲线上各分割点对应的角度值;The equalization processing module is connected with the acquisition module of the rotation angle curve, and is used to perform equalization processing on the rotation angle curve, and obtain the angle value corresponding to each division point on the rotation angle curve after the equalization processing;
分段处理模块,与所述均分处理模块连接,用于基于所述旋转角度曲线上各分割点对应的角度值,对所述原始角度曲线进行分段处理,获取所述多个分段区间。A segmentation processing module, connected to the equalization processing module, for performing segmentation processing on the original angle curve based on the angle value corresponding to each segmentation point on the rotation angle curve, and obtaining the plurality of segmentation intervals .
本发明提供的磁角度编码器的角度补偿装置,通过将非线性的原始角度曲线进行分段处理,获取多个分段区间,并确定各分段区间分别对应的偏差值计算公式,进而在每一个分段区间内,基于该分段区间对应的偏差值计算公式确定该分段区间内的各原始角度对应的偏差值,基于各偏差值对该分段内的各原始角度进行补偿,增强了磁角度编码器输出角度的线性化。The angle compensation device of the magnetic angle encoder provided by the present invention obtains a plurality of segmental intervals by segmenting the nonlinear original angle curve, and determines the calculation formula of the deviation value corresponding to each segmental interval, and then in each In a segment interval, the deviation value corresponding to each original angle in the segment interval is determined based on the deviation value calculation formula corresponding to the segment interval, and each original angle in the segment is compensated based on each deviation value, which enhances the Linearization of the output angle of a magnetic angle encoder.
在此需要说明的是,本发明实施例提供的上述磁角度编码器的角度补偿装置,能够实现上述磁角度编码器的角度补偿方法实施例所实现的所有方法步骤,且能够达到相同的技术效果,在此不再对本实施例中与方法实施例相同的部分及有益效果进行具体赘述。It should be noted here that the above-mentioned angle compensation device for the magnetic angle encoder provided by the embodiment of the present invention can realize all the method steps realized by the above-mentioned embodiment of the angle compensation method for the magnetic angle encoder, and can achieve the same technical effect , the same parts and beneficial effects in this embodiment as those in the method embodiment will not be described in detail here.
本发明还提供一种磁角度编码器,包括磁码盘、霍尔元件和信号处理电路,所述信号处理电路用于执行上述各方法所提供的磁角度编码器的角度补偿方法。The present invention also provides a magnetic angle encoder, which includes a magnetic code disc, a Hall element and a signal processing circuit, and the signal processing circuit is used to implement the angle compensation method of the magnetic angle encoder provided by the above methods.
具体地,磁角度编码器由磁码盘、霍尔元件和信号处理电路构成,其中,磁码盘是测量角位移的数字编码器,并用于对测量角度进行前端显示,其可以接收信号处理电路输出的对原始角度补偿后的角度;霍尔元件用于将变化的磁场转化为输出电压的变化;信号处理电路是包含有磁角度编码器的角度补偿装置的集成电路,可以根据磁角度编码器内的霍尔元件以及其他磁感应元件检测到电压变化信号获取磁角度编码器输出的原始角度,进而对原始角度进行角度补偿。Specifically, the magnetic angle encoder is composed of a magnetic code disc, a Hall element and a signal processing circuit, wherein the magnetic code disc is a digital encoder for measuring angular displacement, and is used for front-end display of the measured angle, which can receive the signal processing circuit The output angle after compensating the original angle; the Hall element is used to convert the changing magnetic field into the change of the output voltage; the signal processing circuit is an integrated circuit containing the angle compensation device of the magnetic angle encoder, which can be used according to the magnetic angle encoder The internal Hall element and other magnetic induction elements detect the voltage change signal to obtain the original angle output by the magnetic angle encoder, and then perform angle compensation on the original angle.
本发明提供的磁角度编码器,通过将非线性的原始角度曲线进行分段处理,获取多个分段区间,并确定各分段区间分别对应的偏差值计算公式,进而在每一个分段区间内,基于该分段区间对应的偏差值计算公式确定该分段区间内的各原始角度对应的偏差值,基于各偏差值对该分段内的各原始角度进行补偿,增强了磁角度编码器输出角度的线性化。The magnetic angle encoder provided by the present invention obtains a plurality of segmental intervals by segmenting the nonlinear original angle curve, and determines the calculation formulas of deviation values corresponding to each segmental interval, and then in each segmental interval Inside, the deviation value corresponding to each original angle in the segment interval is determined based on the deviation value calculation formula corresponding to the segment interval, and each original angle in the segment is compensated based on each deviation value, which enhances the magnetic angle encoder Linearization of output angles.
本发明还提供一种磁角度编码器的角度补偿系统,该系统包括控制器和磁角度编码器,所述控制器用于执行上述各方法所提供的磁角度编码器的角度补偿方法,对所述磁角度编码器输出的原始角度进行补偿,所述磁角度编码器的角度补偿方法包括:The present invention also provides an angle compensation system for a magnetic angle encoder, the system includes a controller and a magnetic angle encoder, the controller is used to implement the angle compensation method for the magnetic angle encoder provided by the above methods, and the The original angle output by the magnetic angle encoder is compensated, and the angle compensation method of the magnetic angle encoder includes:
对磁角度编码器输出的各原始角度对应的原始角度曲线进行分段处理,获取多个分段区间;Segmenting the original angle curve corresponding to each original angle output by the magnetic angle encoder to obtain multiple segmented intervals;
确定多个所述分段区间中的目标分段区间对应的偏差值计算公式,所述偏差值计算公式用于表征所述目标分段区间内的各原始角度和与所述各原始角度相对应的旋转角度之间的偏差,所述目标分段区间为所述多个分段区间中的任意一个分段区间;Determine the deviation value calculation formula corresponding to the target segmentation interval in the multiple segmentation intervals, the deviation value calculation formula is used to characterize each original angle in the target segmentation interval and correspond to each original angle The deviation between the rotation angles, the target segment interval is any segment interval in the plurality of segment intervals;
基于所述目标分段区间对应的偏差值计算公式,确定所述目标分段区间内的各原始角度和与所述各原始角度相对应的旋转角度之间的偏差值;Based on the deviation value calculation formula corresponding to the target segmentation interval, determine the deviation value between each original angle in the target segmentation interval and the rotation angle corresponding to each original angle;
分别基于各所述偏差值,对所述目标分段区间内的各所述原始角度进行补偿。Compensating each of the original angles within the target segmentation interval based on each of the deviation values respectively.
在此需要说明的是,本发明实施例提供的上述磁角度编码器的角度补偿系统中的控制器,能够实现上述磁角度编码器的角度补偿方法实施例所实现的所有方法步骤,且能够达到相同的技术效果,在此不再对本实施例中与方法实施例相同的部分及有益效果进行具体赘述。It should be noted here that the controller in the above-mentioned angle compensation system of the magnetic angle encoder provided by the embodiment of the present invention can realize all the method steps realized by the above-mentioned embodiment of the angle compensation method of the magnetic angle encoder, and can achieve For the same technical effect, the same parts and beneficial effects in this embodiment as those in the method embodiment will not be described in detail here.
本发明提供的磁角度编码器的角度补偿系统,通过控制器将非线性的原始角度曲线进行分段处理,获取多个分段区间,并确定各分段区间分别对应的偏差值计算公式,进而在每一个分段区间内,基于该分段区间对应的偏差值计算公式确定该分段区间内的各原始角度对应的偏差值,基于各偏差值对磁角度编码器输出的该分段内的各原始角度进行补偿,增强了磁角度编码器输出角度的线性化。In the angle compensation system of the magnetic angle encoder provided by the present invention, the nonlinear original angle curve is segmented by the controller to obtain a plurality of segmented intervals, and determine the deviation value calculation formulas corresponding to each segmented interval, and then In each segment interval, the deviation value corresponding to each original angle in the segment interval is determined based on the deviation value calculation formula corresponding to the segment interval, and the deviation value in the segment output by the magnetic angle encoder is based on each deviation value Each original angle is compensated, which enhances the linearization of the output angle of the magnetic angle encoder.
图13是本发明提供的电子设备的实体结构示意图,如图13所示,该电子设备可以包括:处理器(processor)1310、通信接口(Communications Interface)1320、存储器(memory)1330和通信总线1340,其中,处理器1310,通信接口1320,存储器1330通过通信总线1340完成相互间的通信。处理器1310可以调用存储器1330中的逻辑指令,以执行上述各方法所提供的磁角度编码器的角度补偿方法,该方法包括:FIG. 13 is a schematic diagram of the physical structure of the electronic device provided by the present invention. As shown in FIG. 13 , the electronic device may include: a processor (processor) 1310, a communication interface (Communications Interface) 1320, a memory (memory) 1330 and a
对磁角度编码器输出的各原始角度对应的原始角度曲线进行分段处理,获取多个分段区间;Segmenting the original angle curve corresponding to each original angle output by the magnetic angle encoder to obtain multiple segmented intervals;
确定多个所述分段区间中的目标分段区间对应的偏差值计算公式,所述偏差值计算公式用于表征所述目标分段区间内的各原始角度和与所述各原始角度相对应的旋转角度之间的偏差,所述目标分段区间为所述多个分段区间中的任意一个分段区间;Determine the deviation value calculation formula corresponding to the target segmentation interval in the multiple segmentation intervals, the deviation value calculation formula is used to characterize each original angle in the target segmentation interval and correspond to each original angle The deviation between the rotation angles, the target segment interval is any segment interval in the plurality of segment intervals;
基于所述目标分段区间对应的偏差值计算公式,确定所述目标分段区间内的各原始角度和与所述各原始角度相对应的旋转角度之间的偏差值;Based on the deviation value calculation formula corresponding to the target segmentation interval, determine the deviation value between each original angle in the target segmentation interval and the rotation angle corresponding to each original angle;
分别基于各所述偏差值,对所述目标分段区间内的各所述原始角度进行补偿。Compensating each of the original angles within the target segmentation interval based on each of the deviation values respectively.
此外,上述的存储器1330中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above-mentioned logic instructions in the
另一方面,本发明还提供一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,计算机能够执行上述各方法所提供的磁角度编码器的角度补偿方法,该方法包括:On the other hand, the present invention also provides a computer program product, the computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, and when the program instructions are executed by a computer During execution, the computer can execute the angle compensation method of the magnetic angle encoder provided by the above-mentioned methods, and the method includes:
对磁角度编码器输出的各原始角度对应的原始角度曲线进行分段处理,获取多个分段区间;Segmenting the original angle curve corresponding to each original angle output by the magnetic angle encoder to obtain multiple segmented intervals;
确定多个所述分段区间中的目标分段区间对应的偏差值计算公式,所述偏差值计算公式用于表征所述目标分段区间内的各原始角度和与所述各原始角度相对应的旋转角度之间的偏差,所述目标分段区间为所述多个分段区间中的任意一个分段区间;Determine the deviation value calculation formula corresponding to the target segmentation interval in the multiple segmentation intervals, the deviation value calculation formula is used to characterize each original angle in the target segmentation interval and correspond to each original angle The deviation between the rotation angles, the target segment interval is any segment interval in the plurality of segment intervals;
基于所述目标分段区间对应的偏差值计算公式,确定所述目标分段区间内的各原始角度和与所述各原始角度相对应的旋转角度之间的偏差值;Based on the deviation value calculation formula corresponding to the target segmentation interval, determine the deviation value between each original angle in the target segmentation interval and the rotation angle corresponding to each original angle;
分别基于各所述偏差值,对所述目标分段区间内的各所述原始角度进行补偿。Compensating each of the original angles within the target segmentation interval based on each of the deviation values respectively.
又一方面,本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各提供的磁角度编码器的角度补偿方法,该方法包括:In another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it is implemented to perform the angle compensation methods of the magnetic angle encoders provided above, The method includes:
对磁角度编码器输出的各原始角度对应的原始角度曲线进行分段处理,获取多个分段区间;Segmenting the original angle curve corresponding to each original angle output by the magnetic angle encoder to obtain multiple segmented intervals;
确定多个所述分段区间中的目标分段区间对应的偏差值计算公式,所述偏差值计算公式用于表征所述目标分段区间内的各原始角度和与所述各原始角度相对应的旋转角度之间的偏差,所述目标分段区间为所述多个分段区间中的任意一个分段区间;Determine the deviation value calculation formula corresponding to the target segmentation interval in the multiple segmentation intervals, the deviation value calculation formula is used to characterize each original angle in the target segmentation interval and correspond to each original angle The deviation between the rotation angles, the target segment interval is any segment interval in the plurality of segment intervals;
基于所述目标分段区间对应的偏差值计算公式,确定所述目标分段区间内的各原始角度和与所述各原始角度相对应的旋转角度之间的偏差值;Based on the deviation value calculation formula corresponding to the target segmentation interval, determine the deviation value between each original angle in the target segmentation interval and the rotation angle corresponding to each original angle;
分别基于各所述偏差值,对所述目标分段区间内的各所述原始角度进行补偿。Compensating each of the original angles within the target segmentation interval based on each of the deviation values respectively.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without any creative efforts.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the above description of the implementations, those skilled in the art can clearly understand that each implementation can be implemented by means of software plus a necessary general hardware platform, and of course also by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic discs, optical discs, etc., including several instructions to make a computer device (which may be a personal computer, server, or network device, etc.) execute the methods described in various embodiments or some parts of the embodiments.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211543360.7A CN115876242A (en) | 2022-12-02 | 2022-12-02 | Angle Compensation Method and Device for Magnetic Angle Encoder and Magnetic Angle Encoder |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211543360.7A CN115876242A (en) | 2022-12-02 | 2022-12-02 | Angle Compensation Method and Device for Magnetic Angle Encoder and Magnetic Angle Encoder |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115876242A true CN115876242A (en) | 2023-03-31 |
Family
ID=85765735
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211543360.7A Pending CN115876242A (en) | 2022-12-02 | 2022-12-02 | Angle Compensation Method and Device for Magnetic Angle Encoder and Magnetic Angle Encoder |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115876242A (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100478978B1 (en) * | 2004-12-28 | 2005-03-28 | (주)다림시스템 | Apparatus for resolution of angular position using hall-ic and method thereof |
CN107607037A (en) * | 2017-09-18 | 2018-01-19 | 哈尔滨理工大学 | A kind of magnetism encoder scaling method based on transregional tabulating method of arc tangent |
CN111082725A (en) * | 2019-12-25 | 2020-04-28 | 傲基科技股份有限公司 | Magnetic rotary encoder angle compensation method, compensation system and motor |
CN111964707A (en) * | 2020-08-28 | 2020-11-20 | 哈尔滨工业大学 | Angle Calibration Method of Absolute Magnetic Encoder Based on Vernier Code Track |
CN114777811A (en) * | 2022-04-20 | 2022-07-22 | 唐山钢铁集团有限责任公司 | Calibration method for absolute value type encoder in angle measurement |
CN114894238A (en) * | 2022-05-06 | 2022-08-12 | 微传智能科技(常州)有限公司 | Calibration compensation device, system and method for plate-level magnetic encoding |
CN115373433A (en) * | 2022-10-25 | 2022-11-22 | 季华实验室 | Turntable motion compensation method, device, equipment and storage medium |
-
2022
- 2022-12-02 CN CN202211543360.7A patent/CN115876242A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100478978B1 (en) * | 2004-12-28 | 2005-03-28 | (주)다림시스템 | Apparatus for resolution of angular position using hall-ic and method thereof |
CN107607037A (en) * | 2017-09-18 | 2018-01-19 | 哈尔滨理工大学 | A kind of magnetism encoder scaling method based on transregional tabulating method of arc tangent |
CN111082725A (en) * | 2019-12-25 | 2020-04-28 | 傲基科技股份有限公司 | Magnetic rotary encoder angle compensation method, compensation system and motor |
CN111964707A (en) * | 2020-08-28 | 2020-11-20 | 哈尔滨工业大学 | Angle Calibration Method of Absolute Magnetic Encoder Based on Vernier Code Track |
CN114777811A (en) * | 2022-04-20 | 2022-07-22 | 唐山钢铁集团有限责任公司 | Calibration method for absolute value type encoder in angle measurement |
CN114894238A (en) * | 2022-05-06 | 2022-08-12 | 微传智能科技(常州)有限公司 | Calibration compensation device, system and method for plate-level magnetic encoding |
CN115373433A (en) * | 2022-10-25 | 2022-11-22 | 季华实验室 | Turntable motion compensation method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107607037B (en) | Magnetoelectric encoder calibration method based on arc tangent trans-interval tabulation method | |
US7711508B2 (en) | Position detector | |
CN105229424B (en) | Method for self-calibrating a rotary encoder | |
CN107884099B (en) | Calibration device, calibration method and measurement system | |
CN110455222B (en) | High-precision rotation angle measuring method, device and equipment | |
JP2003254785A (en) | Signal processor for encoder | |
CN105651324A (en) | Correction table generating apparatus, encoder and correction table generating method | |
CN106871821A (en) | A kind of Circular gratings process alignment error calibration and modification method based on single reading head | |
WO2024139067A1 (en) | Encoder line compensation method and device, absolute encoder and storage medium | |
CN105675030A (en) | Measuring method and device for absolute value encoder | |
CN116182924A (en) | Phase compensation method, device and magnetic encoder | |
WO2024113450A1 (en) | Magnetic encoder correction method and apparatus, and magnetic encoder | |
CN111964707A (en) | Angle Calibration Method of Absolute Magnetic Encoder Based on Vernier Code Track | |
JPWO2016204205A1 (en) | Detection device, rotation angle detection device, detection method, and program | |
CN109855668B (en) | Self-calibration method and device of magnetic angle sensor, magnetic angle sensor and system | |
CN115876242A (en) | Angle Compensation Method and Device for Magnetic Angle Encoder and Magnetic Angle Encoder | |
CN114298098A (en) | Data processing method and device for error correction | |
JP2016001103A (en) | Position detector | |
CN111368584B (en) | High-resolution position information splicing method of sine and cosine encoder capable of self-correcting | |
CN112701983A (en) | Rotor angle calibration method and device based on linear Hall sensor | |
CN112113517B (en) | Method for detecting flatness of sliding plate brick | |
US10666388B2 (en) | Encoder signal processing device and encoder | |
CN115900775A (en) | Encoder, position compensation method and device thereof, and storage medium | |
CN108152527B (en) | Digital speed measurement method based on median average filtering | |
CN107014317A (en) | A kind of sub-pixel angular displacement divided method and device based on image detector |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |