TWI427919B - Encoding system and encoding method thereof - Google Patents

Encoding system and encoding method thereof Download PDF

Info

Publication number
TWI427919B
TWI427919B TW98117755A TW98117755A TWI427919B TW I427919 B TWI427919 B TW I427919B TW 98117755 A TW98117755 A TW 98117755A TW 98117755 A TW98117755 A TW 98117755A TW I427919 B TWI427919 B TW I427919B
Authority
TW
Taiwan
Prior art keywords
processor
measured
amplitude
wave
point
Prior art date
Application number
TW98117755A
Other languages
Chinese (zh)
Other versions
TW201042905A (en
Inventor
Rong Cong Hung
Rong Hwang Horng
Shen An Chen
You Ren Lin
Shih Chang Chen
Yaw Shen Lai
Original Assignee
Foxnum Technology Co Ltd
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 Foxnum Technology Co Ltd filed Critical Foxnum Technology Co Ltd
Priority to TW98117755A priority Critical patent/TWI427919B/en
Publication of TW201042905A publication Critical patent/TW201042905A/en
Application granted granted Critical
Publication of TWI427919B publication Critical patent/TWI427919B/en

Links

Description

解碼裝置及其解碼方法 Decoding device and decoding method thereof

本發明係關於一種解碼裝置及其解碼方法。 The present invention relates to a decoding apparatus and a decoding method thereof.

編碼器分為增量式編碼器及絕對式編碼器,其中該增量式編碼器輸出的訊號為TTL數位脈衝訊號,該絕對式編碼器輸出的訊號為Sin波訊號或者Cos波訊號。當絕對式編碼器與一馬達連接時,對馬達在某段時間內旋轉的距離的求取是透過編碼器輸出的弦波在兩個時刻之間的位置差來確定。如此即需要對兩個時刻的弦波進行解碼。習知均是透過將弦波轉化成脈衝波來確定馬達旋轉的距離,由於脈衝波只體現了弦波的頂點處的資訊,從而使得在該段時間內兩頂點之間的任意時刻的位置資訊在弦波轉換成脈衝波時會損失掉,造成確定馬達旋轉的距離求取的不準確。 The encoder is divided into an incremental encoder and an absolute encoder. The signal output by the incremental encoder is a TTL digital pulse signal, and the signal output by the absolute encoder is a Sin wave signal or a Cos wave signal. When the absolute encoder is coupled to a motor, the distance of rotation of the motor for a certain period of time is determined by the difference in position between the sine waves output by the encoder at two times. In this case, the sine wave at two moments needs to be decoded. It is conventional to determine the distance of the motor rotation by converting the sine wave into a pulse wave. Since the pulse wave only reflects the information at the apex of the sine wave, the position information at any time between the two vertices in the period of time is obtained. When the sine wave is converted into a pulse wave, it is lost, causing inaccuracy in determining the distance at which the motor rotates.

鑒於以上,有必要提供一種可準確求取弦波上任意兩點之間的位置差的解碼裝置及其解碼方法。 In view of the above, it is necessary to provide a decoding apparatus and a decoding method thereof that can accurately determine the position difference between any two points on a sine wave.

一種弦波解碼裝置,用於計算由一編碼器輸出的相位相差90度的兩弦波在一第一待測點與一第二待測點之間的距離,該弦波解碼裝置包括一轉換器及一處理器,該轉換器連接在該編碼器與該處理器之間以得到該兩弦波在每一點的幅值,並將其傳輸至該處理器,該處理器包括: 一資料處理單元,存儲該兩弦波的幅值的符號、兩弦波的幅值的絕對值之間的差值的符號以及上述三個符號與複數區間的對應關係,並存儲有每一區間所對應的正切函數;一區間判定單元,用於根據該第一待測點兩弦波的幅值以及該第二待測點兩弦波的幅值判定第一待測點及一第二待測點該兩弦波的幅值所組成的點所位於的區間,該資料處理單元用於根據該第一及第二待測點兩弦波的幅值所組成的點所位於的區間分別選擇對應的正切函數,並根據所選擇的正切函數對應得到該第一及第二待測點的θ值,還用於根據公式L=N/2 π×θ計算該第一及第二待測點的L值,其中N為目標解析度;及一位置記錄求取單元,用於記錄該第一及第二待測點之間所經過的弦波的週期個數M及透過公式S=L Q +[M/4]×R-L P 來求取該兩弦波任意兩點之間的位置差S,其中L Q 及L P 分別為該第二及第一待測點的L值,R為一個週期的弦波的長度。 A sine wave decoding device, configured to calculate a distance between a first to-be-measured point and a second to-be-measured point of a two-sine wave with a phase difference of 90 degrees outputted by an encoder, the sine wave decoding device including a conversion And a processor coupled between the encoder and the processor to obtain the amplitude of the two-string wave at each point, and transmitting the same to the processor, the processor comprising: a data processing a unit storing a sign of a magnitude of the two-string wave, a sign of a difference between absolute values of amplitudes of the two-sine wave, and a correspondence between the three symbols and the complex interval, and storing corresponding to each interval a tangent function; an interval determining unit, configured to determine, according to the amplitude of the two sine waves of the first point to be measured and the amplitude of the two sine waves of the second point to be measured, the first point to be measured and the second point to be measured The interval in which the amplitude of the two-string wave is located, the data processing unit is configured to respectively select the corresponding tangent according to the interval in which the points formed by the amplitudes of the first and second points to be measured are located Function, and get the corresponding according to the selected tangent function And the θ value of the second point to be measured is further used to calculate the L value of the first and second points to be measured according to the formula L=N/2 π×θ, where N is the target resolution; and a position record is obtained. a unit for recording the number M of periods of the sine wave passing between the first and second points to be measured and using the formula S=L Q +[M/4]×RL P to obtain the two-string arbitrary The position difference S between two points, where L Q and L P are the L values of the second and first points to be measured, respectively, and R is the length of the sine wave of one period.

一種解碼方法,用於計算由一編碼器輸出的兩相位相差90度的弦波在一第一待測點與一第二待測點之間的距離,該解碼方法包括以下步驟:透過一轉換器得到該兩弦波在每一點的幅值,並將其傳輸至一處理器,其中該處理器內存儲有兩弦波的幅值的符號、兩弦波的幅值的絕對值之間的差值的符號以及其與複數區間的對應關係,並存儲有每一區間所對應的正切函數;該處理器根據該第一待測點兩弦波的幅值以及該第二待測點兩弦 波的幅值判定第一待測點及一第二待測點該兩弦波的幅值所組成的點所位於的區間;該處理器根據得到的區間運算得到該第一及第二待測點的θ值,還用於根據公式L=N/2 π×θ計算該第一及第二待測點的L值,其中N為目標解析度;及該處理器記錄該第一及第二待測點之間所經過的弦波的週期個數M及透過公式S=L Q +[M/4]×R-L P 來求取該兩弦波任意兩點之間的位置差S,其中L Q 及L P 分別為該第二及第一待測點的L值,R為一個週期的弦波的長度。 A decoding method for calculating a distance between a first to-be-measured point and a second to-be-measured point of a sine wave whose two phases are 90 degrees out of phase by an encoder, the decoding method comprising the following steps: Obtaining the amplitude of the two sine waves at each point and transmitting it to a processor, wherein the processor stores the sign of the amplitude of the two sine waves and the absolute value of the amplitude of the two sine waves a sign of the difference and its correspondence with the complex interval, and storing a tangent function corresponding to each interval; the processor is based on the amplitude of the two-string wave of the first point to be measured and the second string of the second point to be measured The amplitude of the wave determines an interval in which the point formed by the amplitude of the two sine waves of the first to-be-measured point and a second to-be-measured point is located; the processor obtains the first and second to-be-tested according to the obtained interval operation The θ value of the point is further used to calculate the L value of the first and second points to be measured according to the formula L=N/2 π×θ, where N is the target resolution; and the processor records the first and second The number of periods M of the sine wave passing between the points to be measured and the formula S=L Q +[M/4]×RL P are used to obtain the two The position difference S between any two points of the sine wave, wherein L Q and L P are the L values of the second and first points to be measured, respectively, and R is the length of the sine wave of one period.

本發明解碼方法應用該弦波解碼裝置,將該編碼器輸出的兩弦波每一點的幅值傳輸至該處理器,該兩弦波對應的幅值透過該處理器中的區間判定單元、資料處理單元及位置記錄求取單元,以得到該第一及第二待測點之間的位置差,相較於習知編碼器而言可準確求取兩弦波上任意兩點之間的位置差。 The decoding method of the present invention applies the sine wave decoding device, and transmits the amplitude of each point of the two-string wave outputted by the encoder to the processor, and the amplitude corresponding to the two-string wave passes through the interval determining unit and the data in the processor. The processing unit and the position record obtaining unit are configured to obtain a position difference between the first and second points to be measured, and the position between any two points on the two-string wave can be accurately obtained compared with the conventional encoder. difference.

10‧‧‧轉換器 10‧‧‧ converter

20‧‧‧偏移調節器 20‧‧‧Offset adjuster

30‧‧‧振幅調節器 30‧‧‧Amplitude adjuster

40‧‧‧處理器 40‧‧‧ processor

41‧‧‧區間判定單元 41‧‧‧Interval decision unit

42‧‧‧資料處理單元 42‧‧‧Data Processing Unit

43‧‧‧合成單元 43‧‧‧Synthesis unit

44‧‧‧位置記錄求取單元 44‧‧‧Location Recording Unit

45‧‧‧結果輸出單元 45‧‧‧Result output unit

50‧‧‧監視器 50‧‧‧ monitor

60‧‧‧編碼器 60‧‧‧Encoder

620‧‧‧第一正弦波 620‧‧‧First sine wave

621‧‧‧第二正弦波 621‧‧‧Second sine wave

622‧‧‧A相數位脈衝訊號 622‧‧‧A phase digital pulse signal

623‧‧‧B相數位脈衝訊號 623‧‧‧B phase digital pulse signal

624‧‧‧合成脈衝訊號 624‧‧‧Synthesis pulse signal

444‧‧‧鋸齒波 444‧‧‧Sawtooth wave

70‧‧‧轉換電路 70‧‧‧Transition circuit

圖1係本發明解碼裝置的較佳實施方式的原理框圖。 1 is a schematic block diagram of a preferred embodiment of a decoding device of the present invention.

圖2係本發明解碼裝置的較佳實施方式的處理器的功能模塊圖。 2 is a functional block diagram of a processor of a preferred embodiment of the decoding device of the present invention.

圖3係本發明解碼裝置的較佳實施方式中的區間劃分示意圖。 3 is a schematic diagram of interval division in a preferred embodiment of the decoding apparatus of the present invention.

圖4係本發明解碼裝置的較佳實施方式中未經過偏移調整前的波形圖。 4 is a waveform diagram before the offset adjustment is performed in the preferred embodiment of the decoding apparatus of the present invention.

圖5係本發明解碼裝置的較佳實施方式中經過解碼後的波形圖。 Figure 5 is a waveform diagram after decoding in a preferred embodiment of the decoding apparatus of the present invention.

圖6A及6B為本發明應用該解碼裝置的解碼方法的較佳實施方式的流程圖。 6A and 6B are flowcharts showing a preferred embodiment of a decoding method of the decoding apparatus of the present invention.

請一併參閱圖1至圖5,本發明弦波解碼裝置較佳實施方式包括一轉換器10、一偏移調節器20、一振幅調節器30、一處理器40、一監視器50、一編碼器60及一轉換電路70。 Referring to FIG. 1 to FIG. 5 together, a preferred embodiment of the sine wave decoding device of the present invention includes a converter 10, an offset adjuster 20, an amplitude adjuster 30, a processor 40, a monitor 50, and a The encoder 60 and a conversion circuit 70.

該轉換器10連接在該編碼器60與該偏移調節器20之間以得到由該編碼器60所輸出的一第一正弦波620及一第二正弦波621在每一點的幅值,並將其傳輸至該偏移調節器20,其中,該第一、第二正弦波620及621之間的相位差為90度。 The converter 10 is connected between the encoder 60 and the offset adjuster 20 to obtain the amplitude of a first sine wave 620 and a second sine wave 621 output by the encoder 60 at each point, and It is transmitted to the offset adjuster 20, wherein the phase difference between the first and second sine waves 620 and 621 is 90 degrees.

該偏移調節器20用於調節該第一正弦波620及第二正弦波621的幾何中心線至同一水平線上,並根據每一點該第一、第二正弦波620及621的幅值構建一如圖3所示的座標軸,該座標軸的橫座標為第二正弦波621的幅值,縱座標為第一正弦波620的幅值。其中,構建該座標軸的作用是為了劃分出A、B、C及D四個區間,下面將對其進行說明。前述正弦波的幾何中心線為該正弦波的橫向中心線,如圖4中虛線即為該第一正弦波620的幾何中心線,X軸即為該第二正弦波621的幾何中心線,此時,該第一正弦波620及第二正弦波621的幾何中心線不位於同一水平線上,即需要該偏移調節器20對其進行調整。 The offset adjuster 20 is configured to adjust the geometric center lines of the first sine wave 620 and the second sine wave 621 to the same horizontal line, and construct a first and second sine waves 620 and 621 according to the amplitude of each of the first and second sine waves 620 and 621. As shown in the coordinate axis of FIG. 3, the abscissa of the coordinate axis is the amplitude of the second sine wave 621, and the ordinate is the amplitude of the first sine wave 620. Among them, the function of constructing the coordinate axis is to divide the four sections A, B, C and D, which will be described below. The geometric center line of the sine wave is the transverse center line of the sine wave, and the dotted line in FIG. 4 is the geometric center line of the first sine wave 620, and the X axis is the geometric center line of the second sine wave 621. The geometric centerlines of the first sine wave 620 and the second sine wave 621 are not on the same horizontal line, that is, the offset adjuster 20 is required to adjust it.

該振幅調節器30連接在該偏移調節器20與該處理器40之間。該振幅調節器30用於將經由該偏移調節器20調整後的第一正弦波620及第二正弦波621的振幅調整為1個單位,以方便後續該處理器40對該第一正弦波620及第二正弦波621進行分析處理。該監視器50 連接該處理器40以顯示該處理器40輸出的結果。其中,單位表示一指定長度,如單位表示5mm時,1個單位則表示5mm,2個單位則表示10mm。 The amplitude adjuster 30 is coupled between the offset adjuster 20 and the processor 40. The amplitude adjuster 30 is configured to adjust the amplitudes of the first sine wave 620 and the second sine wave 621 adjusted by the offset adjuster 20 to 1 unit to facilitate subsequent processing of the first sine wave by the processor 40. The 620 and the second sine wave 621 are subjected to analysis processing. The monitor 50 The processor 40 is coupled to display the results of the processor 40 output. Wherein, the unit represents a specified length. If the unit indicates 5 mm, 1 unit indicates 5 mm, and 2 units indicates 10 mm.

該轉換電路70連接在該編碼器60及處理器40之間以將該編碼器60輸出的第一正弦波620及第二正弦波621對應轉換成A相數位脈衝訊號622及B相數位脈衝訊號623,並將其傳輸至該處理器40。 The conversion circuit 70 is connected between the encoder 60 and the processor 40 to convert the first sine wave 620 and the second sine wave 621 output by the encoder 60 into an A-phase digital pulse signal 622 and a B-phase digital pulse signal. 623 and transmit it to the processor 40.

該處理器40包括一區間判定單元41、一資料處理單元42、一合成單元43、一位置記錄求取單元44及一結果輸出單元45。 The processor 40 includes a section determining unit 41, a data processing unit 42, a synthesizing unit 43, a position recording obtaining unit 44, and a result output unit 45.

該區間判定單元41用於透過判斷某一時間點該處理器40接收到的第一正弦波620的幅值Sin β 1、第二正弦波621的幅值Sin β 2以及該兩正弦波的幅值的絕對值的差值| Sin β 1 |-| Sin β 2|,並根據該資料處理單元42內存儲的如表1中的內容判斷此時該第一正弦波620與第二正弦波621的幅值所組成的點所位於的區間,其中A區間、B區間、C區間以及D區間的劃分如圖3所示。 The interval determining unit 41 is configured to determine the amplitude Sin β 1 of the first sine wave 620 received by the processor 40 at a certain time point, the amplitude Sin β 2 of the second sine wave 621, and the amplitude of the two sine waves. The difference between the absolute values of the values | Sin β 1 |-| Sin β 2|, and determining the first sine wave 620 and the second sine wave 621 at this time according to the contents stored in the data processing unit 42 as in Table 1. The interval in which the amplitude is composed is the interval in which the A interval, the B interval, the C interval, and the D interval are as shown in FIG. 3 .

該資料處理單元42內還存儲有複數公式,其中每一公式對應表1中的一個區間,如表2所示。 The data processing unit 42 also stores a complex formula, wherein each formula corresponds to an interval in Table 1, as shown in Table 2.

該資料處理單元42還用於根據由該區間判定單元41所得知的區間及其內存儲的公式計算出對應的角度α及θ的值。又,該資料處理單元42將根據公式(5)計算得到L:L=N/2 π×θ (5) The data processing unit 42 is further configured to calculate values of the corresponding angles α and θ based on the section known by the section determining unit 41 and the formula stored therein. Moreover, the data processing unit 42 will calculate L: L = N / 2 π × θ (5) according to the formula (5).

其中,N為目標解析度,即360度被劃分為N等分,以表示本發明解碼裝置的精確度,本實施例中,N=2000。 Wherein, N is the target resolution, that is, 360 degrees is divided into N equal parts to indicate the accuracy of the decoding apparatus of the present invention. In this embodiment, N=2000.

該資料處理單元42處理所有時間點該處理器40接收到的第一正弦波620及第二正弦波621的幅值得到複數角度θ的值,以得到複數L的值,並根據該等L的值繪製一鋸齒波444。其中,該鋸齒波444是為了說明此時該第一正弦波620及第二正弦波621的幅值為連續變化而非離散變化,從而比將弦波轉化成脈衝波來確定兩時間點之間的位置差更精確。其他實施例中,該鋸齒波444可不用生成,即並不需要實際有繪製的動作,只需根據公式(5)計算出兩待測時間點的L值即可。 The data processing unit 42 processes the amplitudes of the first sine wave 620 and the second sine wave 621 received by the processor 40 at all points in time to obtain a value of the complex angle θ to obtain a value of the complex L, and according to the L The value draws a sawtooth wave 444. The sawtooth wave 444 is used to illustrate that the amplitudes of the first sine wave 620 and the second sine wave 621 are continuously changed rather than discretely changed, thereby converting the sine wave into a pulse wave to determine between two time points. The position difference is more precise. In other embodiments, the sawtooth wave 444 may not be generated, that is, the actual drawing action is not required, and only the L value of the two time points to be measured may be calculated according to the formula (5).

該合成單元43用於將由該轉換電路70所傳輸的A相數位脈衝訊號622及B相數位脈衝訊號623合併為一合成脈衝訊號624。 The synthesizing unit 43 is configured to combine the A-phase digital pulse signal 622 and the B-phase digital pulse signal 623 transmitted by the conversion circuit 70 into a combined pulse signal 624.

該位置記錄求取單元44用於記錄第一待測時間點P及第二待測時間點Q之間所經過的合成脈衝訊號624的完整的個數M,還用於計算該第一、第二待測時間點P及Q的L值分別記為L P 及L Q ,並根據公式(6)計算得到該第一、第二待測時間點P及Q之間的位置差:S=L Q +[M/4]×R-L P (6) The position record obtaining unit 44 is configured to record the complete number M of the synthesized pulse signals 624 passing between the first time point P to be measured and the second time point Q to be measured, and is also used to calculate the first and the first The L values of the time points P and Q to be measured are respectively recorded as L P and L Q , and the position difference between the first and second time points P and Q to be measured is calculated according to formula (6): S=L Q +[M/4]×RL P (6)

其中,S表示該第一、第二待測時間點P及Q之間的位置差,[M/4]表示對M/4的值取整數,R表示一個週期的正弦波的長度,且R=N/2 π×2 π=N。由於一個週期的正弦波可轉化為四個合成脈衝訊號,故該第一、第二待測時間點P及Q之間所經歷的正弦波的週期數量為M/4,即該第一、第二待測時間點P及Q之間的正弦波的完整週期數量為[M/4]。其他實施例中,該第一、第二待測時間點亦可為兩待測位置點。 Wherein, S represents the position difference between the first and second time points P and Q to be tested, [M/4] represents an integer for the value of M/4, and R represents the length of the sine wave of one cycle, and R =N/2 π×2 π=N. Since the sine wave of one cycle can be converted into four synthesized pulse signals, the number of cycles of the sine wave experienced between the first and second time points P and Q to be tested is M/4, that is, the first and the first The number of complete cycles of the sine wave between the time points P and Q to be measured is [M/4]. In other embodiments, the first and second time points to be tested may also be two points to be tested.

如圖6A及6B所示,利用本發明解碼裝置求取第一、第二待測時間點P及Q之間的位置差的步驟包括: As shown in FIG. 6A and FIG. 6B, the step of obtaining the position difference between the first and second time points P and Q to be tested by using the decoding device of the present invention includes:

步驟S1:透過該轉換器10得到該編碼器60輸出的第一正弦波620及第二正弦波621在每一點的幅值,並將其傳輸至該偏移調節器20。 Step S1: The amplitude of the first sine wave 620 and the second sine wave 621 output by the encoder 60 at each point is obtained through the converter 10 and transmitted to the offset adjuster 20.

步驟S2:透過該轉換電路70將該第一正弦波620及第二正弦波621對應轉換成A相數位脈衝訊號622及B相數位脈衝訊號623,並將其傳輸至該處理器40。 Step S2: The first sine wave 620 and the second sine wave 621 are correspondingly converted into the A-phase digital pulse signal 622 and the B-phase digital pulse signal 623 through the conversion circuit 70, and transmitted to the processor 40.

步驟S3:該偏移調節器20判斷該第一正弦波620及第二正弦波621 的幾何中心線是否位於同一水平線上。 Step S3: The offset adjuster 20 determines the first sine wave 620 and the second sine wave 621. Whether the geometric centerlines are on the same horizontal line.

步驟S4:若該第一、第二正弦波620及621的幾何中心線不位於同一水平線上,該偏移調節器20則將該第一正弦波620及第二正弦波621的幾何中心線調節至同一水平線上,並根據每一點該第一、第二正弦波620及621的幅值構建一如圖3所示的坐標軸,還將調整後的第一正弦波620及第二正弦波621在每一點的幅值傳輸至該振幅調節器30。 Step S4: If the geometric center lines of the first and second sine waves 620 and 621 are not on the same horizontal line, the offset adjuster 20 adjusts the geometric center lines of the first sine wave 620 and the second sine wave 621. Up to the same horizontal line, and constructing a coordinate axis as shown in FIG. 3 according to the amplitudes of the first and second sine waves 620 and 621 at each point, and adjusting the first sine wave 620 and the second sine wave 621. The amplitude at each point is transmitted to the amplitude adjuster 30.

步驟S5:若該第一、第二正弦波620及621的幾何中心線位於同一水平線上,該偏移調節器20則根據每一點該第一、第二正弦波620及621的幅值構建一如圖3所示的座標軸,並將第一正弦波620及第二正弦波621在每一點的幅值傳輸至該振幅調節器30。 Step S5: If the geometric center lines of the first and second sine waves 620 and 621 are on the same horizontal line, the offset adjuster 20 constructs a first and second sine waves 620 and 621 according to the amplitude of each of the first and second sine waves 620 and 621. The coordinate axis shown in FIG. 3 transmits the amplitude of the first sine wave 620 and the second sine wave 621 at each point to the amplitude adjuster 30.

步驟S6:該振幅調節器30判斷該第一正弦波620及第二正弦波621的振幅是否為1個單位。 Step S6: The amplitude adjuster 30 determines whether the amplitudes of the first sine wave 620 and the second sine wave 621 are 1 unit.

步驟S7:若該第一正弦波620及第二正弦波621的振幅不為1個單位,則透過該振幅調節器30將該第一正弦波620及第二正弦波621的振幅調整為1個單位,並將該振幅調節器30所接收的訊號傳送至該處理器40。 Step S7: If the amplitudes of the first sine wave 620 and the second sine wave 621 are not one unit, the amplitudes of the first sine wave 620 and the second sine wave 621 are adjusted to one by the amplitude adjuster 30. The unit transmits the signal received by the amplitude adjuster 30 to the processor 40.

步驟S8:若該第一正弦波620及第二正弦波621的振幅為1個單位,則將該振幅調節器30所接收的訊號傳送至該處理器40。 Step S8: If the amplitudes of the first sine wave 620 and the second sine wave 621 are one unit, the signal received by the amplitude adjuster 30 is transmitted to the processor 40.

步驟S9:該區間判定單元41根據表1中的內容判斷每一時間點該第一正弦波620與第二正弦波621的幅值所組成的點所位於的區間。 Step S9: The section determining unit 41 determines the section in which the point formed by the amplitudes of the first sine wave 620 and the second sine wave 621 is located at each time point according to the content in Table 1.

步驟S10:該資料處理單元42根據該區間判定單元41所得之區間 及表2中的內容計算出每一時間點該第一正弦波620與第二正弦波621所對應的角度α及θ的值,並根據公式(5)得到複數L的值,以繪製得到該鋸齒波444;並計算該第一待測時間點P及第二待測時間點Q的L值L P 及L Q Step S10: The data processing unit 42 calculates the values of the angles α and θ corresponding to the first sine wave 620 and the second sine wave 621 at each time point according to the interval obtained by the section determining unit 41 and the content in Table 2. And obtaining the value of the complex number L according to the formula (5) to draw the sawtooth wave 444; and calculating the L values L P and L Q of the first time point P to be tested and the second time point Q to be measured.

步驟S11:該合成單元43將由該轉換電路70所傳輸的A相數位脈衝訊號622及B相數位脈衝訊號623合併為一合成脈衝訊號624。 Step S11: The synthesizing unit 43 combines the A-phase digital pulse signal 622 and the B-phase digital pulse signal 623 transmitted by the conversion circuit 70 into a combined pulse signal 624.

步驟S12:該位置記錄求取單元44記錄第一待測時間點P及第二待測時間點Q之間所經過的合成脈衝訊號624的完整的個數M。 Step S12: The position record obtaining unit 44 records the complete number M of the synthesized pulse signals 624 passing between the first time point P to be measured and the second time point Q to be measured.

步驟S13:該位置記錄求取單元44根據公式(6)求取該第一、第二待測時間點P及Q之間的位置差S。根據該編碼器60的特徵及位置差S即可對應計算出該第一、第二待測時間點P及Q之間一與該馬達相連的螺桿的前進長度。如,若根據該編碼器60的規格可知當該解析度N取值2000時、該編碼器60顯示數位“1000”即代表該馬達旋轉一圈,並帶動該螺桿前進兩個牙的距離,即0.5mm時,則可計算出該第一、第二待測時間點P及Q之間,該螺桿的前進長度為 Step S13: The position record obtaining unit 44 obtains the position difference S between the first and second time points P and Q to be tested according to the formula (6). According to the characteristics of the encoder 60 and the position difference S, the advancement length of a screw connected to the motor between the first and second time points P and Q to be tested can be calculated. For example, according to the specification of the encoder 60, when the resolution N is 2000, the encoder 60 displays the digit "1000", that is, the motor rotates once, and drives the screw to advance the distance between the two teeth, that is, At 0.5 mm, the first and second time points P and Q to be measured can be calculated, and the advancement length of the screw is

步驟S14:該處理器40的結果輸出單元45將該位置記錄求取單元44所得到的位置差S及透過該位置差S相應得到的螺桿的前進長度傳輸至該監視器50,以供測試者得知測量結果。 Step S14: The result output unit 45 of the processor 40 transmits the position difference S obtained by the position record obtaining unit 44 and the advance length of the screw obtained by the position difference S to the monitor 50 for the tester. Know the measurement results.

下面將舉例對前述解碼裝置的工作原理進行說明。請一併參閱圖5,本實施例中,該第一待測時間點P所對應的第一正弦波620的幅值為0、第二正弦波621的幅值為1。該區間判定單元41根據表1 中的內容可以得知此時該第一正弦波620與第二正弦波621的幅值所組成的點位於C區間。該資料處理單元42根據表2中的內容計算得到θ=0,進而根據公式(5)可以得知該第一待測時間點P的L值L P =N/2 π×θ=0。 The operation of the aforementioned decoding apparatus will be described below by way of example. Referring to FIG. 5 together, in the embodiment, the amplitude of the first sine wave 620 corresponding to the first time point P to be measured is 0, and the amplitude of the second sine wave 621 is 1. The section determining unit 41 can know from the contents in Table 1 that the point formed by the amplitudes of the first sine wave 620 and the second sine wave 621 is located in the C section. The data processing unit 42 calculates θ=0 according to the content in Table 2, and further can know the L value L P =N/2 π×θ=0 of the first time point P to be tested according to the formula (5).

該第二待測時間點Q所對應的第一正弦波620的幅值為-1、第二正弦波621的幅值為0。根據表1中的內容可得知此時該第一正弦波620與第二正弦波621所組成的點的比值位於B區間,根據表2中的內容計算得到θ=3 π/2,進而根據公式(5)可以得知該第二待測時間點Q的L值L Q =N/2 π×θ=2000/2 π×3 π/2=1500。此時,該位置記錄求取單元44記錄第一待測時間點P及第二待測時間點Q之間所經過的合成脈衝訊號624的完整的個數M為3,故,根據公式(6)即可得到該第一待測時間點P與第二待測時間點Q之間的位置差S=1500+[3/4]×2000-0=1500。若規定當該解析度N取值2000時,該編碼器60顯示數位“1000”即代表該馬達旋轉一圈,並帶動該螺桿前進0.5mm,則可計算出該第一、第二待測時間點P及Q之間,該螺桿的前進長度為 The amplitude of the first sine wave 620 corresponding to the second time point Q to be measured is -1, and the amplitude of the second sine wave 621 is 0. According to the content in Table 1, it can be known that the ratio of the points formed by the first sine wave 620 and the second sine wave 621 is in the B interval, and θ=3 π/2 is calculated according to the content in Table 2, and then according to Equation (5) can know that the L value L Q = N/2 π × θ = 2000/2 π × 3 π/2 = 1500 of the second time point Q to be measured. At this time, the position record obtaining unit 44 records that the complete number M of the synthesized pulse signals 624 passing between the first time point P to be measured and the second time point Q to be measured is 3, and therefore, according to the formula (6) The position difference S=1500+[3/4]×2000-0=1500 between the first time point P to be tested and the second time point Q to be measured can be obtained. If it is specified that when the resolution N is 2000, the encoder 60 displays the digit "1000", that is, the motor rotates one revolution, and drives the screw to advance 0.5 mm, then the first and second time to be tested can be calculated. Between points P and Q, the advancement length of the screw is

其中,前述步驟S10中該資料處理單元42計算出每一時間點該第一正弦波620與第二正弦波621所對應的角度α及θ的值及據此得到該鋸齒波444是為了表徵此時該第一正弦波620及第二正弦波621的幅值為連續變化而非離散變化,從而比將弦波轉化成脈衝波來確定兩時間點之間的位置差更精確。其他實施例中,該步驟S10中“該資料處理單元42根據公式(5)得到複數L的值以繪製得到該鋸齒波444”可以刪除,即並不需要實際有繪製的動作, 只需根據公式(5)計算出該第一待測時間點P及第二待測時間點Q的L值L P 及L Q 即可。另,本實施例中該偏移調節器20及振幅調節器30的作用是為後續能夠更方便準確對該第一正弦波620及第二正弦波621進行處理,該偏移調節器20及振幅調節器30亦可省略。又,本實施方式中該合成脈衝訊號624的作用主要是更方便的識別該第一待測時間點P與第二待測時間點Q之間經過了多少個週期,故其他實施例中,該轉換電路70及該處理器40中的合成單元43可省略以降低成本,該位置記錄求取單元44則透過對兩正弦波的週期時間及兩待測時間點之間所間隔的時間進行計算,以得到該第一待測時間點P與第二待測時間點Q之間所經過的完整週期數量。 In the foregoing step S10, the data processing unit 42 calculates the values of the angles α and θ corresponding to the first sine wave 620 and the second sine wave 621 at each time point, and obtains the sawtooth wave 444 according to the purpose of characterizing this. The amplitudes of the first sine wave 620 and the second sine wave 621 are continuously changed rather than discretely changed, thereby being more accurate than converting the sine wave into a pulse wave to determine the position difference between the two time points. In other embodiments, in step S10, "the data processing unit 42 obtains the value of the complex number L according to the formula (5) to draw the sawtooth wave 444" can be deleted, that is, the action that actually has to be drawn is not required, and only according to the formula (5) The L values L P and L Q of the first time point P to be measured and the second time point Q to be measured may be calculated. In addition, in the embodiment, the offset adjuster 20 and the amplitude adjuster 30 function to process the first sine wave 620 and the second sine wave 621 more conveniently and accurately, the offset adjuster 20 and the amplitude. The regulator 30 can also be omitted. In addition, in the embodiment, the function of the synthesized pulse signal 624 is mainly to more conveniently identify how many cycles have elapsed between the first time point P to be tested and the time point Q to be measured, so in other embodiments, The conversion circuit 70 and the synthesis unit 43 in the processor 40 can be omitted to reduce the cost. The position record obtaining unit 44 calculates the time interval between the two sine waves and the time interval between the two time points to be measured. The number of complete cycles elapsed between the first time point P to be tested and the time point Q to be tested is obtained.

綜上所述,本發明確已符合發明專利之要件,遂依法提出專利申請。惟,以上所述者僅為本發明之較佳實施方式,自不能以此限制本案之申請專利範圍。凡熟悉本案技藝之人士爰依本發明之精神所作之等效修飾或變化,皆應涵蓋於以下申請專利範圍內。 In summary, the present invention has indeed met the requirements of the invention patent, and has filed a patent application according to law. However, the above description is only a preferred embodiment of the present invention, and it is not possible to limit the scope of the patent application of the present invention. Equivalent modifications or variations made by persons skilled in the art in light of the spirit of the invention are intended to be included within the scope of the following claims.

10‧‧‧轉換器 10‧‧‧ converter

20‧‧‧偏移調節器 20‧‧‧Offset adjuster

30‧‧‧振幅調節器 30‧‧‧Amplitude adjuster

40‧‧‧處理器 40‧‧‧ processor

50‧‧‧監視器 50‧‧‧ monitor

60‧‧‧編碼器 60‧‧‧Encoder

70‧‧‧轉換電路 70‧‧‧Transition circuit

Claims (8)

一種解碼裝置,用於計算由一編碼器輸出的相位相差90度的兩弦波在一第一待測點與一第二待測點之間的距離,該弦波解碼裝置包括一轉換器及一處理器,該轉換器連接在該編碼器與該處理器之間以得到該兩弦波在每一點的幅值,並將其傳輸至該處理器,該處理器包括:一資料處理單元,存儲該兩弦波的幅值的符號、兩弦波的幅值的絕對值之間的差值的符號以及上述三個符號與複數區間的對應關係,並存儲有每一區間所對應的正切函數;一區間判定單元,用於根據該第一待測點兩弦波的幅值以及該第二待測點兩弦波的幅值判定第一待測點及一第二待測點該兩弦波的幅值所組成的點所位於的區間,該資料處理單元用於根據該第一及第二待測點兩弦波的幅值所組成的點所位於的區間分別選擇對應的正切函數,並根據所選擇的正切函數對應得到該第一及第二待測點的θ值,還用於根據公式L=N/2 π×θ計算該第一及第二待測點的L值,其中N為目標解析度;及一位置記錄求取單元,用於記錄該第一及第二待測點之間所經過的弦波的週期個數M及通過公式S=L Q +[M/4]×R-L P 來求取該兩弦波任意兩點之間的位置差S,其中L Q 及L P 分別為該第二及第一待測點的L值,R為一個週期的弦波的長度。 a decoding device, configured to calculate a distance between a first to-be-measured point and a second to-be-measured point by a two-sine wave with a phase difference of 90 degrees output by an encoder, the sine wave decoding device comprising a converter and a processor coupled between the encoder and the processor to obtain the amplitude of the two-string wave at each point, and transmitting the same to the processor, the processor comprising: a data processing unit, And storing a sign of a magnitude of the amplitude of the two sine waves, a sign of a difference between absolute values of amplitudes of the two sine waves, and a correspondence between the three symbols and the complex interval, and storing a tangent function corresponding to each interval An interval determining unit, configured to determine the first to-be-measured point and the second to-be-measured point according to the amplitude of the two-chord wave of the first to-be-measured point and the amplitude of the two-chord wave of the second to-be-measured point The data processing unit is configured to select a corresponding tangent function according to the interval in which the points formed by the amplitudes of the two sine waves of the first and second points to be measured are located in the interval in which the points formed by the amplitudes of the waves are located, And obtaining the first and corresponding according to the selected tangent function The θ value of the two points to be measured is also used to calculate the L value of the first and second points to be measured according to the formula L=N/2 π×θ, where N is the target resolution; and a position record obtaining unit, For recording the number M of cycles of the sine wave passing between the first and second points to be measured and obtaining any two points of the two-string wave by the formula S=L Q +[M/4]×RL P The position difference S between, where L Q and L P are the L values of the second and first points to be measured, respectively, and R is the length of the sine wave of one period. 如申請專利範圍第1項所述之解碼裝置,其中該轉換器與處理器之間還連接一振幅調節器,該振幅調節器用於將由該轉換器輸出的兩弦波的振幅調節為一致,並將調節後的兩弦波傳輸至該處理器。 The decoding device of claim 1, wherein an amplitude adjuster is further connected between the converter and the processor, and the amplitude adjuster is configured to adjust the amplitude of the two-string wave outputted by the converter to be consistent, and The adjusted two-string wave is transmitted to the processor. 如申請專利範圍第1項所述之解碼裝置,其中該轉換器與該處理器之間還 連接一偏移調節器,該偏移調節器用於將該兩弦波的幾何中心線調節至同一水平線上,並將調整後的兩弦波傳輸至該處理器。 The decoding device of claim 1, wherein the converter and the processor are further An offset adjuster is coupled to adjust the geometric centerline of the two-string wave to the same horizontal line and transmit the adjusted two-string wave to the processor. 如申請專利範圍第1項所述之解碼裝置,其還包括一轉換電路,該轉換電路連接在該編碼器與該處理器之間以將該兩弦波轉換成兩數位脈衝訊號,並將其輸出至該處理器;該處理器還包括一合成單元,該合成單元用於將兩數位脈衝訊號合併成一合成脈衝訊號,該位置記錄求取單元用於記錄該第一及第二待測點之間所經過的合成脈衝訊號的個數來確定所經歷的弦波的週期個數M。 The decoding device of claim 1, further comprising a conversion circuit connected between the encoder and the processor to convert the two-string wave into a two-digit pulse signal and Outputting to the processor; the processor further includes a synthesizing unit, the synthesizing unit is configured to combine the two-digit pulse signals into a composite pulse signal, and the position recording and obtaining unit is configured to record the first and second to-be-measured points The number of synthesized pulse signals passed between them determines the number M of cycles of the sine wave experienced. 一種解碼方法,用於計算由一編碼器輸出的相位相差90度的兩弦波在一第一待測點與一第二待測點之間的距離,該解碼方法包括以下步驟:透過一轉換器得到該兩弦波在每一點的幅值,並將其傳輸至一處理器,其中該處理器內存儲有兩弦波的幅值的符號、兩弦波的幅值的絕對值之間的差值的符號以及其與複數區間的對應關係,並存儲有每一區間所對應的正切函數;該處理器根據該第一待測點兩弦波的幅值以及該第二待測點兩弦波的幅值判定第一待測點及一第二待測點該兩弦波的幅值所組成的點所位於的區間;該處理器根據得到的區間運算得到該第一及第二待測點的θ值,還用於根據公式L=N/2 π×θ計算該第一及第二待測點的L值,其中N為目標解析度;及該處理器記錄該第一及第二待測點之間所經過的弦波的週期個數M及透過公式S=L Q +[M/4]×R-L P 來求取該兩弦波任意兩點之間的位置差S,其中L Q 及L P 分別為該第二及第一待測點的L值,R為一個週期的弦波的長度。 A decoding method for calculating a distance between a first to-be-measured point and a second to-be-measured point by a two-sine wave whose phase is 90 degrees out of phase by an encoder, the decoding method comprising the following steps: Obtaining the amplitude of the two sine waves at each point and transmitting it to a processor, wherein the processor stores the sign of the amplitude of the two sine waves and the absolute value of the amplitude of the two sine waves a sign of the difference and its correspondence with the complex interval, and storing a tangent function corresponding to each interval; the processor is based on the amplitude of the two-string wave of the first point to be measured and the second string of the second point to be measured The amplitude of the wave determines an interval in which the point formed by the amplitude of the two sine waves of the first to-be-measured point and a second to-be-measured point is located; the processor obtains the first and second to-be-tested according to the obtained interval operation The θ value of the point is further used to calculate the L value of the first and second points to be measured according to the formula L=N/2 π×θ, where N is the target resolution; and the processor records the first and second The number of periods M of the sine wave passing between the points to be measured and the formula S=L Q +[M/4]×RL P are used to obtain the two The position difference S between any two points of the sine wave, wherein L Q and L P are the L values of the second and first points to be measured, respectively, and R is the length of the sine wave of one period. 如申請專利範圍第5項所述之解碼方法,其中於步驟“該轉換器得到該兩弦波在每一點的幅值”之後:透過一振幅調節器將由該轉換器輸出的兩弦波的振幅調節為一致後再傳輸至該處理器。 The decoding method according to claim 5, wherein after the step "the converter obtains the amplitude of the two-string wave at each point": the amplitude of the two-string wave output by the converter through an amplitude adjuster Adjust to be consistent before transferring to the processor. 如申請專利範圍第5項所述之解碼方法,其中於步驟“該轉換器得到該兩弦波在每一點的幅值”之後:透過一偏移調節器將該兩弦波的幾何中心線調節於同一水平線上後再傳輸至該處理器。 The decoding method of claim 5, wherein after the step "the converter obtains the amplitude of the two-string wave at each point": adjusting the geometric center line of the two-string wave through an offset adjuster Transfer to the processor after the same level. 如申請專利範圍第5項所述之解碼方法,其中步驟“該處理器記錄該第一及第二待測點之間所經過的弦波的週期個數M”透過以下步驟實現:透過一轉換電路將該兩弦波轉換成兩數位脈衝訊號,並將該兩數位脈衝訊號傳輸至該處理器;透過該處理器將兩數位脈衝訊號合併為一合成脈衝訊號;以及透過該處理器記錄該第一及第二待測點之間所經歷的合成脈衝訊號的個數,並據此計算出其間所經過的弦波的週期個數M。 The decoding method of claim 5, wherein the step "the processor records the number of periods M of the sine wave passing between the first and second points to be tested" is implemented by the following steps: The circuit converts the two-string pulse into a two-digit pulse signal, and transmits the two-digit pulse signal to the processor; the two-digit pulse signal is combined into a combined pulse signal by the processor; and the first pulse is recorded by the processor The number of synthesized pulse signals experienced between the first and second points to be measured, and the number M of periods of the sine wave passing between them is calculated accordingly.
TW98117755A 2009-05-27 2009-05-27 Encoding system and encoding method thereof TWI427919B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW98117755A TWI427919B (en) 2009-05-27 2009-05-27 Encoding system and encoding method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW98117755A TWI427919B (en) 2009-05-27 2009-05-27 Encoding system and encoding method thereof

Publications (2)

Publication Number Publication Date
TW201042905A TW201042905A (en) 2010-12-01
TWI427919B true TWI427919B (en) 2014-02-21

Family

ID=45000737

Family Applications (1)

Application Number Title Priority Date Filing Date
TW98117755A TWI427919B (en) 2009-05-27 2009-05-27 Encoding system and encoding method thereof

Country Status (1)

Country Link
TW (1) TWI427919B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW224187B (en) * 1991-04-25 1994-05-21 Gen Electric
TW200305154A (en) * 2002-03-15 2003-10-16 Tokyo Shibaura Electric Co Information recording medium, and information recording/reproducing device and method
CN101013874A (en) * 2006-12-21 2007-08-08 中国科学院电工研究所 System for controlling auto-disturbance rejection of stator voltage of variable speed constant frequency double-fed generator

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW224187B (en) * 1991-04-25 1994-05-21 Gen Electric
TW200305154A (en) * 2002-03-15 2003-10-16 Tokyo Shibaura Electric Co Information recording medium, and information recording/reproducing device and method
CN101013874A (en) * 2006-12-21 2007-08-08 中国科学院电工研究所 System for controlling auto-disturbance rejection of stator voltage of variable speed constant frequency double-fed generator

Also Published As

Publication number Publication date
TW201042905A (en) 2010-12-01

Similar Documents

Publication Publication Date Title
US4518859A (en) Angle measuring device with line sensor
WO2021114419A1 (en) Calibration method, apparatus and device for rotary magnetoelectric encoder
JP6143885B2 (en) Method for self-calibrating a rotary encoder
CN103217139B (en) The online self-calibrating method of a kind of angular displacement sensor based on double testing head
EP1746382A3 (en) Measurement instrument
Just et al. Comparison of angle standards with the aid of a high-resolution angle encoder
CN102022975A (en) Error self-calibration method of angle displacement sensor system
CN110081837A (en) A method of by detecting shafting shaking and eccentric error using angle measurement Circular gratings and reading head
CN101723213A (en) SinCos coder based method for detecting position and speed
CN110779556A (en) Potentiometer full-range angle calibration device and method based on incremental encoder
CN110617783B (en) Turntable eccentric error measuring method based on photoelectric detection modulation period particle swarm optimization
CN204287217U (en) A kind of rotating shaft speed precision pick-up unit
TWI427919B (en) Encoding system and encoding method thereof
CN110133316B (en) Precise speed measurement system and method for photoelectric encoder
CN103438903A (en) Calibration method for orientation error of orientation device
CN110375788B (en) Four-way orthogonal differential signal demodulation instrument calibration method and system
CN110617784B (en) Turntable eccentricity error measuring method
RU2012124994A (en) CONTROL DEVICE AND METHOD FOR ITS OPERATION
CN110879408A (en) CT rotary encoder, CT machine and method for detecting rotation angle of scanning frame
RU83133U1 (en) SPINDLE ASSEMBLY
JP2010249819A (en) Sinusoidal wave encoding device and encoding method
CN201787915U (en) Precision goniometer
CN101216342A (en) High speed linear array CCD torsional vibration measurement method
CN210774092U (en) Potentiometer full-range angle calibration device based on incremental encoder
KR102133455B1 (en) Ultrasonic testing apparatus using inertia sensor

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees