TW200928283A - System and method for controlling grating ruler counting - Google Patents

System and method for controlling grating ruler counting Download PDF

Info

Publication number
TW200928283A
TW200928283A TW96149291A TW96149291A TW200928283A TW 200928283 A TW200928283 A TW 200928283A TW 96149291 A TW96149291 A TW 96149291A TW 96149291 A TW96149291 A TW 96149291A TW 200928283 A TW200928283 A TW 200928283A
Authority
TW
Taiwan
Prior art keywords
signal
data
computer
single chip
signals
Prior art date
Application number
TW96149291A
Other languages
Chinese (zh)
Other versions
TWI396822B (en
Inventor
Chih-Kuang Chang
Wei-Qi Sun
Original Assignee
Hon Hai Prec Ind 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 Hon Hai Prec Ind Co Ltd filed Critical Hon Hai Prec Ind Co Ltd
Priority to TW96149291A priority Critical patent/TWI396822B/en
Publication of TW200928283A publication Critical patent/TW200928283A/en
Application granted granted Critical
Publication of TWI396822B publication Critical patent/TWI396822B/en

Links

Landscapes

  • Radar Systems Or Details Thereof (AREA)
  • Length Measuring Devices With Unspecified Measuring Means (AREA)

Abstract

A method for controlling a grating ruler counting is disclosed. The method includes: a computer sends a command to a single chip via a level changer; the single chip resets a frequency multiplier and a reversible counter after receiving the command; the frequency multiplier receives signals from the grating ruler; the frequency multiplier identifies direction of the signals and multiplying the signals; the reversible counter counts the multiplied signals; the reversible counter sends the counting value to the single chip if the counting value is 256 or -256; the single chip adds counting values of each of signals to obtain results of each of signals; the single chip sends the results of each of signals to the computer; the computer calculates the results of each of signals to obtain coordinates values. A related system is also disclosed.

Description

200928283 • 九、發明說明: , 【發明所屬之技術領域】 本發明涉及一種光柵尺計數控制系統及方法。 【先前技術】 隨著微電技術的發展,對精密定位量測提出了越來越 南的要求^而在精密定位置測糸統中必須有而精度的計量 回饋模組。在現實生活中,當在量測比較細小的物體時, 通常使用的量測器具為遊標卡尺或螺旋測量儀,其量測精 _ 度通常為0.05mm或0.01mm,當需要更加精確的量測時, ❿ 這就需要更加精密的量測器具,而光柵尺就係通常使用的 一種比較精確的設備。 目前,光柵尺在各種精密量測機床中得到廣泛應用, 其主要作用係跟隨機台的運動,動態顧示當前機台位置的 座標值,為尺寸量測提供基本依據。光柵尺的刷新頻率及 解析度直接影響到量測的速度和精度,因此,如何提高光 栅尺的刷新頻率及解析度以提高量測的速度和精度來滿足 〇 更高層次精密量測的需求係有待量測行業的工作人員解決 的一重要問題。 【發明内容】 鑒於以上内容,有必要提供一種光柵尺計數控制系 統,能夠在量測機台移動時,快速並高精度的顯示量測機 台當前位置的三維空間座標。 鑒於以上内容,有必要提供一種光栅尺計數控制方 法,能夠在量測機台移動時,快速並高精度的顯示量測機 7 200928283 台當前位置的三維空間座標。 一種光柵尺計數控制系統,該系統包括電腦及透過電 平轉換器與所述電腦相連的單片機,所述單片機與倍頻 器、可逆計數器及信號鎖存器相連,所述倍頻器與光柵尺 信號發生器相連,所述光栅尺信號發生器安裝於量測機台 上,所述電腦包括電腦發送模組和計算模組,所述單片機 包括清零模組、倍馳龍組、計數㈣模組和單片機發 送模組,其中:所述電腦發送模組用於將所述電腦中的^ 集命令透過所述電平轉換器發送給所述單#機; 模組用於當所述單純純絲娜齡讀 二 器及所述可逆計數ϋ中的⑽清零;所述倍 =倍頻 Ο 於當所述Μ機台發生位㈣,接收所述_ =核組用 器發出的量測機台在X軸、γ轴及ζ轴位移的三路:號發生 别所接收三路信號的方向及放大所述三路信號3號,識 將所述頻率放大後的三路信號輸出給所料逆=率’並 述計數控制模組用於將所接㈣三路㈣分_數二所 位計數’並將計數的資料根據所對應信號的方向:六進 正值和負值,當言十數的資料達到256或_256時將^別兄為 給所述單片機的外部中斷輸入介面,當計數=貝枓輸出 到256或_2:6時將該資料透過所述信號鎖存器 的資料分料行累加;所述W機發送额信號 的二路信號的資料透過所述電 、將累加後 及所述計算模_於將所接收的三路_的 8 200928283 所述光栅尺信號發生器的比例係數得到所述量測機台相應 , 的座標值。 一種光柵尺計數控制方法,該方法包括如下步驟:將 電腦中的採集命令透過電苹轉換器發送給單片機;當所述 單片機接收並執行採集命令後,將倍頻器及可逆計數器中 的資料清零,當量測機台發生位移時,所述倍頻器接收光 栅尺信號發生器發出的所述量測機台在X軸、Y軸及Z軸位 移的三路信號;所述倍頻器識別所接收三路信號的方向及 放大所述>路信號的頻率,炎將所述頻率放大後的三路信 ❹號輸出飨所述可逆計數器;玎逆計數器將所接收的三路信 號分别進行十六進位計數,旅將計數的資料根據所對應信 號的方向分別記為正值和負值;當所述計數的資料達到256 或-256時’可逆計數器將该資料輸出給所述單片機的外部 中斷輸入介面’或者當所述計數的資料沒有達到256或-256 時,町逆計數器將該資料透過所述信號鎖存器將該資料發 送至戶斤述單片機的P0埠;戶斤述單片機將所接收的三路信號 0 的資料分別進行累加;所述單片機將累加後的三路信號的 資料遂過所述電平轉換器發送給所述電腦;及所述電腦將 所接收的二路信號的資料分別乘以所述光栅尺信號發生器 的比例係數得到所述量測機台相應的座標值。 相較於f知技術,本發明所提供的光栅尺計數控制系 統及方法,能夠在量測機台移動時,快速顯示量測機台當 前位ί的三維空間座標值,並且具有足夠高的解析度以滿 足量測的精度要求,提高了量測機台量測的速度和精度。 200928283 【實施方式】 如圖1所示,係本發明光栅尺計數控制系統較佳實施方 式的硬體架構圖。該光栅尺計數控制系統包括電腦及透 過電平轉換器11與所述電腦10相連的單片機12,所述單片 機12與倍頻器15、可逆計數器16及信號鎖存器17相連,所 述倍頻器15與光柵尺信號發生器相連17,所述光栅尺信號 發生器17安裝於量測機台13上。 該電月έι 10用於發出資料獲取命令,並將採集後的資料 轉換成相應座標值。 該電平轉換器11用於將電腦1〇發出負邏輯電平與單片 機12發出的正邏輯電平進行相互轉換。 該單片機12執行電腦10所發送的採集命令後,將該倍 頻器15及該可逆計數器16中的資料清零。 當量測機台13發生位移時,該光柵尺信號發生器14發 出代表二維空間位移的三路信號,並將該三路信號發送給 該倍頻器15。 該倍頻器15用於識別所接收三路信號的方向及放大所 接收二路信號的頻率’並將頻率放大後的三路信號發送給 該可逆計數器16。 、該可逆計數器16用於接收倍頻器15發送的三路信號, 並將分別三路㈣進輯數後發送給單片機12或信號鎖存 器17。 β該信號鎖存器口用於接收可逆計數器ΐό發送的三路信 號的貝料’並將二路^號的資料分別發送給單片機㈣洲 200928283 * .淳0 . 如圖2所示,係本發明光柵尺計數控制系統電腦與單片 機的功能模組圖。所述電腦ίο包括電腦發送模組1〇〇^計算 模組1〇2,所述單>1機I2包括清零模組⑽、倍頻控制模= 122、計數控制模組124、判斷模紕126及單片機發送模組 128 ° 所述電海J發送模組100用於將電腦10中的採集命令透 過電平轉換器11發送給單片機12。所述電腦發送和接收 • 的電平為負邏輯電平,所述單片機12發送和接收的電平為 高邏輯電平。因此,在將該採集命令發送給單片機12前, 需要先將該命令透過電平轉換器11,將電腦1〇發出的負邏 輯電平轉換成正邏輯電平’然後再將該正邏輯電平的命令 發送給單片機12。 所述清零模組120用於當單片機12接收並執行採集命 令後將倍頻器15及可逆計數器16中的資料清零。 所述倍頻控制模組122用於當量測機台13發生位移 〇 時,接收光栅尺信號發生器14發出的量測機台13在X軸、γ 軸及Z軸位移的三路信號。 所述倍頻控制模組122還用於識別所接收三路信號的 方向及放大所述三路信號的頻率,並將所述頻率放大後的 三路信號輸出給可逆計數器16。所述信號的方向包括正向 傳輸和反向傳輸。所述光栅尺信號發生器14發出信鞔的頻 率一般不能滿足可逆計數器16的精度要求,因此,%要利 用倍頻器15將光柵尺信號發生器14發出的信號的頻率放大 11 200928283 以滿足可逆計數器16的精度要求。所述信號的方向係透過 該信號包括的兩路方波來進行識別,如圖4所示,圖中的信 號包括兩路方波T1和T2,方波T1從高電平1轉換為低電平〇 的時間tl小於方波T2從高電平1轉換為低電平〇的時間t2, 方波T1超前於T2,該信號的為正向傳輸;如圖5所示’圖 中的信號包括兩路方波T1和T2,方波T1從高電平1轉換為 低電平0的時間tl大於方波T2從高電平丨轉換為低電平〇的 時間t2,方波T1落後於T2,該信號的為反向傳輸。 所述計數控制模組124用於將所接收的三路信號分別 進行十六進位計數,並將計數的資料根據所對應信號的方 向分別記為正值和負值。當所述信號的方向為正向傳輸 時,該信號計數的資料為正值;當所述信號的方向為反向 傳輸時,該信號計數的資料為負值。 所述判斷模組126用於判斷所述計數的資料是否達到 256或-256。 ❹ 所述計數控制模組124還用於當計數的資料達到256或 -256時將該資料輸出給單片機12的外部中斷輸入介面,當 計數的資料料_256或_256時將該:#料透過信號鎖^ 器17將該資料發送至單片機:^的即埠。所述資料包括χ 軸、Y軸及Z轴位移的三路信號的資料,當三路信號的資料 透過單片機12的P0埠時,為防止資料之間相互干擾,需要 信號鎖存器110將三路信號的資料分別發送至單片機=的 P0埠。例如:當將X軸的資料發送給單片機乜的即埠時,' 信號鎖存器110鎖存Y軸及z軸的數據。 12 200928283 •所述計數控制模組124還用於將單片機12所接收的三 - 路信號的資料分別進行累加。所述累加係指對所述每路信 號從可逆計數器16和信號鎖存期114所發送給單片機12的 所有資料進行累加,例如:若有信號從可逆計數器16計數 後發送給單片機12的資料為2個正256.,從信號鎖存器17發 送給單片機12的資料為一個正253,則將256*2+253所得到 的資料即為該路信號累加的資料;若有信號從可逆計數器 16計數後發送給單片機12的資料為2個負256,從信號鎖存 〇 器17發送給單片機12的資料為一個正253,則將-256*2+253 所得到的資料即為該路信號累加的資料。 所述單片機發送模組128用於將累加後的三路信號的 資料透過電平轉換器11發送給電腦10。該電平轉換器11將 單片機12傳輸的正邏輯電平轉換成電腦10能接收的負邏輯 電平。 所述計算模組1〇2還用於將所接收的三路信號的資料 ”⑺乘以光栅尺彳;號發生II 14的比例係數得到所述量測機 台13相應的座標值。該座標值即為量測機台13發生所述位 移後的座標值。 $圖3所示’係本發明光栅尺計數控制方法較佳實施方 式的肌知圖首先,步驟S10,電腦發送模組1〇〇將電腦 中的抹集命令透過電平轉換eil發送給單片機12。所述電 腦10發达和接收的電平為負邏輯電平,所述單片機u發送 和接收的電平為高邏輯電平。因此,在將該採集命令發送 給單月機12月,』,需要先將該命令透過電平轉換器a,將電 13 200928283 腦ίο發出的負邏輯電平轉換成正邏輯電平,然後再將該正 - 邏輯電平的命令發送給單片機12。 步驟S12 ’當單片機12接收並執行採集命令後,清零 模組120將倍頻器15及可逆計數器16中的資料清零。 步驟S14,當量測機台13發生位移時,倍頻控制模組 122接收光柵尺信號發生器14發出的量測機台13在乂軸、γ 軸及Z軸位移的三路信號。 步驟S16 ’倍頻控制模組122識別所接收三路信號的方 珍向及放大所述三路信號的頻率,並將所述頻率放大後的三 路信號輸出給可逆計數器16。所述信號的方向係透過該信 號包括的兩路方波來進行識別,如圖4所示,圖中的信號包 括兩路方波T1和T2,方波T1從高電平1轉換為低電平〇的時 間tl小於方波T2從高電平1轉換為低電平〇的時間t2,方波 T1超雨於T2 ’該#號的為正向傳輸;如圖5所示,圖中的 信號包括兩路方波T1和T2,方波T1從高電平1轉換為低電 平0的時間tl大於方波T2從高電平丄轉換為低電平〇的時間 〇 ’方波T1落後於T2,該信號的為反向傳輸。 步驟S18,计數控制模組124將所接收的三路信號分別 進行十六進位計數,並將計數的資料根據所對應信號的方 向分別記為正值和負值。當所述信號的方向為正向傳輸 時,該信號計數的資料為正值;當所述信號的方向為反向 傳輸時’該信號計數的資料為負值。 步驟S20,判斷模組126判斷所述計數的資料是否達到 256或-256 。 14 200928283 步驟S22,當計數的資料達到256或_256時,計數控制 •模組124將該資料輸出給單片機12的外部中斷輪入介面' 步驟S24,當計數的資料沒有達到256或-256時,計數 控制模組124將該資料透過信號鎖存器17將該資料發送至 早片機12的P〇i車。 ' 步驟S26,計數控制模組124將單片機12所接收的三路 信號的資料分別進行累加。所述累加係指對所述每路信號 從可逆計數器16和信號鎖存期114所發送給單片機12的所 〇 有資料進行累加,例如:若有信號從可逆計數器16計數後 發送給單片機12的資料為2個正256,從信號鎖存器17發送 給單片機12的資料為一個正253,則將256*2+253所得到的 資料即為該路信號累加的資料;若有信號從可逆計數器16 a十數後毛送給早片機12的資料為2個負256,從信號鎖存器 17發送給單片機12的資料為一個正253,則將_256*2+253 所得到的資料即為該路信號累加的資料。 步驟S28,單片機發送模組128將累加後的三路信號的 © 資料透過電平轉換器11發送給電腦10。該電平轉換器^將 單片機12傳輸的正邏輯電平轉換成電腦1〇能接收的負邏輯 電平。 步驟S30,計算模組1〇2還用於將所接收的三路信號的 資料分別乘以光栅尺信號發生器14的比例係數得到所述量 測機台13相應的座標值。該座標值即為量測機台a發生所 述位移後的座標值。 【圖式簡單說明】 15 200928283 • 圖1係本發明光柵尺計數控制系統較佳實施方式的硬 • 體架構圖。 圖2係本發明光柵尺計數控制系統電腦與單片機的功 能模組圖。 圖3係本發明光柵尺計數控制方法較佳實施方式的流 程圖。 圖4係圖1中光柵尺信號發生器發出的信號為正向傳輸 的示意圖。 _ 圖5係圖1中光栅尺信號發生器發出的信號為反向傳輸 的不意圖。 【主要元件符號說明】 電腦 10 電平轉換器 11 單片機 12 量測機台 13 光栅尺信號發生器 14 倍頻器 15 可逆計數器 16 信號鎖存器 17 電腦發送模組 100 計算模組 102 清零模組 120 倍頻控制模組 122 計數控制模組 124 16 200928283 判斷模組 單片機發送模組200928283 • IX. Invention Description: [Technical Field] The present invention relates to a grating scale counting control system and method. [Prior Art] With the development of micro-electric technology, there is an increasing demand for precision positioning measurement. In the precision position measurement system, there must be a precision measurement feedback module. In real life, when measuring relatively small objects, the commonly used measuring instruments are vernier calipers or augers, and the measurement accuracy is usually 0.05mm or 0.01mm, when more accurate measurement is required. , ❿ This requires more sophisticated measuring instruments, and the grating ruler is a more accurate device that is usually used. At present, the grating scale is widely used in various precision measuring machine tools. Its main function is to follow the movement of the machine, and dynamically monitor the coordinate value of the current machine position to provide a basic basis for dimensional measurement. The refresh rate and resolution of the scale directly affect the speed and accuracy of the measurement. Therefore, how to improve the refresh frequency and resolution of the scale to improve the speed and accuracy of the measurement to meet the requirements of the higher level precision measurement An important issue to be addressed by the staff in the industry. SUMMARY OF THE INVENTION In view of the above, it is necessary to provide a scale counting control system capable of quickly and accurately displaying the three-dimensional coordinates of the current position of the measuring machine while the measuring machine is moving. In view of the above, it is necessary to provide a scale counting control method capable of quickly and accurately displaying the three-dimensional coordinates of the current position of the measuring machine when the measuring machine moves. A grating scale counting control system, comprising: a computer and a single chip microcomputer connected to the computer through a level shifter, wherein the single chip microcomputer is connected with a frequency multiplier, a reversible counter and a signal latch, the frequency multiplier and the grating ruler The signal generator is connected, and the grating signal generator is installed on the measuring machine. The computer comprises a computer transmitting module and a computing module, and the single chip comprises a clearing module, a double-chirping group, and a counting (four) mode. The group and the single chip transmitting module, wherein: the computer sending module is configured to send the set command in the computer to the single machine through the level converter; the module is used when the pure (10) is cleared in the sina ranger and the reversible counter ;; the doubling is multiplied 当 when the Μ machine generates a bit (4), and receives the measuring machine issued by the _=core grouper The three paths of the X-axis, γ-axis and ζ-axis displacement: the direction of the three-way signal received by the number and the amplification of the three-way signal No. 3, and the three-way signal amplified by the frequency is output to the expected Inverse=rate' and the counting control module is used to connect (four) three The road (four) points _ number two bits count 'and the counted data according to the direction of the corresponding signal: six positive and negative values, when the ten data reaches 256 or _256, the other brother will give The external interrupt input interface of the single chip microcomputer, when the count=beauty output is output to 256 or _2:6, the data is accumulated through the data splitting line of the signal latch; the W machine sends the second signal of the amount signal The data is obtained by the electric power, and after accumulating the calculation mode, the coordinate value of the grating scale signal generator of the received digital signal is used to obtain the coordinate value of the measuring machine. A grating rule counting control method, the method comprising the steps of: transmitting an acquisition command in a computer to a single chip microcomputer through a PC converter; and when the MCU receives and executes the acquisition command, clearing the data in the frequency multiplier and the reversible counter Zero, when the displacement measuring machine is displaced, the frequency multiplier receives three signals of the measuring machine's displacement of the measuring machine on the X-axis, the Y-axis and the Z-axis; the frequency multiplier Identifying the direction of the received three-way signal and amplifying the frequency of the >way signal, and inverting the frequency-amplified three-way signal to the reversible counter; the hiccup counter respectively receives the three signals Performing the hexadecimal count, the data of the brigade will be recorded as positive and negative values according to the direction of the corresponding signal; when the counted data reaches 256 or -256, the reversible counter outputs the data to the single chip microcomputer. External interrupt input interface' or when the counted data does not reach 256 or -256, the town counter counter sends the data to the household through the signal latch P0埠 of the machine; the household computer said that the data of the three signals received by the single chip are separately accumulated; the single chip transmits the accumulated data of the three signals to the computer through the level converter; The computer multiplies the data of the received two signals by the proportional coefficient of the grating signal generator to obtain a corresponding coordinate value of the measuring machine. Compared with the f-knowledge technology, the grating scale counting control system and method provided by the invention can quickly display the three-dimensional coordinate value of the current position of the measuring machine when the measuring machine moves, and has a sufficiently high resolution. To meet the accuracy requirements of the measurement, the speed and accuracy of the measurement machine measurement are improved. [Embodiment] As shown in Fig. 1, a hardware structure diagram of a preferred embodiment of the scale counting control system of the present invention is shown. The scale counting control system comprises a computer and a single chip microcomputer 12 connected to the computer 10 through a level shifter 11, the single chip microcomputer 12 is connected to a frequency multiplier 15, a reversible counter 16 and a signal latch 17, the frequency multiplier The device 15 is connected to a scale signal generator 17, which is mounted on the measuring machine 13. The electric moon έ 10 is used to issue a data acquisition command and convert the collected data into corresponding coordinate values. The level shifter 11 is used to convert the negative logic level of the computer 1 to the positive logic level issued by the microcontroller 12. After the microcontroller 12 executes the acquisition command sent by the computer 10, the data in the frequency multiplier 15 and the up/down counter 16 are cleared. When the equivalent measuring machine 13 is displaced, the scale signal generator 14 emits three signals representing two-dimensional spatial displacement, and transmits the three signals to the frequency multiplier 15. The frequency multiplier 15 is for identifying the direction of the received three-way signal and amplifying the frequency of the received two-way signal and transmitting the frequency-amplified three-way signal to the up-down counter 16. The reversible counter 16 is configured to receive the three signals sent by the frequency multiplier 15, and send the three (four) numbers to the single chip 12 or the signal latch 17 respectively. β The signal latch port is used to receive the data of the three signals sent by the reversible counter ' and send the data of the two channels to the single chip (4) Zhou 200928283 * .淳0. As shown in Figure 2, The functional module diagram of the computer and the single chip microcomputer of the grating scale counting control system is invented. The computer ίο includes a computer transmission module 1 计算 ^ calculation module 1 〇 2, the single > 1 machine I2 includes a clear module (10), a frequency multiplication control mode = 122, a counting control module 124, a judgment module纰126 and single chip transmitting module 128° The electric sea J transmitting module 100 is used for transmitting the acquisition command in the computer 10 to the single chip microcomputer 12 through the level shifter 11. The level at which the computer transmits and receives • is a negative logic level, and the level at which the microcontroller 12 transmits and receives is a high logic level. Therefore, before transmitting the acquisition command to the single chip microcomputer 12, the command needs to be first passed through the level shifter 11, and the negative logic level sent by the computer 1 is converted to a positive logic level 'and then the positive logic level is The command is sent to the microcontroller 12. The clear module 120 is configured to clear the data in the frequency multiplier 15 and the up/down counter 16 after the microcontroller 12 receives and executes the acquisition command. The frequency multiplication control module 122 is configured to receive three signals of the displacement of the measuring machine 13 emitted by the grating signal generator 14 on the X-axis, the γ-axis and the Z-axis when the equivalent measuring machine 13 is displaced. The frequency multiplication control module 122 is further configured to identify a direction of the received three signals and amplify the frequency of the three signals, and output the frequency amplified three signals to the up/down counter 16. The direction of the signal includes forward transmission and reverse transmission. The frequency at which the scale signal generator 14 emits a signal signal generally does not satisfy the accuracy requirement of the up-down counter 16. Therefore, the frequency of the signal emitted by the scale signal generator 14 is amplified by the frequency multiplier 15 by 11 to 2828283 to satisfy the reversible The accuracy requirements of the counter 16. The direction of the signal is identified by two square waves included in the signal. As shown in FIG. 4, the signal in the figure includes two square waves T1 and T2, and the square wave T1 is converted from a high level 1 to a low level. The flat time tl is less than the time t2 when the square wave T2 transitions from the high level 1 to the low level ,, the square wave T1 leads the T2, and the signal is forward transmission; as shown in FIG. 5, the signal in the figure includes Two square waves T1 and T2, the time tl of square wave T1 transitioning from high level 1 to low level 0 is greater than time t2 when square wave T2 is converted from high level 丨 to low level ,, square wave T1 lags behind T2 The signal is transmitted in the reverse direction. The counting control module 124 is configured to perform hexadecimal counting on the received three signals, and record the counted data as positive and negative values according to the direction of the corresponding signal. When the direction of the signal is forward transmission, the data of the signal count is a positive value; when the direction of the signal is reverse transmission, the data of the signal count is a negative value. The determining module 126 is configured to determine whether the counted data reaches 256 or -256. The counting control module 124 is further configured to output the data to the external interrupt input interface of the single chip microcomputer 12 when the counted data reaches 256 or -256, and when the counted data is _256 or _256, the material is: The data is sent to the microcontroller through the signal locker: ^. The data includes data of three signals of the χ axis, the Y axis and the Z axis displacement. When the data of the three signals passes through the P0 单片机 of the single chip microcomputer 12, in order to prevent mutual interference between the data, the signal latch 110 is required to be three. The data of the road signal is sent to P0埠 of the single chip=. For example, when the data of the X-axis is transmitted to the instant 乜 of the microcontroller, the signal latch 110 latches the data of the Y-axis and the z-axis. 12 200928283 • The counting control module 124 is further configured to accumulate data of the three-way signals received by the single chip microcomputer 12 respectively. The accumulation means accumulating all the data sent from the up-down counter 16 and the signal latch period 114 to the single-chip microcomputer 12 for each of the signals, for example, if the signal is counted from the up-down counter 16 and sent to the single-chip microcomputer 12, the data is 2 positive 256., the data sent from the signal latch 17 to the single chip 12 is a positive 253, then the data obtained by 256*2+253 is the accumulated data of the road signal; if there is a signal from the reversible counter 16 After the counting, the data sent to the single chip microcomputer 12 is two negative 256, and the data sent from the signal latching buffer 17 to the single chip microcomputer 12 is a positive 253, and the data obtained by the -256*2+253 is accumulated by the road signal. data of. The MCU transmitting module 128 is configured to send the accumulated data of the three signals to the computer 10 through the level shifter 11. The level shifter 11 converts the positive logic level transmitted by the microcontroller 12 to a negative logic level that the computer 10 can receive. The calculation module 1〇2 is further configured to multiply the data of the received three-way signal “(7) by the scale ruler; the proportional coefficient of the number generation II 14 to obtain the corresponding coordinate value of the measuring machine 13 . The value is the coordinate value after the displacement of the measuring machine 13 is generated. The figure shown in Fig. 3 is the image of the preferred embodiment of the grating scale counting control method of the present invention. First, step S10, the computer transmitting module 1〇抹 The erase command in the computer is sent to the single chip microcomputer 12 through the level conversion eil. The computer 10 is developed and the received level is a negative logic level, and the level of the transmitting and receiving of the single chip u is a high logic level. Therefore, in the transmission of the acquisition command to the monthly aircraft for 12 months, the first need to pass the command through the level shifter a, the negative logic level of the brain 13 ίο is converted to a positive logic level, and then The positive-logic level command is sent to the single-chip microcomputer 12. Step S12' After the single-chip microcomputer 12 receives and executes the acquisition command, the clearing module 120 clears the data in the frequency multiplier 15 and the up-down counter 16 to zero. When the equivalent measuring machine 13 is displaced, The frequency control module 122 receives three signals of the displacement of the measuring machine 13 by the grating signal generator 14 on the x-axis, the γ-axis and the Z-axis. Step S16 The multi-frequency control module 122 identifies the three signals received. Fang Zhen and amplifies the frequency of the three-way signal, and outputs the three-channel signal amplified by the frequency to the reversible counter 16. The direction of the signal is identified by two square waves included in the signal, such as As shown in FIG. 4, the signal in the figure includes two square waves T1 and T2, and the time tl of the square wave T1 transitioning from the high level 1 to the low level 〇 is smaller than the square wave T2 is converted from the high level 1 to the low level. Time t2, square wave T1 super rain in T2 'the # number is forward transmission; as shown in Figure 5, the signal in the figure includes two square waves T1 and T2, square wave T1 is converted from high level 1 to The time tl of the low level 0 is greater than the time when the square wave T2 is converted from the high level 丄 to the low level 〇 'the square wave T1 lags behind T2, and the signal is transmitted in the reverse direction. Step S18, the counting control module 124 The received three signals are respectively counted by hexadecimal, and the counted data are respectively according to the direction of the corresponding signal. It is recorded as a positive value and a negative value. When the direction of the signal is forward transmission, the data of the signal count is a positive value; when the direction of the signal is a reverse transmission, the data of the signal count is a negative value. In step S20, the determining module 126 determines whether the counted data reaches 256 or -256. 14 200928283 Step S22, when the counted data reaches 256 or _256, the counting control module 124 outputs the data to the single chip microcomputer 12 The external interrupt rounding interface 'step S24, when the counted data does not reach 256 or -256, the counting control module 124 transmits the data to the P〇i car of the early film machine 12 through the signal latch 17. In step S26, the counting control module 124 accumulates the data of the three signals received by the single chip microcomputer 12 respectively. The accumulation refers to accumulating the data of each signal sent from the up-down counter 16 and the signal latch period 114 to the single-chip microcomputer 12, for example, if a signal is counted from the up-down counter 16 and then sent to the single-chip microcomputer 12 The data is 2 positive 256, and the data sent from the signal latch 17 to the single chip 12 is a positive 253, then the data obtained by 256*2+253 is the accumulated data of the road signal; if there is a signal from the reversible counter After 16 a ten, the data sent to the early film machine 12 is 2 negative 256, and the data sent from the signal latch 17 to the single chip 12 is a positive 253, then the data obtained by _256*2+253 is The data accumulated for this road signal. In step S28, the single chip transmitting module 128 transmits the © data of the accumulated three signals to the computer 10 through the level shifter 11. The level shifter converts the positive logic level transmitted by the microcontroller 12 to a negative logic level that the computer can receive. In step S30, the calculation module 1〇2 is further configured to multiply the data of the received three-way signal by the proportional coefficient of the scale signal generator 14 to obtain a corresponding coordinate value of the measuring machine 13 . The coordinate value is the coordinate value after the displacement of the measuring machine a. BRIEF DESCRIPTION OF THE DRAWINGS 15 200928283 • Fig. 1 is a block diagram of a preferred embodiment of a scale count control system of the present invention. 2 is a functional block diagram of a computer and a single chip microcomputer of the grating scale counting control system of the present invention. Fig. 3 is a flow chart showing a preferred embodiment of the scale counting control method of the present invention. Fig. 4 is a schematic diagram showing the signal from the scale signal generator of Fig. 1 being forward transmission. _ Figure 5 is a schematic diagram of the signal from the scale signal generator of Figure 1 for reverse transmission. [Main component symbol description] Computer 10 level converter 11 Single chip microcomputer 12 Measuring machine 13 Scale signal generator 14 Frequency multiplier 15 Reversible counter 16 Signal latch 17 Computer transmission module 100 Calculation module 102 Clearing mode Group 120 frequency multiplication control module 122 counting control module 124 16 200928283 judgment module single chip transmission module

Claims (1)

200928283 • 十、申請專利範圍: • 1 . 一種光柵尺計數控制系統,該系統包括電腦及透過電 平轉換器與所述電腦相連的單片機,所述單片機與倍 頻器、可逆計數器及信號鎖存器相連,所述倍頻器與 光柵尺信號發生器相連,所述光柵尺信號發生器安裝 於量測機台上,所述電腦包括電腦發送模組和計算模 組,所述單片機包括清零模組、倍頻控制模組、計數 控制模組和單片機發送模組,其中: ©所述電腦發送模組用於將所述電腦中的採集命令透過 所述電平轉換器發送給所述單片機; 所述清零模組用於當所述單片機接收並執行採集命令 後將所述倍頻器及所述可逆計數器中的資料清零; 所述倍頻控制模組用於當所述量測機台發生位移時, 接收所述光柵尺信號發生器發出的量測機台在X轴、Y 軸及z轴位移的三路信號,識別所接收三路信號的方 向及放大所述三路信號的頻率,並將所述頻率放大後 〇 的三路信號輸出給所述可逆計數器; 所述計數控制模組用於將所接收的三路信號分別進行 十六進位計數,並將計數的資料根據所對應信號的方 向分別記為正值和負值,當計數的資料達到256或-256 時將該資料輸出給所述單片機的外部中斷輸入介面, 當計數的資料沒有達到256或-256時將該資料透過所 述信號鎖存器將該資料發送至所述單片機的P0埠,將 所述單片機所接收的三路信號的資料分別進行累加; 18 200928283 所述單片機發送模組用於將累加後的三路信號的資料 透過所述電平轉換器發送給所述電腦;及 所述计算模組用於將所接收的三路信號的資料分別乘 以所述光柵尺信號發生器的比例係數得到所述量測機 台相應的座標值。 2. 如中明專利範圍第城所述之光栅尺計數控制系統,所 述電平轉換器將電腦發出的負邏輯電平與單片機發出 的正邏輯電平進行相互轉換。 3. 如申明專利範圍第1項所述之光柵尺計數控制系統,所 述信號的方向包括正向傳輸和反向傳輸。 4 .如申清專利範圍第3項所述之光栅尺計數控制系統,當 所述彳§號的方向為正向傳輸時,該信號計數的資料為 玉值,當所述信號的方向為反向傳輸時,該信號計數 的資料為負值。 5 ^種利用申請專利範圍第1項所述系統控制光柵尺計數 的方法’該方法包括如下步驟: 將電腦中的採集命令透過電平轉換器發送給單片機; 當所述單片機接收並執行採集命令後,將倍頻器及可 逆計數器中的資料清零; 當量測機台發生位移時,所述倍頻器接收光柵尺信號 發生器發出的所述量測機台在X軸、γ軸及z軸位移的 三路信號; 所述倍頻器識別所接收三路信號的方向及放大所述三 路信號的頻率,並將所述頻率放大後的三路信號輸出 19 200928283 • 給所述可逆計數器; • 可逆計數器將所接收的三路信號分別進行十六進位計 數,並將計數的資料根據所對應信號的方向分別記為 正值和負值; 當所述計數的資料達到256或-256時,可逆計數器將該 資料輸出給所述單片機的外部中斷輸入介面,或者當 所述計數的資料沒有達到256或-256時,可逆計數器將 該資料透過所述信號鎖存器將該資料發送至所述單片 ©機的P0埠; 所述單片機將所接收的三路信號的資料分別進行累 加; 所述單片機將累加後的三路信號的資料透過所述電平 轉換器發送給所述電腦;及 所述電腦將所接收的三路信號的資料分別乘以所述光 柵尺信號發生器的比例係數得到所述量測機台相應的 座標值。 〇 6.如申請專利範圍第5項所述之光柵尺計數控制方法,所 述電平轉換器將電腦發出的負邏輯電平與單片機發出 的正邏輯電平進行相互轉換。 7_如申請專利範圍第5項所述之光柵尺計數控制方法,所 述信號的方向包括正向傳輸和反向傳輸。 8 .如申請專利範圍第7項所述之光柵尺計數控制方法,當 所述信號的方向為正向傳輸時,該信號計數的資料為 正值;當所述信號的方向為反向傳輸時,該信號計數 20 200928283 的資料為負值。200928283 • X. Patent application scope: • 1. A grating scale counting control system, the system comprising a computer and a single-chip microcomputer connected to the computer through a level shifter, the single-chip microcomputer and the frequency multiplier, the reversible counter and the signal latch Connected to the scale signal generator, the scale signal generator is mounted on the measuring machine, the computer comprises a computer transmitting module and a computing module, and the single chip comprises clearing a module, a frequency multiplication control module, a counting control module, and a single chip transmitting module, wherein: the computer transmitting module is configured to send an acquisition command in the computer to the single chip through the level converter The clearing module is configured to clear the data in the frequency multiplier and the reversible counter after the single chip microcomputer receives and executes the acquisition command; the frequency multiplication control module is configured to perform the measurement When the machine is displaced, the three signals of the measuring machine's displacement of the measuring machine on the X-axis, the Y-axis and the z-axis are received, and the direction of the received three-way signal is recognized and placed. a frequency of the three-way signal, and outputting the three-way signal of the frequency-amplified 〇 to the reversible counter; the counting control module is configured to perform hexadecimal counting respectively on the received three-way signal, and The counted data is recorded as a positive value and a negative value according to the direction of the corresponding signal, and when the counted data reaches 256 or -256, the data is output to the external interrupt input interface of the single chip microcomputer, and when the counted data does not reach 256. Or -256 times, the data is sent to the P0 of the single chip through the signal latch, and the data of the three signals received by the single chip are respectively accumulated; 18 200928283 And transmitting, by the level converter, the data of the accumulated three signals to the computer; and the calculating module is configured to multiply the data of the received three signals by the grating signal respectively The scale factor of the device is obtained by the corresponding coordinate value of the measuring machine. 2. The scale-counting control system described in the middle of the patent scope of the patent, the level converter converts the negative logic level sent by the computer and the positive logic level sent by the single-chip microcomputer. 3. The grating scale counting control system of claim 1, wherein the direction of the signal comprises forward transmission and reverse transmission. 4. The grating scale counting control system described in claim 3, wherein when the direction of the 彳§ is forward transmission, the data of the signal is a jade value, and when the direction of the signal is reversed The data counted by this signal is negative when transmitting. 5) A method for controlling the scale of the grating by using the system described in claim 1 of the patent application scope] The method includes the following steps: transmitting an acquisition command in the computer to the single chip microcomputer through the level shifter; when the single chip microcomputer receives and executes the acquisition command After that, the data in the frequency multiplier and the reversible counter are cleared; when the equivalent measuring machine is displaced, the frequency measuring device receives the measuring machine from the grating signal generator and the X-axis and the γ-axis a three-way signal of z-axis displacement; the frequency multiplier identifies the direction of the received three-way signal and amplifies the frequency of the three-way signal, and outputs the three-way signal amplified by the frequency 19 200928283 • to the reversible Counter; • The reversible counter counts the received three signals separately for hexadecimal count, and records the counted data as positive and negative values according to the direction of the corresponding signal; when the counted data reaches 256 or -256 When the reversible counter outputs the data to the external interrupt input interface of the single chip microcomputer, or when the counted data does not reach 256 or -256, the reversible count Transmitting the data to the P0埠 of the single-chip device through the signal latch; the MCU accumulates the data of the received three-way signals separately; the three-way accumulated by the single-chip microcomputer Transmitting, by the level converter, the data of the signal to the computer; and the computer multiplying the data of the received three signals by the proportional coefficient of the grating signal generator to obtain the corresponding measuring machine Coordinate value. 〇 6. The method of controlling the scale of a scale according to claim 5, wherein the level converter converts a negative logic level sent by the computer with a positive logic level sent by the single chip microcomputer. 7_ The method of controlling the scale of the scale as described in claim 5, wherein the direction of the signal comprises forward transmission and reverse transmission. 8. The method according to claim 7, wherein when the direction of the signal is forward transmission, the data of the signal is positive; when the direction of the signal is reverse transmission The signal count 20 200928283 is negative.
TW96149291A 2007-12-21 2007-12-21 System and method for controlling grating ruler counting TWI396822B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW96149291A TWI396822B (en) 2007-12-21 2007-12-21 System and method for controlling grating ruler counting

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW96149291A TWI396822B (en) 2007-12-21 2007-12-21 System and method for controlling grating ruler counting

Publications (2)

Publication Number Publication Date
TW200928283A true TW200928283A (en) 2009-07-01
TWI396822B TWI396822B (en) 2013-05-21

Family

ID=44863973

Family Applications (1)

Application Number Title Priority Date Filing Date
TW96149291A TWI396822B (en) 2007-12-21 2007-12-21 System and method for controlling grating ruler counting

Country Status (1)

Country Link
TW (1) TWI396822B (en)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4780814A (en) * 1987-02-09 1988-10-25 Intel Corporation Global serial channel for microcontroller
TWM286416U (en) * 2005-06-13 2006-01-21 Ching-Kuo Lin Input/output device of multi-functional PC-based controller

Also Published As

Publication number Publication date
TWI396822B (en) 2013-05-21

Similar Documents

Publication Publication Date Title
CN101451824B (en) Grating ruler counting control system and method
JP4647515B2 (en) Coordinate detection device, writing instrument, and coordinate input system
CN101484868B (en) Auto-gain switching module for acoustic touch systems
WO2018196498A1 (en) Biss protocol data decoding method and interface system
WO2008097024A1 (en) Method and apparatus for inputting handwriting and input system using the same
CN104834523A (en) Terminal
JP5661953B1 (en) Programmable controller
TW200928283A (en) System and method for controlling grating ruler counting
WO2020007374A1 (en) Distributed continuous vibration monitoring system
KR20070066541A (en) 3 dimensional displacement measurement apparatus of structure using digital image processing and the method thereof
JPS592107A (en) Interface apparatus
WO2014061242A1 (en) Coordinate input device, electronic calculation device and coordinate input method
CN103412045B (en) Method and device for calculating retardation in ultrasonic detection process with wedge block
JP2013229839A (en) Information signal processing system, information signal processing device, information signal processing circuit, and information recording medium
CN104931009A (en) Method for measuring horizontal distance
CN204359268U (en) A kind of indoor modeling scan device
CN211741962U (en) Computer and clock taming system with hardware triggering function equipment
CN202582497U (en) Grating scale having temperature detection function
CN110927419A (en) Signal generation system, method and storage medium
Chen et al. Identification and comparative analysis of vibration modal parameters of rice planter frame
US8020452B2 (en) Apparatus for measuring a volume flow rate of a controlled medium in a pipeline
CN100534384C (en) Magnetocardiogram signals collecting processing method based on digital signal processing and device thereof
CN201629091U (en) Multifunctional grating signal processing device of numerically controlled machine for teaching
SU849253A1 (en) Method and device for reading-out graphic information
CN205608189U (en) Be used for measuring GPS module

Legal Events

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