TWI616661B - Method of calculating the number of periods of quasi-sinusoidal wave - Google Patents

Method of calculating the number of periods of quasi-sinusoidal wave Download PDF

Info

Publication number
TWI616661B
TWI616661B TW105141311A TW105141311A TWI616661B TW I616661 B TWI616661 B TW I616661B TW 105141311 A TW105141311 A TW 105141311A TW 105141311 A TW105141311 A TW 105141311A TW I616661 B TWI616661 B TW I616661B
Authority
TW
Taiwan
Prior art keywords
wave
division
substituted
coordinates
sine
Prior art date
Application number
TW105141311A
Other languages
Chinese (zh)
Other versions
TW201821810A (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 TW105141311A priority Critical patent/TWI616661B/en
Application granted granted Critical
Publication of TWI616661B publication Critical patent/TWI616661B/en
Publication of TW201821810A publication Critical patent/TW201821810A/en

Links

Abstract

一種計算類弦波之週期數目的方法,包含一個第一轉換步驟、一個第二轉換步驟、一個分割步驟、一個判斷步驟,及一個計數步驟。在該第一轉換步驟與該第二轉換步驟時,將該類弦波轉換成該三角波。在該分割步驟時,選定一個分割係數,並且將該三角波分割為複數分割座標。在該判斷步驟時,將該等分割座標依序代入一個分析程序,藉此判斷需發出正確訊號的數量。最後該計數步驟時,依據該分割係數與正確訊號的數量,就能換算出該類弦波的週期數量。A method for calculating the number of sine-like cycles includes a first conversion step, a second conversion step, a division step, a judgment step, and a counting step. During the first conversion step and the second conversion step, the sine wave-like wave is converted into the triangular wave. In this division step, a division coefficient is selected, and the triangle wave is divided into complex division coordinates. In the determination step, the equal division coordinates are sequentially substituted into an analysis program, thereby determining the number of correct signals to be sent. At the end of the counting step, the number of cycles of the sine wave can be converted based on the division factor and the number of correct signals.

Description

計算類弦波之週期數目的方法Method for calculating the number of periods of sine waves

本發明是有關於一種計算類弦波之特性的方法,特別是指一種計算類弦波之週期數目的方法。The invention relates to a method for calculating the characteristics of a sine wave-like wave, in particular to a method for calculating the number of periods of a sine wave-like wave.

編碼器廣泛地應用在工業界,其主要是用來做位移量測,例如CNC或伺服器馬達控制等。參閱圖1,一個編碼器1由左而右依序包含一個發光單元11、一個游動光柵12、一個固定光柵13,及一個量測單元14;其中,該游動光柵12與該固定光柵13具有相同的週期性條紋。Encoders are widely used in industry, and are mainly used for displacement measurement, such as CNC or servo motor control. Referring to FIG. 1, an encoder 1 includes a light-emitting unit 11, a moving grating 12, a fixed grating 13, and a measuring unit 14 in sequence from left to right; wherein, the moving grating 12 and the fixed grating 13 Have the same periodic stripes.

該發光單元11用以發出兩個週期性的訊號,例如方波或弦波等。該等訊號發出後,將依序通過該游動光柵12與該固定光柵13,最後被該量測單元14接收。The light-emitting unit 11 is used to emit two periodic signals, such as a square wave or a sine wave. After these signals are sent out, they will pass through the moving grating 12 and the fixed grating 13 in sequence, and finally be received by the measuring unit 14.

由於該游動光柵12與該固定光柵13具有相同的週期性條紋,因此當該游動光柵12的透明處與該固定光柵13的透明處彼此相重疊時,此時光通量最多,於是當該等訊號通過時,就會有一個最大的峰值(peak);而當透明處與不透明處彼此相重疊時,此時光通量最小,於是當該等訊號通過時,就會得到一個最小的谷值(deep)。因此,當該游動光柵12上下移動時,該等訊號就會分別變成一個具有一定週期數量的弦波,並被該量測單元14所接收。由於該等弦波所具有的週期與該游動光柵12的移動距離成正比,因此只要計算該等弦波具有的週期數量,就可以精準地換算出該游動光柵12所移動的距離。舉個簡單的例子,若該游動光柵12的條紋週期為20um,而前述的弦波計算出具有12.34個週期,就可得到該游動光柵12的移動距離為:20um*12.34=246.8um。Since the traveling grating 12 and the fixed grating 13 have the same periodic fringes, when the transparent portion of the traveling grating 12 and the transparent portion of the fixed grating 13 overlap each other, the luminous flux is the most at this time, so when these When the signal passes, there will be a maximum peak; and when the transparent and opaque places overlap each other, the luminous flux is the smallest, so when these signals pass, you will get a minimum valley (deep) ). Therefore, when the wandering grating 12 moves up and down, the signals respectively become a sine wave with a certain number of cycles, and are received by the measuring unit 14. Since the period of the sinusoidal wave is proportional to the moving distance of the wandering grating 12, the distance moved by the wandering grating 12 can be accurately converted as long as the number of periods of the sinusoidal wave is calculated. As a simple example, if the fringe period of the wandering grating 12 is 20um, and the aforementioned sine wave calculation has 12.34 cycles, the moving distance of the wandering grating 12 can be obtained as: 20um * 12.34 = 246.8um.

然而,因為受限於諸如光學繞射、光柵製程的精度,及電子元件本身的雜訊等各種因素的干擾,因此如圖2所示,一般來講該量測單元14不會接收到完美的弦波,而是接收到一個振幅不穩定的類弦波。而若是用這樣的類弦波做週期的計算,就沒辦法非常地準確,導致計算移動距離時一直有不可避免的誤差存在。於是,隨著半導體與電子產業所要求的量測精度越來越高,如何更準確地計算類弦波的週期,以提高量測的精度,就成為了一個重要的課題。However, because it is limited by various factors such as optical diffraction, the accuracy of the grating process, and the noise of the electronic component itself, as shown in FIG. 2, generally speaking, the measurement unit 14 will not receive the perfect Sine wave, but received a sine-like wave with unstable amplitude. However, if such a sine wave is used for periodic calculation, there is no way to be very accurate, resulting in an inevitable error when calculating the moving distance. Therefore, as the measurement accuracy required by the semiconductor and electronics industry is getting higher and higher, how to calculate the period of the sine-like wave more accurately in order to improve the measurement accuracy has become an important issue.

因此,本發明之目的,即在提供一種能準確地計算出類弦波週期的一種計算類弦波之週期數目的方法。Therefore, the purpose of the present invention is to provide a method for calculating the number of periods of a sine-like wave that can accurately calculate the period of the sine-like wave.

於是,本發明一種計算類弦波之週期數目的方法,包含一個第一轉換步驟、一個第二轉換步驟、一個分割步驟、一個判斷步驟,及一個計數步驟。該類弦波是由兩個互相垂直的振動軸與相位軸所組成的函數。Therefore, a method for calculating the number of cycles of a sine-like wave of the present invention includes a first conversion step, a second conversion step, a division step, a judgment step, and a counting step. This type of sine wave is a function composed of two mutually perpendicular vibration axes and phase axes.

在該第一轉換步驟時,將該類弦波輸入至一個比較器,藉此將該類弦波轉換為一個相對應的方波。In the first conversion step, the sine-like wave is input to a comparator, thereby converting the sine-like wave into a corresponding square wave.

在該第二轉換步驟時,將該方波輸入至一個積分器,藉此將該方波轉換為一個相對應的三角波,且該三角波在該振動軸具有一個振幅。In the second conversion step, the square wave is input to an integrator, thereby converting the square wave into a corresponding triangular wave, and the triangular wave has an amplitude on the vibration axis.

在該分割步驟時,將該三角波輸入至一個分析處理模組,並選定一個分割係數,藉此將該三角波切割成複數個分割座標。In the segmentation step, the triangle wave is input to an analysis processing module, and a segmentation coefficient is selected, thereby cutting the triangle wave into a plurality of segmentation coordinates.

在該判斷步驟時,定義一個由該分割係數與該三角波之振幅所組成的分析程序,接著依序將該等分割座標代入該分析程序,若當代入的分割座標不滿足該分析程序時,則代入下一個分割座標至該分析程序,若代入的分割座標滿足該分析程序時,傳輸一個正確訊號,接著代入下一個分割座標至該分析程序,當該等分割座標全部代入完畢後,結束該判斷步驟。In this judgment step, an analysis program consisting of the division coefficient and the amplitude of the triangle wave is defined, and then the equal division coordinates are sequentially substituted into the analysis program. If the current division coordinates do not satisfy the analysis program, then Substitute the next division coordinate to the analysis program, if the substituted division coordinate satisfies the analysis program, transmit a correct signal, and then substitute the next division coordinate to the analysis program, when all the division coordinates have been substituted, end the judgment step.

在該計數步驟時,將所得到的正確訊號之數量,除以兩倍的該分割係數,藉此得到該類弦波之週期數量。In the counting step, the number of correct signals obtained is divided by twice the division factor to obtain the number of cycles of the sine wave.

本發明之功效在於:藉由該第一轉換步驟與該第二轉換步驟,將該類弦波轉換成該三角波;再透過該分割步驟與該判斷步驟,將該三角波分割為該等分割座標,並選定該分割係數的數值,接著將該等分割座標依序代入該分析程序,以判斷是否須發出一個正確訊號;最後藉由該計數步驟,就能計算出該類弦波的週期數量,且當選定的該分割係數越大,則計算出的精度也越高。The effect of the present invention is that: through the first conversion step and the second conversion step, the sine wave is converted into the triangle wave; and then through the division step and the judgment step, the triangle wave is divided into the division coordinates, And select the value of the division coefficient, and then substitute the equal division coordinates into the analysis program in order to determine whether it is necessary to send a correct signal; finally, through the counting step, the number of cycles of the sine wave can be calculated, and When the selected segmentation coefficient is larger, the calculated accuracy is also higher.

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

參閱圖3,本發明計算類弦波之週期數目的方法的一個第一實施例,包含一個第一轉換步驟2、一個第二轉換步驟3、一個分割步驟4、一個判斷步驟5、一個計數步驟6,及一個位移計算步驟7。該類弦波是由兩個互相垂直的相位軸與振動軸所組成的函數,且為了方便說明,在圖式中將以t軸與y軸分別代表該相位軸與該振動軸。另外要特別說明的是,實施方式中的每個段落皆須參考圖3,為了使說明更清楚簡潔,後續段落不再特別提醒。Referring to FIG. 3, a first embodiment of the method for calculating the number of sine-like cycles of the present invention includes a first conversion step 2, a second conversion step 3, a division step 4, a judgment step 5, and a counting step 6, and a displacement calculation step 7. This type of sine wave is a function composed of two mutually perpendicular phase axes and vibration axes, and for convenience of description, the t axis and the y axis will be used to represent the phase axis and the vibration axis, respectively. In addition, it should be particularly explained that each paragraph in the embodiment must refer to FIG. 3. In order to make the description clearer and more concise, subsequent paragraphs will not be specially reminded.

參閱圖4,在該第一轉換步驟2時,將該類弦波輸入至一個比較器,藉此將該類弦波轉換為一個相對應的方波。在該第二轉換步驟3時,將該方波輸入至一個積分器,藉此將該方波轉換為一個相對應的三角波。該三角波在該振動軸具有一個振幅A,並且在該第一實施例中,該振幅A的數值為2。Referring to FIG. 4, during the first conversion step 2, the sine wave-like wave is input to a comparator, thereby converting the sine wave-like wave into a corresponding square wave. In the second conversion step 3, the square wave is input to an integrator, thereby converting the square wave into a corresponding triangular wave. The triangular wave has an amplitude A at the vibration axis, and in the first embodiment, the value of the amplitude A is 2.

參閱圖5,在該分割步驟4時,將該三角波輸入至一個分析處理模組,藉此將該三角波切割成複數個分割座標。在該第一實施例中,該三角波將被分割成(t=0,y=0)、(t=1,y=1)、……,及(t=12,y=0)等13個分割座標,並且將(t=0,y=0)定義為初始分割座標。Referring to FIG. 5, in the segmentation step 4, the triangle wave is input to an analysis processing module, thereby cutting the triangle wave into a plurality of segmentation coordinates. In the first embodiment, the triangle wave will be divided into (t = 0, y = 0), (t = 1, y = 1), ..., and (t = 12, y = 0), etc. Split coordinates, and define (t = 0, y = 0) as the initial split coordinates.

接下來將利用圖6~7,說明該判斷步驟5的實施方式,並以圖8~9,舉例說明該判斷步驟5的部份流程。Next, the implementation of the judgment step 5 will be described using FIGS. 6-7, and the partial flow of the judgment step 5 will be exemplified with FIGS. 8-9.

參閱圖6,在該判斷步驟5時,選定一個分割係數S,再依序將該等分割座標代入一個分析程序51。若當代入的分割座標(t,y)不滿足該分析程序51時,則代入下一個分割座標(t,y)至該分析程序51。若代入的分割座標(t,y)滿足該分析程序51時,則傳輸一個正確訊號,接著代入下一個分割座標(t,y)至該分析程序51。當該等分割座標全部代入完畢後,即可結束該判斷步驟5。Referring to FIG. 6, in the judgment step 5, a division coefficient S is selected, and then the equal division coordinates are sequentially substituted into an analysis program 51. If the current segmentation coordinate (t, y) does not satisfy the analysis program 51, the next segmentation coordinate (t, y) is substituted into the analysis program 51. If the subdivided coordinates (t, y) satisfied satisfy the analysis program 51, a correct signal is transmitted, and then the next subordinate coordinates (t, y) are substituted into the analysis program 51. After all the division coordinates are substituted, the judgment step 5 can be ended.

參閱圖7,首先說明構成上述的該分析程序51的四個參數:一個振動軸位移量ρ、一個振動軸變數ψ、一個第一判斷數ψ +,及一個第二判斷數ψ -;其中,ρ≡該振幅A/該分割係數S,ψ +≡ψ+ρ,ψ -≡ψ-ρ。要特別說明的是,該振動軸變數ψ的初始數值,是等於該初始分割座標之震盪軸分量,例如在該第一實施例中,該初始分割座標為(t=0,y=0),因此該振動軸變數ψ的初始數值=0;另外,在該第一實施例中,該振動軸位移量ρ=A/S=2/2=1。 Referring to Figure 7, the above described first configuration of the four parameter analysis program 51: a shaft vibration displacement amount [rho], [Psi] a variable oscillation axis, determining a first number ψ +, and determining a second number ψ -; wherein, ρ≡ the amplitude A / the division coefficient S, ψ + ≡ ψ + ρ, ψ - ≡ ψ-ρ. In particular, the initial value of the vibration axis variable ψ is equal to the oscillation axis component of the initial division coordinate. For example, in the first embodiment, the initial division coordinate is (t = 0, y = 0), Therefore, the initial value of the vibration axis variable ψ = 0; in addition, in the first embodiment, the vibration axis displacement ρ = A / S = 2/2 = 1.

接著說明該分析程序51的流程,當其中一個分割座標(t,y)代入該分析程序51後,將依代入之振動軸分量的大小,分為以下三種狀況: (1) ψ +>y>ψ -,即該第一判斷數>代入之振動軸分量>該第二判斷數:此時判定為不滿足該分析程序51,並直接結束該分析程序51。 (2)y≧ψ +,即代入之振動軸分量≧該第一判斷數:此時輸出一個第一方向訊號,並判定為滿足該分析程序51,接著將該振動軸變數ψ的數值,更新為代入之振動軸分量的數值,最後結束該分析程序51。 (3)y≦ψ -,即代入之振動軸分量≦該第二判斷數:此時輸出一個第二方向訊號,並判定為滿足該分析程序51,接著將該振動軸變數ψ的數值,更新為代入之振動軸分量的數值,最後結束該分析程序51。 Next, the flow of the analysis program 51 will be described. When one of the division coordinates (t, y) is substituted into the analysis program 51, the vibration axis component is divided into the following three situations according to the size of the substitution: (1) ψ + >y> ψ -, i.e., the number of the first determination> substituting vibrate axis component> the second number is determined: In this case it is determined that the parser 51 is not satisfied, and directly ends the analysis program 51. (2) y ≧ ψ + , that is, the substituted vibration axis component ≧ the first judgment number: a first direction signal is output at this time, and it is determined that the analysis program 51 is satisfied, and then the value of the vibration axis variable ψ is updated In order to substitute the value of the vibration axis component, the analysis program 51 is finally ended. (3) y ≦ ψ -, i.e. substituting the vibration axis component of the second number ≦ determination: when the output signal in a second direction, and it is determined to meet the analysis program 51, followed by the variable axis vibration value [Psi], update In order to substitute the value of the vibration axis component, the analysis program 51 is finally ended.

為了更清楚地說明,用以下的例子演示該判斷步驟5的部分流程。由前面的敘述我們已知ψ的初始值=0、ρ=1,於是此時ψ +=1、ψ -=-1。因此如圖8所示,當第一個分割座標(t=0,y=0)代入該分析程序51後,此時ψ +>y=0>ψ -,故判斷不滿足該分析程序51,直接結束該分析程序51,並且代入下一個分割座標(t=1,y=1)至該分析程序51。 In order to explain more clearly, the following example demonstrates part of the flow of this judgment step 5. From the foregoing description that we know the initial value of [Psi] = 0, ρ = 1, then this time ψ + = 1, ψ - = -1. Therefore, as shown, when the first division coordinate (t = 0, y = 0 ) after substituting the analysis program 51, when ψ 8 +> y = 0> ψ -, so that analysis program 51 determines not satisfied, The analysis program 51 is directly ended, and the next division coordinate (t = 1, y = 1) is substituted into the analysis program 51.

接著如圖9所示,當下一個分割座標(t=1,y=1)代入後,由於此時y=1≧ψ +,因此判斷滿足該分析程序51,於是將輸出該第一方向訊號,並將該振動軸變數ψ作更新,也就是ψ=y=1,且此時ψ +=1+1=2、ψ -=1-1=0。更新後首先結束該分析程序51,接著發出一個正確訊號,再代入下一個分割座標(t=2,y=2)至該分析程序51。依此類推,最終就能完成該判斷步驟5,並且得到12個正確訊號。值得一提的是,該第一方向訊號與該第二方向訊號,是用來判斷該類弦波的傳播方向,例如圖1所示,當應用在位移量測時,只要確認該量測單元14接收到的是第一方向訊號還是第二方向訊號,就能推得該游動光柵12是往上移動還是往下移動。 Then, as shown in FIG. 9, after the next division coordinate (t = 1, y = 1) is substituted, since y = 1 ≧ ψ + at this time, it is judged that the analysis program 51 is satisfied, and the first direction signal will be output, and [Psi] as the variable to update the oscillating shaft, that is, ψ = y = 1, and at this time ψ + = 1 + 1 = 2 , ψ - = 1-1 = 0. After the update, the analysis program 51 is ended first, then a correct signal is sent out, and then the next division coordinate (t = 2, y = 2) is substituted into the analysis program 51. By analogy, the final judgment step 5 can be completed, and 12 correct signals are obtained. It is worth mentioning that the first direction signal and the second direction signal are used to determine the propagation direction of the sine wave, for example, as shown in FIG. 1, when applied to displacement measurement, just confirm the measurement unit 14 Whether the first direction signal or the second direction signal is received, it can be deduced whether the traveling grating 12 moves upward or downward.

在該計數步驟6時,將所得到的正確訊號之數量,除以兩倍的該分割係數S,即能得到該類弦波之週期數量。例如在該第一實施例中,該類弦波的週期數量=(正確訊號數量)/(2*該分割系數S)=12/(2*2)=3個。In the counting step 6, the number of correct signals obtained is divided by twice the division factor S to obtain the number of cycles of the sine wave. For example, in the first embodiment, the number of cycles of this type of sine wave = (the number of correct signals) / (2 * the division factor S) = 12 / (2 * 2) = 3.

於是,無論在何種應用領域,當要計算一個類弦波的週期數量時,就能利用該第一轉換步驟2到該計數步驟6,計算出週期數量,且當選定的分割係數S越大時,計算的準確度也會越高。而若是要應用在編碼器的位移量測用途時,就可以使用該位移計算步驟7。參閱圖1,假設該游動光柵12與該固定光柵13的週期長度是20um,則該位移計算步驟7就是將該類弦波的週期數量(3個)乘上該游動光柵12的光柵週期長度(20um),藉此能得到該游動光柵12的位移量,也就是3*20um=60um。Therefore, regardless of the application field, when calculating the number of cycles of a sine-like wave, the first conversion step 2 to the counting step 6 can be used to calculate the number of cycles, and when the selected division factor S is larger , The accuracy of the calculation will be higher. If it is to be used in the displacement measurement of the encoder, the displacement calculation step 7 can be used. Referring to FIG. 1, assuming that the period length of the moving grating 12 and the fixed grating 13 is 20 μm, the displacement calculation step 7 is to multiply the number of periods of the sine wave-like (3) by the grating period of the moving grating 12 Length (20um), by which the displacement of the wandering grating 12 can be obtained, that is, 3 * 20um = 60um.

為了更完整地說明該判斷步驟5與該分析程序51,以下利用一個第二實施例當作範例。參閱圖10~11,並以圖5~6輔助,假設該第二實施例的類弦波經該第一轉換步驟2與該第二轉換步驟3後,輸出如圖10所示的三角波,並且該第二實施例的參數與該第一實施例類似,也就是該振幅A=2、該分割係數S=2,而該振動軸位移量ρ=1。另外由於該第二實施例的三角波,其前段的分割座標與該第一實施例相同,因此這裡不再贅述,此處主要針對後段的分割座標(t=10,y=2)~(t=14,y=0)在該判斷步驟的過程做說明。於是,當分割座標(t=10,y=2)~(t=14,y=0)代入後可分為以下三個階段: (1)當分割座標(t=10,y=2)代入該分析程序51後,參考該第一實施例所演示的,可推得此時將滿足該分析程序,於是首先會把該振動軸變數ψ做更新,也就是ψ=y=2,接著輸出一個第一方向訊號與一個正確訊號,然後再代入下一個分割座標(t=11,y=1.5)至該分析程序51。 (2)當下一個分割座標(t=11,y=1.5)代入後,由於此時ψ +=2+1=1,ψ -=2-1=1,也就是ψ +>y=1.5>ψ -,因此判定不滿足該分析程序51,此時不更新該振動軸變數ψ的數值,且當結束該分析程序51後,也不輸出正確訊號。 (3)當再下一個分割座標(t=12,y=1)代入後,由於此時y=1≦ψ -,因此將更新該振動軸變數ψ,也就是ψ=y=1,並且輸出一個第一方向訊號與一個正確訊號。依此類推,下一個分割座標(t=13,y=0.5)同樣不會滿足該分析程序,直到下下一個分割座標(t=14,y=0)才會滿足。於是最終將如同第一實施例一樣,得到12個正確訊號。 In order to explain the judgment step 5 and the analysis program 51 more completely, a second embodiment is used as an example below. Referring to FIGS. 10 to 11, and assisted by FIGS. 5 to 6, suppose that the sine-like wave of the second embodiment outputs the triangular wave as shown in FIG. 10 after the first conversion step 2 and the second conversion step 3, and The parameters of the second embodiment are similar to those of the first embodiment, that is, the amplitude A = 2, the division coefficient S = 2, and the vibration axis displacement ρ = 1. In addition, due to the triangular wave of the second embodiment, the segmentation coordinates of the front segment are the same as those of the first embodiment, so they will not be repeated here. The segmentation coordinates of the rear segment (t = 10, y = 2) ~ (t = 14, y = 0) The process of this judgment step will be described. Therefore, when the division coordinates (t = 10, y = 2) ~ (t = 14, y = 0) are substituted, they can be divided into the following three stages: (1) When the division coordinates (t = 10, y = 2) are substituted After the analysis program 51, referring to the demonstration of the first embodiment, it can be concluded that the analysis program will be satisfied at this time, so the vibration axis variable ψ will be updated first, that is, ψ = y = 2, and then a The first direction signal and a correct signal are then substituted into the next segmentation coordinate (t = 11, y = 1.5) to the analysis program 51. (2) dividing a current coordinate (t = 11, y = 1.5 ) after substituting, since at this time ψ + = 2 + 1 = 1 , ψ - = 2-1 = 1, i.e. ψ +> y = 1.5> ψ -Therefore , it is determined that the analysis program 51 is not satisfied. At this time, the value of the vibration axis variable ψ is not updated, and when the analysis program 51 is ended, the correct signal is not output. (3) When the next division coordinate (t = 12, y = 1) is substituted, since y = 1 ≦ ψ - at this time, the vibration axis variable ψ, that is, ψ = y = 1, will be updated and the output A first direction signal and a correct signal. By analogy, the next segmentation coordinate (t = 13, y = 0.5) will also not satisfy the analysis procedure until the next segmentation coordinate (t = 14, y = 0). So in the end, as in the first embodiment, 12 correct signals will be obtained.

如同在先前技術中所提的,圖1中的量測單元14由於諸多因素的影響,因而會接收到各種的類弦波。例如當該游動光柵12在移動時突然改變速度,就會產生如同圖10所示的三角波,因此該第二實施例就展示了即使因為各種因素而產生各種類弦波,還是能利用本發明方法精確地計算類弦波的週期,並且推得該游動光柵12的移動距離。As mentioned in the prior art, the measurement unit 14 in FIG. 1 receives various sine-like waves due to many factors. For example, when the wandering grating 12 suddenly changes its speed while moving, a triangular wave as shown in FIG. 10 is generated, so the second embodiment shows that even if various kinds of sine waves are generated due to various factors, the present invention can still be utilized The method accurately calculates the period of the sine-like wave, and derives the moving distance of the wandering grating 12.

綜上所述,本發明計算類弦波之週期數目的方法,藉由該第一轉換步驟2與該第二轉換步驟3,將該類弦波轉換成該三角波;再透過該分割步驟4與該判斷步驟5,將該三角波分割為該等分割座標,並選定該分割係數S的數值,接著將該等分割座標依序代入該分析程序51,以判斷是否須發出一個正確訊號;最後藉由該計數步驟6,就能計算出該類弦波的週期數量,且當選定的該分割係數S越大,則計算出的精度也越高,故確實能達成本發明之目的。In summary, the method for calculating the number of periods of the sine-like wave of the present invention converts the sine-like wave into the triangular wave through the first conversion step 2 and the second conversion step 3; In the judgment step 5, the triangle wave is divided into the division coordinates, and the value of the division coefficient S is selected, and then the equal division coordinates are sequentially substituted into the analysis program 51 to judge whether it is necessary to send a correct signal; and finally by In the counting step 6, the number of cycles of the sine wave can be calculated, and the larger the selected division factor S, the higher the accuracy of the calculation, so it can indeed achieve the purpose of the invention.

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

1‧‧‧編碼器
11‧‧‧發光單元
12‧‧‧游動光柵
13‧‧‧固定光柵
14‧‧‧量測單元
2‧‧‧第一轉換步驟
3‧‧‧第二轉換步驟
4‧‧‧分割步驟
5‧‧‧判斷步驟
51‧‧‧分析程序
6‧‧‧計數步驟
7‧‧‧位移計算步驟
A‧‧‧振幅
t‧‧‧相位軸
y‧‧‧振動軸
ρ‧‧‧振動軸位移量
ψ‧‧‧振動軸變數
ψ<sup>+</sup>‧‧‧第一判斷數
ψ<sup>-</sup>‧‧‧第二判斷數
1‧‧‧ Encoder
11‧‧‧Lighting unit
12‧‧‧travel grating
13‧‧‧Fixed grating
14‧‧‧Measurement unit
2‧‧‧ First conversion step
3‧‧‧The second conversion step
4‧‧‧Segmentation step
5‧‧‧Judgment steps
51‧‧‧Analysis procedure
6‧‧‧Counting steps
7‧‧‧Displacement calculation steps
A‧‧‧Amplitude
t‧‧‧Phase axis
y‧‧‧Vibration axis ρ‧‧‧Vibration axis displacement ψ‧‧‧Vibration axis variable ψ <sup> + </ sup> ‧‧‧First judgment number ψ <sup>-</ sup> Dichotomous number

本發明之其他的特徵及功效,將於參照圖式的實施方式中清楚地呈現,其中: 圖1是一個編碼器的一個示意圖; 圖2是一個二維座標圖,說明該編碼器的一個量測單元,接收到一個類弦波; 圖3是一個流程圖,說明本發明計算類弦波之週期數目的方法的一個第一實施例; 圖4是一個二維座標圖組,說明藉由該第一實施例的一個第一轉換步驟與一個第二轉換步驟,將一個類弦波轉換為一個三角波; 圖5是一個二維座標圖,說明該三角波被切割為複數個分割座標; 圖6是一個流程圖,說明該第一實施例的一個判斷步驟的流程; 圖7是一個流程圖,說明該判斷步驟中的一個分析程序的流程; 圖8與圖9分別是一個二維座標圖,說明該判斷步驟的部分過程; 圖10是一個二維座標圖,說明本發明計算類弦波之週期數目的方法的一個第二實施例;及 圖11是一個二維座標圖,說明該第二實施例的一個判斷步驟的部分過程。Other features and functions of the present invention will be clearly presented in the embodiment with reference to the drawings, in which: FIG. 1 is a schematic diagram of an encoder; FIG. 2 is a two-dimensional coordinate diagram illustrating a quantity of the encoder The measurement unit receives a sine-like wave; FIG. 3 is a flowchart illustrating a first embodiment of the method for calculating the number of periods of the sine-like wave of the present invention; FIG. 4 is a two-dimensional coordinate graph group, illustrating A first conversion step and a second conversion step of the first embodiment convert a sine-like wave into a triangular wave; FIG. 5 is a two-dimensional coordinate diagram illustrating that the triangular wave is cut into a plurality of division coordinates; FIG. 6 is A flowchart illustrating the flow of a judgment step of the first embodiment; FIG. 7 is a flowchart illustrating the flow of an analysis program in the judgment step; FIGS. 8 and 9 are respectively a two-dimensional coordinate diagram to illustrate Part of the process of this judgment step; FIG. 10 is a two-dimensional coordinate diagram illustrating a second embodiment of the method for calculating the number of periods of a sine-like wave of the present invention; and FIG. 11 is a two-dimensional coordinate FIG., The step of determining a portion of the process described in the second embodiment.

2‧‧‧第一轉換步驟 2‧‧‧ First conversion step

3‧‧‧第二轉換步驟 3‧‧‧The second conversion step

4‧‧‧分割步驟 4‧‧‧Segmentation step

5‧‧‧判斷步驟 5‧‧‧Judgment steps

51‧‧‧分析程序 51‧‧‧Analysis procedure

6‧‧‧計數步驟 6‧‧‧Counting steps

7‧‧‧位移計算步驟 7‧‧‧Displacement calculation steps

Claims (5)

一種計算類弦波之週期數目的方法,該類弦波是由兩個互相垂直的相位軸與振動軸所組成的函數,本發明方法依序包含: 一個第一轉換步驟,將該類弦波輸入至一個比較器,藉此將該類弦波轉換為一個相對應的方波; 一個第二轉換步驟,將該方波輸入至一個積分器,藉此將該方波轉換為一個相對應的三角波,且該三角波在該振動軸具有一個振幅; 一個分割步驟,將該三角波輸入至一個分析處理模組,藉此將該三角波切割成複數個分割座標; 一個判斷步驟,選定一個分割係數,並定義一個由該分割係數與該三角波之振幅所組成的分析程序,接著依序將該等分割座標代入該分析程序,若當代入的分割座標不滿足該分析程序時,則代入下一個分割座標至該分析程序,若代入的分割座標滿足該分析程序時,傳輸一個正確訊號,接著代入下一個分割座標至該分析程序,當該等分割座標全部代入完畢後,結束該判斷步驟;及 一個計數步驟,將所得到的正確訊號之數量,除以兩倍的該分割係數,藉此得到該類弦波之週期數量。A method for calculating the number of periods of a sine-like wave, which is a function composed of two mutually perpendicular phase axes and vibration axes. The method of the present invention sequentially includes: a first conversion step to convert the sine-like waves Input to a comparator to convert the sine wave to a corresponding square wave; a second conversion step to input the square wave to an integrator to convert the square wave to a corresponding square wave Triangle wave, and the triangle wave has an amplitude on the vibration axis; a division step, input the triangle wave to an analysis processing module, thereby cutting the triangle wave into a plurality of division coordinates; a judgment step, select a division coefficient, and Define an analysis program composed of the segmentation coefficient and the amplitude of the triangle wave, and then substitute the equal segmentation coordinates into the analysis program in sequence. If the current segmentation coordinates do not satisfy the analysis program, then substitute the next segmentation coordinate to In the analysis program, if the segmentation coordinates entered satisfy the analysis procedure, a correct signal is transmitted, and then the next segmentation coordinates are substituted to The analysis procedure ends the judgment step after all the division coordinates have been substituted; and a counting step, which divides the number of correct signals obtained by twice the division coefficient to obtain the Number of cycles. 如請求項1所述的計算類弦波之週期數目的方法,其中,在該判斷步驟時,將第一個代入該分析程序的分割座標定義為初始分割座標;該分析程序是由以下參數所組成 一個振動軸位移量,等於該三角波之振幅除以該分割係數, 一個振動軸變數,當該等分割座標尚未代入該分析程序時,該振動軸變數等於該初始分割座標之振動軸分量, 一個第一判斷數,等於該振動軸變數加該振動軸位移量,及 一個第二判斷數,等於該振動軸變數減該振動軸位移量; 於是,當任意一個分割座標代入該分析程序,若代入之振動軸分量小於該第一判斷數,且大於該第二判斷數時,則判定為不滿足該分析程序,並結束該分析程序,否則將判定為滿足該分析程序,並將該振動軸變數的數值,更新為代入之振動軸分量的數值,更新後結束該分析程序。The method for calculating the number of sine wave-like cycles as described in claim 1, wherein, in the judgment step, the first division coordinate substituted into the analysis program is defined as the initial division coordinate; the analysis program is defined by the following parameters A vibration axis displacement is equal to the amplitude of the triangle wave divided by the division factor, a vibration axis variable. When the division coordinates have not been substituted into the analysis program, the vibration axis variable is equal to the vibration axis component of the initial division coordinate, a The first judgment number is equal to the vibration axis variable plus the vibration axis displacement, and a second judgment number is equal to the vibration axis variable minus the vibration axis displacement; therefore, when any one of the division coordinates is substituted into the analysis program, if it is substituted into When the vibration axis component is less than the first judgment number and greater than the second judgment number, it is determined that the analysis procedure is not satisfied, and the analysis procedure is ended, otherwise it is determined that the analysis procedure is satisfied, and the vibration axis variable is determined The value of is updated to the value of the vibration axis component that is substituted, and the analysis process is ended after the update. 如請求項2所述的計算類弦波之週期數目的方法,其中,在該分析程序時,若代入之分割座標判定為不滿足該分析程序,且代入的分割座標之相位軸分量不小於該第一判斷數,則輸出一個第一方向訊號。The method for calculating the number of sine-like cycles as described in claim 2, wherein, in the analysis procedure, if the substituted division coordinates are determined not to satisfy the analysis procedure, and the phase axis component of the substituted division coordinates is not less than the The first judgment number outputs a first direction signal. 如請求項3所述的計算類弦波之週期數目的方法,其中,在該分析程序時,若代入之分割座標判定為不滿足該分析程序,且代入的分割座標之相位軸分量不大於該第二判斷數,則輸出一個第二方向訊號。The method for calculating the number of sine-like cycles as described in claim 3, wherein, in the analysis procedure, if the substituted division coordinates are determined not to satisfy the analysis procedure, and the phase axis component of the substituted division coordinates is not greater than the The second judgment number outputs a second direction signal. 如請求項1至4任一項所述的計算類弦波之週期數目的方法,還包含一個在該計數步驟後面的位移計算步驟,該位移計算步驟是將該類弦波之週期數量乘以一個光柵週期長度。The method for calculating the number of periods of a sine wave-like wave as described in any one of claims 1 to 4 further includes a displacement calculation step after the counting step, which is a step of multiplying the number of periods of the sine wave-like wave by One raster period length.
TW105141311A 2016-12-14 2016-12-14 Method of calculating the number of periods of quasi-sinusoidal wave TWI616661B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW105141311A TWI616661B (en) 2016-12-14 2016-12-14 Method of calculating the number of periods of quasi-sinusoidal wave

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW105141311A TWI616661B (en) 2016-12-14 2016-12-14 Method of calculating the number of periods of quasi-sinusoidal wave

Publications (2)

Publication Number Publication Date
TWI616661B true TWI616661B (en) 2018-03-01
TW201821810A TW201821810A (en) 2018-06-16

Family

ID=62189237

Family Applications (1)

Application Number Title Priority Date Filing Date
TW105141311A TWI616661B (en) 2016-12-14 2016-12-14 Method of calculating the number of periods of quasi-sinusoidal wave

Country Status (1)

Country Link
TW (1) TWI616661B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW581856B (en) * 2001-12-31 2004-04-01 Ind Tech Res Inst Counting of dual sine wave signal
WO2011016480A1 (en) * 2009-08-05 2011-02-10 三井造船株式会社 Apparatus for calculating number of revolutions of reciprocating engine and reciprocating engine control apparatus
CN104764473A (en) * 2008-08-26 2015-07-08 株式会社尼康 Encoder system, signal processing method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW581856B (en) * 2001-12-31 2004-04-01 Ind Tech Res Inst Counting of dual sine wave signal
CN104764473A (en) * 2008-08-26 2015-07-08 株式会社尼康 Encoder system, signal processing method
WO2011016480A1 (en) * 2009-08-05 2011-02-10 三井造船株式会社 Apparatus for calculating number of revolutions of reciprocating engine and reciprocating engine control apparatus

Also Published As

Publication number Publication date
TW201821810A (en) 2018-06-16

Similar Documents

Publication Publication Date Title
CN103837169B (en) For self-correcting apparatus and method and the magnetism encoder of magnetism encoder
CN102589405B (en) Motor rotor displacement measurement method
JP6436616B2 (en) Measuring device, measuring method, and processing device
KR20130114193A (en) Device for detecting multi-turn absolute rotation angle, and method for detecting rotation angle thereof
CN102111158A (en) Device for subdividing sine signal and cosine signal of position sensor and coding data, and implementation method thereof
JP5942085B2 (en) Flow rate correction coefficient setting method and flow rate measuring apparatus using the same
CN102759633A (en) Real-time rotating speed detection module of servo motor based on FPGA (Field Programmable Gate Array)
CN104949620A (en) Correction device and correction method for optical measuring apparatus
CN201858990U (en) Device for subdividing sine-cosine signals and encoding data of position sensor
TWI616661B (en) Method of calculating the number of periods of quasi-sinusoidal wave
CN102879017B (en) Novel double-speed coarse and fine combination system for resolver-to-digital converter
CN102620704B (en) Steering wheel angle measurement method and steering wheel angle sensor
CN104455311B (en) Involute teeth shape parameter is parameterized to calculate and drawing practice
CN103152016A (en) Shaping method and circuit for photoelectricity code circuit output signal
RU2598690C1 (en) Method for measuring displacements of object
US9250103B2 (en) Optical rotary encoder with correction method reducing variation of a distance between a rotation body and a light receiving unit
JP2013246054A (en) Motor control device, and control method of motor control device
RU2594669C1 (en) Method for measuring displacements of object
JP2007327898A (en) Standard deviation calculation method and its program of sound field energy spread in gaussian ray bundle model
CN104682818A (en) Rotary variable-voltage angle measuring system based on CORDIC (coordinate rotation digital computer) arc tangent algorithm
CN108759644B (en) Moving distance detection method and device and storage medium
CN106441375B (en) A kind of angular speed calculation method and device
CN103488352B (en) The coordinate capture of infrared multi-point touch screen and correction algorithm
JP6589107B2 (en) Modulated wave resolver device
CN115342830A (en) Calibration method, program product and calibration device for a positioning device and a odometer