Motor speed measurement is counting pulses per unit time. This page shows how a counter plus an encoder yields RPM, and how to choose the gate time and multiplication.
Principle: the motor shaft drives an encoder that emits a fixed number P of pulses per revolution, say 100 lines. Count N pulses in a fixed gate time T, say 1 second, and RPM equals N divided by P times T, times 60. A longer gate gives finer resolution but slower response; a short gate responds fast but resolves poorly. This is the M method.
Multiplication and accuracy: the two quadrature phases A and B can be counted on both edges for four times the resolution, sharper at low speed. At high frequency the T method, timing the interval between adjacent pulses and inverting, fits better. Use a wide enough counter, 32 bits, to avoid overflow inside the gate, which otherwise yields a fake fraction. Lost pulses from interference bias the reading low.
Implementation: use an MCU timer or a 74-series counting chain. Condition the encoder pulses through a Schmitt trigger into the count clock, gate with a second time base, read once per second and compute RPM for the display. Keep encoder supply stable and use shielded cable or pulses drop and the reading jumps; when P times RPM over 60 exceeds the counter limit, divide first.
| Parameter | Meaning | Selection |
|---|---|---|
| P | Pulses per revolution | 100 or 1000 lines |
| T | Gate time | 0.1 to 1s |
| N | Count value | Guard against overflow |
| Multiplication | Edges times four | Better at low speed |
| RPM | Result | N over P T times 60 |
| Interference | Lost pulses | Shielded cable |
The M method is weak at low speed and the T method at high, so combine them. Choose the gate and the multiplication by speed range, and let the encoder line count set the resolution.
The quantities and component characteristics discussed here follow current national standards and the corresponding IEC documents: Speed measurement and counting per GB/T 4728 and IEC 60617 symbols. Always check the device datasheet and the product design file for ratings and derating.
Locate the issue with the approach above, then confirm with measurements; safety-related circuits must follow the standards and manufacturer requirements.