Introduction to Encoder Principles and Applications
Position detection devices, as a crucial component of transmission control, detect displacement and send feedback signals. These signals are compared with the command signals from the control device. If a deviation is found, it is amplified and used to control the actuator to move in the direction of eliminating the deviation until the deviation is zero. To improve the machining accuracy of mechanical devices, the accuracy of the detection elements and systems must be improved. Rotary encoders , linear encoders (optical scales, magnetic scales), rotary transformers, and tachogenerators are commonly used. Encoders are among the most frequently used detection devices in various types of machinery. Using encoders for signal detection is widely applied in industrial automation fields such as CNC machine tools, textile machinery, metallurgical machinery, petroleum machinery, mining machinery, printing and packaging machinery, plastics machinery, testing machines, elevators, servo motors, aerospace, and instrumentation. There are many types of encoders, and different industry users have varying requirements for encoder parameters and specifications.
Encoders can be categorized into two types based on their readout method: contact and non-contact. Contact encoders use brushes for output, with the brushes contacting conductive or insulating areas to indicate whether the code state is "1" or "0". Non-contact encoders use photosensitive or magnetic sensitive elements for receiving signals. When using photosensitive elements, the code state is indicated by the presence of light-transmitting and opaque areas.
Encoders can be classified according to their detection principle into optical, magnetic, inductive, and capacitive types.
Encoders can be classified by their measurement method into linear encoders (optical scales, magnetic scales) and rotary encoders.
Encoders can be classified into three types based on their signal principle (scale method and signal output form): incremental encoders, absolute encoders, and hybrid encoders.
I. Incremental Encoder (Rotary Type)
1. Working principle:
An optical encoder consists of a photoelectric code disk with a central shaft and circular, dark markings. When the disk rotates one pitch, the photosensitive element receives signals A and B, which are sinusoidal waves with a 90-degree phase difference, under illumination from the light-emitting element. These signals are amplified and shaped to produce an output square wave, with phase A leading phase B by 90 degrees. Its voltage amplitude is typically 5V. If phase A leads phase B, it indicates positive rotation; conversely, if phase B leads phase A, it indicates negative rotation. The phase relationship between phases A and B can be used to determine the encoder's forward and reverse rotation. The pulse generated by phase C is the reference pulse, also known as the zero-point pulse. It is generated at a fixed position during one revolution of the shaft and provides the encoder's zero-position reference. After frequency-to-voltage conversion, the AB phase pulse signals produce a voltage signal proportional to the shaft's rotational speed, allowing the measurement of speed and displacement.
Magnetic encoders are a new type of electromagnetic sensing element developed in recent years, evolving alongside optical encoders. While optical encoders are sensitive to humid gases and contamination, they suffer from poor reliability. Magnetic encoders, on the other hand, are less affected by dust and condensation, and possess a simple, compact structure, can operate at high speeds, have a fast response time (500–700 kHz), are smaller than optical encoders, and are less expensive. Furthermore, they allow for precise arrangement and combination of multiple components, making it easier to construct new and multifunctional devices compared to optical or semiconductor magnetic sensing elements. In the face of demands for high speed, high precision, miniaturization, and long lifespan, and in the fierce market competition, magnetic encoders, with their outstanding characteristics, possess unique advantages and have become a key factor in the development of high-tech products.
The principle of a magnetic encoder is to generate a signal by forming a pulse train through magnetic force. Its characteristic is that rare-earth magnetic powder is mixed with uncured rubber to form a magnetic rubber blank, which is then vulcanized and adhered to a reinforcing ring (1) to form a magnetic rubber ring (2). Magnetization is applied alternately in a circumferential pattern on this magnetic rubber ring to generate S and N poles. Simultaneously, a novel SMR (magnetoresistor) or Hall effect sensor is used as the sensing element, ensuring stable and reliable signal transmission. Furthermore, the use of a double-layer wiring process allows the magnetic encoder to not only have the incremental signal and incremental and exponential signal outputs found only in general encoders, but also an absolute signal output function. Therefore, although currently about 90% of encoders are optical encoders, there is no doubt that the use of magnetic encoders will gradually increase in future motion control systems.
2. Incremental encoder resolution, frequency multiplication and subdivision techniques
An incremental encoder's code disk consists of many grating lines. It has two (or four, we'll discuss four-eye encoders later) photocells that read the A and B signals. The density of the grating lines determines the resolution of the incremental encoder, that is, the smallest angle change value it can distinguish and read. The parameter representing the resolution of an incremental encoder is PPR, or pulses per revolution.
The A/B output waveform of an incremental encoder generally has two types: one is a square wave signal with a steep rising edge and a steep falling edge, and the other is a sin/cos curve waveform signal output with a slow rising and falling edge, similar to a sine curve. A and B are 90 degrees out of phase with a period of 1/4T. If A is a sinusoidal sin curve, then B is a cosine cos curve.
For a square wave signal, phases A and B are 90 degrees out of phase (1/4T). Thus, there are rising and falling edges at four phase angles: 0 degrees, 90 degrees, 180 degrees, and 270 degrees. Therefore, angle changes can be determined within 1/4T of the square wave period. This 1/4T period is the minimum measurement step size. By judging these rising and falling edges, the circuit can read angle changes four times the PPR (Pressure Proportion) value; this is the fourth harmonic of the square wave. This judgment can also be done using logic, where 0 represents low and 1 represents high. The changes in phases A and B within one period are 00, 01, 11, and 10. This judgment not only allows for the fourth harmonic but also the determination of the rotation direction.
Strictly speaking, square waves can only be divided up to 4 times the frequency. Although some people use the time difference method to divide them into finer subdivisions, this is generally not recommended for incremental encoders. Higher frequency divisions require incremental pulse signals, which are sine/cosine signals like SIN/COS. Subsequent circuits can then subdivide the signal by reading the phase changes of the waveform and using an analog-to-digital converter (ADC) to subdivide it by 5, 10, 20, or even more than 100 times. After subdivision, the result is a square wave output (PPR). The frequency division factor is actually limited. First, ADC has a time response issue; the speed of ADC and the accuracy of resolution are contradictory. Infinite subdivision is impossible; excessive subdivision will cause problems with response and accuracy. Second, the original encoder's engraving precision, the consistency of the output sine/cosine signal, and the perfection of the waveform are limited. Excessive subdivision will only expose the original code disk's errors more clearly, introducing further errors. Subdivision is easy to implement, but difficult to execute well. It depends on the engraving precision and output waveform perfection of the original code disk, as well as the response speed and resolution accuracy of the subdivision circuit. For example, German industrial encoders recommend an optimal subdivision of 20x. Higher subdivisions are recommended for more accurate angle encoders, but the rotational speed is very low.
An incremental encoder that outputs A/B/Z square waves after subdivision can be multiplied by 4 again. However, please note that subdivision has requirements on the encoder's rotational speed, which is generally low. In addition, if the original code disk has low engraving precision, the waveform is imperfect, or there are limitations in the subdivision circuit itself, subdivision may cause severe waveform distortion, large or small steps, or missed steps. These factors should be considered when selecting and using the encoder.
Some incremental encoders can have an initial 2048 lines (2 to the power of 11, 11 bits). By subdividing by 16 times (4 bits), a 15-bit PPR is obtained. Then, by multiplying the frequency by 4 times (2 bits), a 17-bit resolution is achieved. This is how some Japanese encoders achieve their 17-bit high-resolution output, which is typically expressed using "bit". At higher speeds, these Japanese encoders still internally use the unsubdivided low-bit signals to process the output; otherwise, the response wouldn't be fast enough. So don't be misled by the "17 bits".
3. Characteristics of incremental encoders:
The characteristics of incremental encoders are: non-contact, frictionless and wear-free, small size, light weight, compact structure, easy installation, simple maintenance, low driving torque, high precision, large range measurement, fast response, and digital output.
Incremental encoders are well-suited for speed measurement, allowing for infinite accumulation of measurements. However, they suffer from zero-point accumulation error, poor interference resistance, and require power-off memory when the receiving device is off, as well as zeroing or finding a reference position upon startup. These problems can be solved by using an absolute encoder.
Built-in battery technology:
Some encoders use built-in batteries to avoid signal loss when power is off. Other encoders use a single turn as an absolute signal, while the multi-turn signal is obtained by incremental counting using the built-in battery and circuitry. This is a pseudo-absolute encoder, which is greatly affected by factors such as battery life, battery failure at low temperatures, and poor battery contacts due to vibration, thus significantly reducing its reliability.
4. General applications of incremental encoders:
Speed measurement, rotation direction measurement, and movement angle and distance (relative).
II. Absolute Encoder (Rotary Type)
Incremental encoders output pulses as they rotate, and their position is determined by a counting device. When the encoder is stationary or there is a power outage, the position is remembered by the internal memory of the counting device. Therefore, the encoder cannot move at all after a power outage, and when power is restored, there must be no interference or loss of pulses during the encoder's pulse output process; otherwise, the zero point remembered by the counting device will shift, and the amount of this shift is unknown until an erroneous production result occurs.
The solution is to add reference points. Each time the encoder passes a reference point, it corrects the reference position into the counting device's memory. Before reaching the reference point, position accuracy cannot be guaranteed. Therefore, industrial control systems employ methods such as finding a reference point before each operation and zeroing upon startup.
For example, printers and scanners use incremental encoders for positioning. Every time you turn them on, you can hear a crackling sound as they search for the reference zero point before they start working.
This method is quite troublesome for some industrial control projects, and it may even prevent zeroing after powering on (the exact position must be known after powering on). Therefore, absolute encoders were developed.
1. Working principle:
An absolute encoder has many etched lines on its code disk, arranged sequentially with 2, 4, 8, 16 lines, and so on. Thus, at each position of the encoder, by reading the on/off state of each etched line, a unique binary code (Gray code) from 2^0 to 2^(n-1) is obtained. This is called an n-bit absolute encoder. Such an encoder is determined by the mechanical position of the code disk and is unaffected by power outages or interference.
An absolute encoder ensures the uniqueness of each position determined by its mechanical position. It requires no power-off memory, no reference point, and doesn't need continuous counting; the position is read only when needed. This significantly improves the encoder's anti-interference capabilities and data reliability.
Because absolute encoders are significantly superior to incremental encoders in positioning, they are increasingly used in angle and length measurement and positioning control in various industrial systems. However, due to their high precision and large number of output bits, if parallel output is still used, each output signal must be well connected, and isolation is also required for more complex operating conditions. The large number of connecting cable cores brings many inconveniences and reduces reliability. Therefore, absolute encoders with multi-bit output generally use serial output or bus-type output.
2. From single-turn absolute encoders to multi-turn absolute encoders:
A single-turn absolute encoder measures each line on a photoelectric code disk during rotation to obtain a unique code. When the rotation exceeds 360 degrees, the code returns to the origin, which does not conform to the principle of unique absolute coding. Such coding can only be used for measurements within a rotation range of 360 degrees, hence the name single-turn absolute encoder.
If you need to measure rotations exceeding 360 degrees, you will need to use a multi-turn absolute encoder.
Encoder manufacturers utilize the mechanical principle of clock gears. When the central code disk rotates, it drives another set of code disks (or multiple sets of gears and multiple sets of code disks) through gear transmission. This adds more turns of encoding on top of the single-turn encoding, thereby expanding the encoder's measurement range. Such an absolute encoder is called a multi-turn absolute encoder. It also determines the encoding by mechanical position, and each position encoding is unique and non-repeating, so there is no need to memorize it.
Another advantage of multi-turn absolute encoders is that due to their large measurement range, there is often a lot of margin in actual use. This means that there is no need to painstakingly find the zero point during installation. You can simply use a certain intermediate position as the starting point, which greatly simplifies the installation and debugging process.
Multi-turn absolute encoders have significant advantages in length positioning and are increasingly being used in industrial control positioning.