1344003 九、發明說明: 【發明所屬之技術領域】 本發明係有關一種用於馬達轉速量測系 指一種馬達轉速量測系統之起始估計轉速自 【先前技術】 統之方法,尤 動設定方法。1344003 IX. Description of the invention: [Technical field of the invention] The present invention relates to a method for measuring the rotational speed of a motor, which refers to a method for estimating the initial rotational speed of a motor rotational speed measuring system from the prior art. .
在馬達閉環速度控制中,速度估測是不 月b。一般在對馬達做速度估測時,常使用一 估測馬達轉子運轉速度。 可或缺的功 編碼器來幫助 第-圖所示為一 AC馬達控制系統方塊圖,藉由量測 馬達速度的回授資訊,以控制馬彡1〇a轉速。該習知速度 估測系、统20a包含一計數器22a及一速度估測單元冰。 一編瑪器12a #出-脈波信號以表示一量測到的馬達位 置,該計數器22a處理該脈波信號後得到馬達的位置訊號 P。該速度估測單元24a處理該馬達位置訊號p,以得到 馬達轉速^ 位置控制單元40a根據一位置命令PcIn motor closed loop speed control, the speed estimate is not monthly b. Generally, when estimating the speed of a motor, it is often used to estimate the operating speed of the motor rotor. The indispensable work of the encoder to help Figure 1-6 shows an AC motor control system block diagram that measures the speed of the motor to control the speed of the horse's 1〇a. The conventional speed estimation system 20a includes a counter 22a and a speed estimating unit ice. A coder 12a #out-pulse signal indicates a measured motor position, and the counter 22a processes the pulse signal to obtain a position signal P of the motor. The speed estimating unit 24a processes the motor position signal p to obtain the motor speed ^ the position control unit 40a according to a position command Pc
與來自計數器22a之回授,計算出一速度命令v〇md ;然後 一速度控制單元30a依據該速度命令Vcmd計算出一電流命 令“輸出至一電流控制與驅動單元50a。該電流控制與驅 動單元50a依據該電流命令‘及馬達回授電流以驅動馬達 10a 。 參見第二及第三圖’分別為說明習知技術速度估測單 元24a處理之原理及步驟。如苐二圖所示,習知之速度估 測單元24a利用單位時間内的位移量來估算目前的移動速 6 1344003 度 κ(〇: P(t)-P(t-T) , Μ- Φ V 1 τ ’、 (t)為估測速度,i5⑴表示編碼 器的回授位置,Γ為取樣時間。如第三圖所示,該速度估 .測單元24a在每次時間r的中斷時(步驟si〇a),取得計 數器回授的數值")(步驟Sl2a)。該速度估測單元地 再由計數n回授的數值p (t)減去前次中斷的位P(t_T) (步驟S14a)。接著該速度估測單元2如依據兩次位置的 •差值及取樣時間r計异出初步估測速度V[t)_P{t)~P(t-T^ (步 驟%)。然後將求得的初步估測速度㈣-低通㈣ 器平順化後形成最後的速度值L (步驟施)。心、 美國專利早期公開案us細施3528 A1揭露1 個取樣週期的量測速度做平均的方法,以降低量測連波 日匕PP二)問題m述專利提案方式在馬達高頻率操作 τ會有相位延遲(phase delay)的問題。 Φ 一般量測轉速或計數時,通常會讓使用者輸入 ^轉速的頻率。也就是使用者必須知道待測物的最高轉 i狀^則有可力造成量測誤差。這個量測誤差的產生有兩 r力物讀’但使用者輸人高轉速頻率:抗雜訊 b欠差,假如有雜訊進來會產生誤差。 銮·:太待測物很快,但使用者輸入低於待測物轉速頻 ;;.θ生計數脈波漏數或測得轉速變慢。 、 然而有時候待測物的轉速並不固定,因此使用者很難 7 1344003 預測待測物的轉速。如能設計自動切換馬達轉速量測系統 之起始估計轉速,不需要由使用者輸入,即可減少量測的 誤差’增加準確性。 【發明内容】 ^因此本發明之另一目的即在於提供一種馬達轉速量測 系統之起始估計轉速自動設定方法。 為達成上述目的’本發明提供一種馬達轉速量測系統With the feedback from the counter 22a, a speed command v〇md is calculated; then a speed control unit 30a calculates a current command "output to a current control and drive unit 50a according to the speed command Vcmd. The current control and drive unit 50a according to the current command 'and the motor feedback current to drive the motor 10a. See the second and third figures' respectively for explaining the principle and steps of the conventional technique speed estimating unit 24a. As shown in Fig. 2, the conventional The velocity estimating unit 24a estimates the current moving speed 6 1344003 degrees κ (〇: P(t) - P(tT) , Μ - Φ V 1 τ ', (t) as the estimated speed by using the displacement amount per unit time. I5(1) denotes the feedback position of the encoder, and Γ is the sampling time. As shown in the third figure, the speed estimation unit 24a obtains the value of the counter feedback every time the time r is interrupted (step si〇a). ") (step S12a). The speed estimating unit further subtracts the previous interrupted bit P(t_T) from the value p(t) fed back by the count n (step S14a). Then the speed estimating unit 2 According to the difference between the two positions and the sampling time r Measure the speed V[t)_P{t)~P(tT^ (step %). Then, the obtained initial estimated speed (4)-low-pass (four) is smoothed to form the final speed value L (step). US Patent Early Disclosure Us3528 A1 exposes the measurement method of averaging the sampling speed of one sampling period to reduce the measurement of the continuous wave 匕 匕 PP II) The problem of the patent proposal is that the motor will operate at high frequency τ. The problem of phase delay Φ Generally, when measuring the speed or counting, the user usually inputs the frequency of the speed. That is, the user must know the highest value of the object to be tested. Measuring error. This measurement error is generated by two r-force readings', but the user inputs high-speed frequency: anti-noise b is poor, if there is noise coming in, it will produce error. 銮·: too much object to be tested , but the user input is lower than the speed of the object to be tested;; θ raw count pulse wave leakage or measured speed is slow. However, sometimes the speed of the object to be tested is not fixed, so the user is difficult to predict 7 1344003 The speed of the object to be tested. If the design can automatically design the start of the motor speed measurement system Estimating the rotational speed, the error of the measurement can be reduced without increasing the accuracy of the measurement. [SUMMARY OF THE INVENTION] Therefore, another object of the present invention is to provide an automatic setting of the initial estimated rotational speed of the motor rotational speed measuring system. Method for achieving the above purpose, the present invention provides a motor speed measuring system
之起始估計轉速自動設定方法,係用於處理一編碼器感測 馬達轉動之脈波訊號,以自動產生用於計算脈波之起始估 計轉速。在量測初始設定時,先將一計數器歸零並設定一 起始估計轉速及一計數設定值M,其中在做第一筆資料量 測時,可將該起始估計轉速設定為該馬達轉速量測系統= 能量測之最大轉速。將馬達轉子轉速分成複數個階層',並 依據起始估計轉速設定一脈波寬度臨界值△τ。該系統在 接收該編碼器之一脈波訊號時,計算該脈波訊號之一脈波 寬度,若該脈波寬度大於該脈波寬度臨界值Δτ,則將^十 數器加1。在計數完成該計數設定值Μ後,由計數器計算 之脈波數目及全部量測時間計算出一新的馬達轉速.及利 用該新的馬達轉速設定新的起始估計轉速,其中該起始估 计轉速係為比新的馬達轉速速度為高的另—階層速度 者計數設定值Μ也可以隨馬達估計轉速而單 / 保量測精確度。 確 【實施方式】 第四圖為依據本發明一較佳具體實例之馬達轉速量測 1344003 :系、統方塊圖’該馬達轉速量測系統主要包含—速度控制器 .10、-轉速計18、及-編碼器16。該編碼器16係與:達二 轉子連動,並可以依據轉子轉動而輸出脈波㈣se)信號。 該轉速計18可以依據該輸出脈波信號而估計馬達轉子轉 :速’並將估計轉速送至速度控制器1〇。該速度控制器10可 以接收一輸入轉速命令及估計轉速,以產生一個速度命 令’然後將速度命令送給該驅動電路12,以精確控制馬達 14轉子轉速。 # 參見第五圖,為編石馬器16輸出脈波信號之時序圖,假 設每一脈波之脈波週期為時間τ(脈波與脈波間時間 差)。一般量測轉速或計數通常有兩個參數,一個是時 間 個疋脈波數。也就是每一秒產生幾個脈波,單位為 赫炫(Hz)。市面上轉速計的單位有卬以(每分鐘之圈數)或 IPS (每秒鐘之圈數)。若每一圈有n個脈波,那麼丨卬爪= n/60 Hz ’ lrps=n Hz。跟據兩個參數,轉速計18可利用硬體 •中斷,當程式偵測到有脈波發生時,啟動時間計時,當程 式又偵測到下一個脈波,停止時間計時,如此可知道脈波 與脈波之間之時間T。若轉速夠快可取N個脈波,經過時 間Ttotal ’則可計算出馬達轉子轉速N/(T_)Hz。 然而在上述馬達轉速估計中,為了避免雜訊干擾對於 脈波的量測,通常會設定脈波寬度臨界值△ T(pulsewidth threshold) ’當一脈波寬度經判斷小於脈波寬度臨界值△ τ ’則把該脈波視為雜訊去除掉。但脈波寬度臨界值△T 的大小與使用者設定的轉速有關,設定的轉速越快,脈波 9 丄344003 、2臨界值ΛΤ越小’通常是小於轉速的一半。例如如轉 V為1kHz,則對應的脈波寬度臨界值λτ必須不得小於 l/(lk X 2)=0.5ms。 一如Ϊ讓使用者自己設定待測物的轉速,跟據使用者的 ,设定計算出雜訊脈波寬度,確保量測的精確度。但此時脈 波寬度是固定,但待測物的轉速並不一定不變,而且萬一 使用者設定錯誤或忘了設定或不知待測物的轉速,如此勢 必造成量測誤差。 對於-般轉速必須要使用者設定而造成量測誤差的缺 失’本發明可利用量測轉速有連續性的特色,自動切換轉 速的設定。參見第六圖,為依據本發明之馬達轉度估計值 二自$設定方法之流程圖。步驟S1〇〇為馬達轉速估計初始值 設定,在此有兩個參數需要自動設定,一個是脈波寬度臨 界值ΔΤ,一個是計數設定值(set e〇unt vaiue)M。依據本發 明,可以建立一個起始估計轉速對照表(initially_estimated • speedk)〇kuPtabie),因為轉子轉速係有連續性,不會由1Hz 瞬間變成100 Hz,轉子轉速一定從1Hz經過一段時間變成 100Hz。因此該起始估計轉速對照表係將馬達轉子轉速由 該馬達轉速量測系統所能量測的最小轉速到最大轉速之間 分成複數個階層(multiple ranges),(參見第七圖)如 1Hz、200Hz、500Hz、1kHz 、500kHz、1_ζ ·..。每 一速度階層均有一個對應之時間週期(timeperi〇d),亦即^ (ΙΗζ )、ι/(2〇〇Ηζ)…1/(1ΜΗζ)。在此起始估計轉速對照 表可以由轉速計18所能量測的最小轉速到最大轉逮設定多 1344003 ,轉速階層’以有利於依據目前轉速設定高—層(速度較 - 高)的起始估計轉速,而能精確量測正確的脈波。 脈波X度臨界值△τ即為速度階層之對應時間週期的 一特定工作週率(duty cycle)。例如假使速度階層為5kHz,那 麼對應時間週期為l/5k=0.2mS ,如果取50%的工作週率 (一半High ’ 一半Low) ’則脈波寬度臨界值△ τ為 O.lmS。因此如果轉速計18設定之脈波寬度臨界值^丁為 〇.lmS ’則轉速計18量測到脈波寬度小於01mS脈波即視 為雜訊去除掉。 為了能精確量測脈波,在步驟S100,如果是第一次量 測(之前無量測數據),就取轉速計18所能量測的最大轉 速為起始估計轉速。如果已經有量測數據,則取目前轉速 (current rotational speed)的上一轉速階層作為起始估計轉速, 以避免量測誤差。如目前量測轉速為190Hz ,比較接近 200Hz (第2階層),可預先將脈波寬度臨界值△ τ設到 φ相對應5〇〇Hz(第3階層)的脈波寬度。若目前量測轉速為 10Hz ’比較接近1Hz(第1階層),可預先將脈波寬度臨界 值△ T設到相對應200Hz (第2階層)的脈波寬度。再 者,該轉速計18内部包含有一個計數器(未圖示),在初 始值設定時,計數器會歸零。 在完成初始值設定之後,該轉速計18等待脈波進入 (步驟S102)、並在脈波進入後由硬體中斷產生及偵測脈波 寬度(步驟S102)。該轉速計18判斷偵測脈波是否大於一脈 波寬度臨界值ΛΤ ?(步驟S110);若否’則將該偵測脈波 丄 3>44υϋ:3 視為雜訊(步驟S112);若是,則將該偵測脈波視為正常之 皮而將計數器加〗(步驟s】i4)。接著該轉速計18 判斷计數$之結果,若計㈣之計數結果等於該計數設定 ’則結束該次量測並計算新的馬達轉速=斷㈣_, :、中τ_,為該次量測之全部量測時間(步驟MU)。該轉速 十依據。十异出來的新的馬達轉速計算新的脈波寬度臨界 值及計數設定值Μ(步驟S124),其中計數設定值财 里測頻率有關’也可設定為固定值。該計數設定值Μ 交佳者係與量測到的頻率成單調遞增_K>t〇n〇usly increasing) ^係曰例如量測頻率在2〇舰以上,計數設定值^取2〇〇 .2()()Hz以下’計數設定值Μ取1筆,依此The initial estimated speed automatic setting method is used to process an encoder to sense the pulse signal of the motor rotation to automatically generate an initial estimated speed for calculating the pulse wave. When measuring the initial setting, first reset a counter to zero and set an initial estimated speed and a count set value M, wherein the initial estimated speed can be set to the motor speed when the first data measurement is performed. Test system = maximum speed of energy measurement. The motor rotor speed is divided into a plurality of levels ', and a pulse width threshold Δτ is set according to the initial estimated speed. The system calculates a pulse width of one of the pulse signals when receiving a pulse signal of the encoder, and if the pulse width is greater than the pulse width threshold Δτ, the comparator is incremented by one. After counting the count set value ,, a new motor speed is calculated from the number of pulse waves calculated by the counter and all measurement times. And a new initial estimated speed is set by using the new motor speed, wherein the initial estimate The speed is a higher-level speed count setting value that is higher than the new motor speed. It can also be single/preserved with the motor estimated speed. [Fourth Embodiment] The fourth figure is a motor speed measurement 1344003 according to a preferred embodiment of the present invention: a system diagram of the motor speed measurement system mainly includes a speed controller. 10, a tachometer 18, And - encoder 16. The encoder 16 is coupled to the second rotor and can output a pulse (four) se) signal depending on the rotation of the rotor. The tachometer 18 can estimate the motor rotor rotation speed based on the output pulse wave signal and send the estimated speed to the speed controller 1A. The speed controller 10 can receive an input speed command and an estimated speed to generate a speed command 'and then send a speed command to the drive circuit 12 to precisely control the rotor speed of the motor 14. # Refer to the fifth figure, which is the timing diagram of the output pulse signal of the stone-removing device 16. It is assumed that the pulse wave period of each pulse wave is time τ (time difference between pulse wave and pulse wave). Generally, the measurement speed or count usually has two parameters, one is the time of the pulse wave. That is, several pulses are generated every second, and the unit is He Hyun (Hz). The unit of the tachometer on the market is ( (number of turns per minute) or IPS (turns per second). If there are n pulse waves per revolution, then the paw = n/60 Hz ' lrps = n Hz. According to the two parameters, the tachometer 18 can utilize the hardware and the interrupt. When the program detects that a pulse wave occurs, the time is started. When the program detects the next pulse wave, the time is stopped, so that the pulse can be known. The time T between the wave and the pulse wave. If the rotation speed is fast enough, N pulse waves can be taken. After the time Ttotal ’, the motor rotor speed N/(T_) Hz can be calculated. However, in the above motor speed estimation, in order to avoid noise interference measurement of the pulse wave, the pulse width threshold Δ T (pulsewidth threshold) is usually set. When the pulse width is judged to be smaller than the pulse width threshold Δ τ 'The pulse is removed as noise. However, the magnitude of the pulse width threshold ΔT is related to the rotational speed set by the user. The faster the set rotational speed, the smaller the pulse value 9 丄 344003 and 2, and the smaller the threshold value ’ is usually less than half of the rotational speed. For example, if the transition V is 1 kHz, the corresponding pulse width threshold λτ must not be less than l/(lk X 2)=0.5 ms. Just as the user sets the rotation speed of the object to be tested, and according to the user's settings, the noise pulse width is calculated to ensure the accuracy of the measurement. However, the pulse width is fixed at this time, but the rotation speed of the object to be tested does not necessarily change, and if the user sets an error or forgets to set or does not know the rotation speed of the object to be tested, this will inevitably cause measurement error. For the general rotation speed, the user must set the measurement error to cause the measurement error. The present invention can utilize the characteristic that the measurement rotation speed has continuity, and automatically switches the setting of the rotation speed. Referring to the sixth figure, there is shown a flow chart of the method for setting the motor rotation degree according to the present invention. Step S1〇〇 is the motor speed estimation initial value setting, where two parameters need to be automatically set, one is the pulse width threshold value ΔΤ, and the other is the set value (set e〇unt vaiue) M. According to the present invention, an initial estimated speed list (initially_estimated • speedk) 〇kuPtabie can be established because the rotor speed is continuous and does not change from 1 Hz to 100 Hz, and the rotor speed must be changed from 1 Hz to 100 Hz. Therefore, the initial estimated speed comparison table divides the motor rotor speed into a plurality of ranges from the minimum speed to the maximum speed measured by the motor speed measuring system, (see the seventh figure), such as 1 Hz, 200Hz, 500Hz, 1kHz, 500kHz, 1_ζ ·.. Each speed class has a corresponding time period (timeperi〇d), that is, ^ (ΙΗζ ), ι / (2〇〇Ηζ)...1/(1ΜΗζ). Here, the initial estimated speed comparison table can be set by the speed of the tachometer 18 from the minimum speed to the maximum speed setting of 1,344,003, and the speed class is set to facilitate the setting of the high-layer (speed-high) based on the current speed. Estimate the speed and accurately measure the correct pulse. The pulse wave X degree threshold Δτ is a specific duty cycle of the corresponding time period of the velocity hierarchy. For example, if the speed class is 5 kHz, then the corresponding time period is l/5k = 0.2 mS, and if 50% of the working cycle rate (half of High's half of Low) is taken, the pulse width threshold Δτ is O.lmS. Therefore, if the threshold value of the pulse width set by the tachometer 18 is 〇.lmS ’, the tachometer 18 measures that the pulse width is less than 01 mS, which means that the noise is removed. In order to accurately measure the pulse wave, in step S100, if it is the first measurement (previous measurement data), the maximum speed measured by the tachometer 18 is taken as the initial estimated rotation speed. If there is already measured data, the previous rotational speed level of the current rotational speed is taken as the initial estimated rotational speed to avoid the measurement error. If the current measurement speed is 190 Hz and is close to 200 Hz (second level), the pulse width threshold Δ τ can be set to φ corresponding to the pulse width of 5 Hz (third level). If the current measured rotational speed is 10 Hz' is closer to 1 Hz (first level), the pulse width threshold ΔT can be set to a pulse width corresponding to 200 Hz (second level) in advance. Further, the tachometer 18 includes a counter (not shown) therein, and the counter is reset to zero when the initial value is set. After the initial value setting is completed, the tachometer 18 waits for the pulse wave to enter (step S102), and generates and detects the pulse wave width by the hardware interrupt after the pulse wave enters (step S102). The tachometer 18 determines whether the detected pulse wave is greater than a pulse width threshold value (step S110); if not, the detected pulse wave &3 > 44υϋ:3 is regarded as noise (step S112); Then, the detected pulse wave is regarded as a normal skin and the counter is added (step s) i4). Then, the tachometer 18 judges the result of counting $, and if the counting result of (4) is equal to the counting setting, the end of the measurement is completed and a new motor speed is calculated = (4) _, :, τ_, which is the measurement. All measurement time (step MU). The speed is based on ten. The new new motor speed is calculated as a new pulse width threshold and a count set value Μ (step S124), wherein the count set value is also set to a fixed value. The count set value Μ is better than the measured frequency in a monotonically increasing _K>t〇n〇usly increasing) ^System 曰 For example, the measurement frequency is above 2 〇, and the count setting value is 2 〇〇. 2 () () Hz below 'count setting value to draw 1 pen, according to this
本發明具有起始估計轉速自動設定方法之馬達轉速量 :統,可以依據前一次的量測結果自動設定起始估計轉 自動設定脈波寬度臨界值Δτ),且計數設定值 ρ測頻率增大而增加,因此可以準確量測轉子頻 而改進设定固定起始估計轉速的問題。 進牛:上所述’當知本發明已具有產業利用性、新穎性與 用ν χ本發明之構造亦未曾見於同類產品及公開使 圏^符合發料利t請要件,差依專利法提 【圖式簡單說明】 第一圖所示為一 AC馬達控制系統方塊圖。 第^圖說明習知技術速度估測單元處理之原理。 第三圖說明習知技術速度估測單元處理之步驟。 12 、系統:=為依據本發明一較佳具體實例之馬達轉速量測 第五圖為編碼器輪出脈波信號之時序 第六圖依據本發明之馬達轉速量測 ^ ^自動設定方法流程圖。 ,、、·之起始估計轉 第七圖為馬達轉子轉速分成複數個階層的—個範例。 [主要元件符號說明】The invention has the motor speed quantity of the initial estimated speed automatic setting method: the system can automatically set the initial estimation turn automatically set the pulse width threshold Δτ according to the previous measurement result, and the counting set value ρ is increased. With the increase, it is possible to accurately measure the rotor frequency and improve the problem of setting the fixed initial estimated speed. Into the cattle: the above description 'when the invention has industrial applicability, novelty and use ν χ the structure of the invention has not been seen in similar products and publicly made 圏 ^ meet the requirements of the delivery of goods, according to the patent law [Simple description of the diagram] The first figure shows a block diagram of an AC motor control system. The figure illustrates the principle of the conventional technique speed estimation unit processing. The third figure illustrates the steps of the prior art speed estimation unit processing. 12, system: = is a motor speed measurement according to a preferred embodiment of the present invention. The fifth figure is the timing of the pulse signal of the encoder wheel. FIG. 6 is a flow chart of the motor speed measurement method according to the present invention. . The initial estimation of , , , · The seventh figure is an example of the motor rotor speed divided into multiple levels. [Main component symbol description]
【習知技術】 編碼器12a 速度估測單元24a 位置控制單元40a 50a 驅動電路12 編碼器16 馬達10a 計數器22a 速度控制單元30a 電流控制與驅動單元 【本發明】 速度控制器10 馬達14 轉速計18 步驟 S100-124[Technical Technology] Encoder 12a Speed Estimation Unit 24a Position Control Unit 40a 50a Drive Circuit 12 Encoder 16 Motor 10a Counter 22a Speed Control Unit 30a Current Control and Drive Unit [Invention] Speed Controller 10 Motor 14 Tachometer 18 Step S100-124