OPTICAL ENCODER DIVISION

Main Page
History
----------------
Rotary Encoders
Linear Encoders
Virtual Absolute Technology
Expedited Encoders
----------------
Custom Applications
METRA
Technical Articles
Conversion Factors
Glossary
----------------
Encoder News
Representation
Quizzes
Industry Links
New Product Mail List
---------------
Contact GPI


TECHNICAL ARTICLES

Here are some useful articles about Optical Encoder Technology:

"Understanding Quadrature"

"Square Waves And Pulses: A Clarification"

"Virtual Absolute Technology" (Updated 6/99)

"Let's Talk Accuracy"


"Understanding Quadrature"

Written By Gerald S. Gordon

      Incremental optical encoders generate two data signals that are electrically 90° out of phase with each other, as shown below. The term quadrature refers to this 90° phase relationship. Since each full cycle contains four transitions, or edges, an encoder that generates 2500 cycles/rev, for example, provides 10,000 edges per revolution.

     20+ years ago, when I was a youngster just learning about encoders, the prevalent electronic circuitry of the day was based on "edge detection". The transitions coming from the encoder would act as the "trigger" to cause a count. At each transition, the electronics not only generates a count, but also determines direction of travel so that it knows whether to count up or down. This is done by establishing whether the transition is going high or going low, and what the state of the other signal is, as shown by the following table:

FORWARD TRAVEL REVERSE TRAVEL
CHAN A CHAN B CHAN A CHAN B
Up High (1) Up Low (0)
Down Low (0) Down High (1)
Low (0) Up High (1) Up
High (1) Down Low (0) Down

      However, modern electronics looks not at transitions, but at changes of state. (Yes, a transition is where a state changes, but that's English, not electronics.) Basically, the user's electronics contains a high-speed clock and constantly samples the states of A and B. When it sees a change, it counts up or down based on the following table, where 0,1 represents the states of A and B, respectively. Instead of waiting for a triggering event from the encoder, the electronics generates its own triggering based on its detection of a state change from the encoder. A subtle difference, but critical to the operation of modern digital circuitry.

FORWARD TRAVEL REVERSE TRAVEL
FROM TO FROM TO
0, 1 1, 1 0, 1 0, 0
1, 1 1, 0 1, 1 0, 1
1, 0 0, 0 1, 0 1, 1
0, 0 0, 1 0, 0 1, 0

     Along with these 8 "legal" state changes, there are also 4 possibilities that mean trouble: 0,0 to 1,1; 1,1 to 0,0; 0,1 to1,0; and 1,0 to 0,1. When one of these occurs, it means that (at least) one state has been skipped. The user's circuitry is generally smart enough to generate an error signal warning that there's a malfunction somewhere. Since there are four distinguishable states (or edges) per cycle, it is extremely common for customers to take full advantage of the encoder's intrinsic resolution. In fact, there are off-the-shelf chips available these days to do this quadrature decoding; the user no longer needs to hand-wire his own circuit.

So who cares?

INDEX implications

      With the old edge detection method, it was important that the index signal be tied to one particular transition; otherwise, the repeatability of the index would be lost. With a full cycle or half cycle index, the user would gate the high state of the index with the high state of channel A and a transition on channel B. The output of this gate would thus always correspond to the same edge of channel B.

      With the new electronics, it is more important to tie the index to a particular quadrature state. The user can thus gate the high state of a full- or half-cycle index with the high states of channels A and B; the result will be a quarter-cycle index that is high when A and B are high. Or, Gurley can supply a quarter-cycle index directly out of the encoder; check the data sheets for availability.

TERMINOLOGY implications

      Back when people were counting edges, it was often convenient to have the encoder vendor provide an output that not only identified a specific number of edges per cycle (1, 2 or 4), but also gave direction information directly. That's when Gurley started to offer pulse output. Pulses differ from square waves in 2 important ways:

•      Pulse widths are of fixed time duration, whereas the width of a square wave ON state is a function of speed. (The distance between pulses is, of course, a function of position.)

•      "Quadrature" has no meaning with pulse output; you get FWD pulses on one line, and REV pulses on another. (Or pulses on one line and direction information on the other.)

      Pulse output options were fairly popular at one time, but it's been dwindling for quite a while. With the new quad decode chips that are available, the requirement has gone away, as long as the customer is using 1980s or later technology. On any of our newer encoders, pulses will no longer be offered.

      What has survived is the terminology. Many encoder vendors, and therefore encoder customers, use the term "pulses per revolution" (PPR) when they really mean cycles per revolution of quadrature square waves. Because we still offer pulses, and because we're pretty deeply ingrained with the distinction, Gurley will not use "pulses" to mean anything but "pulses". (If the customer uses the word "quadrature", we know he means "cycles/rev".)

      We used to say "4X multiplication" or "4X edge detection"; better terms are "quadrature decode" or "quadrature evaluation".

      We generally use "counts/rev" for what you get after decoding; "output steps" or "measuring steps" are also acceptable.

      Because it can mean either cycles/rev or counts/rev, do not use CPR for anything other than a life-saving technique.

BACK TO TOP


 

"Square Waves And Pulses: A Clarification"

Reprinted from MEASUREMENTS & CONTROL, September 1988

Written By Gerald S. Gordon

      The term "pulses/rev" is sometimes used to describe the output of incremental encoders, even when the output is in square-waves rather than pulse format. This indiscriminate usage creates confusion among encoder users. Square-waves are not the same as pulses, and it is important that the distinction be made.

      The most common format for incremental encoder output is "quadrature square-waves," a term that denotes two square-waves that are phase-shifted with respect to each other by 90 degrees electrical, or one-quarter of a cycle. Their spatial frequency is best expressed in "cycles per revolution." Usually, this is the same as the number of lines on the encoder disc. However, some manufacturers offer interpolated square-waves at many times the line count on the disc, but that is another subject. For purposes of this discussion, there is no difference between 1X square-waves, read directly from the disc, and interpolated square-waves, which are at some multiple of the line count on the disc.

      Since each square-wave has two transition or edges per cycle, quadrature square-waves contain 4 edges per cycle. Simple circuitry can be used to detect 1, 2, or 4 of these edges. Additionally, the edge detection circuitry determines direction of travel by looking at the relative phase of the two square-waves.

      The edge-detection circuitry generates electrical pulses. Although they look "square" on an oscilloscope, pulse output differs from square-wave output in two vital ways:

1.      With square-wave output, each square-wave has a 50% duty cycle (motion corresponding to ON = motion corresponding to OFF), and the location of any given edge is a function of encoder position. In other words, in an encoder with N cycles/rev square-wave output, the transitions on each square-wave are 1/2N rev apart; considering both square-waves together, the distance between any two adjacent edges is 1/4N rev.

      With pulse output, "one-shots" generate short duration pulses. Hence, the distance between the leading edges is a function of position (1/N, 1/2N, or 1/4N rev, depending on whether the edge-counting circuitry is 1X, 2X, or 4X), but each pulse is of a fixed time duration, independent of encoder speed.

2.      With square-wave output, square-wave 'A' appears on one terminal and square-wave 'B' on another. Both A and B are always present regardless of direction. The user must determine direction based on whether A leads or lags B.

      With pulse output, the pulses appear one terminal for CW rotation and on another terminal for CCW rotation. Only one terminal is "live" at any particular instant. (With oscillating motion, the pulses will appear alternately on one terminal and then the other.)

      Because of these important distinctions between square-wave and pulse outputs, the quantifier "pulses/rev" (PPR) should be reserved only for those encoders that provide true pulse output; it should not be used with square-wave output, nor should it be used to describe the information on the disc ("lines/rev.") "Cycles/rev" should be used for square-wave output; the abbreviation "CPR" should be avoided unless the context makes it clear whether cycles/rev or counts/rev is intended.

BACK TO TOP


 

"Virtual Absolute Technology"

Written By Gerald S. Gordon and Alex Hillis

Gurley Precision Instruments has developed a unique encoding method that combines the opto-mechanical simplicity of an incremental encoder with the system reliability and interfacing ease of an absolute encoder. This document refers mostly to rotary encoders, but the technique is equally useful in linear encoders. The reason for the selection of the name Virtual Absolute™ (VA™) will become apparent later in the discussion.

Let’s begin with a short review of encoders. In an Incremental encoder, the primary track consists of uniformly spaced alternating opaque and clear lines. The typical incremental encoder output consists of two square waves 90° out of phase with each other. Most commonly, the user’s circuitry decodes the relative phase to determine direction of travel, and counts the four quadrature states in each cycle. This provides a resolution equal to four times the line count on the disk. (Techniques exist to electronically increase this resolution, but that’s another subject.) An up/down counter must be dedicated to watching the output at all times so that no information is lost.

To generate absolute position information from an incremental encoder, a second track is added to the disk to provide an index signal that occurs once per revolution. (It is also sometimes called a marker, reference, or zero signal.) When a homing procedure is executed on power-up to find this signal, absolute position is then discovered, but sometimes that can require up to a full revolution from the power-up starting position. If electrical noise or encoder damage later produces false counts in the up/down counter, this often goes undetected until the next index is seen, whenever that may be.

In a conventional Absolute encoder, the pattern on the disk consists of a series of concentric incremental tracks, with the number of cycles per revolution doubling on each track of increasing radius. Each track has its own photodetectors, and the tracks are arranged so that reading all the detectors generates a parallel binary word, usually in Gray code. For example, an encoder with 12 tracks would generate 4096 words per revolution. (As with incrementals, techniques exist to increase resolution beyond the number of tracks, but many tracks are still required for high-resolution encoding.) The opto-mechanics and track detection electronics of such an encoder are significantly more complex and expensive than an incremental encoder, and all track channels must function perfectly in concert to avoid reporting false position information. However, it does have the compelling advantage of providing position information immediately on start-up, without a homing procedure.

Two other distinguishing features of an absolute encoder are:

  1. Because the encoder generates parallel binary data, it is easy and straightforward to interface to any microprocessor-based controller or display.
  2. Because the encoder "stores" non-volatile position data in the code pattern of the disk, it is not necessary to constantly accumulate data from its output; you just read it whenever you want to find its position at that instant.

Now for the good stuff: A Virtual Absolute encoder uses just cyclic and index tracks, like an incremental encoder. However, the index track is a serial code similar to a bar code instead of just a single line. You do not know position immediately upon start-up, as you do in a conventional absolute, but after a very short travel, in either direction and starting from anywhere, you know exactly where you are. In a rotary VA™ encoder, this initialization angle is typically about one degree, depending on the encoder's line count; in a linear VA™ encoder, about 1/2 mm motion is needed. From then on, the encoder is truly absolute in the sense of both #1 and #2 above.

In addition to the natural binary position output, a status bit is provided to tell you when the encoder is initialized. This bit is at a logic high whenever the supply voltage is interrupted, when the initializing motion is not yet complete, or when some other effect such as electrical noise, damage, or fouling of the disk interferes with the proper code sequence from the index track. When these self-tests are all satisfied and the encoder is initialized, the status bit is low, indicating the position data output is valid.

As we have said, the opto-mechanics of such a device are as simple and reliable as those of an incremental encoder, but its digital electronics are more sophisticated. That's why the VA™ encoder costs more than an incremental, but not a lot more, and much less than a conventional absolute.

To summarize, the advantages of our Virtual Absolute™ technology are:

  1. The initialization distance or angle is a fixed and very small motion, regardless of the starting position or direction of travel. Just "bump" it to find out where you are.
  2. The encoder contains inherent built-in-test functions not found in any conventional encoder. It reports not only various encoder malfunctions, but can also help detect system problems such as too high a temperature or excessive speed.
  3. The encoder generates the same whole-word information as a conventional absolute, so it is very easy to interface to computers, PLC's, servo controls, etc.
  4. With its simpler optics, a rotary VA™ encoder can be smaller than a conventional absolute of equal resolution. And you can use a linear VA™ encoder for applications where a suitable conventional absolute linear would be very hard to find.
  5. Because of its simpler electronics, reduced parts count, and less critical internal alignments, a VA™ encoder is inherently more reliable than a conventional absolute.
  6. A VA™ encoder is usually dramatically less expensive than a conventional absolute.

GPI manufactures conventional incremental and absolute encoders, too. We have learned that no one kind of encoder is right for every job. If you choose to work with us, you will find that we understand the strengths and weaknesses of each kind of encoder and how they relate to your application. Virtual Absolute™ encoding is just another way of getting the job done, but one we are proud to say is finding exciting applications in the most advanced fields of robotics, satellite communications, semiconductor and flat panel manufacturing, and many more. Contact Gurley Precision Instruments or your local representative today to find out how VA™ technology can solve your motion measurement problem.

29-Jun-99

BACK TO TOP


 

"Let's Talk Accuracy"

Written by Gerald S. Gordon

      In the world of encoders, the terms resolution, accuracy and repeatability are often confused, and sometimes even thought to be synonyms. Before we can talk sensibly to each other, we need a common language, so we’ll start with some definitions. This article refers to rotary encoders because they’re much more common than linear, but the interested reader can easily extend this discussion to linear encoders as well.

      Resolution is a measure of how many counts per unit distance the encoder generates, or, inversely, the size of the measuring step. With rotary encoders, resolution is expressed in either units of angle (degrees-minutes-seconds, decimal degrees, grads, or radians) or in number of measuring steps per revolution (e.g., 10,000 counts/rev). [PPR, or pulses per rev, is quite common, but we avoid this term on purpose; see "Understanding Quadrature" and "Square Waves and Pulses" to find out why.] Often, when a binary number of measuring steps per revolution is required, the term "bit" is used to indicate the resolution’s highest power of 2; for example, a 16-bit encoder generates 216 = 65,536 counts/rev. Resolution is the most basic encoder parameter; you cannot specify an encoder without stating its resolution.

      Accuracy is a measure of where the encoder says it is vs. where it actually is, or where the counts are compared to where they should be. It is almost always expressed in units of angle, although some components of the error may sometimes be expressed in electrical degrees, which must then be translated to angular measure before summing with other sources. The use of that other term, error, is almost always a tip-off that the accuracy of the encoder is being discussed. Accuracy and error are both expressions of the difference between indicated and true position, but with slightly different connotations: accuracy is how close the indicated reading is to true position, while error is how far the indicated is from true. Thus, higher accuracy is better, but higher error is not.

      While the resolution of the encoder is permanently fixed at the time of manufacture by what code disk is installed, and what kind of sensing and processing electronics are built in, encoder error can vary as a function of environmental factors like temperature, shaft loading, and service life. This does not mean that the number of counts per revolution changes. That would occur only as a result of severe damage or contamination of encoder components such as the code disk or bearings. Although accuracy is an attribute of all encoders, not all customers specify it, and you won’t even find commonality among the various encoder vendors’ data sheets. Some, like us, go into considerable detail when specifying accuracy, some touch on it lightly, and some don’t even mention it! In all fairness, many customers assume any encoder offered for sale will be accurate to not worse than ±1 count, including quantization error, and in the case of low-resolution devices (up to about 10,000 counts/rev), it’s pretty hard to build a self-contained encoder that’s not at least that accurate. However, resolution and accuracy are not directly related. In higher performance encoders, the error may sometimes equal many counts, or may be a tiny fraction of a single count, depending on the needs of the application.

      Repeatability is a measure of what the reading is this time, compared to what it was last time, for travel in the same direction. Depending on the application, it may be important to distinguish between long-term and short-term repeatability. Like accuracy, it is expressed in units of angle. The repeatability of a rotary encoder of conventional construction is usually 5-10 times better (smaller) than the manufacturer’s quoted total accuracy (error) specification. You have to understand the application to know what to specify. If you’re tracking an aircraft, for example, accuracy will be critical, but if you’re teaching a robot to perform a repetitive task, repeatability may be more important to you than accuracy.

      Total Optical Encoder Error is the algebraic sum of Instrument Error + Quadrature Error + Interpolation Error + Quantization Error. In reality, these error sources sum to a value statistically less than the theoretical maximum, but if you use the sum, you’ll have a conservative worst-case value. (Before you add the errors, make sure they’re all in the same unit of measure.)

      Instrument Error is the sum of code disk eccentricity, pattern errors, bearing run-out and other opto-mechanical imperfections within the encoder. This error tends to vary slowly around a revolution. We usually express it in either seconds or minutes of arc. In applications where the user’s apparatus is operating over a limited rotation angle, it’s often possible to assume a significant part of the instrument error will be in effect outside the arc of interest. If you think this may be the case in your application, please consult with us. We know how to estimate (or measure exactly, if necessary) how much of the instrument error over a given angle can be ignored for each of the encoders we produce.

      Quadrature Error is the combined effect of phasing and duty-cycle tolerances and other variables in the basic analog signals. This error applies to data taken at all four transitions within an optical cycle (the "4X quadrature decode" that is so common among encoder users; see also "Understanding Quadrature"). If data are extracted from 1X square waves on a 1X basis (i.e., at only one transition per cycle), this error can be ignored. It is expressed on most vendors’ data sheets in electrical degrees; you can convert it to angular measure with one of these formulas:

      Error in arcsec = (3600) x (error in elect degrees) / (disk line count)

      Error in arcmin = (60) x (error in elect degrees) / (disk line count)

      Error in milliradians = (17.45) x (error in elect degrees) / (disk line count)

      Interpolation Error is present only when the resolution has been electronically increased to more than four measuring steps per optical cycle. It is the sum of all the tolerances in the electronic interpolation circuitry, and on our data sheets it is expressed in quanta. ("Quantum" is the final resolution of the encoder; it’s also called measuring step or count.)

      Error in arcsec = (1296000) x (error in quanta) / (final counts/rev)

      Error in arcmin = (21600) x (error in quanta) / (final counts/rev)

      Error in milliradians = (6283.2) x (error in quanta) / (final counts/rev)

      Quantization Error is not an encoder error per se, but is an inherent characteristic of any digital instrument. It is the measure of uncertainty stemming from the fact that there is no information between transitions; its value is always ±1/2 quantum. Since encoder vendors’ data sheets typically define accuracy at the signal transitions, quantization error is not included, but it should not be overlooked when determining the total error budget for your application. Since simply increasing the resolution of the encoder can reduce this error source, servo system designers often specify higher resolutions than they "need" with full knowledge that the final accuracy of the system is nowhere near the resolution of the feedback device. That’s one reason why it is helpful to remember that encoder errors occur in such a way that the encoder never loses count; it always produces exactly the correct number of measuring steps per revolution unless it has been badly contaminated or damaged.

      One way to measure encoder accuracy is to rotate the encoder at a very precisely controlled speed, and measure the time interval between successive transitions of the encoder’s output. Modern electronics allow this time interval to be measured quite accurately, but it is impossible to separate speed variations in the test stand from the encoder’s position errors. Present-day capabilities in speed control make this technique adequate for encoders of low to moderate performance, but better encoders need a method to measure position errors more directly.

      The classic way to measure position errors is with an autocollimator. This is essentially a multi-faceted mirror that is mounted on the encoder’s shaft. The angle between the facets is known to high degree of accuracy. By using reflected light from the mirrors, the encoder shaft can be turned this known angle, and the results compared to the encoder’s electronic output. There are two severe disadvantages to this technique: it is very slow and labor-intensive, and it allows a very limited number of measurements per revolution.

     To overcome these drawbacks, Gurley Precision Instruments has developed a unique angle standard we call METRA - Master Encoder for Testing Rotary Accuracy. The heart of METRA is an optical encoder with a 20-inch diameter disk that is mounted to an air-bearing spindle. A multiple reading head technique eliminates virtually all errors. METRA has resolution of 221 counts/rev, or 0.62 arcseconds per count. Its NIST-traceable accuracy is better than ±0.1 arcseconds; this certified accuracy is limited by available angle standards, and not by METRA itself. Because the accuracy is inherent in the master encoder, precise speed control is not necessary.

      The electronic portion of the test stand works much like a logic analyzer or digital storage oscilloscope, but with the samples occurring at regular angle intervals dictated by the master encoder, rather than at regular time intervals according to a crystal-controlled clock. Also like a logic analyzer, the sample history of an entire revolution is stored in a high-speed RAM cache for subsequent computer analysis.

      To measure accuracy, the EUT (Encoder Under Test) is coupled to METRA with precision fixturing. As the EUT and METRA are rotated together, the position information from METRA is used to interrogate the EUT 2,097,152 times per revolution. Thus, this test verifies the location of every single output state of the EUT. This method reveals all encoder errors, and does not depend on statistical assumptions based on an incomplete data set.

      On the resultant plot, you see a gray band that represents the composite of the errors from all sources: instrument error, quadrature error and (if applicable) interpolation error. The band is composed of 512 vertical line segments, each of which includes the errors of all consecutive edges comprising 1/512th of a revolution. The top end of each line represents the maximum positive (lead) error from its group, and the lower end shows the maximum lag error. The solid dark line is the average of all errors for the group, and is a good approximation of the encoder’s instrument error only, i.e., the error curve from data taken on a once-per-optical-cycle basis, excluding quadrature and interpolation errors. If the EUT has an index signal, it is used to initialize the test and is therefore located at 0° rotation angle.

      The typical error curve will tend to have a generally sinusoidal shape, with its period related directly to the number of read stations in the encoder. As the number of read stations in the EUT is increased, there will be a corresponding increase in the number of sub-cycles, but their amplitude will be much less than in an encoder with fewer read stations.

      Since its founding in 1845 as a producer of surveying instruments, Gurley Precision Instruments’ engineers have always been preoccupied with the question of accuracy in all of its products. Today, our company is an ISO-9001 certified designer and manufacturer of precise measuring equipment and components applied in several fields besides encoders, including optical sights and reticles, digital machine tool readouts, hydrological instruments, and sophisticated machines for testing material stiffness, porosity, and other quality characteristics. If you have an application that demands high performance, give us a call, and let’s talk accuracy!

BACK TO TOP

(800) 759-1844, (518) 272-6300 fax 274-0336