1、外文翻译Digital Meter for Measuring Rotational SpeedAbstract A digital meter for measuring the rotational speed is introduced in this paper. It is controlled by an MCS-51 series single-chip microcomputer 8032. It contains the following features: rational design, high accuracy, wide measurability range a
2、nd powerful function and dependability. Moreover, it is very nimble and convenient to use. The work principle is presented in detail in the paper and the block diagram and program flowchart are given as well.Key works: digital measuring apparatus; rotation speed; single-chip micro-computerThe rotor
3、speed control system of industry is one of the important parameters. Mechanical tachometer measuring speed, the rotor contact with the measured object must be to get the synchronous speed, through the internal gear shift instruction after the pointer speed with the size of the header. Use of mechani
4、cal tachometer measured object can interfere with movement, especially when measured rotor mass is very small, speed tables on the rotor pressure is not a small additional load, which affects the measurement accuracy. This paper describes a 8032 single-chip microcomputer as the core to the non-conta
5、ct Digital Tachometer. 1 speed measuring principle The gun speed-sensitive devices with infrared sensors, launched by the specialized infrared detection devices, while receiving reflected back from the measured object infrared, photoelectric conversion into electrical pulses through the signal, does
6、 not affect the rotation of the object. Tubes and pipes are fixed in the detection of acceptable shelf, through the lens focus, semi-transparent film not only to the reflected infrared light fired rotating objects, they can rotate the object by the reflected infrared light through the translucent me
7、mbrane back fired for management. Along the circumference of a rotating body even paste some reflection paper, it directed reflection infrared to receive the reflected acceptance of the infrared control. Photovoltaic conversion shown in Figure In the optical triode 3DU5C adding an appropriate bias,
8、when 3DU5C by infrared irradiation, at the conduction state, A point for the low level, 3DG6 end, B point is high; when no infrared radiation, the photoelectric transistor closed A high point presentation, so 3DG6 low collector point B, B point of the pulse signal through the inverter 1,2 plastic, a
9、nd then the door 3 RP, frequency and speed will be proportional to the size of the corresponding changes The speed pulse signal. Speed pulse signal into the 8032 microcontroller timer / counter, through the microcontroller to calculate speed software processing. Figure 1 Schematic photoelectric conv
10、ersionWhen the machine used in the measurement speed M / T method and timing method were used. M/T M / T method is the detection time Tc, the time according to speed pulse m1 and m2 to calculate the speed pulse. If a fixed period Tc, the total time taken and pulse rotation pulse fp fcs Pulse on m1 a
11、nd m2, timing pulse frequency f, rotor output pulses per revolution for the p, the speed n = 60fm1 / pm2 (r / min). Such as the speed measured over 1 s pulses for the m1, rotor output pulse number per revolution, that great number of p, the speed n = 60m1 / p (r / min). 2 hardware speed measurement
12、instrument Figure 2 constitute the grounds of speed 8032 MCU measuring circuit. 8032 is MCS-51 series single chip, compared with the common 8031 chip, a feature more than 8032 strong T2 timer / counters and 128 bytes of internal RAM, which T2 counter with 16-bit auto-reload and capture, can for time
13、r / counter with, but also used as a baud rate generator. The system used for time T2, which take into account regular pulse, regular pulse signal directly from the 8032 chip address latch signal ALE client leads, and through the 74LS74 dual D flip-flop frequency, was two points. When using 6 MHz cr
14、ystal oscillator, the time pulse frequency fc is 0.5 MHz. T0 accrual speed pulse counter fp, T1 time pulse counter for taking into account fc, trigger DFF1, DFF2 and 1,2,3,4 component count and gate control circuit, can also start and stop counters T0 and T1. P0 port to allow control through the end
15、 of 8D with latch 74LS377 extends an 8-bit output, as a five segment LED digital display of the data line selection code. P3.0, P3.1 access switches S1 and S4, S1 for the very few P set selector switch, S4 input pulse for the very few keys. P3.2 and P3.3 are connected S2 and S3 switch, S2 switch met
16、hod for the speed selection key; select the use of M / T method speed, or velocity measurement with time. S3 for the speed frequency select switch, to select the measuring speed or frequency measurements. When using regular method to measure the speed, the system can be easily measured by measuring
17、the frequency. 3 software design and anti-interference measures System programming includes the main program, interrupt procedures, code conversion routines, display routines, etc. The hardware structure of two measurement methods are identical, but different software process, to set the speed throu
18、gh the P3.2 port approach. The following two measurement methods were discussed works. M / T method, first of all by the end of 8032 the P1.1 output start pulse signal, the start pulse cleared DFF1 and DFF2 two triggers, so that Q1 ended output low, blocking the door 2,3,4, Q- 1 side open the door f
19、or the high one, and trigger DFF2 the Q-2-ended output is high, ready for the start of work. When the speed pulse signal fp receives the rising edge, the flip-flop DFF1 turn, Q-1 is low, blocking the door 1, Q1 is high, open the door 2,3,4, so that start time T2, m1, m2 and started counting. In the
20、interrupt program, the P1.2 8032 ended output pulse signal to stop, set bit trigger DFF2, Q-2 low-side outputs, blocking the door 2,3,4, T0, T1 and stop counting. Interrupt the program while reading speed signal pulses and timing signal pulses m1 m2, in the main program, in accordance with m1, m2, P
21、 and f calculated speed n = 60fm1/pm2, and converted to BCD code sent to the digital look-up table display, complete a data collection and display. In the regular method, due to the timing signal generated 1 s, while the maximum time the system 131 ms, it is the law in time to take 10 consecutive 10
22、0 ms time method, when the time to 100 ms, the timer T2 overflow interrupt to the 8032 application. Interrupt in the interrupt process of the cumulative number of times, if the cumulative number of times until they break 10, not to make any operation on the return, T2 to the next 100ms the time, T0
23、to count speed pulse, when the interrupt when the number reached 10 in interrupt the program, set bit P1.2, stop counting, and reading the count value T0 m1, corresponding in the main program to calculate the speed of operation, and converted to BCD code, send LED display. Time here with 16-bit coun
24、ter with auto-loading feature of the T2 counter, when T2 overflow interrupt the same time, the counter counts automatically reload the initial value, continue to regularly. So its time is continuous, without interruption and response procedures for dealing with the impact of disruption. If not overl
25、oaded 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
26、timer is a feature of the system, it can significantly improve measurement precision. The guns range in 0-49r/min accuracy up to 0.1 r / min, at 50-99 999r/min range of accuracy up to 1 r / min. The gun can measure the number of different pole pulse generator pulse occurs, such as infrared detectors
27、 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
28、system provides very few of the features set the scene: P3.0 I take very few set selector switch, when P3.0 is high time that need to set the pole, then the system waiting for input into the mouth by the P3.1 pulse signal, each pulse makes the system very few register value plus 1, and displayed in
29、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 frequency options. P3.3 port ac
30、cess speed frequency select switch S3, when P3.3 is high time that test frequency. Meanwhile, the system software has set a number of logical fault diagnosis functions, such as speeds above 99 999 r / min, the system will display PPPPP, that go beyond the scope of this gun is measured, and as if the
31、 M / T velocity measurement, the Select the measurement frequency, it shows EEEEE, prompts the user error and so on. As the gun is generally in the industrial field in the working environment of sources of interference, so in the design, using anti-jamming measures, such as power supply filtering, d
32、ecoupling, pay attention to the trend of ground, then the locations and other hardware interference approach to CPU, RAM self-test, software redundancy, software, software such as anti-jamming technology trap. Figure 2 Circuit Digital Speed Meter中文翻译数字式转速测量仪摘要 介绍了一种以MCS-51系列单片机8032为控制主体的数字式转速测量仪。该测量
33、仪具有设计合理、精度高、测速范围宽、功能强、可靠性好、使用灵活方便等特点。文中详细介绍了该仪表的工作原理,给出了它的硬件原理图和软件流程图。关键词:数字式测量仪器;转速;单片机转动体的速度是工业测控系统中的重要参数之一。机械式转速表在测量转速时,必须将转轴接触被测物体,以获得同步转速,通过内部齿轮变速后用表头指针指示转速大小。使用机械式转速表会干扰被测物体的运动,特别是当被测转动体质量很小时,测速表对转动体施加的压力就是一个不小的附加负载,这影响测量的准确性。本文介绍一种以8032单片微机为核心的测速仪。1 转速测量仪原理本测速仪的测速敏感器件采用红外线传感器,由专门的探测装置发射红外线,同时
34、接受从被测物体反射回来的红外线,通过光电转换变为电脉冲信号,不影响物体的转动。发射管和接受管都固定在探测架上,通过透镜聚焦,半透明膜既能使反射的红外光线射向转动物体,又能使由转动物体反射回来的红外线通过半透明膜射向接受管。在转动体上沿圆周均匀贴上若干反射纸,它能定向反射红外线,使接受管接受到反射回来的红外线。光电转换原理见图1。在光电三极管3DU5C上加一适当偏压,当3DU5C受红外线照射时,处于导通状态,A点为低压电平,3DG6截止,B点为高电平;当没有红外线照射时,光电三极管截止,A点呈现高电平,使3DG6集电极B点为低电平,B点的脉冲信号经过反相器1、2的整形,再经门3反相,便得到频率与
35、转速大小相应成比例变化的转速脉冲信号。转速脉冲信号送入8032单片机的定时/计数器,经过单片机的软件处理计算出转速。图1 光电转换原理图本机在测量转速时采用了M/T法和定时法两种方法。M/T法是在检测时间Tc内,根据转速脉冲m1和计时脉冲m2来计算转速。如在固定周期Tc内,计取转动脉冲fp和计时脉冲fc的脉冲个数分别为m1和m2,计时脉冲的频率为f,转动体每转输出的脉冲数为p,则转速n=60fm1/pm2(r/min)。定时法是在给定的时间间隔1 s内,对转速脉冲进行计数。如在1 s内测得的转速脉冲数为m1,转动体每转输出的脉冲个数,即极数为p,则转速n=60m1/p(r/min)。2 转速测
36、量仪的硬件结构图2为由8032单片机构成的转速测量仪电路图。8032属于MCS-51系列单片机,与常用的8031芯片相比,8032多了一个功能较强的T2定时/计数器和128字节内部RAM,其中T2计数器具有16位自动重载和捕获能力,既可作定时/计数用,又可作为波特率发生器用。本系统T2用于定时,即计取定时脉冲信号,定时脉冲信号直接从8032芯片的地址锁存信号端ALE引出,并经过74LS74双D触发器两分频后获得。当晶振采用6 MHz时,定时脉冲的频率fc为0.5 MHz。T0计数器计取转速脉冲fp,T1计数器用于计取定时脉冲fc,触发器DFF1,DFF2和与门1,2,3,4组成计数控制电路,能
37、使T0和T1计数器同时启停。系统采用动态显示方式。P0口通过带允许控制端的8D锁存器74LS377扩展了一个8位输出口,作为5位LED数码管显示的段选码数据线。P1.3-P1.75根口线作为五位LED显示的位选线。P3.0、P3.1接S1和S4开关,S1为极数P设定选择开关,S4为极数输入脉冲键。P3.2和P3.3分别接S2和S3开关,S2开关为测速方法选择键,选择用M/T法测速,还是用定时法测速。S3为转速/频率选择开关,用来选择测转速还是测频率。当用定时法测转速时,系统可以很方便地测出所测频率。3 软件设计及抗干扰措施系统的程序设计主要包括主程序、中断程序、代码转换子程序、显示子程序等。两
38、种测速方法硬件结构完全相同,只是软件流程不同,通过P3.2口来设定测速方法。下面分别论述两种测速方法的工作原理。M/T法中,首先由8032的P1.1端输出启动脉冲信号,该启动脉冲清零DFF1和DFF2两个触发器,使Q1端输出低电平,封锁门2、3、4,Q-1端为高电平打开门1,而触发器DFF2的Q-2端输出为高电平,为启动工作做好准备。当接受到转速脉冲信号fp的上升沿时,触发器DFF1翻转,Q-1为低电平,封锁门1,Q1为高电平,打开门2、3、4,从而使T2开始定时,m1,m2同时开始计数。当T2定时到100 ms时,向8032申请中断。在中断程序中,8032的P1.2端输出停止脉冲信号,置位触
39、发器DFF2,Q-2端输出低电平,封锁门2、3、4,T0、T1同时停止计数。同时在中断程序中读出转速信号脉冲数m1和定时信号脉冲数m2,在主程序中根据m1、m2,P和f算出转速n=60fm1/pm2,并转换为BCD码,查表送至数码管显示,完成一次数据的采集和显示。在定时法中,由于要产生1 s的定时信号,而本系统中定时最大值为131 ms,故在定时法中,采取连续定时10次100 ms的方法,当到了100 ms定时时,定时器T2溢出向8032申请中断。在中断程序中对中断次数进行累计,如果累计中断次数未到10次,则不作任何运算就返回,T2继续下一次的100ms的定时,T0继续计数转速脉冲,当中断次数
40、达到10次时,在中断程序中,置位P1.2,停止计数,并且读出T0的计数值m1,在主程序中进行相应运算算出转速,并转换为BCD码,送LED显示。这里定时计数器采用了具有16位自动重装载功能的T2计数器,当T2溢出产生中断的同时,计数器自动重载计数初值,继续定时。因此它的定时是连续的,不受响应中断和处理中断程序的影响。而如果采用没有重载功能的定时器如T0或T1,则当定时器溢出时,须在响应中断后,在中断程序中重置定时器初值。定时器的定时是断续的,影响定时精度,继而影响测速精度。可见采用8032中的T2计数器定时是本系统一个特点,它能显著提高测速精度。本测速仪在0-49r/min范围内,精度可达0.1
41、 r/min,在50-99 999r/min范围内,精度可达1 r/min。本测速仪可以测量不同极数的脉冲发生器发生的脉冲,如前述的红外线探测器,当改变贴在转动体上反射纸的数量时,转动体每转发出的脉冲数p也相应改变,此时如果仍按照程序中原定的p值进行计算,就会运算出错。因此本系统提供了现场设置极数的功能:P3.0口接极数设定选择开关,当P3.0高电平时,表明需要设置极数,此时系统等待由P3.1口输进的脉冲信号,每一个脉冲信号可使系统的极数寄存器数值加1,并显示在LED数码管上。在定时法测速时,当不进行n=60m1/p的运算,直接将1 s内的转速脉冲数m1变换为BCD码显示,所得的数值显然就是输
42、入脉冲信号的频率。因此系统设置了转速/频率选择功能。P3.3口接转速/频率选择开关S3,当P3.3为高电平时,表示测频率。同时,系统软件还设置了一些逻辑错误诊断功能,如当转速超过99 999 r/min,系统将显示PPPPP,表示超出本测速仪所测范围,又如当在M/T法测速时,选择了测频率,则显示EEEEE,提示用户出错等。由于测速仪一般都在工业生产现场工作,工作环境干扰来源多,因此在设计中,采用了抗干扰措施,如电源滤波、去耦、注意地线的走向,接地点的安排等硬件抗干扰办法,以CPU、RAM自检、软件冗余、软件陷阱等软件抗干扰技术。图2 数字式转速测量仪电路图参考文献1 Yurish S.Y.,
43、Kirianaki N.V. Design of High Performances Digital Tachometers and Tachometric Systems Based on the Method of the Depended Count, In Proceedings of the VII-th International Conference CADSM 2003, Lviv-Slavsko, UKRAINE, 18-22 February, 20032Kirianaki N.V., Deynega V.P., Yurish S.Y., Microprocessor Ta
44、chometers of New Generation for Turbogenerators of Thermal and Nuclear Electric Power Stations, Automatic, Measurements and Control, 1995, No. 292, pp. 52-60.3Yurish S.Y., Kirianaki N.V., Shpak N.O., Novel Rotation Speed Measurement Concept for ABS Appropriated for Microsystem Creation. In: Advanced Microsystems for Automotive Applications 99 (Ed. by Ricken D.E. and Gesner W., Springer, 1999, pp.215-223.
©2010-2024 宁波自信网络信息技术有限公司 版权所有
客服电话:4008-655-100 投诉/维权电话:4009-655-100