Incremental-rotation or linear encoders are very common, but normally they do not provide a direction signal. This design shows an easy way to detect forward or reverse direction.
Incremental encoders normally provide two output signals, usually named Channel A and Channel B. These signals deliver both clock information, depending on resolution, and rotating speed. They differ only in phase margin (for example, –90° for clockwise and +90° for counter clockwise).
The circuit in Figure 1 uses these signals as inputs to a 4538 single-chip, dual monostable multivibrator. Depending on the speed required for the application, the IC could be a metal-gate device, a 74HC, or a 74HCT type.
The feedback from one of the outputs to an input is used to avoid re-triggering. This isn’t strictly necessary but helps to keep the pulse duration constant. On the other hand, an important function is to trigger forward pulses from one edge of the input signal and reverse pulses from the other edge of that signal (Fig. 2).
This is why the same mechanical position, or slot edge of the encoding wheel, delivers, for instance, a positive edge in the forward direction and a negative edge in reverse. So if a design uses the same electrical edge for triggering, the result will be a hysteresis in changing the direction of one encoder slot width, which is normally one half of the rated encoder resolution (Fig. 3). This can create accuracy problems that get even worse if the encoder is mechanically jittering (vibrating) around the clocking edge.
The designer should use care in determining the output pulse duration of the monostables. If medium scale integrated (MSI) logic counters like the ’193 are used, 200 ns will be enough, but sometimes a microprocessor using its interrupt inputs counts the forward and reverse signals. This requires a pulse length of at least the maximum MCU interrupt response time.
In many cases, this may be pulse lengths of some tens of microseconds as in the circuit of Figure1, where the pulse width, tPLS ≈ 50 µs. Once the pulse length is known, the maximum speed is determined by:
fMax = 1/(tPLS × 4)
So, the maximum speed or encoder frequency in this example is approximately 5 kHz (Fig. 4). The circuit won’t totally stop working if overdriven in frequency, but beyond the maximum frequency the duration of the output pulse will be cut to a length from the triggering edge (Channel A) to the falling edge (Channel B).
This leads to a possible simplification of the circuit in Figure 1. If you eliminate resistors R1 and R2, the output pulse would always be the time from the triggering edge of Channel A to the falling edge of Channel B (Fig. 5).