Professional Documents
Culture Documents
DECEMBER 1989
Authorized licensed use limited to: UNIVERSITAS GADJAH MADA. Downloaded on November 27,2023 at 13:57:53 UTC from IEEE Xplore. Restrictions apply.
BONERT: DIGITAL TACHOMETER WITH A MICROCONTROLLER 1105
starta I stop started. If the encoder pulse length exceeds the time T,,
rising edge I pulse counter I pulse counter
Authorized licensed use limited to: UNIVERSITAS GADJAH MADA. Downloaded on November 27,2023 at 13:57:53 UTC from IEEE Xplore. Restrictions apply.
1106 IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 38, NO. 6, DECEMBER 1989
at Stand Still Fig. 3. Start up or acceleration from below minimum speed or stand still.
E. Program Structure
Fig. 4. Principle structure of the tachometer program.
The program structure for evaluating the speed is shown
in Fig. 4. The program executes a wait loop. This loop
can be interrupted by a rising encoder pulse edge. If no calculation. Software execution time effects only the max-
edge occurs within the maximum response time T,,,, the imum measurable speed as described.
speed value is set to zero and the INIT FLAG is set. The The program will wait most of the time in the elapsed
INIT FLAG indicates that the next rising encoder pulse time loop at point B shown in Fig. 4. This time can be
edge will initialize the counters to start a speed measure- used for other tasks, for example, to communicate the
ment interval. speed value to other processors, to do additional speed
The exit of the wait loop occurs subsequent to a rising related calculations, or to provide values for a display.
encoder pulse edge. On the occurrence of a rising edge
the content of the free running timer is stored by the cap- V . ILLUSTRATED EXAMPLE OF A TACHOMETER DESIGN
ture register and an interrupt is generated. The interrupt A tachometer utilizing an encoder with 1024 marks per
routine reads the pulse counter, disables the capture func- turn and a microcontroller type 6 8 H C l l was built. The
tion, and further interrupts and resets the WAIT FLAG. specification for the maximum response time and elapsed
The WAIT FLAG facilitates the exit from the wait loop time are 2.3 and 1 ms, respectively. The choice of the
to the elapsed time loop, as shown in Fig. 4. maximum response time results in a measurable minimum
The elapsed time loop starts the timing of T,, and T,,, speed of 25.5 rpm.
based on the last time counter reading. A speed value is The 2-MHz processor clock is used for time counting.
calculated, if the system was initialized. After the time This provides a time increment T, of 0.5 ps. The mini-
T,, elapsed, the loop is terminated and the capture register mum time required to read the pulse counter was found to
function and the interrupt are again enabled. be 12 ps, which limits the maximum measurable speed to
The proposed program structure ensures that initial- 4883 rpm. The speed range of the tachometer is, there-
ization occurs without delay and is only required below fore, 25.5-4883 rpm or 1 : 190.
minimum measurable speed. The execution time of the The direction of the speed is determined by feeding a
statements has no influence on the accuracy of the speed quadrature pulse of the encoder to a strobed port of the
Authorized licensed use limited to: UNIVERSITAS GADJAH MADA. Downloaded on November 27,2023 at 13:57:53 UTC from IEEE Xplore. Restrictions apply.
BONERT: DIGITAL TACHOMETER WITH A MICROCONTROLLER 1107
The error for A t decreases to 0.02 percent and the speed Fig. 6 . Experimental results, detail A from Fig. 5.
range extends to 1 :406, from 12 to 4883 rpm, if the
elapsed time T,, is chosen to be 2.5 ms.
DETAIL B
A . Experimental Vuijication
The shaft encoder was mounted to a 5-hp dynamometer
which was coupled by a drive shaft to a 3-hp dc motor tI
with a rated speed of 1000 rpm.
To demonstrate the performance of the tachometer the
speed of the dc motor operating initially at approximately
25.6 rpm ' 1
J
Authorized licensed use limited to: UNIVERSITAS GADJAH MADA. Downloaded on November 27,2023 at 13:57:53 UTC from IEEE Xplore. Restrictions apply.
1108 IEEE TRANSACTIONS ON INSTRUMENTATION A N D MEASUREMENT. VOL. 3X. NO. 6. DECEMBER 1989
low speed increases to the maximum allowed response encoder becomes the critical factor in determining the
time of 2 . 3 ms. The figure shows that the speed output overall achievable accuracy of the tachometer system.
drops to zero as soon as the measurable minimum speed The proposed circuit could in future be integrated to-
of 25.5 rpm is reached. gether with the pulse shaping circuitry into the encoder
housing thus providing a compact tachometer unit. More-
over, if a D/A converter is also integrated, the unit would
VI. CONCLUSIONS emulate a dc tachometer.
The proposed concept for a digital tachometer provides
REFERENCES
a meed measurement svstem with high accuracv and ex-
v
cellent dynamic perfomance. The concept only one 111 R. Bonert, “Digital tachometer with fast dynamic response imple-
mented by a microprocessor,” IEEE Trans. Ind. A p p l . , vol. IA-19,
single chip low cost microcontroller and the CET method. pp. 1052-56, 1983,
It is easy to achieve a speed range larger than 1 : 400 [2] G. F. Pierce, “Frequency determining apparatus,” Canadian General
with a response tirne of less than 5 ms, and a relative Electric Company, Canadian Patent 1144 986, 1983; U . S . Patent
4 420 809.
Of the ’peed Of less than 0.02 percent. With 131 J . Duennwald, “Digitale Drehzahlerfassung elektrischer Antnebe mit
this low error in speed evaluation the accuracy ofthe shaft Mikrorechner,” Tech. Mes., Heft 3 , 1981.
Authorized licensed use limited to: UNIVERSITAS GADJAH MADA. Downloaded on November 27,2023 at 13:57:53 UTC from IEEE Xplore. Restrictions apply.