【正文】
數(shù)值加 1,并顯示在 LED 數(shù)碼管上。因此它的定時是連續(xù)的,不受響應(yīng)中斷和處 理中斷程序的影響。 M/T 法中,首先由 8032 的 端輸出啟動脈沖信號,該啟動脈沖清零 DFF1和 DFF2 兩個觸發(fā)器,使 Q1 端輸出低電平,封鎖門 4, Q1 端為高電平打開門 1,而觸發(fā)器 DFF2 的 Q2 端輸出為高電平,為啟動工作做好準備。 根口線作為五位 LED顯示的位選線。如在 1 s 內(nèi)測得的轉(zhuǎn)速脈沖數(shù)為 m1,轉(zhuǎn)動體每轉(zhuǎn)輸出的脈沖個數(shù),即極數(shù)為 p,則轉(zhuǎn)速 n=60m1/p(r/min)。在轉(zhuǎn)動體上沿圓周均勻貼上若干反射紙,它能定向反射紅外線,使接受管接受到反射回來的紅外線。該測量儀具有設(shè)計合理、精度高、測速范圍寬、功能強、可靠性好、使用靈活方便等特點。 rotation speed。s time is continuous, without interruption and response procedures for dealing with the impact of disruption. If not overloaded by features such as timers T0 or T1, then when the timer overflow, it should be in response to failure, reset the timer interrupt program, the initial value. Timer timing is intermittent, the impact of timing accuracy, thereby affecting measurement precision. Visible by 8032 in the T2 counter timer is a feature of the system, it can significantly improve measurement precision. The guns range in 049r/min accuracy up to 177。本文介紹一種以 8032 單片微機為核心的測速儀。 M/T 法是在檢測時間 Tc內(nèi),根據(jù)轉(zhuǎn)速脈沖 m1和計時脈沖 m2 來計算轉(zhuǎn)速。T0計數(shù)器計取轉(zhuǎn)速脈沖 fp, T1計數(shù)器用于計取定時脈沖 fc,觸發(fā)器 DFF1, DFF2和與門 1,2,3,4 組成計數(shù)控制電路,能使 T0和 T1 計數(shù)器同時啟停。 3 軟件設(shè)計及抗干擾措施 系統(tǒng)的程序設(shè)計主要包括主程序、中斷程序 、代碼轉(zhuǎn)換子程序、顯示子程序等。 在定時法中,由于要產(chǎn)生 1 s的定時信號,而本系統(tǒng)中定時最大值為 131 ms,故在定時法中,采取連續(xù)定時 10 次 100 ms 的 方法,當?shù)搅?100 ms 定時時,定時器 T2 溢出向 8032 申請中斷。 r/min,在 5099 999r/min 范圍內(nèi),精度可達177。 由于測速儀一般都在工業(yè)生產(chǎn)現(xiàn)場工作,工作環(huán)境干擾來源多,因此在設(shè)計中,采用了抗干擾措施,如電源濾波、去耦、注意地線的走向,接地點的安排等硬件抗干擾辦法,以 CPU、 RAM自檢、軟件冗余、軟件陷阱等軟件抗干擾技術(shù)。 本測速儀可以測量不同極數(shù)的脈沖發(fā)生器發(fā)生的脈沖,如前述的紅外線探測器,當改變貼在轉(zhuǎn)動體上反射紙的數(shù)量時,轉(zhuǎn)動體每轉(zhuǎn)發(fā)出的脈沖數(shù) p也相應(yīng)改變,此時如果仍按照程序中原定的 p 值進行計算,就會運算出錯。這里定時計數(shù)器采用了具有 16位自動重裝載功能的 T2計數(shù)器,當 T2 溢出產(chǎn)生中斷的同時,計數(shù)器自動重載計數(shù)初值,繼續(xù)定時。下面分別論述兩種測速方法的工作原理。 P0口通 過帶允許控制端的 8D 鎖存器 74LS377 擴展了一個 8位輸出口,作為 5位 LED 數(shù)碼管顯示的段選碼數(shù)據(jù)線。定時法是在給定的時間間隔 1 s 內(nèi),對轉(zhuǎn)速脈沖進行計數(shù)。發(fā)射管和接受管都固定在探測架上,通過透鏡聚焦,半透明膜既能使反射的紅外光線射向轉(zhuǎn)動物體,又能使由轉(zhuǎn)動物體反射回來的紅外線通過半透明膜射向接受管。 1 r / min. The gun can measure the number of different pole pulse generator pulse occurs, such as infrared detectors above, when changing the rotating body attached to the amount of reflection paper, issued by the rotor per revolution pulse number p is also changed accordingly, At this point, if still in accordance with the procedures in the original p value calculation, calculation error will be. Therefore, the system provides very few of the features set the scene: I take very few set selector switch, when is high time that need to set the pole, then the system waiting for input into the mouth by the pulse signal, each pulse makes the system very few register value plus 1, and displayed in the LED digital tube. Velocity measurement at the time, and when not to n = 60m1 / p the operators directly to the speed of 1 s pulses m1 transformed into BCD code shows that the value obtained is obviously the input pulse frequency. Therefore, the system set up speed freq