TW201623921A - Magnetic encoding device - Google Patents
Magnetic encoding device Download PDFInfo
- Publication number
- TW201623921A TW201623921A TW103144209A TW103144209A TW201623921A TW 201623921 A TW201623921 A TW 201623921A TW 103144209 A TW103144209 A TW 103144209A TW 103144209 A TW103144209 A TW 103144209A TW 201623921 A TW201623921 A TW 201623921A
- Authority
- TW
- Taiwan
- Prior art keywords
- magnetic
- encoding device
- microcontroller
- magnetic block
- circular
- Prior art date
Links
- 230000003287 optical effect Effects 0.000 claims description 25
- 230000008859 change Effects 0.000 claims description 9
- 238000000034 method Methods 0.000 claims description 4
- 230000005355 Hall effect Effects 0.000 claims description 3
- 238000004519 manufacturing process Methods 0.000 abstract description 10
- 238000010586 diagram Methods 0.000 description 16
- 238000005516 engineering process Methods 0.000 description 8
- 230000005405 multipole Effects 0.000 description 7
- 239000000428 dust Substances 0.000 description 5
- 230000004907 flux Effects 0.000 description 5
- 238000012937 correction Methods 0.000 description 4
- 230000032683 aging Effects 0.000 description 3
- 238000009434 installation Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 2
- 230000007613 environmental effect Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000001816 cooling Methods 0.000 description 1
- 238000005520 cutting process Methods 0.000 description 1
- 230000007123 defense Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 238000010438 heat treatment Methods 0.000 description 1
- 238000005286 illumination Methods 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 238000003754 machining Methods 0.000 description 1
- 230000005415 magnetization Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000010355 oscillation Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Landscapes
- Transmission And Conversion Of Sensor Element Output (AREA)
Abstract
Description
本發明係與信號轉換技術有關,特別係指一種將類比磁場訊號轉換為數位編碼之磁性編碼裝置。 The invention relates to signal conversion technology, in particular to a magnetic encoding device for converting an analog magnetic field signal into a digital code.
編碼器(Encoder)屬於低功率訊號調整裝置,普遍應用在國防、工業、車輛及一般商用訊號調整場合,如武器系統中致動器等伺服機構之命令傳送元件、電視音響喇叭之音量、冷暖氣機之溫度、燈光亮度等。舉凡有關類比或數位控制命令、人體感官之類比訊號,如聲音、亮度、溫度、風量的調整等,均會應用到此類裝置。 Encoder is a low-power signal adjustment device commonly used in defense, industrial, vehicle and general commercial signal adjustment applications, such as command transmission components of servos such as actuators in weapon systems, volume of TV audio speakers, and heating and cooling. Machine temperature, light brightness, etc. Any analog signal such as analog or digital control commands and human senses, such as adjustment of sound, brightness, temperature, and air volume, will be applied to such devices.
目前的編碼器類型大致分為機械式、光學式,以及電磁式等幾類,其中機械式以機械接點產生脈波訊號,每圈的解析度低,使用壽命短。光學式增量型及絕對型編碼器為目前非接觸式編碼器主流,使用量大,技術成熟,且精度及可靠度高,適用於工具機、機器人、機器手臂,以及高端的位置伺服控制系統。但光學編碼器有體積及耗電流大,產品可靠度受環境影響大(如粉塵與潮溼環境等)。 The current encoder types are roughly classified into mechanical, optical, and electromagnetic types. Among them, the mechanical type generates pulse signals by mechanical contacts, and the resolution per turn is low, and the service life is short. The optical incremental and absolute encoders are the mainstream of the current non-contact encoders. They are large in use, mature in technology, and highly accurate and reliable. They are suitable for machine tools, robots, robot arms, and high-end position servo control systems. . However, optical encoders have large volume and current consumption, and product reliability is greatly affected by the environment (such as dust and moisture).
光學編碼器有光柵式與反射式兩種,光柵式係讓轉軸帶動一薄片,此薄片上一定角度間隔蝕刻隙縫,在薄片兩端分置LED或雷射光源。在另一端以感光元件偵測光線是否通過光柵而產生0與1的脈波串。此脈波經專用晶片分析,便可了解轉軸旋轉角度。目前業界普遍利用兩組感光元件產生相位差90度的兩組脈波串,如圖2所示之光學編碼器AB相脈波圖,以產生四倍解析度的效果。以每圈1000格的光柵為例,四倍解析之後,可以4000格分解360度,即解析度可達0.09度。反射式光學編碼器,或稱光學尺則以一組雷射光源對反射面發射雷射光,反射面以蝕刻方式製造成正弦波或三角波外型,雷射光打在不同高度時反射光的相位會有相對應變 化,分析反射光的相位即可了解光點所在位置,進而推算轉軸旋轉角度。反射式光學編碼器在一個波形範圍內又可分割成8位元(256格)或更高,因此,其解析度較光柵式編碼器高,一般可達20位元或更高,若應用在線性光學尺上,解析度可達0.1μm。光柵式光學式編碼器有增量型及絕對型兩種。絕對型編碼器其功能有如電位計或解角器等,可提供轉軸的絕對角度,此型產品價格昂貴,12位元的產品即需要12對光源發射與接收模組。增量型編碼器則必須設定零點(通常由Z相提供),提供轉軸對零點的相對角度。反射式編碼器則僅有增量型。不論是反射式或光柵式光學編碼器,均需使用光源,接收端為感光元件,受粉塵或濕氣影響較大,元件亦有老化問題。因此光學編碼器讀頭一般均以IP65等級封裝,可防塵防水。但武器系統需考慮長時間處於惡劣環境下,一旦光學編碼器的封裝因老化而降低功能,裝置可能滲入水汽或灰塵,其性能將受影響甚至失效。因此,一般光學編碼器較常用於環境良好之精密加工間等處,使用於武器系統或車輛上的產品則必須為封裝等級相當高之產品。此外光學編碼器的耗電量較一般的感測器高,普遍需要的電流約50-100mA,而一般的感測器耗電量大多在10mA以下。 The optical encoder has two types of grating type and reflective type. The grating type allows the rotating shaft to drive a sheet. The sheet is etched at a certain angular interval, and the LED or the laser source is separated at both ends of the sheet. At the other end, the photosensitive element detects whether the light passes through the grating to generate a pulse train of 0 and 1. This pulse wave is analyzed by a dedicated wafer to understand the angle of rotation of the shaft. At present, two sets of photosensitive elements are commonly used in the industry to generate two sets of pulse trains with a phase difference of 90 degrees, such as the optical encoder AB phase pulse wave diagram shown in FIG. 2, to produce a quadruple resolution effect. Taking a grating of 1000 grids per circle as an example, after four times of analysis, 4000 degrees can be decomposed by 360 degrees, that is, the resolution can reach 0.09 degrees. A reflective optical encoder, or optical scale, emits laser light to a reflecting surface by a set of laser light sources, and the reflecting surface is etched to form a sine wave or a triangular wave shape, and the phase of the reflected light when the laser light strikes at different heights There is a corresponding change, analyze the phase of the reflected light to understand the position of the spot, and then calculate the angle of rotation of the shaft. The reflective optical encoder can be divided into 8-bit (256-frame) or higher in a waveform range. Therefore, its resolution is higher than that of the grating encoder, generally up to 20 bits or higher. On the optical scale, the resolution is up to 0.1 μm . Grating optical encoders are available in both incremental and absolute versions. Absolute encoders have functions such as potentiometers or resolvers, which provide absolute angles of the shaft. This type of product is expensive, and 12-bit products require 12 pairs of light source transmitting and receiving modules. Incremental encoders must be set to zero (usually provided by the Z phase) to provide the relative angle of the shaft to the zero. Reflective encoders are only incremental. Whether it is a reflective or grating optical encoder, the light source is required, and the receiving end is a photosensitive element, which is greatly affected by dust or moisture, and the component also has aging problems. Therefore, optical encoder read heads are generally packaged in IP65 grade and are dust and water resistant. However, the weapon system needs to be considered in a harsh environment for a long time. Once the package of the optical encoder is degraded due to aging, the device may seep into water vapor or dust, and its performance will be affected or even fail. Therefore, general optical encoders are often used in precision machining rooms where the environment is good, and products used in weapon systems or vehicles must be products with a relatively high package level. In addition, the power consumption of the optical encoder is higher than that of a general sensor, and the current required is generally about 50-100 mA, while the power consumption of a general sensor is mostly below 10 mA.
磁帶型磁性編碼器類似光學尺,只是光學尺以雷射光產生訊號,磁帶型磁性編碼器則以磁條產生訊號,藉由磁感測技術解調出位置或角度訊號。藉由讀取磁場強度變化,1對NS磁極之間尚可切割為數十至上百等分,因此,此類產品位置解析度亦可達μm等級,唯讀取頭相當精密,供應量少,價格昂貴,民生產業較少使用,切入技術門檻相當高。 A magnetic tape type magnetic encoder is similar to an optical scale, except that the optical scale generates a signal by laser light, and the magnetic tape type magnetic encoder generates a signal by using a magnetic stripe to demodulate the position or angle signal by magnetic sensing technology. By reading the change of the magnetic field strength, the pair of NS magnetic poles can be cut into tens to hundreds of equal parts. Therefore, the position resolution of such products can reach the μ m level, but the reading head is quite precise and the supply is small. The price is high, the civilian production industry is less used, and the threshold for cutting into technology is quite high.
多磁極型磁性編碼器的轉軸則帶動一多磁極的磁塊,使用2組霍爾開關(Hall switch)輸出一對相位差90度的脈波。多磁極型磁性編碼器產品在音響音量調整場合,或是需要長期使用的控制訊號調整旋鈕(如武器系統地面裝備之控制旋鈕)特別適用,其特性與增量式光學編碼器相同,無旋轉角度限制,無接觸,無磨耗,長期使用不會因灰塵或毛屑受靜電吸引附著於電刷上而產生雜音,對環境的耐受性較光學及可變電阻式的電位計優。多磁極型磁性編碼器無旋轉角度限制,內部無發光與感光元件,僅使用磁塊與霍爾開關,幾無元件老化問題,在使用壽命、可靠度,以及對使 用環境的耐受性上均較光學編碼器及電位計優良,且價格較光學編碼器低廉。然而現有多磁極型磁性編碼器於製造上有幾點困難:多磁極磁塊之充磁技術門檻高,特別是用於較小型裝置的縮裝化工程,目前市面上僅有少數廠商掌握關鍵技術;多磁極磁塊對於霍爾開關之安裝精度要求高,以圖1為例,圖1為現有典型之多磁極型磁性編碼器結構圖,若其具有4對磁極,每對磁極分配90度機械角(360度磁極角),每個磁極分配45度機械角(180度磁極角),兩顆霍爾開關若要輸出90度的磁極相位差,則安裝的機械角度差為360/8/2=22.5度機械角,或1度機械角相當於4度磁極角,若是12對磁極,則90度的磁極角相當於360/24/2=7.5度的機械角,或每1度的機械角相當於12度的磁極角,亦即安裝時若兩組磁場感測器的相對位置誤差1度,則在AB相的相位差上就出現12度的誤差,以一顆外徑16mm、12對磁極的磁性編碼器來計算,1度的機械角換算的弧長為0.140mm,在組裝的要求上相當嚴格,加工技術門檻高、不易普及化推廣應用。 The rotating shaft of the multi-pole type magnetic encoder drives a magnetic block of a plurality of magnetic poles, and uses two sets of Hall switches to output a pair of pulse waves with a phase difference of 90 degrees. Multi-pole type magnetic encoder products are especially suitable for sound volume adjustment, or control signal adjustment knobs that need to be used for a long time (such as control knobs for weapon system ground equipment). Their characteristics are the same as those of incremental optical encoders. Restricted, non-contact, no wear, long-term use will not be caused by dust or dander by static electricity attached to the brush to produce noise, environmental resistance is better than optical and variable resistance potentiometers. Multi-pole type magnetic encoder has no rotation angle limitation, no internal illumination and photosensitive element, only magnetic block and Hall switch, no component aging problem, in service life, reliability, and The environmental tolerance is superior to optical encoders and potentiometers, and the price is lower than that of optical encoders. However, the existing multi-pole magnetic encoder has several difficulties in manufacturing: the magnetization technology of the multi-magnetic magnetic block has a high threshold, especially for the shrinking of a smaller device, and only a few manufacturers currently have master technologies in the market. Multi-pole magnetic block requires high installation accuracy of the Hall switch. Take Figure 1 as an example. Figure 1 shows the structure of a typical multi-pole magnetic encoder. If it has 4 pairs of magnetic poles, each pair of poles is assigned 90 degrees. Angle (360 degree magnetic pole angle), each magnetic pole is assigned a mechanical angle of 45 degrees (180 degree magnetic pole angle). If two Hall switches are to output a phase difference of 90 degrees, the mechanical angle difference of the installation is 360/8/2. = 22.5 degrees mechanical angle, or 1 degree mechanical angle equivalent to 4 degrees magnetic pole angle, if 12 pairs of magnetic poles, the 90 degree magnetic pole angle is equivalent to 360/24/2 = 7.5 degree mechanical angle, or mechanical angle per 1 degree Corresponding to a magnetic pole angle of 12 degrees, that is, if the relative position error of the two sets of magnetic field sensors is 1 degree during installation, a 12 degree error occurs in the phase difference of the AB phase, with an outer diameter of 16 mm and 12 pairs. Magnetic pole magnetic encoder to calculate, 1 degree mechanical angle converted arc length is 0.140mm, in the group On very strict requirements, high technical threshold processing, easy to popularize application.
鑒於傳統技術之缺點,本發明係提供一種磁性編碼裝置,係使用單對磁極磁塊,結合霍爾元件與微控制器組成一磁性編碼裝置,本發明之構造簡單可靠、製造成本與難度均較傳統技術低。 In view of the shortcomings of the conventional technology, the present invention provides a magnetic encoding device that uses a pair of magnetic pole magnetic blocks, and combines a Hall element and a microcontroller to form a magnetic encoding device. The structure of the present invention is simple and reliable, and the manufacturing cost and difficulty are compared. Traditional technology is low.
本發明係提供一種磁性編碼裝置,係包括:一圓形磁塊,係為單對磁極磁塊;複數霍爾元件,係設置於該圓形磁塊之圓周側邊,該霍爾元件係以該圓形磁塊圓心為基點,彼此相隔90度角設置;一微控制器,係連接該霍爾元件,係將該霍爾元件感測之磁場變化量轉變成數位編碼輸出,該微控制器係可模擬遲滯切換,使該磁性編碼裝置可穩定輸出2狀態編碼;其中該圓形磁塊係以該圓形磁塊圓心為旋轉軸旋轉;該圓形磁塊亦可為具有複數對磁極之磁塊;該圓形磁塊係為徑向充磁磁塊;該霍爾元件係可為線性霍爾效應裝置(Linear Hall-effect device,LHE device),或其他可根據磁場變化而輸出類比電壓之裝置。 The present invention provides a magnetic encoding device, comprising: a circular magnetic block, which is a single pair of magnetic pole magnetic blocks; a plurality of Hall elements disposed on a circumferential side of the circular magnetic block, the Hall element is The center of the circular magnetic block is a base point and is disposed at an angle of 90 degrees from each other; a microcontroller is connected to the Hall element, and the amount of magnetic field change sensed by the Hall element is converted into a digital coded output, the microcontroller The system can simulate hysteresis switching, so that the magnetic encoding device can stably output the 2-state code; wherein the circular magnetic block rotates with the center of the circular magnetic block as a rotating axis; the circular magnetic block can also have a plurality of pairs of magnetic poles. a magnetic block; the circular magnetic block is a radial magnetizing magnetic block; the Hall element can be a linear Hall-effect device (LHE device), or other analog voltage can be output according to a magnetic field change Device.
以上之概述與接下來的詳細說明及附圖,皆是為了能進一步說明本發明達到預定目的所採取的方式、手段及功效。而有關本發明的其他目的及優點,將在後續的說明及圖示中加以闡述。 The above summary, the following detailed description and the accompanying drawings are intended to further illustrate the manner, the Other objects and advantages of the present invention will be described in the following description and drawings.
11‧‧‧圓形磁塊 11‧‧‧Circular magnetic block
12‧‧‧霍爾元件 12‧‧‧ Hall element
13‧‧‧微控制器 13‧‧‧Microcontroller
圖1係為現有典型之多磁極型磁性編碼器結構圖。 FIG. 1 is a structural diagram of a typical multi-pole type magnetic encoder.
圖2係為光學編碼器之AB相脈波圖。 Figure 2 is an AB phase pulse diagram of an optical encoder.
圖3係為本發明之磁性編碼裝置結構圖。 3 is a structural view of a magnetic encoding device of the present invention.
圖4係為本發明之磁性編碼裝置之霍爾元件輸出波形圖。 Fig. 4 is a waveform diagram showing the output of a Hall element of the magnetic encoding device of the present invention.
圖5係為本發明之磁性編碼裝置之霍爾元件相對關係圖。 Figure 5 is a diagram showing the relative relationship of Hall elements of the magnetic encoding device of the present invention.
圖6係為本發明之磁性編碼裝置未經軟體處理之一個脈波周期的AB相波形圖。 Fig. 6 is a diagram showing the AB phase waveform of a pulse wave period in which the magnetic encoding device of the present invention is not processed by software.
圖7係為本發明之磁性編碼裝置未經軟體處理之360度的AB相輸出波形。 7 is a 360-degree AB phase output waveform of the magnetic encoding device of the present invention without software processing.
圖8係為霍爾數位開關之輸出特性曲線圖。 Figure 8 is a graph showing the output characteristics of a Hall digital switch.
圖9係為本發明之以4狀態編碼與傳統2狀態編碼A相波形對照圖。 FIG. 9 is a comparison diagram of a 4-phase code and a conventional 2-state code A phase waveform according to the present invention.
圖10係為本發明之以4狀態編碼與傳統2狀態編碼B相波形對照圖。 FIG. 10 is a comparison diagram of a 4-phase code and a conventional 2-state code B-phase waveform according to the present invention.
圖11係為本發明之以4狀態編碼之AB相波形圖。 Figure 11 is a diagram showing the AB phase waveform of the 4-state code of the present invention.
圖12為本發明之遲滯點數4實施例的AB相單脈波周期內4狀態編碼波形圖。 Figure 12 is a diagram showing the state of the four-state encoding of the AB phase single pulse period in the embodiment of the hysteresis point 4 of the present invention.
圖13為本發明之遲滯點數1實施例的AB相單脈波周期內4狀態編碼波形圖。 Figure 13 is a diagram showing the state of the four-state encoding of the AB phase single pulse period in the embodiment of the hysteresis point 1 of the present invention.
圖14為本發明之B相落後A相54度實施例的單脈波周期4狀態編碼波形圖。 Figure 14 is a diagram showing a single pulse period 4 state coded waveform of the B phase backward A phase 54 degree embodiment of the present invention.
圖15為本發明之B相領先A相45度實施例的單脈波周期4狀態編碼波形圖。 Figure 15 is a diagram showing a single pulse period 4 state coded waveform of the B phase leading A phase 45 degree embodiment of the present invention.
以下係藉由特定的具體實例說明本發明之實施方式,熟悉此技藝之人士可由本說明書所揭示之內容輕易地瞭解本發明之其他優點與功效。 The embodiments of the present invention are described below by way of specific examples, and those skilled in the art can readily appreciate other advantages and functions of the present invention from the disclosure herein.
本發明之磁性編碼裝置結構圖如圖3所示,係包括:一圓形磁塊11,係為單對磁極磁塊,係以該圓形磁塊圓心為旋轉軸旋轉;二霍爾元件12,係設置於該圓形磁塊之圓周側邊,該二霍爾元件係以該圓形磁塊 圓心為基點,彼此相隔90度角設置;一微控制器13,係連接該二霍爾元件,係將該二霍爾元件感測之磁場變化量轉變成數位編碼輸出:其中該微控制器係可模擬遲滯切換,使該磁性編碼裝置可穩定輸出2狀態編碼;該圓形磁塊係為徑向充磁磁塊;該霍爾元件係為線性霍爾效應裝置(Linear Hall-effect device,LHE device),或其他可根據磁場變化而輸出類比電壓之裝置。 The structure of the magnetic encoding device of the present invention is as shown in FIG. 3, which includes: a circular magnetic block 11 which is a single pair of magnetic pole blocks rotating with the center of the circular magnetic block as a rotating axis; Is disposed on a circumferential side of the circular magnetic block, and the two Hall elements are the circular magnetic block The center of the circle is set at an angle of 90 degrees from each other; a microcontroller 13 is connected to the two Hall elements, and the amount of change in the magnetic field sensed by the two Hall elements is converted into a digital coded output: wherein the microcontroller is The hysteresis switching can be simulated, so that the magnetic encoding device can stably output the 2-state code; the circular magnetic block is a radial magnetizing magnetic block; the Hall element is a linear Hall-effect device (LHE) Device), or other device that outputs an analog voltage based on changes in the magnetic field.
本發明之磁性編碼裝置工作原理為:當該圓形磁塊旋轉一圈時,兩顆霍爾元件(LHE)的輸出訊號為一對相位差90度的正弦/餘弦波,如圖4(實測訊號),此二組訊號的相對關係為一圓,如圖5。由於圖4的輸出波形並非先前技術之光學編碼器的AB相脈波形式(如圖錯誤!找不到參照來源。),因此本發明先利用該微控制器讀取該霍爾元件之訊號,解出該圓形磁塊的旋轉角度後,再根據預先設定之資料表輸出0或1的AB相波形。先設定本發明之磁性編碼裝置每圈具有之脈波格數Nppr(Pulse Per Round,ppr),將圖5的圓分成Nppr等分,或將圖4中的橫軸(角度)分成Nppr格,以圖4為例,橫軸被分成12格,每格將產生一個脈波,因此每30度為一脈波格。每一脈波格(30度)中,有一對AB相方波,本發明將每一脈波格再細分為Ngpc格(Grid per Cycle,gpc),此處以每一個脈波格有Ngpc=40格為例,若整圈共有Nppr=12個脈波格,因此每一小格的角度為0.75度,若Ngpc=80,則每小格的角度為0.375度。Nppr與Ngpc的乘積為每一圈的總細格數(girds),此格數受該微控制器(Micro Control Unit,MCU)的位元數以及訊號雜訊度限制。一般以10位元的微控制器而言,最多能分辨1024個類比電壓,Nppr×Ngpc的上限為1024,因此若Ngpc設定為40,磁性編碼裝置未經軟體處理之每圈的脈波數上限為25.6,每個脈波周期的AB相波形如圖6,一圈360度共要產生Nppr個脈波週期,其中A相在每個脈波周期的前半部為1,後半周期為0;B相與A相相差90度(四分之一週期)。將圖4中每30度一組的脈波格,裡面的40個格子點都設計成如圖6的0與1的資料,理論上,即可讓該磁性編碼裝置輸出每圈Nppr個脈波的編碼,如圖7。但實際上,編碼器的輸出在某些位置(角度)並非固定是0或1,在0切換到1與1切換到0之區間可能會高速切換變化,造成編碼信號錯誤與雜訊產生,若 直接將本發明之微控制器的輸出設計成圖7的波形,將無遲滯特性,使用上會造成問題。一般數位輸出的開關均有遲滯切換功能,以免開關位置在切換點時,輸出在0與1之間高速變化。以霍爾數位開關為例,圖8為霍爾數位開關的輸出特性曲線。以圖8右圖為例,BOP>BRP,二者均為磁通密度。當霍爾數位開關面臨的磁通密度高於BOP時,霍爾開關輸出必然為1,當磁通密度<BRP時,輸出必然為0,但是當磁通密度介於BRP與BOP之間時,霍爾開關的輸出與前一刻的狀態有關。此設計可避免霍爾開關在某個磁通密度時,高速在0與1的狀態間切換,造成信號錯誤。遲滯特性與前一刻的狀態值有關,此外,也與切換點的距離有關,如圖8,BRP與BOP之差距BHYS即為遲滯區間。 The working principle of the magnetic encoding device of the present invention is: when the circular magnetic block rotates one turn, the output signals of the two Hall elements (LHE) are a pair of sine/cosine waves with a phase difference of 90 degrees, as shown in FIG. 4 (measured Signal), the relative relationship between the two groups of signals is a circle, as shown in Figure 5. Since the output waveform of FIG. 4 is not in the form of the AB phase pulse of the optical encoder of the prior art (as shown in the figure ! The reference source is not found ), the present invention first uses the microcontroller to read the signal of the Hall element. After the rotation angle of the circular magnetic block is solved, the AB phase waveform of 0 or 1 is output according to a preset data table. First, the magnetic encoding device of the present invention has a pulse wave number N ppr (Pulse Per Round, ppr) per circle, and the circle of FIG. 5 is divided into N ppr equal parts, or the horizontal axis (angle) in FIG. 4 is divided into N. In the ppr grid, as shown in Fig. 4, the horizontal axis is divided into 12 grids, and each grid will generate a pulse wave, so every 30 degrees is a pulse grid. In each pulse wave (30 degrees), there is a pair of AB phase square waves. The present invention subdivides each pulse wave into a N gpc grid (Grid per Cycle, gpc), where each pulse wave has N gpc = For example, if 40 circles have a total of N ppr = 12 pulse cells, the angle of each cell is 0.75 degrees. If N gpc = 80, the angle of each cell is 0.375 degrees. The product of N ppr and N gpc is the total number of fines (girds) per revolution, which is limited by the number of bits of the Micro Control Unit (MCU) and the signal noise. Generally, a 10-bit microcontroller can resolve up to 1024 analog voltages. The upper limit of N ppr ×N gpc is 1024. Therefore, if N gpc is set to 40, the magnetic encoding device is not processed by software. The upper limit of the wave number is 25.6, and the AB phase waveform of each pulse period is as shown in Fig. 6. A total of N ppr pulse period is generated in a 360 degree cycle, wherein phase A is 1 in the first half of each pulse period, and the second half is It is 0; phase B and phase A are 90 degrees apart (quarter cycle). The pulse grid of every 30 degrees in Fig. 4, the 40 grid points inside are designed as the data of 0 and 1 in Fig. 6. In theory, the magnetic coding device can output N ppr pulses per revolution. The wave code is shown in Figure 7. However, in fact, the output of the encoder is not fixed at 0 or 1 at certain positions (angles). In the interval where 0 is switched to 1 and 1 is switched to 0, the change may be switched at a high speed, resulting in a coded signal error and noise generation. Directly designing the output of the microcontroller of the present invention to the waveform of Figure 7, there will be no hysteresis characteristics, which can cause problems in use. Generally, the digital output switch has a hysteresis switching function to prevent the output from changing at a high speed between 0 and 1 when the switch position is at the switching point. Taking the Hall digital switch as an example, Figure 8 shows the output characteristic curve of the Hall digital switch. Taking the right picture of Fig. 8 as an example, B OP > B RP , both of which are magnetic flux densities. When the magnetic flux density faced by the Hall digital switch is higher than B OP , the Hall switch output must be 1. When the magnetic flux density is < B RP , the output must be 0, but when the magnetic flux density is between B RP and B OP The output of the Hall switch is related to the state of the previous moment. This design avoids the Hall switch switching between 0 and 1 at high speed at a certain magnetic flux density, causing signal errors. And the hysteresis characteristic value relating to the state before the moment, in addition, also from the point of a switch, as shown in FIG 8, the gap between the B OP and B RP B HYS is the Hysteresis Interval.
本發明係以軟體模擬來達成遲滯切換功能,係由該微控制器將原本脈波輸出之2狀態編碼0、1的兩種狀態,進一步區分為0、1、2、3的四種狀態,因此需找出原本的2狀態編碼中,由1變成0、以及由0變成1的位置(切換點),如圖9上圖中的第20格(由1變0),以及第40格(由0變1)。本發明之微控制器模擬遲滯切換之方法步驟實施例係包括:設定脈波切換點位置,若每脈波周期的格數為Ngpc,則切換點位於Ngpc/2,以及Ngpc兩處,如本文前例,Ngpc=40,則切換點分別位於20與40兩處(因一周期脈波中1與0各佔一半,因此Ngpc必須設定為偶數。);設定遲滯區間長度,遲滯區間長度(遲滯點數)Nhys代表在切換點該處前後Nhys點為遲滯區間;定義該切換點前後遲滯區間之狀態,將切換點前後Nhys點(共2Nhys點)的區間(即設定之遲滯區間)重新定義為0、1以外之狀態,若切換點前Nhys點(含切換點本身)或切換點後Nhys點(不含切換點本身)的狀態為1、則將切換點前Nhys點(含切換點本身)區間的狀態設為2,若切換點前Nhys點(含切換點本身)或切換點後Nhys點(不含切換點本身)的狀態為0、則將切換點前Nhys點(含切換點本身)的狀態設為3;將該切換點前後遲滯區間之狀態分類為2狀態編碼,例如在微控制器中將上述步驟產生之2視為1,將上述步驟產生之3視為0,該磁性編碼裝置即可具有遲滯切換功能,穩定輸出0、1之2狀態編碼。請參閱圖9,上圖為 原來2狀態的A相編碼(圖6上圖),前一半週期為1、後半週期為0,以本發明之4狀態編碼方法重新編排後,Nhys設定為2,A相4狀態編碼的結果如圖9下圖。若將切換點前後2點原本屬於1的狀態編為2,屬於0的狀態編為3,則將變成圖10上圖B相之2狀態編碼與圖10下圖之4狀態編碼結果,4狀態編碼之AB相波形圖如圖11。本發明係由該微控制器以軟體模擬方式,將上述實施例定義之2分類為1、將3分類為0,即可使本發明之磁性編碼裝置穩定輸出0、1之2狀態編碼,消除輸出脈波在0切換到1與1切換到0之區間會產生高速切換震盪、造成雜訊與信號不佳之狀況,且本發明不需設置額外之數位開關電路,降低生產複雜度與製造成本。 The invention realizes the hysteresis switching function by software simulation, and the microcontroller further divides the two states of the original pulse output 2 state code 0 and 1 into four states of 0, 1, 2, and 3, Therefore, it is necessary to find out the position (switching point) from 1 to 0 and from 0 to 1 in the original 2-state code, as shown in the figure 20 in the first 20 (from 1 to 0), and the 40th ( Change from 0 to 1). The embodiment of the method for simulating hysteresis switching of the microcontroller of the present invention comprises: setting a pulse switching point position, if the number of cells per pulse period is N gpc , the switching point is located at N gpc /2, and N gpc As in the previous example, N gpc =40, the switching points are located at 20 and 40 respectively (since 1 and 0 are half of a cycle pulse, so N gpc must be set to an even number.); set the length of the hysteresis interval, hysteresis interval length (hysteresis points) N hys the representative points before and after the switching point where the hysteresis interval N hys; hysteresis range defined state before and after the switching point, the switching point N hys (co 2N hys points) before and after the dot interval (i.e. The set hysteresis interval is redefined as a state other than 0 and 1. If the state of the N hys point (including the switching point itself) before the switching point or the N hys point (excluding the switching point itself) after the switching point is 1, the switch will be switched. The state of the interval of the N hys point (including the switching point itself) before the point is set to 2, and the state of the N hys point (including the switching point itself) before the switching point or the N hys point (excluding the switching point itself) after the switching point is 0. N hys state point before the switching point will be (including switching point itself) is set to 3; and after the switching point of the hysteresis The state between the two is classified into two state codes. For example, in the microcontroller, 2 of the above steps is regarded as 1 and 3 generated by the above steps is regarded as 0. The magnetic encoding device can have a hysteresis switching function and stabilize the output 0. 1 to 2 state code. Please refer to FIG. 9. The upper picture shows the original 2-state A-phase coding (upper figure in FIG. 6). The first half period is 1, and the second half period is 0. After re-arranging according to the 4-state coding method of the present invention, N hys is set to 2 The result of the A-phase 4-state coding is shown in the following figure. If the state that belongs to 1 at 2 points before and after the switching point is 2, and the state belonging to 0 is 3, it will become the 2 state code of the B phase in FIG. 10 and the 4 state code result of the lower diagram of FIG. 10, 4 state. The encoded AB phase waveform is shown in Figure 11. According to the present invention, the microcontroller defines the 2 in the above embodiment as 1 and 3 as 0 in a software simulation manner, so that the magnetic encoding device of the present invention can stably output 0 and 1 of 2 state codes, eliminating When the output pulse is switched from 0 to 1 and 1 is switched to 0, high-speed switching oscillation occurs, resulting in poor noise and signal, and the present invention does not need to provide an additional digital switching circuit, thereby reducing production complexity and manufacturing cost.
本發明之磁性編碼裝置之圓形磁塊亦可使用軸向充磁磁塊,此種配置中,霍爾元件(LHE)立可直於電路板上,軸向充磁的磁塊面對霍爾元件(LHE)時,霍爾元件(LHE)看見的磁力線最多,另一顆霍爾元件(LHE)的磁力線數最少,但霍爾元件(LHE)的輸出無法如徑向充磁磁塊的配置那樣產生一組正弦/餘弦(sin/cos)波形,在校正程序上需要附加外部角度校正單元以利該微控制器進行編碼排列,該外部角度校正單元係設置於該圓形磁塊之旋轉軸上,並連接該微控制器,該外部角度校正單元係提供該圓形磁塊之旋轉角度給該微控制器,以提高該微控制器之信號精度。本發明之磁性編碼裝置使用徑向充磁磁塊時,亦可附加外部角度校正單元,以符合對角度精度與解析度要求較高之產品需求。該外部角度校正單元係可為光學編碼器、解角器或其他角度量測裝置。 The circular magnetic block of the magnetic encoding device of the present invention can also use an axial magnetizing magnetic block. In this configuration, the Hall element (LHE) can be perpendicular to the circuit board, and the axially magnetized magnetic block faces the Huo. When the element (LHE) is used, the Hall element (LHE) sees the most lines of magnetic force, and the other Hall element (LHE) has the least number of lines of magnetic force, but the output of the Hall element (LHE) cannot be as radial as the magnetized block. The configuration generates a set of sin/cos (sin/cos) waveforms, and an external angle correction unit is needed in the calibration procedure to facilitate the coding arrangement of the microcontroller. The external angle correction unit is disposed on the rotation of the circular magnetic block. On the shaft, and connected to the microcontroller, the external angle correction unit provides the rotation angle of the circular magnetic block to the microcontroller to improve the signal precision of the microcontroller. When the magnetic encoding device of the present invention uses a radial magnetizing magnetic block, an external angle correcting unit may be added to meet the demand for a product having high angular precision and resolution. The external angle correction unit can be an optical encoder, a resolver or other angle measuring device.
本發明之磁性編碼裝置係可調整遲滯寬度,一般數位開關的遲滯範圍由電路硬體決定,而本發明之磁性編碼裝置可在生產時由該微控制器內建之軟體設定其AB相脈波切換點的遲滯寬度。設定時僅需調整遲滯點數Nhys即可。如圖9與圖10中的遲滯點數為2,因此在切換點左右各2格,共4格的範圍為遲滯範圍。此二圖中每個脈波周期內的格點Ngpc=40,整圈共有Nppr=12個脈波格,因此,每一小格的角度為0.75度,遲滯範圍為3度。圖12為本發明之遲滯點數4實施例的AB相單脈波周期內4狀態編碼波形圖,圖13為本發明之遲滯點數1實施例的AB相單脈波周期內4狀態編碼波形圖。本發明之磁性編碼裝置係可由該微控制器之軟體設定調 整遲滯寬度,而不需變更硬體規格,可增加生產效率、節省加工成本。 The magnetic encoding device of the present invention can adjust the hysteresis width. The hysteresis range of the general digital switch is determined by the circuit hardware, and the magnetic encoding device of the present invention can set the AB phase pulse wave by the software built in the microcontroller during production. The hysteresis width of the switching point. It is only necessary to adjust the hysteresis point N hys when setting. As shown in Fig. 9 and Fig. 10, the number of hysteresis points is 2, so there are 2 grids on the left and right sides of the switching point, and the range of 4 grids is the hysteresis range. In the two graphs, the lattice point N gpc = 40 in each pulse wave period, and the whole circle has N ppr = 12 pulse wave grids. Therefore, the angle of each small grid is 0.75 degrees, and the hysteresis range is 3 degrees. 12 is a waveform diagram of a 4-state encoding of an AB phase single pulse period in the embodiment of the hysteresis point 4 of the present invention, and FIG. 13 is a 4-state encoding waveform of an AB phase single pulse period in the embodiment of the hysteresis point 1 of the present invention. Figure. The magnetic encoding device of the present invention can adjust the hysteresis width by the software of the microcontroller without changing the hardware specifications, thereby increasing the production efficiency and saving the processing cost.
一般編碼器AB相的相位差均固定為B相落後A相90度,本發明之磁性編碼裝置可在生產時由該微控制器內建之軟體設定其AB相的相位差,設定時僅需調整相位差數值即可,可調最小刻度為1個格子點的角度。圖14為本發明之B相落後A相54度實施例的單脈波周期4狀態編碼波形圖,圖15為本發明之B相領先A相45度實施例的單脈波周期4狀態編碼波形圖,二者的遲滯格子點數均為2。本發明之磁性編碼裝置係可由該微控制器之軟體設定其AB相的相位差,可適應各種不同用途之編碼器需求,設計彈性大且應用範圍廣泛。 Generally, the phase difference of the AB phase of the encoder is fixed to be 90 degrees behind the A phase. The magnetic encoding device of the present invention can set the phase difference of the AB phase by the software built in the microcontroller during production, and only needs to be set when setting. Adjust the phase difference value, and adjust the minimum scale to the angle of 1 grid point. 14 is a single pulse period 4 state coded waveform diagram of the B phase backward A phase 54 degree embodiment of the present invention, and FIG. 15 is a single pulse wave period 4 state coded waveform of the B phase leading A phase 45 degree embodiment of the present invention. In the figure, both of the hysteresis lattice points are 2. The magnetic encoding device of the present invention can set the phase difference of the AB phase by the software of the microcontroller, can adapt to the encoder requirements of various uses, has large design flexibility and wide application range.
上述之實施例僅為例示性說明本發明之特點及其功效,而非用於限制本發明之實質技術內容的範圍。任何熟習此技藝之人士均可在不違背本發明之精神及範疇下,對上述實施例進行修飾與變化。因此,本發明之權利保護範圍,應如後述之申請專利範圍所列。 The above-described embodiments are merely illustrative of the features and functions of the present invention, and are not intended to limit the scope of the technical scope of the present invention. Modifications and variations of the above-described embodiments can be made by those skilled in the art without departing from the spirit and scope of the invention. Therefore, the scope of protection of the present invention should be as set forth in the scope of the claims described below.
11‧‧‧圓形磁塊 11‧‧‧Circular magnetic block
12‧‧‧霍爾元件 12‧‧‧ Hall element
13‧‧‧微控制器 13‧‧‧Microcontroller
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW103144209A TWI553297B (en) | 2014-12-18 | 2014-12-18 | Magnetic coding device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW103144209A TWI553297B (en) | 2014-12-18 | 2014-12-18 | Magnetic coding device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TW201623921A true TW201623921A (en) | 2016-07-01 |
| TWI553297B TWI553297B (en) | 2016-10-11 |
Family
ID=56984652
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW103144209A TWI553297B (en) | 2014-12-18 | 2014-12-18 | Magnetic coding device |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TWI553297B (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| TWI618668B (en) * | 2017-03-01 | 2018-03-21 | 台達電子工業股份有限公司 | Moving-magnet transfer platform |
| TWI724341B (en) * | 2018-11-01 | 2021-04-11 | 台達電子工業股份有限公司 | Rotation detection device and encoder and motor using same |
| US11085797B2 (en) | 2018-11-01 | 2021-08-10 | Delta Electronics, Inc. | Rotation detecting device, encoder, and motor |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20100315073A1 (en) * | 2006-10-16 | 2010-12-16 | Kabushiki Kaisha Yaskawa Denki | Magnetic encoder apparatus and manufacturing method therefor |
| TW200916723A (en) * | 2007-10-15 | 2009-04-16 | Chen Jack | Angle measuring device |
| DE102009034744A1 (en) * | 2009-02-24 | 2010-09-30 | Mehnert, Walter, Dr. | Absolute magnetic position sensor |
| PL2798311T3 (en) * | 2011-12-28 | 2019-07-31 | Servosense (Smc) Ltd. | High resolution absolute encoder |
-
2014
- 2014-12-18 TW TW103144209A patent/TWI553297B/en active
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| TWI618668B (en) * | 2017-03-01 | 2018-03-21 | 台達電子工業股份有限公司 | Moving-magnet transfer platform |
| TWI724341B (en) * | 2018-11-01 | 2021-04-11 | 台達電子工業股份有限公司 | Rotation detection device and encoder and motor using same |
| US11085797B2 (en) | 2018-11-01 | 2021-08-10 | Delta Electronics, Inc. | Rotation detecting device, encoder, and motor |
Also Published As
| Publication number | Publication date |
|---|---|
| TWI553297B (en) | 2016-10-11 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP4880066B2 (en) | Origin position signal detector | |
| CN108180933B (en) | Magneto-electric encoder self-correction method based on sensorless speed control of permanent magnet synchronous motor | |
| CN206291915U (en) | A kind of encoder of Hall-type | |
| TWI553297B (en) | Magnetic coding device | |
| CN101534630A (en) | Multiturn rotational sensor | |
| Bahn et al. | Digital optoelectrical pulse method for Vernier-type rotary encoders | |
| US20190195660A1 (en) | High resolution absolute encoder | |
| CN212721467U (en) | Code wheel and magnetic encoder | |
| CN218481102U (en) | Hybrid encoder and motor | |
| CN111006696A (en) | Magnetic encoder and angle calculation method thereof | |
| CN107389104B (en) | Multi-ring magnetic absolute angle sensor | |
| CN109323646B (en) | Position sensor system applied to linear motor vector control | |
| CN209313635U (en) | A kind of closed loop stepping motor system based on reflective gratings encoder | |
| CN221223826U (en) | An incremental inductive encoder | |
| CN111982164A (en) | Multi-track sector positioning off-axis absolute encoder | |
| CN100339684C (en) | Four-sensor style coding device | |
| Hao et al. | Design of high precision magnetic grid displacement sensor | |
| CN212179935U (en) | Analog photoelectric corner sensor | |
| CN115342718A (en) | A Displacement Test Sensor Test System Based on Laboratory Environment | |
| CN109708673A (en) | Separate type magnetic coder based on pattern | |
| CN210375163U (en) | Encoder | |
| US11448530B2 (en) | Encoder, servo motor including the encoder, and servo system including the encoder | |
| Peng et al. | Length-adaptive linear position sensing system based on De-Bruijn sequence | |
| CN116046037A (en) | Absolute encoder and its position acquisition method, motor and automation equipment | |
| CN117367466B (en) | Magnetic encoder for displacement measurement and manufacturing method thereof |