{"id":211,"date":"2019-02-04T09:50:37","date_gmt":"2019-02-04T09:50:37","guid":{"rendered":"http:\/\/tis-eg.com\/en\/?p=211"},"modified":"2019-02-04T09:50:37","modified_gmt":"2019-02-04T09:50:37","slug":"a-rotary-encoder","status":"publish","type":"post","link":"https:\/\/tis-eg.com\/en\/a-rotary-encoder\/","title":{"rendered":"A\u00a0rotary encoder"},"content":{"rendered":"<p>A\u00a0<b>rotary encoder<\/b>, also called a\u00a0<b>shaft encoder<\/b>, is an\u00a0<a class=\"mw-redirect\" title=\"Electro-mechanical\" href=\"https:\/\/en.wikipedia.org\/wiki\/Electro-mechanical\">electro-mechanical<\/a>\u00a0device that converts the\u00a0<a title=\"Angle\" href=\"https:\/\/en.wikipedia.org\/wiki\/Angle\">angular<\/a>\u00a0position or motion of a shaft or axle to analog or digital output signals.<\/p>\n<p>There are two main types of rotary encoder: absolute and incremental. The output of an absolute encoder indicates the current shaft position, making it an\u00a0<a title=\"Transducer\" href=\"https:\/\/en.wikipedia.org\/wiki\/Transducer\">angle transducer<\/a>. The output of an incremental encoder provides information about the\u00a0<i>motion<\/i>\u00a0of the shaft, which typically is processed elsewhere into information such as position, speed and distance.<\/p>\n<p>Rotary encoders are used in a wide range of applications that require monitoring or control, or both, of mechanical systems, including industrial controls,\u00a0<a title=\"Robotics\" href=\"https:\/\/en.wikipedia.org\/wiki\/Robotics\">robotics<\/a>,\u00a0<a class=\"mw-redirect\" title=\"Photographic lens\" href=\"https:\/\/en.wikipedia.org\/wiki\/Photographic_lens\">photographic lenses<\/a>,<sup id=\"cite_ref-1\" class=\"reference\"><a href=\"https:\/\/en.wikipedia.org\/wiki\/Rotary_encoder#cite_note-1\">[1]<\/a><\/sup>\u00a0computer input devices such as optomechanical\u00a0<a title=\"Computer mouse\" href=\"https:\/\/en.wikipedia.org\/wiki\/Computer_mouse\">mice<\/a>\u00a0and\u00a0<a title=\"Trackball\" href=\"https:\/\/en.wikipedia.org\/wiki\/Trackball\">trackballs<\/a>, controlled stress\u00a0<a class=\"mw-redirect\" title=\"Rheometers\" href=\"https:\/\/en.wikipedia.org\/wiki\/Rheometers\">rheometers<\/a>, and rotating\u00a0<a title=\"Radar\" href=\"https:\/\/en.wikipedia.org\/wiki\/Radar\">radar<\/a>\u00a0platforms.<\/p>\n<h2><span id=\"Encoder_technologies\" class=\"mw-headline\">Encoder technologies.<\/span><\/h2>\n<div class=\"thumb tright\">\n<div class=\"thumbinner\"><a class=\"image\" href=\"https:\/\/en.wikipedia.org\/wiki\/File:Odometergearcropped.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"thumbimage\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/4\/40\/Odometergearcropped.jpg\/220px-Odometergearcropped.jpg\" srcset=\"\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/4\/40\/Odometergearcropped.jpg\/330px-Odometergearcropped.jpg 1.5x, \/\/upload.wikimedia.org\/wikipedia\/commons\/4\/40\/Odometergearcropped.jpg 2x\" alt=\"\" width=\"220\" height=\"302\" data-file-width=\"373\" data-file-height=\"512\" \/><\/a><\/p>\n<div class=\"thumbcaption\">\n<div class=\"magnify\"><\/div>\n<p><a title=\"Hall effect\" href=\"https:\/\/en.wikipedia.org\/wiki\/Hall_effect\">Hall effect<\/a>\u00a0quadrature encoder, sensing gear teeth on the\u00a0<a class=\"mw-redirect\" title=\"Driveshaft\" href=\"https:\/\/en.wikipedia.org\/wiki\/Driveshaft\">driveshaft<\/a>\u00a0of a robot vehicle.<\/div>\n<\/div>\n<\/div>\n<ul>\n<li><b>Conductive<\/b>: A series of circumferential copper tracks etched onto a PCB is used to encode the information. Contact brushes sense the conductive areas. This form of encoder is now rarely seen except as a user input in\u00a0<a class=\"mw-redirect\" title=\"Digital multimeter\" href=\"https:\/\/en.wikipedia.org\/wiki\/Digital_multimeter\">digital multimeters<\/a>.<\/li>\n<li><b>Optical<\/b>: This uses a light shining onto a\u00a0<a title=\"Photodiode\" href=\"https:\/\/en.wikipedia.org\/wiki\/Photodiode\">photodiode<\/a>\u00a0through slits in a metal or glass disc. Reflective versions also exist. This is one of the most common technologies. Optical encoders are very sensitive to dust.<\/li>\n<li><b>On-Axis Magnetic<\/b>: This technology typically uses a specially magnetized 2 pole neodymium magnet attached to the motor shaft. Because it can be fixed to the end of the shaft, it can work with motors that only have 1 shaft extending out of the motor body. The accuracy can vary from a few degrees to under 1 degree. Resolutions can be as low as 1 degree or as high as 0.09 degree (4000 CPR, Count per Revolution).<sup id=\"cite_ref-2\" class=\"reference\"><a href=\"https:\/\/en.wikipedia.org\/wiki\/Rotary_encoder#cite_note-2\">[2]<\/a><\/sup>\u00a0Poorly designed internal interpolation can cause output jitter, but this can be overcome with internal sample averaging.<\/li>\n<li><b>Off-Axis Magnetic<\/b>: This technology typically employs the use of rubber bonded ferrite magnets attached to a metal hub. This offers flexibility in design and low cost for custom applications. Due to the flexibility in many off axis encoder chips they can be programmed to accept any number of pole widths so the chip can be placed in any position required for the application. Magnetic encoders operate in harsh environments where optical encoders would fail to work.<\/li>\n<\/ul>\n<h2><span id=\"Basic_types\" class=\"mw-headline\">Basic types.<\/span><\/h2>\n<h3><span id=\"Absolute\" class=\"mw-headline\">Absolute.<\/span><\/h3>\n<div class=\"thumb tright\">\n<div class=\"thumbinner\"><a class=\"image\" href=\"https:\/\/en.wikipedia.org\/wiki\/File:Encoder_incremental_Dynapar_B58N.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"thumbimage\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/a\/a1\/Encoder_incremental_Dynapar_B58N.jpg\/220px-Encoder_incremental_Dynapar_B58N.jpg\" srcset=\"\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/a\/a1\/Encoder_incremental_Dynapar_B58N.jpg\/330px-Encoder_incremental_Dynapar_B58N.jpg 1.5x, \/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/a\/a1\/Encoder_incremental_Dynapar_B58N.jpg\/440px-Encoder_incremental_Dynapar_B58N.jpg 2x\" alt=\"\" width=\"220\" height=\"166\" data-file-width=\"791\" data-file-height=\"596\" \/><\/a><\/p>\n<div class=\"thumbcaption\">\n<div class=\"magnify\"><\/div>\n<p>Incremental encoder<\/p><\/div>\n<\/div>\n<\/div>\n<p>An\u00a0<b>absolute encoder<\/b>\u00a0maintains position information when power is removed from the encoder.<sup id=\"cite_ref-absolute1_3-0\" class=\"reference\"><a href=\"https:\/\/en.wikipedia.org\/wiki\/Rotary_encoder#cite_note-absolute1-3\">[3]<\/a><\/sup>\u00a0The position of the encoder is available immediately on applying power. The relationship between the encoder value and the physical position of the controlled machinery is set at assembly; the system does not need to return to a calibration point to maintain position accuracy.<\/p>\n<p>An absolute encoder has multiple code rings with various binary weightings which provide a\u00a0<a class=\"mw-redirect\" title=\"Data word\" href=\"https:\/\/en.wikipedia.org\/wiki\/Data_word\">data word<\/a>\u00a0representing the absolute position of the encoder within one revolution. This type of encoder is often referred to as a parallel absolute encoder.<sup id=\"cite_ref-mitch_5000_4-0\" class=\"reference\"><a href=\"https:\/\/en.wikipedia.org\/wiki\/Rotary_encoder#cite_note-mitch_5000-4\">[4]<\/a><\/sup><\/p>\n<p>A multi-turn absolute rotary encoder includes additional code wheels and gears. A high-resolution wheel measures the fractional rotation, and lower-resolution geared code wheels record the number of whole revolutions of the shaft.<sup id=\"cite_ref-5\" class=\"reference\"><a href=\"https:\/\/en.wikipedia.org\/wiki\/Rotary_encoder#cite_note-5\">[5]<\/a><\/sup><\/p>\n<h3><span id=\"Incremental\" class=\"mw-headline\">Incremental.<\/span><\/h3>\n<p>An\u00a0<a title=\"Incremental encoder\" href=\"https:\/\/en.wikipedia.org\/wiki\/Incremental_encoder\">incremental encoder<\/a>\u00a0will immediately report changes in position, which is an essential capability in some applications. However, it does not report or keep track of absolute position. As a result, the mechanical system monitored by an incremental encoder may have to be moved to a fixed reference point to initialize the position measurement.<\/p>\n<h2><span id=\"Absolute_encoder\" class=\"mw-headline\">Absolute encoder.<\/span><\/h2>\n<h3><span id=\"Absolute_rotary_encoder\" class=\"mw-headline\">Absolute rotary encoder.<\/span><\/h3>\n<h4><span id=\"Construction\" class=\"mw-headline\">Construction.<\/span><\/h4>\n<p>Digital absolute encoders produce a unique digital code for each distinct angle of the shaft. They come in two basic types: optical and mechanical.<\/p>\n<h4><span id=\"Mechanical_absolute_encoders\" class=\"mw-headline\">Mechanical absolute encoders.<\/span><\/h4>\n<p>A metal disc containing a set of concentric rings of openings is fixed to an insulating disc, which is rigidly fixed to the shaft. A row of sliding contacts is fixed to a stationary object so that each contact wipes against the metal disc at a different distance from the shaft. As the disc rotates with the shaft, some of the contacts touch metal, while others fall in the gaps where the metal has been cut out. The metal sheet is connected to a source of\u00a0<a title=\"Electric current\" href=\"https:\/\/en.wikipedia.org\/wiki\/Electric_current\">electric current<\/a>, and each contact is connected to a separate electrical sensor. The metal pattern is designed so that each possible position of the axle creates a unique\u00a0<a title=\"Binary code\" href=\"https:\/\/en.wikipedia.org\/wiki\/Binary_code\">binary code<\/a>\u00a0in which some of the contacts are connected to the current source (i.e. switched on) and others are not (i.e. switched off).<\/p>\n<p>Because brush-type contacts are susceptible to wear, encoders using contacts are not common; they can be found in low-speed applications such as manual volume or tuning controls in a radio receiver.<\/p>\n<h4><span id=\"Optical_absolute_encoders\" class=\"mw-headline\">Optical absolute encoders.<\/span><\/h4>\n<p>The optical encoder&#8217;s disc is made of glass or plastic with transparent and opaque areas. A light source and photo detector array reads the optical pattern that results from the disc&#8217;s position at any one time.<sup id=\"cite_ref-6\" class=\"reference\"><a href=\"https:\/\/en.wikipedia.org\/wiki\/Rotary_encoder#cite_note-6\">[6]<\/a><\/sup>\u00a0The\u00a0<a title=\"Gray code\" href=\"https:\/\/en.wikipedia.org\/wiki\/Gray_code\">Gray code<\/a>\u00a0is often used. This code can be read by a controlling device, such as a\u00a0<a title=\"Microprocessor\" href=\"https:\/\/en.wikipedia.org\/wiki\/Microprocessor\">microprocessor<\/a>\u00a0or microcontroller to determine the angle of the shaft.<\/p>\n<p>The absolute analog type produces a unique dual analog code that can be translated into an absolute angle of the shaft.<\/p>\n<h4><span id=\"Magnetic_absolute_encoders\" class=\"mw-headline\">Magnetic absolute encoders.<\/span><\/h4>\n<p>The magnetic encoder uses a series of magnetic poles (2 or more) to represent the encoder position to a magnetic sensor (typically magneto-resistive or Hall Effect). The magnetic sensor reads the magnetic pole positions.<\/p>\n<p>This code can be read by a controlling device, such as a\u00a0<a title=\"Microprocessor\" href=\"https:\/\/en.wikipedia.org\/wiki\/Microprocessor\">microprocessor<\/a>\u00a0or microcontroller to determine the angle of the shaft, similar to an optical encoder.<\/p>\n<p>The absolute analog type produces a unique dual analog code that can be translated into an absolute angle of the shaft (by using a special algorithm<sup class=\"noprint Inline-Template Template-Fact\">[<i><a title=\"Wikipedia:Citation needed\" href=\"https:\/\/en.wikipedia.org\/wiki\/Wikipedia:Citation_needed\"><span title=\"give source for claim why algorithm is special (February 2016)\">citation needed<\/span><\/a><\/i>]<\/sup>).<\/p>\n<p>Due to the nature of recording magnetic effects, these encoders may be optimal to use in conditions where other types of encoders may fail due to dust or debris accumulation. Magnetic encoders are also relatively insensitive to vibrations, minor misalignment, or shocks.<\/p>\n<dl>\n<dt>Brushless motor commutation<\/dt>\n<\/dl>\n<p>Built-in rotary encoders are used to indicate the angle of the motor shaft in permanent magnet\u00a0<a class=\"mw-redirect\" title=\"Brushless motor\" href=\"https:\/\/en.wikipedia.org\/wiki\/Brushless_motor\">brushless motors<\/a>, which are commonly used on\u00a0<a class=\"mw-redirect\" title=\"CNC\" href=\"https:\/\/en.wikipedia.org\/wiki\/CNC\">CNC<\/a>\u00a0machines,\u00a0<a title=\"Robot\" href=\"https:\/\/en.wikipedia.org\/wiki\/Robot\">robots<\/a>, and other industrial equipment. In such cases, the encoder serves as a feedback device that plays a vital role in proper equipment operation. Brushless motors require electronic commutation, which often is implemented in part by using rotor magnets as a low-resolution absolute encoder (typically six or twelve pulses per revolution). The resulting shaft angle information is conveyed to the servo drive to enable it to energize the proper stator winding at any moment in time.<\/p>\n<h4><span id=\"Capacitive_absolute_encoders\" class=\"mw-headline\">Capacitive absolute encoders.<\/span><\/h4>\n<p>An asymmetrical shaped disc is rotated within the encoder. This disc will change the\u00a0<a title=\"Capacitance\" href=\"https:\/\/en.wikipedia.org\/wiki\/Capacitance\">capacitance<\/a>\u00a0between two electrodes which can be measured and calculated back to an angular value.<sup id=\"cite_ref-7\" class=\"reference\"><a href=\"https:\/\/en.wikipedia.org\/wiki\/Rotary_encoder#cite_note-7\">[7]<\/a><\/sup><\/p>\n<h3><span id=\"Absolute_multi-turn_encoder\" class=\"mw-headline\">Absolute multi-turn encoder.<\/span><\/h3>\n<p>A multi-turn encoder can detect and store more than one revolution. The term absolute multi-turn encoder is generally used if the encoder will detect movements of its shaft even if the encoder is not provided with external power.<\/p>\n<h4><span id=\"Battery-powered_multi-turn_encoder\" class=\"mw-headline\">Battery-powered multi-turn encoder.<\/span><\/h4>\n<p>This type of encoder uses a battery for retaining the counts across power cycles. It uses energy conserving electrical design to detect the movements.<\/p>\n<h4><span id=\"Geared_multi-turn_encoder\" class=\"mw-headline\">Geared multi-turn encoder.<\/span><\/h4>\n<p>These encoders use a train of gears to mechanically store the number of revolutions. The position of the single gears is detected with one of the above-mentioned technologies.<sup id=\"cite_ref-8\" class=\"reference\"><a href=\"https:\/\/en.wikipedia.org\/wiki\/Rotary_encoder#cite_note-8\">[8]<\/a><\/sup><\/p>\n<h4><span id=\"Self-powered_multi-turn_encoder\" class=\"mw-headline\">Self-powered multi-turn encoder.<\/span><\/h4>\n<p>These encoders use the principle of\u00a0<a title=\"Energy harvesting\" href=\"https:\/\/en.wikipedia.org\/wiki\/Energy_harvesting\">energy harvesting<\/a>\u00a0to generate energy from the moving shaft. This principle, introduced in 2007,<sup id=\"cite_ref-9\" class=\"reference\"><a href=\"https:\/\/en.wikipedia.org\/wiki\/Rotary_encoder#cite_note-9\">[9]<\/a><\/sup>\u00a0uses a\u00a0<a title=\"Wiegand effect\" href=\"https:\/\/en.wikipedia.org\/wiki\/Wiegand_effect\">Wiegand Sensor<\/a>\u00a0to produce electricity sufficient to power the encoder and write the turns count to non-volatile memory.<sup id=\"cite_ref-10\" class=\"reference\"><a href=\"https:\/\/en.wikipedia.org\/wiki\/Rotary_encoder#cite_note-10\">[10]<\/a><\/sup><\/p>\n<h3><span id=\"Ways_of_encoding_shaft_position\" class=\"mw-headline\">Ways of encoding shaft position.<\/span><\/h3>\n<h4><span id=\"Standard_binary_encoding\" class=\"mw-headline\">Standard binary encoding.<\/span><\/h4>\n<div class=\"thumb tright\">\n<div class=\"thumbinner\"><a class=\"image\" href=\"https:\/\/en.wikipedia.org\/wiki\/File:Encoder_disc_(3-Bit_binary).svg\"><img loading=\"lazy\" decoding=\"async\" class=\"thumbimage\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/0\/0b\/Encoder_disc_%283-Bit_binary%29.svg\/220px-Encoder_disc_%283-Bit_binary%29.svg.png\" srcset=\"\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/0\/0b\/Encoder_disc_%283-Bit_binary%29.svg\/330px-Encoder_disc_%283-Bit_binary%29.svg.png 1.5x, \/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/0\/0b\/Encoder_disc_%283-Bit_binary%29.svg\/440px-Encoder_disc_%283-Bit_binary%29.svg.png 2x\" alt=\"\" width=\"220\" height=\"220\" data-file-width=\"284\" data-file-height=\"284\" \/><\/a><\/p>\n<div class=\"thumbcaption\">\n<div class=\"magnify\"><\/div>\n<p>Rotary encoder for angle-measuring devices marked in 3-bit binary. The inner ring corresponds to Contact 1 in the table. Black sectors are &#8220;on&#8221;. Zero degrees is on the right-hand side, with angle increasing counterclockwise.<\/p><\/div>\n<\/div>\n<\/div>\n<p>An example of a binary code, in an extremely simplified encoder with only three contacts, is shown below.<\/p>\n<table class=\"wikitable\">\n<caption>Standard Binary Encoding<\/caption>\n<tbody>\n<tr>\n<th>Sector<\/th>\n<th>Contact 1<\/th>\n<th>Contact 2<\/th>\n<th>Contact 3<\/th>\n<th>Angle<\/th>\n<\/tr>\n<tr>\n<td>0<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td>0\u00b0 to 45\u00b0<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td>45\u00b0 to 90\u00b0<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td>90\u00b0 to 135\u00b0<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td>135\u00b0 to 180\u00b0<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td>180\u00b0 to 225\u00b0<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td>225\u00b0 to 270\u00b0<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td>270\u00b0 to 315\u00b0<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td>315\u00b0 to 360\u00b0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>In general, where there are\u00a0<i>n<\/i>\u00a0contacts, the number of distinct positions of the shaft is 2<sup><i>n<\/i><\/sup>. In this example,\u00a0<i>n<\/i>\u00a0is 3, so there are 2\u00b3 or 8 positions.<\/p>\n<p>In the above example, the contacts produce a standard binary count as the disc rotates. However, this has the drawback that if the disc stops between two adjacent sectors, or the contacts are not perfectly aligned, it can be impossible to determine the angle of the shaft. To illustrate this problem, consider what happens when the shaft angle changes from 179.9\u00b0 to 180.1\u00b0 (from sector 3 to sector 4). At some instant, according to the above table, the contact pattern changes from off-on-on to on-off-off. However, this is not what happens in reality. In a practical device, the contacts are never perfectly aligned, so each switches at a different moment. If contact 1 switches first, followed by contact 3 and then contact 2, for example, the actual sequence of codes is:<\/p>\n<dl>\n<dd>off-on-on (starting position)<\/dd>\n<dd>on-on-on (first, contact 1 switches on)<\/dd>\n<dd>on-on-off (next, contact 3 switches off)<\/dd>\n<dd>on-off-off (finally, contact 2 switches off)<\/dd>\n<\/dl>\n<p>Now look at the sectors corresponding to these codes in the table. In order, they are 3, 7, 6 and then 4. So, from the sequence of codes produced, the shaft appears to have jumped from sector 3 to sector 7, then gone backwards to sector 6, then backwards again to sector 4, which is where we expected to find it. In many situations, this behaviour is undesirable and could cause the system to fail. For example, if the encoder were used in a robot arm, the controller would think that the arm was in the wrong position, and try to correct the error by turning it through 180\u00b0, perhaps causing damage to the arm.<\/p>\n<h4><span id=\"Gray_encoding\" class=\"mw-headline\">Gray encoding.<\/span><\/h4>\n<div class=\"thumb tright\">\n<div class=\"thumbinner\"><a class=\"image\" href=\"https:\/\/en.wikipedia.org\/wiki\/File:Encoder_Disc_(3-Bit).svg\"><img loading=\"lazy\" decoding=\"async\" class=\"thumbimage\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/9\/9b\/Encoder_Disc_%283-Bit%29.svg\/220px-Encoder_Disc_%283-Bit%29.svg.png\" srcset=\"\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/9\/9b\/Encoder_Disc_%283-Bit%29.svg\/330px-Encoder_Disc_%283-Bit%29.svg.png 1.5x, \/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/9\/9b\/Encoder_Disc_%283-Bit%29.svg\/440px-Encoder_Disc_%283-Bit%29.svg.png 2x\" alt=\"\" width=\"220\" height=\"220\" data-file-width=\"284\" data-file-height=\"284\" \/><\/a><\/p>\n<div class=\"thumbcaption\">\n<div class=\"magnify\"><\/div>\n<p>Rotary encoder for angle-measuring devices marked in 3-bit binary-reflected Gray code (BRGC). The inner ring corresponds to Contact 1 in the table. Black sectors are &#8220;on&#8221;. Zero degrees is on the right-hand side, with angle increasing counter-clockwise.<\/p><\/div>\n<\/div>\n<\/div>\n<p>To avoid the above problem, Gray coding is used. This is a system of binary counting in which any two adjacent codes differ by only one bit position. For the three-contact example given above, the Gray-coded version would be as follows.<\/p>\n<table class=\"wikitable\">\n<caption>Gray Coding<\/caption>\n<tbody>\n<tr>\n<th>Sector<\/th>\n<th>Contact 1<\/th>\n<th>Contact 2<\/th>\n<th>Contact 3<\/th>\n<th>Angle<\/th>\n<\/tr>\n<tr>\n<td>0<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td>0\u00b0 to 45\u00b0<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td>45\u00b0 to 90\u00b0<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td>90\u00b0 to 135\u00b0<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td>135\u00b0 to 180\u00b0<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td>180\u00b0 to 225\u00b0<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td>225\u00b0 to 270\u00b0<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td>270\u00b0 to 315\u00b0<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td bgcolor=\"#ccffcc\">ON<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td bgcolor=\"#ffcccc\">off<\/td>\n<td>315\u00b0 to 360\u00b0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>In this example, the transition from sector 3 to sector 4, like all other transitions, involves only one of the contacts changing its state from on to off or vice versa. This means that the sequence of incorrect codes shown in the previous illustration cannot happen.<\/p>\n<h4><span id=\"Single-track_Gray_encoding\" class=\"mw-headline\">Single-track Gray encoding.<\/span><\/h4>\n<p>If the designer moves a contact to a different angular position (but at the same distance from the center shaft), then the corresponding &#8220;ring pattern&#8221; needs to be rotated the same angle to give the same output. If the most significant bit (the inner ring in Figure 1) is rotated enough, it exactly matches the next ring out. Since both rings are then identical, the inner ring can be omitted, and the sensor for that ring moved to the remaining, identical ring (but offset at that angle from the other sensor on that ring). Those two sensors on a single ring make a quadrature encoder with a single ring.<\/p>\n<p>It is possible to arrange several sensors around a single track (ring) so that consecutive positions differ at only a single sensor; the result is the\u00a0<a class=\"mw-redirect\" title=\"Single-track Gray code\" href=\"https:\/\/en.wikipedia.org\/wiki\/Single-track_Gray_code\">single-track Gray code<\/a>\u00a0encoder.<\/p>\n<h3><span id=\"Data_output_methods\" class=\"mw-headline\">Data output methods.<\/span><\/h3>\n<p>Depending on the device and manufacturer, an absolute encoder may use any of several signal types and communication protocols to transmit data, including parallel binary,\u00a0<a title=\"Analog signal\" href=\"https:\/\/en.wikipedia.org\/wiki\/Analog_signal\">analog signals<\/a>\u00a0(current or voltage), and serial bus systems such as\u00a0<a title=\"Synchronous Serial Interface\" href=\"https:\/\/en.wikipedia.org\/wiki\/Synchronous_Serial_Interface\">SSI<\/a>,\u00a0<a title=\"BiSS interface\" href=\"https:\/\/en.wikipedia.org\/wiki\/BiSS_interface\">BiSS<\/a>,\u00a0<a title=\"DeviceNet\" href=\"https:\/\/en.wikipedia.org\/wiki\/DeviceNet\">DeviceNet<\/a>,\u00a0<a title=\"Modbus\" href=\"https:\/\/en.wikipedia.org\/wiki\/Modbus\">Modbus<\/a>,\u00a0<a title=\"Profibus\" href=\"https:\/\/en.wikipedia.org\/wiki\/Profibus\">Profibus<\/a>,\u00a0<a title=\"CANopen\" href=\"https:\/\/en.wikipedia.org\/wiki\/CANopen\">CANopen<\/a>\u00a0and\u00a0<a title=\"EtherCAT\" href=\"https:\/\/en.wikipedia.org\/wiki\/EtherCAT\">EtherCAT<\/a>, which typically employ\u00a0<a title=\"Ethernet\" href=\"https:\/\/en.wikipedia.org\/wiki\/Ethernet\">Ethernet<\/a>\u00a0or RS-422\/RS-485 physical layers.<\/p>\n<h2><span id=\"Incremental_encoder\" class=\"mw-headline\">Incremental encoder.<\/span><\/h2>\n<div class=\"hatnote navigation-not-searchable\" role=\"note\">Main article:\u00a0<a title=\"Incremental encoder\" href=\"https:\/\/en.wikipedia.org\/wiki\/Incremental_encoder\">Incremental encoder<\/a><\/div>\n<div class=\"thumb tright\">\n<div class=\"thumbinner\"><a class=\"image\" href=\"https:\/\/en.wikipedia.org\/wiki\/File:ROD420_HEIDENHAIN.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"thumbimage\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/6\/6a\/ROD420_HEIDENHAIN.jpg\/220px-ROD420_HEIDENHAIN.jpg\" srcset=\"\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/6\/6a\/ROD420_HEIDENHAIN.jpg\/330px-ROD420_HEIDENHAIN.jpg 1.5x, \/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/6\/6a\/ROD420_HEIDENHAIN.jpg\/440px-ROD420_HEIDENHAIN.jpg 2x\" alt=\"\" width=\"220\" height=\"293\" data-file-width=\"1704\" data-file-height=\"2272\" \/><\/a><\/p>\n<div class=\"thumbcaption\">\n<div class=\"magnify\"><\/div>\n<p>An incremental encoder<\/p><\/div>\n<\/div>\n<\/div>\n<div class=\"thumb tright\">\n<div class=\"thumbinner\"><a class=\"image\" href=\"https:\/\/en.wikipedia.org\/wiki\/File:Quadrature_Diagram.svg\"><img loading=\"lazy\" decoding=\"async\" class=\"thumbimage\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/6\/68\/Quadrature_Diagram.svg\/220px-Quadrature_Diagram.svg.png\" srcset=\"\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/6\/68\/Quadrature_Diagram.svg\/330px-Quadrature_Diagram.svg.png 1.5x, \/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/6\/68\/Quadrature_Diagram.svg\/440px-Quadrature_Diagram.svg.png 2x\" alt=\"\" width=\"220\" height=\"73\" data-file-width=\"600\" data-file-height=\"200\" \/><\/a><\/p>\n<div class=\"thumbcaption\">\n<div class=\"magnify\"><\/div>\n<p>Two square waves in quadrature. The direction of rotation is indicated by the sign of the A-B phase angle which, in this case, is negative because A trails B.<\/p><\/div>\n<\/div>\n<\/div>\n<div class=\"thumb tright\">\n<div class=\"thumbinner\"><a class=\"image\" href=\"https:\/\/en.wikipedia.org\/wiki\/File:Incremental_directional_encoder.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"thumbimage\" src=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/1\/1e\/Incremental_directional_encoder.gif\/220px-Incremental_directional_encoder.gif\" srcset=\"\/\/upload.wikimedia.org\/wikipedia\/commons\/thumb\/1\/1e\/Incremental_directional_encoder.gif\/330px-Incremental_directional_encoder.gif 1.5x, \/\/upload.wikimedia.org\/wikipedia\/commons\/1\/1e\/Incremental_directional_encoder.gif 2x\" alt=\"\" width=\"220\" height=\"128\" data-file-width=\"400\" data-file-height=\"233\" \/><\/a><\/p>\n<div class=\"thumbcaption\">\n<div class=\"magnify\"><\/div>\n<p>Conceptual drawing of a rotary incremental encoder sensor mechanism, with the corresponding logic states of the A and B signals<\/p><\/div>\n<\/div>\n<\/div>\n<p>The rotary\u00a0<a title=\"Incremental encoder\" href=\"https:\/\/en.wikipedia.org\/wiki\/Incremental_encoder\">incremental encoder<\/a>\u00a0is the most widely used of all rotary encoders due to its low cost and ability to provide real-time position information. The measurement resolution of an incremental encoder is not limited in any way by its two internal, incremental movement sensors; one can find in the market incremental encoders with up to 10,000 counts per revolution, or more.<\/p>\n<p>Rotary incremental encoders report position changes without being prompted to do so, and they convey this information at data rates which are orders of magnitude faster than those of most types of absolute shaft encoders. Because of this, incremental encoders are commonly used in applications that require precise measurement of position and velocity.<\/p>\n<p>A rotary incremental encoder may use mechanical, optical or magnetic sensors to detect rotational position changes. The mechanical type is commonly employed as a manually operated &#8220;digital potentiometer&#8221; control on electronic equipment. For example, modern home and car stereos typically use mechanical rotary encoders as volume controls. Encoders with mechanical sensors require switch\u00a0<a class=\"mw-redirect\" title=\"Debouncing\" href=\"https:\/\/en.wikipedia.org\/wiki\/Debouncing\">debouncing<\/a>\u00a0and consequently are limited in the rotational speeds they can handle. The optical type is used when higher speeds are encountered or a higher degree of precision is required.<\/p>\n<p>A rotary incremental encoder has two output signals, A and B, which issue square waves in quadrature when the encoder shaft rotates. The square wave frequency indicates the speed of shaft rotation, whereas the A-B phase relationship indicates the direction of rotation.<\/p>\n<p>Some rotary incremental encoders have an additional &#8220;index&#8221; output (typically labeled Z), which emits a pulse when the shaft passes through a particular angle. Once every rotation, the Z signal is asserted, typically always at the same angle, until the next AB state change. This is commonly used in radar systems and other applications that require a registration signal when the encoder shaft is located at a particular reference angle.<\/p>\n<p>Unlike absolute encoders, an incremental encoder does not keep track of, nor do its outputs indicate the absolute position of the mechanical system to which it is attached. Consequently, to determine the absolute position at any particular moment, it is necessary to &#8220;track&#8221; the absolute position with an\u00a0<a class=\"mw-redirect\" title=\"Incremental encoder interface\" href=\"https:\/\/en.wikipedia.org\/wiki\/Incremental_encoder_interface\">incremental encoder interface<\/a>.<\/p>\n<p>Inexpensive incremental encoders are used in\u00a0<a title=\"Computer mouse\" href=\"https:\/\/en.wikipedia.org\/wiki\/Computer_mouse#Mechanical_mice\">mechanical computer mice<\/a>. Typically, two encoders are used: one to sense left-right motion and another to sense forward-backward motion.<\/p>\n<h3><span id=\"Other_pulse-output_rotary_encoders\" class=\"mw-headline\">Other pulse-output rotary encoders.<\/span><\/h3>\n<p>Rotary encoders with a single output (i.e.\u00a0<a title=\"Tachometer\" href=\"https:\/\/en.wikipedia.org\/wiki\/Tachometer\">tachometers<\/a>) cannot be used to sense direction of motion but are suitable for measuring speed and for measuring position when the direction of travel is constant. In certain applications they may be used to measure distance of motion (e.g. feet of movement).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A\u00a0rotary encoder, also called a\u00a0shaft encoder, is an\u00a0electro-mechanical\u00a0device that converts the\u00a0angular\u00a0position or motion of a shaft or axle to analog or digital output signals. There are two main types of rotary encoder: absolute and incremental. The output of an absolute encoder indicates the current shaft position, making it an\u00a0angle transducer. The output of an incremental [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":212,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-211","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles"],"_links":{"self":[{"href":"https:\/\/tis-eg.com\/en\/wp-json\/wp\/v2\/posts\/211","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tis-eg.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tis-eg.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tis-eg.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tis-eg.com\/en\/wp-json\/wp\/v2\/comments?post=211"}],"version-history":[{"count":1,"href":"https:\/\/tis-eg.com\/en\/wp-json\/wp\/v2\/posts\/211\/revisions"}],"predecessor-version":[{"id":213,"href":"https:\/\/tis-eg.com\/en\/wp-json\/wp\/v2\/posts\/211\/revisions\/213"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tis-eg.com\/en\/wp-json\/wp\/v2\/media\/212"}],"wp:attachment":[{"href":"https:\/\/tis-eg.com\/en\/wp-json\/wp\/v2\/media?parent=211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tis-eg.com\/en\/wp-json\/wp\/v2\/categories?post=211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tis-eg.com\/en\/wp-json\/wp\/v2\/tags?post=211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}