▲Wirig Diagram Hot
▲ ▲ ▼

Understanding Rotary Encoder Switches: How Do They Work?

By

In the realm of electronics, rotary encoders play a pivotal role in converting mechanical motion into digital signals. These versatile components are widely used in applications such as robotics, CNC machines, and gaming controllers, enabling precise and smooth control. But what lies beneath their simple, circular appearance? Let's delve into the working mechanism of a rotary encoder switch.

The essence of a rotary encoder is its ability to interpret the rotational movements of an axis and translate them into digital pulses. These pulses are then used by the connected system to determine the direction of rotation and the extent of movement. Generally, rotary encoders come in two primary types: absolute and incremental. Today, we're going to focus on the more common incremental type, which measures relative movement.

Incremental Rotary Encoder

Incremental rotary encoders, also known as relative encoders, track the motion of a shaft in relation to a previous position. They continuously output pulses, signifying rotational movement, making them perfect for tasks that require real-time feedback, such as controlling the speed of a motor or a machine's axis.

the diagram shows how an object is being used to produce light and sound in its surroundings
the diagram shows how an object is being used to produce light and sound in its surroundings
How to Use a Rotary Encoder
How to Use a Rotary Encoder
How Rotary Encoder Works
How Rotary Encoder Works

The core of an incremental encoder consists of a coding disc, an light source, and a light-sensitive detector. The coding disc, typically a glass or plastic plate, is attached to the rotating shaft and bears a specific pattern - usually a series of opaque and transparent sectors. This disc rotates between the light source and the detector, allowing the latter to sense the changing light levels and convert them into electrical signals.

Directional Sensing

Incremental encoders typically have two output channels (marked as A and B). These channels allow the encoder to report the direction of rotation along with the movement. The pattern on the coding disc is designed to shift the phase between channels A and B by 90 degrees. This phase shift enables the connected microcontroller to determine the direction of rotation based on the sequence of pulses received.

How to wire a rotary encoder fit in a matrix?
How to wire a rotary encoder fit in a matrix?
Simple Rotary Encoder Interface [Updated]
Simple Rotary Encoder Interface [Updated]
How Rotary Encoders Work
How Rotary Encoders Work

When the shaft rotates in one direction, the leading edge of each pulse on channel A matches up with the trailing edge of each pulse on channel B. Conversely, rotation in the opposite direction aligns the leading edge of channel B with the trailing edge of channel A. By observing this sequence, the microcontroller can deduce the direction of rotation and adjust the connected system's response accordingly.

Sensing Rotation Angle

The pulse count generated by an incremental encoder is directly proportional to the angle of rotation. A full rotation of the shaft (360 degrees) typically results in a certain number of pulses, known as the encoder's resolution. Resolution can be increased by using more lines on the coding disc, enabling finer control over the connected system.

For instance, consider an encoder with a resolution of 1,000 pulses per rotation (PPR). If the connected system requires an angular accuracy of 0.36 degrees, the microcontroller would need to count 1,000 pulses for a complete rotation. In this case, each pulse corresponds to an angular displacement of 0.36 degrees, allowing for precise control of the connected system's axis.

Rotary Encoder Primer - Codrey Electronics
Rotary Encoder Primer - Codrey Electronics
Arduino 2 - Rotary Encoder Reading
Arduino 2 - Rotary Encoder Reading
How Rotary Encoder Works and How To Use It with Arduino
How Rotary Encoder Works and How To Use It with Arduino
an electrical circuit diagram with instructions for how to wire it and where to use the switch
an electrical circuit diagram with instructions for how to wire it and where to use the switch
How Rotary Encoder Works With Arduino!
How Rotary Encoder Works With Arduino!
How Rotary Encoder Works | Arduino
How Rotary Encoder Works | Arduino

Absolute Rotary Encoder

On the other hand, absolute encoders provide a unique output for each discrete position of the shaft. Unlike their incremental counterparts, absolute encoders can report the shaft's position even after a power cycle, making them ideal for applications where retention of the last known position is crucial.

Absolute encoders typically use unique binary codes for each position, which are read by the attached microcontroller. To achieve this, these encoders employ multiple tracks on the coding disc, with each track corresponding to a specific bit in the binary code. By detecting the pattern of illuminated and unilluminated sectors on these tracks, the encoder can ascertain the shaft's absolute position.

Encoding Schemes

Absolute encoders employ various encoding schemes to generate their unique binary codes, such as Gray code and binary coded decimal (BCD). Gray code, for example, is a binary encoding scheme that minimizes the transition between consecutive codes, making it less prone to errors caused by noise or collateral readings. In BCD, each track represents a single digit of a binary number, making the encoding scheme easier to decode but more susceptible to errors.

In-Depth: How Rotary Encoder Works and Interface It with Arduino
In-Depth: How Rotary Encoder Works and Interface It with Arduino
Rotary Encoder Module with Arduino - Control Servo abd DC motor
Rotary Encoder Module with Arduino - Control Servo abd DC motor

Regardless of the encoding scheme, absolute encoders require more complex circuitry and processing power than incremental encoders. However, their ability to retain the last known position makes them indispensable in applications such as CNC machines, where precise positioning and repeatability are paramount.

Single-turn and Multi-turn Absolute Encoders

Absolute encoders can further be categorized into single-turn and multi-turn variants. Single-turn encoders, as the name suggests, detect the shaft's position within a single rotation (0 to 360 degrees). Their coding discs bear patterns that repeat once per rotation, similar to incremental encoders.

Multi-turn encoders, on the other hand, can detect the shaft's position over multiple rotations. These encoders employ specialized circuitry and coding discs, often using multiple electric control units (ECUs) that collaborate to track the shaft's movement across several rotations. This makes them suitable for applications such as robotic arms or CNC machine axes, which require precise multi-turn positioning.

In conclusion, rotary encoders play an indispensable role in modern electronics, enabling precise and responsive control of connected systems. Familiarizing oneself with their working principles and nuanced differences allows engineers to make informed decisions when selecting the right encoder for their applications. Venturing into the world of rotary encoders unlocks a wealth of opportunities for innovation and precision across various industries.

Embarking on the journey of understanding rotary encoders is a fascinating endeavor that unveils the intricacies of mechanical-to-electronic conversion. As you delve deeper into their workings, you'll discover a realm of possibilities for harnessing their power in your next project. So, gear up and start experimenting - the world of motion control awaits!

💬 Comments ↗ Share ★ Save
AD