Learning Series: An Introduction to Encoders
Part 1: How an Encoder Works and the Feedback Information it Provides
3.5 Minute Read
If you’ve read enough about encoders online, you’ll quickly notice things go vague and any useful information gets blurred or left unpublished. The information is often contradictory, and after reading several sources, you’re left with more questions than answers.
No more blog hopping to find the information you need. This learning series is straightforward. Leaving out the nonsense and only giving practical advice. Continue reading as we explain in simple terms how an encoder works and the feedback information it provides.
What You’ll Learn
How an Encoder Calculates:
How Does an Encoder Work?
An encoder is a feedback device that converts a shaft’s rotary motion or linear motion into an analog or digital output signal. We can use the signals to identify speed, direction, and distance.
Using Encoder Resolution to Calculate Distance
Think of an encoder disc as a measuring instrument. Much like a ruler, an encoder disc is marked with exact segments. These segments are known as windows. The actual quantity of these windows is determined by the application's accuracy and is called encoder resolution.These windows get placed in two channels: Channel A and Channel B. Both channels have an equal number of windows – each matching the resolution.
Each window will produce a voltage pulse as the encoder disc travels between two electronic components. Each pulse is an increment corresponding to the defined resolution.
Encoder Resolution Terms
Resolution can range from the very low teens to the high thousands.
- Pulses per Revolution (PPR)
- Count per Rotation (CPR)
The light-emitting diode produces light, whereas the phototransistor receives light. When the LED's light beam connects with the photoreceiver, the electrical current moves through the photoreceiver into the encoder’s electronic circuitry. This connection produces a pulse of voltage.
Because the windows are placed at such precise distances from each other, the user can obtain accurate distance measurements by counting the voltage pulses generated.
How to Calculate Speed of the Encoder Disc
There are two ways to determine speed when working with an encoder. Option #1 is only available when the encoder has a Z channel. If you’re working with an encoder without a Z channel – use Option #2.
The Z pulse is the easiest way to determine encoder speed. The Z channel has a single window placed in the channel, which produces a single pulse of voltage with each encoder revolution. The Z channel pulse is at a fixed position on the disc and occurs at the same point. The greater the number of Z pulses, the greater the speed.
The pulse can be scaled in various ways, such as revolutions per minute (RPM) or inches per second (IPS). The speed annotation used depends on the requirements and specifications of the encoder application.
Since we know that there’s a specific number of pulses produced with every encoder revolution, we can work backward and use the pulse count to indicate speed.
If we have an encoder that produces 100 PPR, we know that 100 pulses equal one revolution. With this information in hand, we can determine the encoder speed. For example, an encoder that has operated for one minute has produced 100,000 pulses. This indicates the encoder is rotating at 1000 RPM.
Using Channel Offset to Determine Direction
This Method Only Works When Working with Quadrature Encoders
The windows that comprise channel A are offset from those that comprise channel B. This slight offset between the two channels gives us a simple yet reliable way to determine the direction of encoder movement.
When moving the encoder disc, one channel will produce a pulse before the other channel. The terms used to describe this are leading and lagging. One channel either leads or lags the other.
If A leads B, the encoder disc is rotating in a clockwise direction. If B leads A, then the disk is rotating in a counterclockwise direction.
We’ve covered how an encoder works and the feedback information it provides. Part 2 will widen your rotary encoder know-how. Learn the similarities and differences between incremental and absolute encoders.