TWI769695B - Calibration method of magnetic linear position sensor - Google Patents

Calibration method of magnetic linear position sensor Download PDF

Info

Publication number
TWI769695B
TWI769695B TW110104629A TW110104629A TWI769695B TW I769695 B TWI769695 B TW I769695B TW 110104629 A TW110104629 A TW 110104629A TW 110104629 A TW110104629 A TW 110104629A TW I769695 B TWI769695 B TW I769695B
Authority
TW
Taiwan
Prior art keywords
value
signal
magnetic
sensing element
curvature
Prior art date
Application number
TW110104629A
Other languages
Chinese (zh)
Other versions
TW202232057A (en
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 經登企業股份有限公司
Priority to TW110104629A priority Critical patent/TWI769695B/en
Application granted granted Critical
Publication of TWI769695B publication Critical patent/TWI769695B/en
Publication of TW202232057A publication Critical patent/TW202232057A/en

Links

Images

Landscapes

  • Transmission And Conversion Of Sensor Element Output (AREA)
  • Measurement Of Length, Angles, Or The Like Using Electric Or Magnetic Means (AREA)

Abstract

一種磁性線性位置感應器的校正方法,其令一磁鐵沿一直線行程移動的同時,令磁性線性位置感應器的處理單元要求磁性線性位置感應器的磁性角度型感應元件定時回傳當下產生的正弦訊號和餘弦訊號直到磁鐵走完直線行程;訊號處理裝置接收處理單元傳來之數位化的該等正弦訊號和該等餘弦訊號,並對減去一第一預設值的該等正弦訊號值和減去一第二預設值的該等餘弦訊號值進行反正切函數的二階導數(atan2)運算以獲得一曲率曲線,並求得一擬合該曲率曲線的一有效線段的多項式方程式,且將該多項式方程式寫入該處理單元中做為磁性角度型感應元件的數學模型。A method for calibrating a magnetic linear position sensor, which causes a magnet to move along a straight line while making a processing unit of the magnetic linear position sensor request a magnetic angle sensing element of the magnetic linear position sensor to periodically return a sinusoidal signal generated at the moment and the cosine signals until the magnet completes the linear travel; the signal processing device receives the digitized sine signals and the cosine signals from the processing unit, and subtracts a first preset value from the sine signal values and the subtraction. A second-order derivative (atan2) operation of the arctangent function is performed on the cosine signal values from a second preset value to obtain a curvature curve, and a polynomial equation fitting an effective line segment of the curvature curve is obtained, and the The polynomial equation is written in the processing unit as the mathematical model of the magnetic angle-type sensing element.

Description

磁性線性位置感應器的校正方法Calibration method of magnetic linear position sensor

本發明是有關於一種位置感應器的校正方法,特別是指一種磁性線性位置感應器的校正方法。 The present invention relates to a calibration method of a position sensor, in particular to a calibration method of a magnetic linear position sensor.

參見圖1所示,現有獲得一磁性角度型感應元件S(例如AMR、Hall、TMR....)的偵測距離的一種方式是令磁性角度型感應元件S感應沿一直線行程P1運動之磁鐵M的磁場,使產生與磁鐵M之一移動距離相關的一正弦波訊號和一餘弦波訊號並輸出至一訊號處理器10,該訊號處理器10將該正弦波訊號和餘弦波訊號數位化為如圖1所示之由複數正弦訊號值Usin形成的數位化正弦波訊號sin以及如圖1示之由複數餘弦訊號值Ucos形成的數位化餘弦波訊號cos,並對該等正弦訊號值Usin和該等餘弦訊號值Ucos進行反正切函數(ARCTAN)的二階導數(atan2)運算,即atan2(Usin/Ucos),可求得複數曲率值,且該等曲率值形成如圖1所示之一曲率曲線C1,該曲率曲線C1中的一有效線段L1上的每一點的曲率值對應一偵測距離,且因為該有效線段L1的曲率值範圍只有從0.2~1.2,代表磁性角度型感應元件S的一有效偵測距離並不 長,例如圖1所示只有6mm,因此,假設需要偵測的長度是6mm的6倍,則至少需要並列6顆磁性角度型感應元件S同時進行偵測。 Referring to FIG. 1 , one way to obtain the detection distance of a magnetic angle sensing element S (such as AMR, Hall, TMR....) is to make the magnetic angle sensing element S sense a magnet moving along a linear stroke P1 The magnetic field of M causes a sine wave signal and a cosine wave signal related to a moving distance of the magnet M to be generated and output to a signal processor 10. The signal processor 10 digitizes the sine wave signal and the cosine wave signal into The digitized sine wave signal sin formed by the complex sine signal value Usin as shown in Fig. 1 and the digitized cosine wave signal cos formed by the complex cosine signal value Ucos shown in Fig. 1, and the sine signal values Usin and These cosine signal values Ucos are subjected to the second derivative (atan2) operation of the arc tangent function (ARCTAN), namely atan2(Usin/Ucos), to obtain complex curvature values, and these curvature values form a curvature as shown in Figure 1 Curve C1, the curvature value of each point on an effective line segment L1 in the curvature curve C1 corresponds to a detection distance, and because the curvature value of the effective line segment L1 only ranges from 0.2 to 1.2, it represents the magnetic angle sensor element S. An effective detection distance is not For example, as shown in Figure 1, it is only 6mm. Therefore, if the length to be detected is 6 times of 6mm, at least 6 magnetic angle sensing elements S need to be connected in parallel to detect at the same time.

因此,本發明之目的,即在提供一種磁性線性位置感應器的校正方法,其能增長該磁性線性位置感應器中之磁性角度型感應元件的偵測距離,進而減少磁性角度型感應元件的使用數量。 Therefore, the purpose of the present invention is to provide a calibration method for a magnetic linear position sensor, which can increase the detection distance of the magnetic angle sensing element in the magnetic linear position sensor, thereby reducing the use of the magnetic angle sensing element quantity.

於是,本發明一種磁性線性位置感應器的校正方法,該磁性線性位置感應器設於一直線行程的一側以偵測沿該直線行程往復移動的一磁鐵的位置,該磁性線性位置感應器包含一磁性角度型感應元件及一處理單元;該校正方法包括:(A)令該磁鐵沿該直線行程移動,同時,一訊號處理裝置令該處理單元以一取樣頻率要求該磁性角度型感應元件回傳當下產生的一正弦訊號和一餘弦訊號直到該磁鐵走完該直線行程;(B)該處理單元將該磁性角度型感應元件持續傳來的該等正弦訊號和該等餘弦訊號數位化並輸出至該訊號處理裝置;(C)該訊號處理裝置根據該直線行程的長度和該取樣頻率,獲得該磁鐵在該直線行程中每一個取樣點的位置與數位化的該等正弦訊號值和該等餘弦訊號值的對應關係,且該訊號處理裝置將該等正弦訊號值減去一第一預設值,並將該等餘弦訊號值減去一第二預設值;(D)該訊號處理裝置對減去該第一預設值的該等正弦訊號值和減去該第二預設值的該等餘弦訊號值進行反正切函 數的二階導數(atan2)運算,即atan2(減去該第一預設值的該正弦訊號值/減去該第二預設值的該餘弦訊號值),而獲得相對應的複數曲率值,且該等曲率值構成一曲率曲線;(E)該訊號處理裝置以該曲率曲線中的一有效線段做為該磁性角度型感應元件的一特性曲線,並根據該特性曲線決定該磁性角度型感應元件的一有效偵測距離以及相對應的一曲率值範圍;(F)該訊號處理裝置根據該有效偵測距離和該曲率值範圍,藉由曲線擬合和線性迴歸分析決定一擬合該特性曲線的多項式方程式

Figure 110104629-A0305-02-0004-6
的m值以及β0m的值,其中i=1,2,3...n,yi代表該磁性角度型感應元件與該磁鐵的一相對距離,xi代表該曲率值,β0m是該磁性角度型感應元件的係數;及(G)該訊號處理裝置將該多項式方程式寫入該處理單元中做為該磁性角度型感應元件的一數學模型。 Therefore, the present invention provides a method for calibrating a magnetic linear position sensor. The magnetic linear position sensor is arranged on one side of a linear travel to detect the position of a magnet that reciprocates along the linear travel. The magnetic linear position sensor includes a Magnetic angle type induction element and a processing unit; the calibration method includes: (A) making the magnet move along the linear stroke, and at the same time, a signal processing device makes the processing unit request the magnetic angle type induction element to return with a sampling frequency A sine signal and a cosine signal are generated at the moment until the magnet completes the linear travel; (B) the processing unit digitizes the sine signals and the cosine signals continuously transmitted from the magnetic angle sensing element and outputs them to the signal processing device; (C) the signal processing device obtains the digitized sine signal values and the cosines of the position of each sampling point of the magnet in the linear stroke according to the length of the linear stroke and the sampling frequency The corresponding relationship between the signal values, and the signal processing device subtracts a first predetermined value from the sine signal values, and subtracts a second predetermined value from the cosine signal values; (D) the signal processing device pairs The sine signal values minus the first preset value and the cosine signal values minus the second preset value are subjected to the second derivative (atan2) operation of the arc tangent function, that is, atan2 (minus the first preset value) setting the sine signal value of the value/subtracting the cosine signal value of the second preset value) to obtain a corresponding complex curvature value, and the curvature values form a curvature curve; (E) the signal processing device uses An effective line segment in the curvature curve is used as a characteristic curve of the magnetic angle sensing element, and an effective detection distance and a corresponding curvature value range of the magnetic angle sensing element are determined according to the characteristic curve; (F ) The signal processing device determines a polynomial equation for fitting the characteristic curve by curve fitting and linear regression analysis according to the effective detection distance and the curvature value range
Figure 110104629-A0305-02-0004-6
The m value and the value of β 0m , where i=1,2,3...n, yi represents a relative distance between the magnetic angle-type induction element and the magnet, xi represents the curvature value, β 0 ~ βm is a coefficient of the magnetic angle sensing element; and (G) the signal processing device writes the polynomial equation into the processing unit as a mathematical model of the magnetic angle sensing element.

在本發明的一些實施態樣中,該第一預設值是該等正弦訊號值中的最大值與最小值之和的二之一;該第二預設值是該等餘弦訊號值中的最大值與最小值之和的二之一。 In some embodiments of the present invention, the first preset value is one of the sum of the maximum value and the minimum value among the sine signal values; the second preset value is one of the cosine signal values One of two of the sum of the maximum and minimum values.

在本發明的一些實施態樣中,m為6。 In some embodiments of the present invention, m is 6.

在本發明的一些實施態樣中,該磁性角度型感應元件具有兩個相差45°的磁阻電橋,其中一磁阻電橋感應該磁鐵的磁場並產生一正弦波訊號,其中另一磁阻電橋感應該磁鐵的磁場並產生一與該正弦波訊號相位差45°的餘弦波訊號。 In some embodiments of the present invention, the magnetic angle sensing element has two magnetoresistive bridges with a difference of 45°, wherein one magnetoresistive bridge induces the magnetic field of the magnet and generates a sine wave signal, and the other magnetoresistive bridge induces a sine wave signal. The resistive bridge senses the magnetic field of the magnet and generates a cosine wave signal with a phase difference of 45° from the sine wave signal.

本發明之功效在於:在校正程序中,藉由將該磁性角度型感應元件感應獲得的該等正弦訊號值和該等餘弦訊號適當平移後再對其進行反正切函數(ARCTAN)的二階導數(atan2)運算,能使該磁性角度型感應元件的有效偵測距離增長,而達到減少磁性角度型感應元件的使用數量,並使該磁性線性位置感應器2的偵測距離變長的功效與目的。 The effect of the present invention is: in the calibration procedure, the sine signal values and the cosine signals obtained by the induction of the magnetic angle-type sensing element are appropriately shifted and then the second derivative of the arc tangent function (ARCTAN) is performed on them ( atan2) operation can increase the effective detection distance of the magnetic angle sensing element, thereby reducing the number of magnetic angle sensing elements used and making the detection distance of the magnetic linear position sensor 2 longer. .

1:氣缸 1: Cylinder

2:磁性線性位置感應器 2: Magnetic Linear Position Sensor

21:磁性角度型感應元件 21: Magnetic angle sensing element

211、212:磁阻電橋 211, 212: Magnetoresistive bridge

22:處理單元 22: Processing unit

3:訊號處理裝置 3: Signal processing device

M:磁鐵(活塞) M: Magnet (Piston)

P2:直線行程 P2: Linear stroke

SIN:正弦波訊號 SIN: Sine wave signal

COS:餘弦波訊號 COS: cosine wave signal

sin:數位化正弦波訊號 sin: digitized sine wave signal

cos:數位化餘弦波訊號 cos: digitized cosine wave signal

sin’:平移後數位化正弦波訊號 sin': digitized sine wave signal after translation

cos’:平移後數位化餘弦波訊號 cos': digitized cosine wave signal after translation

C2:曲率曲線 C2: Curvature Curve

L2:有效線段 L2: valid line segment

L2’:置換後有效線段 L2': Effective line segment after replacement

S1~S7:步驟 S1~S7: Steps

本發明之其他的特徵及功效,將於參照圖式的實施方式中清楚地顯示,其中:圖1說明現有獲得磁性角度型感應元件的偵測距離的一種方法;圖2是本發明磁性線性位置感應器的校正方法的一實施例的流程圖;圖3說明本實施例所要校正的磁性線性位置感應器包含的元件及其設置方式;圖4是本實施例的磁性線性位置感應器包含的磁性角度型感應元件的細部電路示意圖;圖5是經由本實施例的處理單元數位化後的數位化正弦波訊號sin和數位化餘弦波訊號cos的波形示意圖;圖6說明將圖5的數位化正弦波訊號sin和數位化餘弦波訊 號cos分別向下平移一第一預設值和一第二預設值;圖7說明對圖6所示的正弦波訊號sin’和餘弦波訊號cos’進行反正切函數(ARCTAN)的二階導數(atan2)運算以獲得相對應的複數曲率值,該等曲率值構成一曲率曲線C2;及圖8說明將圖7所示的曲率曲線C2之有效線段L2的X軸數據與Y軸數據置換,而變成置換後有效線段L2’。 Other features and effects of the present invention will be clearly shown in the embodiments with reference to the drawings, wherein: FIG. 1 illustrates a method for obtaining the detection distance of the magnetic angle sensing element; FIG. 2 is the magnetic linear position of the present invention. A flow chart of an embodiment of a method for calibrating a sensor; FIG. 3 illustrates the components and their arrangement of the magnetic linear position sensor to be calibrated in this embodiment; FIG. 4 is a magnetic linear position sensor included in this embodiment A schematic diagram of a detailed circuit of an angle-type sensing element; FIG. 5 is a schematic diagram of waveforms of the digitized sine wave signal sin and the digitized cosine wave signal cos after being digitized by the processing unit of the present embodiment; FIG. 6 illustrates the digitized sine wave signal of FIG. 5 wave signal sin and digitized cosine wave signal The number cos is shifted downward by a first preset value and a second preset value, respectively; FIG. 7 illustrates the second derivative of the arc tangent function (ARCTAN) performed on the sine wave signal sin' and the cosine wave signal cos' shown in FIG. 6 (atan2) operation to obtain corresponding complex curvature values, which constitute a curvature curve C2; and FIG. 8 illustrates the replacement of the X-axis data and the Y-axis data of the effective line segment L2 of the curvature curve C2 shown in FIG. 7, Instead, it becomes the effective line segment L2' after replacement.

在本發明被詳細描述之前,應當注意在以下的說明內容中,類似的元件是以相同的編號來表示。 Before the present invention is described in detail, it should be noted that in the following description, similar elements are designated by the same reference numerals.

參閱圖2所示,是本發明磁性線性位置感應器的校正方法的一實施例的主要流程,且如圖3所示,要被校正的該磁性線性位置感應器2設於一直線行程P2的一側,以偵測沿該直線行程P2往復移動的一磁鐵M的位置,例如該磁鐵M是設於一氣缸1內的一活塞,且該直線行程P2是該活塞在該氣缸1內往復運動的活塞行程。該磁性線性位置感應器2主要包括一磁性角度型感應元件21及一處理單元22,例如一微處理器或一微控制器(MCU)。該磁性角度型感應元件21設於該直線行程P2的一側,例如該氣缸1的外壁面,以感應該磁鐵M的磁場並輸出類比的一正弦訊號和一餘弦訊號;該處理單元22與該磁性角度型感應元件21電連接,以接 收該正弦訊號和該餘弦訊號。 Referring to FIG. 2, it is the main flow of an embodiment of the calibration method of the magnetic linear position sensor of the present invention, and as shown in FIG. side, to detect the position of a magnet M reciprocating along the linear stroke P2, for example, the magnet M is a piston set in a cylinder 1, and the linear stroke P2 is the reciprocating motion of the piston in the cylinder 1 Piston stroke. The magnetic linear position sensor 2 mainly includes a magnetic angle sensing element 21 and a processing unit 22, such as a microprocessor or a microcontroller (MCU). The magnetic angle sensing element 21 is arranged on one side of the linear stroke P2, such as the outer wall of the cylinder 1, to sense the magnetic field of the magnet M and output an analogous sine signal and a cosine signal; the processing unit 22 and the The magnetic angle type induction element 21 is electrically connected to connect receive the sine signal and the cosine signal.

而由於每一磁性線性位置感應器2中的該磁性角度型感應元件21的特性都不相同,因此在該磁性線性位置感應器2出廠之前,該磁性線性位置感應器2需先經過一校正程序以找到符合該磁性角度型感應元件21特性的該數學模型;且如圖4所示,該磁性角度型感應元件21(例如AMR、Hall、TMR....)內具有兩個相差45°(即夾45°角)的磁阻電橋(Bridge)211、212;因此,在本實施例的校正方法中,如圖2的步驟S1所示,首先,使磁鐵M從該直線行程P2之遠離該磁性角度型感應元件21的一端朝該磁性角度型感應元件21移動,並通過該磁性角度型感應元件21後朝遠離該磁性角度型感應元件21方向移動至該直線行程P2的另一端,在此過程中,這兩個磁阻電橋211、212會持續感應磁鐵M的磁場而產生相位差45°的一正弦波訊號SIN和一餘弦波訊號COS。 Since the characteristics of the magnetic angle-type sensing element 21 in each magnetic linear position sensor 2 are different, the magnetic linear position sensor 2 needs to undergo a calibration procedure before the magnetic linear position sensor 2 leaves the factory. To find the mathematical model that conforms to the characteristics of the magnetic angle sensing element 21; and as shown in FIG. 4, the magnetic angle sensing element 21 (eg AMR, Hall, TMR... Therefore, in the calibration method of this embodiment, as shown in step S1 of FIG. 2 , first, the magnet M is moved away from the linear stroke P2 One end of the magnetic angle sensing element 21 moves toward the magnetic angle sensing element 21 , and then moves away from the magnetic angle sensing element 21 to the other end of the linear stroke P2 after passing through the magnetic angle sensing element 21 . During this process, the two magnetoresistive bridges 211 and 212 will continue to induce the magnetic field of the magnet M to generate a sine wave signal SIN and a cosine wave signal COS with a phase difference of 45°.

同時,一訊號處理裝置3,例如但不限於一個人電腦,令該處理單元22以一取樣頻率(例如10次/秒)要求該磁性角度型感應元件21回傳當下產生的該正弦訊號(即該正弦波訊號SIN的某一點的值,類比電壓值)和該餘弦訊號(即該餘弦波訊號COS的某一點的值,類比電壓值),直到該磁鐵M走完該直線行程P2,藉此,該磁性角度型感應元件21每秒將回傳10筆正弦訊號和10筆餘弦訊號給該處理單元22,然後,如圖2的步驟S2,該處理單元 22將收到的該等正弦訊號和該等餘弦訊號數位化後輸出至該訊號處理裝置3。該等正弦訊號值Usin和該等餘弦訊號值Ucos的數位化數值可對照圖5左邊縱軸所標示的數值。 At the same time, a signal processing device 3, such as but not limited to a personal computer, causes the processing unit 22 to request the magnetic angle sensing element 21 to return the currently generated sinusoidal signal (ie the The value of a certain point of the sine wave signal SIN, the analog voltage value) and the cosine signal (that is, the value of a certain point of the cosine wave signal COS, the analog voltage value), until the magnet M completes the linear stroke P2, thereby, The magnetic angle sensing element 21 will return 10 sine signals and 10 cosine signals to the processing unit 22 every second. Then, as shown in step S2 in FIG. 2 , the processing unit 22 digitizes the received sine signals and the cosine signals and outputs them to the signal processing device 3 . The digitized values of the sine signal values Usin and the cosine signal values Ucos can be compared with the values indicated by the vertical axis on the left side of FIG. 5 .

因此,該訊號處理裝置3可根據該磁鐵M的一移動距離(即該直線行程P2的長度)以及該取樣頻率,得知該磁鐵M在該直線行程P2中每一個取樣點的位置與數位化的該等正弦訊號值Usin和該等餘弦訊號值Ucos的對應關係,例如圖5所示之由數位化的該等正弦訊號值Usin構成的數位化正弦波訊號sin,以及如圖5所示之由數位化之該等餘弦訊號值Ucos構成的數位化餘弦波訊號cos。 Therefore, the signal processing device 3 can know and digitize the position and digitization of each sampling point of the magnet M in the linear stroke P2 according to a moving distance of the magnet M (ie the length of the linear stroke P2 ) and the sampling frequency The corresponding relationship between the sine signal values Usin and the cosine signal values Ucos, such as the digitized sine wave signal sin composed of the digitized sine signal values Usin shown in FIG. A digitized cosine wave signal cos composed of the digitized cosine signal values Ucos.

然後,如圖2的步驟S3,該訊號處理裝置3將該等正弦訊號值Usin減去一第一預設值成為Usin’,如圖6所示,相當於將該數位化正弦波訊號sin向下平移(offset)該第一預設值而成為一平移後數位化正弦波訊號sin’,並且該訊號處理裝置3將該等餘弦訊號值Ucos減去一第二預設值成為Ucos’,如圖6所示,相當於將該數位化餘弦波訊號cos向下平移(offset)該第二預設值而成為一平移後數位化餘弦波訊號cos’;且在本實施例中,該第一預設值是該等正弦訊號值Usin中的最大值與最小值之和的二之一,但不以此為限;該第二預設值是該等餘弦訊號值Ucos中的最大值與最小值之和的二之一,但不以此為限。 Then, in step S3 of FIG. 2 , the signal processing device 3 subtracts a first preset value from the sinusoidal signal values Usin to obtain Usin′, as shown in FIG. 6 , which is equivalent to the digitized sinusoidal signal sin to the The first preset value is shifted downward to become a shifted digitized sine wave signal sin', and the signal processing device 3 subtracts a second preset value from the cosine signal values Ucos to become Ucos', such as As shown in FIG. 6, it is equivalent to shifting the digitized cosine wave signal cos downward (offset) the second preset value to become a shifted digitized cosine wave signal cos'; and in this embodiment, the first The default value is one of two, but not limited to, the sum of the maximum value and the minimum value among the sine signal values Usin; the second default value is the maximum value and the minimum value among the cosine signal values Ucos One of two, but not limited to, the sum of the values.

接著,如圖2的步驟S4,該訊號處理裝置3對減去該第一預設值的該等正弦訊號值Usin’(即平移後數位化正弦波訊號sin’)和減去該第二預設值的該等餘弦訊號值Ucos’(即平移後數位化餘弦波訊號cos’)進行反正切函數(ARCTAN)的二階導數(atan2)運算,即atan2(Usin’/Ucos’),而獲得相對應的複數曲率值,該等曲率值可對照圖7右邊縱軸所標示的數值,而該等曲率值構成如圖7所示的一曲率曲線C2,且該曲率曲線C2的一有效線段L2代表該磁性角度型感應元件21的一特性曲線,並決定該磁性角度型感應元件21的一有效偵測距離以及相對應的一曲率值範圍,例如當曲率值為-1時,可以從該有效線段L2(該特性曲線)得知距離值為-2mm,對照圖3來看,其可以代表磁鐵M是位在該磁性角度型感應元件21的左側且與該磁性角度型感應元件21相距2mm的位置;同理,當曲率值為2時,可以得知距離值為2.6mm,這代表磁鐵M位是在該磁性角度型感應元件21的右側且與該磁性角度型感應元件21相距約2.6mm的位置;且如圖7所示,在本實施例中,由於該曲率值範圍可達到-π~π,因此其相對應的該有效偵測距離可以增長至14mm,由此可知,本實施例透過上述將該磁性角度型感應元件21感應獲得的訊號值平移後,再進行反正切函數(ARCTAN)的二階導數(atan2)運算,能將該磁性角度型感應元件21的偵測距離(14mm)增長至習知技術(6mm)的兩倍以上,因此, 假設需要偵測的長度是6mm的6倍,則只需要並列3顆磁性角度型感應元件21同時進行偵測,而能減少磁性角度型感應元件21的使用數量。 Next, as shown in step S4 in FIG. 2 , the signal processing device 3 subtracts the sine signal values Usin' (ie, the digitized sine wave signal sin' after the translation) from the first preset value and subtracts the second preset value. These cosine signal values Ucos' (that is, the digitized cosine wave signal cos' after translation) are set to perform the second derivative (atan2) operation of the arc tangent function (ARCTAN), namely atan2(Usin'/Ucos'), and obtain the phase Corresponding complex curvature values, these curvature values can be compared with the values indicated by the vertical axis on the right side of FIG. 7, and these curvature values constitute a curvature curve C2 as shown in FIG. 7, and an effective line segment L2 of the curvature curve C2 represents A characteristic curve of the magnetic angle sensing element 21 determines an effective detection distance of the magnetic angle sensing element 21 and a corresponding curvature value range. For example, when the curvature value is -1, it can be determined from the effective line segment L2 (the characteristic curve) shows that the distance value is -2mm. Compared to FIG. 3 , it can represent that the magnet M is located on the left side of the magnetic angle type induction element 21 and is 2mm away from the magnetic angle type induction element 21 ; Similarly, when the curvature value is 2, it can be known that the distance value is 2.6mm, which means that the magnet M is on the right side of the magnetic angle type induction element 21 and is about 2.6mm away from the magnetic angle type induction element 21. position; and as shown in FIG. 7, in this embodiment, since the curvature value range can reach -π~π, the corresponding effective detection distance can be increased to 14mm, it can be seen that this embodiment through After the signal value sensed by the magnetic angle sensing element 21 is shifted, and the second derivative (atan2) of the arc tangent function (ARCTAN) is calculated, the detection distance (14 mm) of the magnetic angle sensing element 21 can be increased. to more than twice the conventional technology (6mm), therefore, Assuming that the length to be detected is 6 times as long as 6 mm, only three magnetic angle sensing elements 21 need to be connected in parallel for detection at the same time, thereby reducing the number of magnetic angle sensing elements 21 used.

然後,如圖2的步驟S6,該訊號處理裝置3以該有效線段L2(即該有效偵測距離與相對應的該曲率值範圍)做為該磁性角度型感應元件21的該特性曲線,而決定該磁性角度型感應元件21的該有效偵測距離以及相對應的該曲率值範圍,且該訊號處理裝置3根據該有效偵測距離和該曲率值範圍,藉由曲線擬合和線性迴歸分析決定一擬合該特性曲線的多項式方程式

Figure 110104629-A0305-02-0010-1
的m值以及β0m的值,其中 i=1,2,3...n,yi代表該磁性角度型感應元件21與該磁鐵M的一相對距離,xi代表該曲率值,β0m是該磁性角度型感應元件21的係數。 Then, as shown in step S6 of FIG. 2 , the signal processing device 3 uses the effective line segment L2 (ie, the effective detection distance and the corresponding curvature value range) as the characteristic curve of the magnetic angle sensing element 21 , and Determine the effective detection distance of the magnetic angle type sensing element 21 and the corresponding curvature value range, and the signal processing device 3 performs curve fitting and linear regression analysis according to the effective detection distance and the curvature value range determine a polynomial equation that fits the characteristic curve
Figure 110104629-A0305-02-0010-1
The m value and the value of β 0m , where i=1,2,3...n, yi represents a relative distance between the magnetic angle type induction element 21 and the magnet M, xi represents the curvature value, β 0 to β m are coefficients of the magnetic angle type induction element 21 .

具體而言,如圖8(A)所示,假設該有效線段L2(該特性曲線)是由對應100個位置(即100個磁鐵M與該磁性角度型感應元件21的距離值,亦即該有效偵測距離)的100筆曲率值(該曲率值範圍)構成,則在本實施例中,該訊號處理裝置3會先將該有效線段L2的X軸與Y軸的數據置換,使X軸改為呈現該等曲率值而Y軸改為呈現相對應的該等距離值,而使該有效線段L2變成置換後有效線段L2’,如圖8(B)所示。然後,該訊號處理裝置3決 定最適合該置換後有效線段L2’的多項式方程式

Figure 110104629-A0305-02-0011-3
,例如採用多項式擬合(Polynomial Fitting),以一元m次多項式回歸方程式
Figure 110104629-A0305-02-0011-4
來擬合該置換後有效線段L2’,並以 如下所示的矩陣解多項式回歸方程式:
Figure 110104629-A0305-02-0011-2
Specifically, as shown in FIG. 8(A) , it is assumed that the effective line segment L2 (the characteristic curve) is defined by the distance values corresponding to 100 positions (that is, the distances between 100 magnets M and the magnetic angle type induction element 21 , that is, the The effective detection distance is composed of 100 curvature values (the curvature value range), in this embodiment, the signal processing device 3 will first replace the data of the X axis and the Y axis of the effective line segment L2, so that the X axis Instead, the curvature values are displayed and the Y-axis is replaced with the corresponding distance values, so that the effective line segment L2 becomes the replaced effective line segment L2', as shown in FIG. 8(B). Then, the signal processing device 3 determines the most suitable polynomial equation for the permuted effective line segment L2'
Figure 110104629-A0305-02-0011-3
, for example, using polynomial fitting (Polynomial Fitting), a univariate m-degree polynomial regression equation
Figure 110104629-A0305-02-0011-4
to fit the permuted effective line segment L2' and solve the polynomial regression equation with the matrix shown below:
Figure 110104629-A0305-02-0011-2

其中y1~yn代表該100個距離值,x1~xn代表該100個曲率值,β0m是係數,且由於每個該磁性角度型感應元件21的特性不同,因此其係數β0m亦不相同,所以藉由上述矩陣運算,可以找出該磁性角度型感應元件21的該等係數β0m的值,以及決定要採用之擬合該置換後有效線段L2’的多項式方程式。例如,本實施例可以應用METLAB提供的polyfit指令找出上述一元m次多項式方程式的最佳係數(參數)以及最符合該置換後有效線段L2’的多項式方程式。 Wherein y 1 ~y n represent the 100 distance values, x 1 ~x n represent the 100 curvature values, β 0m are coefficients, and since the characteristics of each of the magnetic angle sensing elements 21 are different, the The coefficients β 0 to β m are also different, so through the above matrix operation, the values of the coefficients β 0 to β m of the magnetic angle type sensing element 21 can be found out, and the fitting to be used is determined to be valid after the replacement. Polynomial equation for line segment L2'. For example, in this embodiment, the polyfit command provided by METLAB can be used to find the optimal coefficients (parameters) of the above-mentioned one-variable m-th degree polynomial equation and the polynomial equation that best matches the permuted effective line segment L2'.

舉例來說,藉由polyfit指令將上述已知的該100筆曲率值(x1~xn)與相對應的該100筆距離值(y1~yn)分別代入1元1次~1元8次共8個多項式方程式中,將求得這8個多項式方程式 各自的最佳係數及其與該置換後有效線段L2’的擬合結果,且從這8個多項式方程式中發現一元6次多項式方程式擬合該置換後有效線段L2’的結果最佳(即一元6次多項式方程式最貼近而最能代表該置換後有效線段L2’)時,該訊號處理裝置3則採用具有最佳擬合結果的一元6次多項式方程式,該方程式例如為y=2.4431x6-8.2418x5+15.967x4-10.349x3+7.6091x2+1.567x+1.0009,其中y代表磁鐵M與該磁性角度型感應元件21的一相對距離(即上述的距離值),x代表曲率值。然後,如圖1的步驟S7,該訊號處理裝置3將該一元6次多項式方程式及該曲率值範圍寫入該處理單元22中做為該磁性角度型感應元件21的該特性曲線的一數學模型,即完成校正程序。 For example, use the polyfit command to substitute the 100 known curvature values (x 1 ~x n ) and the corresponding 100 distance values (y 1 ~y n ) into 1 yuan 1 ~1 yuan respectively Among the 8 polynomial equations of the 8th degree, the respective optimal coefficients of these 8 polynomial equations and their fitting results with the effective line segment L2' after replacement will be obtained, and the univariate 6th degree polynomial will be found from these 8 polynomial equations. When the equation fitting the effective line segment L2' after replacement has the best result (that is, the unary 6th-degree polynomial equation is closest and best represents the effective line segment L2' after replacement), the signal processing device 3 uses the best fitting result. The 6th degree polynomial equation of one variable, for example, is y=2.4431x 6 -8.2418x 5 +15.967x 4 -10.349x 3 +7.6091x 2 +1.567x+1.0009, where y represents the magnet M and the magnetic angle sensing element A relative distance of 21 (that is, the above-mentioned distance value), and x represents the curvature value. Then, as shown in step S7 in FIG. 1 , the signal processing device 3 writes the unary sixth-order polynomial equation and the curvature value range into the processing unit 22 as a mathematical model of the characteristic curve of the magnetic angle sensing element 21 , that is, the calibration procedure is completed.

藉此,當該磁性線性位置感應器2實際應用於例如圖3所示的氣缸1以偵測氣缸1內的活塞(即磁鐵M)位置時,該處理單元22接收到該磁性角度型感應元件21傳來之類比的該正弦訊號和該餘弦訊號時,該處理單元22將該正弦訊號和該餘弦訊號數位化為一正弦訊號值和一餘弦訊號值,且將該正弦訊號值減去該第一預設值以及將該餘弦訊號值減去該第二預設值後,對減去該第一預設值的該正弦訊訊號值和減去該第二預設值的該餘弦訊號值進行反正切函數(ARCTAN)的二階導數(atan2)運算,即atan2(減去該第一預設值的該正弦訊號值/減去該第二預設值的該餘弦訊號 值),以獲得一曲率值;然後,該處理單元22判斷該曲率值是在該曲率值範圍內時,將該曲率值代入該數學模型中,即可藉由該一元6次多項式方程式求得一距離值,該距離值即代表該磁性角度型感應元件21與該磁鐵M的該相對距離;然後,該處理單元22可以直接輸出該距離值供後端應用,或者將該距離值轉成相對應的一類比訊號,例如類比電壓(比如1~5V其中的一電壓值)或類比電流(比如4~20mA其中的一電流值)再輸出給後端應用。 Therefore, when the magnetic linear position sensor 2 is actually applied to the cylinder 1 shown in FIG. 3 to detect the position of the piston (ie the magnet M) in the cylinder 1, the processing unit 22 receives the magnetic angle type sensing element When the analogous sine signal and the cosine signal are transmitted from 21, the processing unit 22 digitizes the sine signal and the cosine signal into a sine signal value and a cosine signal value, and subtracts the first sine signal value from the sine signal value. a preset value and the cosine signal value minus the second preset value, the sine signal value minus the first preset value and the cosine signal value minus the second preset value are processed The second derivative (atan2) operation of the arc tangent function (ARCTAN), namely atan2 (subtract the sine signal value of the first preset value/subtract the cosine signal value of the second preset value value) to obtain a curvature value; then, when the processing unit 22 judges that the curvature value is within the range of the curvature value, and substitutes the curvature value into the mathematical model to obtain the univariate sixth degree polynomial equation A distance value, which represents the relative distance between the magnetic angle-type sensing element 21 and the magnet M; then, the processing unit 22 can directly output the distance value for back-end application, or convert the distance value into phase The corresponding analog signal, such as analog voltage (such as a voltage value of 1~5V) or analog current (such as a current value of 4~20mA), is output to the back-end application.

綜上所述,上述實施例在校正程序中,藉由將該磁性角度型感應元件21感應獲得的該等正弦訊號值和該等餘弦訊號適當平移後再對其進行反正切函數(ARCTAN)的二階導數(atan2)運算,能使該磁性角度型感應元件21的有效偵測距離增長,而達到減少磁性角度型感應元件21的使用數量,並使該磁性線性位置感應器2的偵測距離變長的功效與目的;並且,藉由校正程序,使該磁性線性位置感應器2的該處理單元22中的該數學模型擬合該磁性角度型感應元件21的特性曲線,並決定該磁性角度型感應元件21的一有效偵測距離及相對應的一曲率值範圍;藉此,該處理單元22只需將該磁性角度型感應元件21傳來的該正弦訊號和該餘弦訊號數位化後,對減去第一預設值的該正弦訊號值和減去第二預設值的該餘弦訊號值進行atan2(減去該第一預設值的該正弦訊號值/減去該第二預設值的該餘弦訊號值)運算,獲得對應的一曲率值後,將該曲率 值輸入計算距離的該數學模型,即可透過容易計算的一元m次多項式方程式快速地求得該磁性角度型感應元件21與該磁鐵M的一相對距離。 To sum up, in the calibration procedure of the above embodiment, the sine signal values and the cosine signals obtained by the induction of the magnetic angle sensing element 21 are appropriately shifted and then the arc tangent function (ARCTAN) is performed on them. The second-order derivative (atan2) operation can increase the effective detection distance of the magnetic angle sensing element 21, thereby reducing the number of magnetic angle sensing elements 21 used, and making the detection distance of the magnetic linear position sensor 2 change. long-term effect and purpose; and, through the calibration procedure, the mathematical model in the processing unit 22 of the magnetic linear position sensor 2 is fitted to the characteristic curve of the magnetic angle type sensing element 21, and the magnetic angle type is determined. An effective detection distance of the sensing element 21 and a corresponding range of curvature values; thus, the processing unit 22 only needs to digitize the sine signal and the cosine signal transmitted from the magnetic angle sensing element 21, and then Subtract the sine signal value of the first preset value and subtract the cosine signal value of the second preset value to perform atan2 (subtract the sine signal value of the first preset value/subtract the second preset value the cosine signal value) operation, after obtaining a corresponding curvature value, the curvature By inputting the value into the mathematical model for calculating distance, a relative distance between the magnetic angle-type sensing element 21 and the magnet M can be quickly obtained through an easy-to-calculate one-dimensional m-th degree polynomial equation.

惟以上所述者,僅為本發明之實施例而已,當不能以此限定本發明實施之範圍,凡是依本發明申請專利範圍及專利說明書內容所作之簡單的等效變化與修飾,皆仍屬本發明專利涵蓋之範圍內。 However, the above are only examples of the present invention, and should not limit the scope of the present invention. Any simple equivalent changes and modifications made according to the scope of the application for patent of the present invention and the content of the patent specification are still within the scope of the present invention. within the scope of the invention patent.

S1~S7:步驟 S1~S7: Steps

Claims (5)

一種磁性線性位置感應器的校正方法,該磁性線性位置感應器設於一直線行程的一側以偵測沿該直線行程往復移動的一磁鐵的位置,該磁性線性位置感應器包含一磁性角度型感應元件及一處理單元;該校正方法包括:(A)令該磁鐵沿該直線行程移動,同時,一訊號處理裝置令該處理單元以一取樣頻率要求該磁性角度型感應元件回傳當下產生的一正弦訊號和一餘弦訊號直到該磁鐵走完該直線行程;(B)該處理單元將該磁性角度型感應元件持續傳來的該等正弦訊號和該等餘弦訊號數位化並輸出至該訊號處理裝置;(C)該訊號處理裝置根據該直線行程的長度和該取樣頻率,獲得該磁鐵在該直線行程中每一個取樣點的位置與數位化的該等正弦訊號值和該等餘弦訊號值的對應關係,且該訊號處理裝置將該等正弦訊號值減去一第一預設值,並將該等餘弦訊號值減去一第二預設值;(D)該訊號處理裝置對減去該第一預設值的該等正弦訊號值和減去該第二預設值的該等餘弦訊號值進行反正切函數的二階導數(atan2)運算,即atan2(減去該第一預設值的該正弦訊號值/減去該第二預設值的該餘弦訊號值),而獲得相對應的複數曲率值,且該等曲率值構成一曲率曲線; (E)該訊號處理裝置以該曲率曲線中的一有效線段做為該磁性角度型感應元件的一特性曲線,並根據該特性曲線決定該磁性角度型感應元件的一有效偵測距離以及相對應的一曲率值範圍;(F)該訊號處理裝置根據該有效偵測距離和該曲率值範圍,藉由曲線擬合和線性迴歸分析決定一擬合該特性 曲線的多項式方程式
Figure 110104629-A0305-02-0016-5
的m 值以及β0m的值,其中i=1,2,3...n,yi代表該磁性角度型感應元件與該磁鐵的一相對距離,xi代表該曲率值,β0m是該磁性角度型感應元件的係數;及(G)該訊號處理裝置將該多項式方程式及該曲率值範圍寫入該處理單元中做為該磁性角度型感應元件的該特性曲線的一數學模型。
A method for calibrating a magnetic linear position sensor, the magnetic linear position sensor is arranged on one side of a linear stroke to detect the position of a magnet that reciprocates along the linear stroke, the magnetic linear position sensor comprises a magnetic angle sensor Element and a processing unit; the calibration method includes: (A) making the magnet move along the linear stroke, and at the same time, a signal processing device makes the processing unit request the magnetic angle-type sensing element to return a currently generated one at a sampling frequency The sine signal and a cosine signal until the magnet completes the linear travel; (B) the processing unit digitizes the sine signal and the cosine signal continuously transmitted from the magnetic angle type induction element and outputs it to the signal processing device (C) The signal processing device obtains the correspondence between the position of each sampling point of the magnet in the straight line travel and the digitized sine signal values and the cosine signal values according to the length of the straight line travel and the sampling frequency relationship, and the signal processing device subtracts a first predetermined value from the sine signal values, and subtracts a second predetermined value from the cosine signal values; (D) the signal processing device subtracts the first predetermined value from the The sine signal values of a preset value and the cosine signal values minus the second preset value are subjected to the second derivative (atan2) operation of the arc tangent function, namely atan2 (subtracting the first preset value of the second derivative (atan2) sine signal value/subtracting the cosine signal value of the second preset value) to obtain a corresponding complex curvature value, and the curvature values constitute a curvature curve; (E) the signal processing device uses the curvature curve in the An effective line segment of the magnetic angle sensing element is used as a characteristic curve of the magnetic angle sensing element, and an effective detection distance and a corresponding curvature value range of the magnetic angle sensing element are determined according to the characteristic curve; (F) The signal processing The device determines a polynomial equation for fitting the characteristic curve through curve fitting and linear regression analysis according to the effective detection distance and the curvature value range
Figure 110104629-A0305-02-0016-5
The m value and the value of β 0m , where i=1,2,3...n, y i represents a relative distance between the magnetic angle sensing element and the magnet, xi represents the curvature value, β 0 ~ βm is the coefficient of the magnetic angle sensing element; and (G) the signal processing device writes the polynomial equation and the curvature value range into the processing unit as a characteristic curve of the magnetic angle sensing element mathematical model.
如請求項1所述的磁性線性位置感應器的校正方法,其中該第一預設值是該等正弦訊號值中的最大值與最小值之和的二之一;該第二預設值是該等餘弦訊號值中的最大值與最小值之和的二之一。 The calibration method for a magnetic linear position sensor as claimed in claim 1, wherein the first preset value is one of the sum of the maximum value and the minimum value among the sinusoidal signal values; the second preset value is One of two of the sum of the maximum value and the minimum value of the cosine signal values. 如請求項1或2所述的磁性線性位置感應器的校正方法,其中m為6。 The calibration method of a magnetic linear position sensor as claimed in claim 1 or 2, wherein m is 6. 如請求項1或2所述的磁性線性位置感應器的校正方法,其中該磁性角度型感應元件具有兩個相差45°的磁阻電橋,其中一磁阻電橋感應該磁鐵的磁場並產生一正弦波訊號,其中另一磁阻電橋感應該磁鐵的磁場並產生一與該正弦波訊號相位差45°的餘弦波訊號。 The method for calibrating a magnetic linear position sensor according to claim 1 or 2, wherein the magnetic angle sensing element has two magnetoresistive bridges with a difference of 45°, wherein one magnetoresistive bridge induces the magnetic field of the magnet and generates For a sine wave signal, the other magnetoresistive bridge induces the magnetic field of the magnet and generates a cosine wave signal with a phase difference of 45° from the sine wave signal. 如請求項1或2所述的磁性線性位置感應器的校正方法,其中該曲率值範圍是-π~π。 The calibration method for a magnetic linear position sensor according to claim 1 or 2, wherein the curvature value range is -π~π.
TW110104629A 2021-02-08 2021-02-08 Calibration method of magnetic linear position sensor TWI769695B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW110104629A TWI769695B (en) 2021-02-08 2021-02-08 Calibration method of magnetic linear position sensor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW110104629A TWI769695B (en) 2021-02-08 2021-02-08 Calibration method of magnetic linear position sensor

Publications (2)

Publication Number Publication Date
TWI769695B true TWI769695B (en) 2022-07-01
TW202232057A TW202232057A (en) 2022-08-16

Family

ID=83439418

Family Applications (1)

Application Number Title Priority Date Filing Date
TW110104629A TWI769695B (en) 2021-02-08 2021-02-08 Calibration method of magnetic linear position sensor

Country Status (1)

Country Link
TW (1) TWI769695B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200914800A (en) * 2007-06-27 2009-04-01 Brooks Automation Inc Multiple dimension position sensor
WO2013002103A1 (en) * 2011-06-30 2013-01-03 日立オートモティブシステムズ株式会社 Device for measuring rotation angle, control device, and rotator system using device for measuring rotation angle and control device
CN109443451A (en) * 2018-12-27 2019-03-08 中国科学院宁波材料技术与工程研究所 A kind of motor position speed detector

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200914800A (en) * 2007-06-27 2009-04-01 Brooks Automation Inc Multiple dimension position sensor
WO2013002103A1 (en) * 2011-06-30 2013-01-03 日立オートモティブシステムズ株式会社 Device for measuring rotation angle, control device, and rotator system using device for measuring rotation angle and control device
CN109443451A (en) * 2018-12-27 2019-03-08 中国科学院宁波材料技术与工程研究所 A kind of motor position speed detector

Also Published As

Publication number Publication date
TW202232057A (en) 2022-08-16

Similar Documents

Publication Publication Date Title
CN1025691C (en) Metrological apparatus and calibration method therefor
US8415946B2 (en) Arrangement and method for magnetic determination of a linear length or a rotary angle
TWI564548B (en) Method for self-calibrating a rotary encoder
US20090058430A1 (en) Systems and Methods for Sensing Positions of Components
JPH04136713A (en) Position detection device
JP4653323B2 (en) Linear position sensor and object position detection method
JP2007287117A (en) Contactless electron joystick of universal joint structure using single hall sensor
JP2000131006A (en) Relative straight line position measuring device
CN109115095B (en) Structural parameter optimization method of non-contact R-test measuring instrument
Li et al. An accurate low-cost capacitive absolute angular-position sensor with a full-circle range
CN109696187B (en) Eccentric correcting device of rotary encoder
CN112902817B (en) Magnetic linear position sensor
TWI769695B (en) Calibration method of magnetic linear position sensor
CN109727267B (en) Standard virtual sine linear vibration measurement method
TWI761072B (en) Magnetic Linear Position Sensor
JP2008533476A (en) Method and circuit apparatus for grasping and compensating for tilt angle in detecting motion or rotation angle
CN112902818B (en) Method for calibrating magnetic linear position sensor
US9335151B2 (en) Film measurement
US9291510B2 (en) Measuring apparatus
Vasseur et al. Contribution to the development of a smart sensor using eddy currents for measurement of displacement
JP2839341B2 (en) Calibration device for position signal
CN104180744B (en) Distance measuring apparatus
CN111044604A (en) ACFM single-axis magnetic signal evaluation method
Fang et al. Eddy Current Digital Proximity Sensing for Vibration Detection
Wei et al. High-precision time-grating displacement sensor based on harmonic wave correcting method