Electronicdesign 29093 Promo Ifdvol1 No3 1

Single-Chip Circuit Delivers Direction Information In Encoders

May 24, 2012
Incremental-rotation or linear encoders usually don’t provide a directional signal. However, a simple circuit uses a dual monostable multivibrator to extract forward/reverse directional information from an encoder’s two output signals.

>> Electronic Design Resources
.. >> Library: Article Series
.. .. >> Series: Ideas for Design
.. .. .. >> Ideas for Design Vol. 1

Download this article as a PDF file

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.

1. The direction discriminator circuit is based on a dual monostable multivibrator, which can be a metal-gate, 74HC, or 74HCT type depending on the speed required by the application.

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).

2. This scope printout shows the behavior of the circuit when the encoder shaft is moved a little between clockwise and counter-clockwise. Channel 1 is In Channel A (U1 pin 4). Channel 2 is In Channel B (pin 13). Channel 3 is Out Forward (pin 6). Channel 4 is Out Reverse (pin 10).

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.

3. This circuit using a D flip-flop can cause inaccuracies at the point of reversing the direction, especially when the encoder is 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).

4. These scope traces show the circuit’s response when the encoder’s shaft turns clockwise at near maximum speed. The channels are the same as in Figure 2.

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).

5. Resistors R1 and R2 in the direction discriminator circuit can be removed with only minor changes to the circuit’s response. Again, the scope’s traces are the same as those in Figure 2.

Sponsored Recommendations

What are the Important Considerations when Assessing Cobot Safety?

April 16, 2024
A review of the requirements of ISO/TS 15066 and how they fit in with ISO 10218-1 and 10218-2 a consideration the complexities of collaboration.

Wire & Cable Cutting Digi-Spool® Service

April 16, 2024
Explore DigiKey’s Digi-Spool® professional cutting service for efficient and precise wire and cable management. Custom-cut to your exact specifications for a variety of cable ...

DigiKey Factory Tomorrow Season 3: Sustainable Manufacturing

April 16, 2024
Industry 4.0 is helping manufacturers develop and integrate technologies such as AI, edge computing and connectivity for the factories of tomorrow. Learn more at DigiKey today...

Connectivity – The Backbone of Sustainable Automation

April 16, 2024
Advanced interfaces for signals, data, and electrical power are essential. They help save resources and costs when networking production equipment.

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!