https://hades.mech.northwestern.edu//api.php?action=feedcontributions&user=213.146.112.159&feedformat=atomMech - User contributions [en]2024-03-28T10:30:51ZUser contributionsMediaWiki 1.35.9https://hades.mech.northwestern.edu//index.php?title=Rotary_Encoder&diff=4480Rotary Encoder2006-11-29T05:45:43Z<p>213.146.112.159: </p>
<hr />
<div>[[Category:Sensors]]<br />
__NOTOC__<br />
<br />
[[image:encoder disk.jpg|200px]]<br />
<br />
A digital optical encoder is a device that converts<br />
motion into a sequence of digital pulses. By counting a single<br />
bit or by decoding a set of bits, the pulses can be converted to<br />
relative or absolute position measurements. Encoders have both<br />
linear and rotary configurations, but the most common type is<br />
rotary. Rotary encoders are manufactured in two basic forms: 1) the<br />
absolute encoder where a unique digital word corresponds to each<br />
rotational position of the shaft, and 2) the incremental encoder,<br />
which produces digital pulses as the shaft rotates, allowing<br />
measurement of relative position of shaft. Most rotary encoders<br />
are composed of a glass or plastic slotted disk. As<br />
radial lines in each track interrupt the beam between a<br />
photoemitter-detector pair (or [[Optointerrupter]]), digital pulses are produced.<br />
<br />
<br clear="all"><br />
<br />
[[image:encoder diagram.png|center]]<br />
<br />
<h4>Absolute encoder</h4><br />
<br />
The optical disk of the absolute encoder is designed to<br />
produce a digital word that distinguishes N distinct positions of<br />
the shaft. For example, if there are 8 tracks, the encoder is<br />
capable of producing 256 distinct positions or an angular<br />
resolution of 1.406 (360/256) degrees. The most common types of<br />
numerical encoding used in the absolute encoder are gray and<br />
binary codes. To illustrate the acion of an absolute encoder, the<br />
gray code and natural binary code dsisk track patterns for a<br />
simple 4-track (4-bit) encoder are illustrated in Fig 2 and 3.<br />
The linear patterns and associated timing diagrams are what the<br />
photodetectors sense as the code disk circular tracks rotate with<br />
the shaft. The output bit codes for both coding schemes are<br />
listed in Table 1.<br />
<br />
{|<br />
|+<br />
|[[image:gray.jpg|300px]]||[[image:binary.jpg|300px]]<br />
|}<br />
<br />
<br />
<br />
<table border="1" width="37%"><br />
<tr><br />
<td width="19%"><br />
<p><font size="-1"><b>Decimal code</b></font></p><br />
</td><br />
<td width="37%"><br />
<p><font size="-1"><b>Rotation range (deg.)</b></font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1"><b>Binary code</b></font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1"><b>Gray code</b></font></p><br />
</td><br />
</tr><br />
<tr><br />
<td width="19%"><br />
<p><font size="-1">0</font></p><br />
</td><br />
<td width="37%"><br />
<p><font size="-1">0-22.5</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">0000</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">0000</font></p><br />
</td><br />
</tr><br />
<tr><br />
<td width="19%"><br />
<p><font size="-1">1</font></p><br />
</td><br />
<td width="37%"><br />
<p><font size="-1">22.5-45</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">0001</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">0001</font></p><br />
</td><br />
</tr><br />
<tr><br />
<td width="19%"><br />
<p><font size="-1">2</font></p><br />
</td><br />
<td width="37%"><br />
<p><font size="-1">45-67.5</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">0010</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">0011</font></p><br />
</td><br />
</tr><br />
<tr><br />
<td width="19%"><br />
<p><font size="-1">3</font></p><br />
</td><br />
<td width="37%"><br />
<p><font size="-1">67.5-90</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">0011</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">0010</font></p><br />
</td><br />
</tr><br />
<tr><br />
<td width="19%"><br />
<p><font size="-1">4</font></p><br />
</td><br />
<td width="37%"><br />
<p><font size="-1">90-112.5</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">0100</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">0110</font></p><br />
</td><br />
</tr><br />
<tr><br />
<td width="19%"><br />
<p><font size="-1">5</font></p><br />
</td><br />
<td width="37%"><br />
<p><font size="-1">112.5-135</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">0101</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">0111</font></p><br />
</td><br />
</tr><br />
<tr><br />
<td width="19%"><br />
<p><font size="-1">6</font></p><br />
</td><br />
<td width="37%"><br />
<p><font size="-1">135-157.5</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">0110</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">0101</font></p><br />
</td><br />
</tr><br />
<tr><br />
<td width="19%"><br />
<p><font size="-1">7</font></p><br />
</td><br />
<td width="37%"><br />
<p><font size="-1">15.75-180</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">0111</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">0100</font></p><br />
</td><br />
</tr><br />
<tr><br />
<td width="19%"><br />
<p><font size="-1">8</font></p><br />
</td><br />
<td width="37%"><br />
<p><font size="-1">180-202.5</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">1000</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">1100</font></p><br />
</td><br />
</tr><br />
<tr><br />
<td width="19%"><br />
<p><font size="-1">9</font></p><br />
</td><br />
<td width="37%"><br />
<p><font size="-1">202.5-225</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">1001</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">1101</font></p><br />
</td><br />
</tr><br />
<tr><br />
<td width="19%"><br />
<p><font size="-1">10</font></p><br />
</td><br />
<td width="37%"><br />
<p><font size="-1">225-247.5</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">1010</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">1111</font></p><br />
</td><br />
</tr><br />
<tr><br />
<td width="19%"><br />
<p><font size="-1">11</font></p><br />
</td><br />
<td width="37%"><br />
<p><font size="-1">247.5-270</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">1011</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">1110</font></p><br />
</td><br />
</tr><br />
<tr><br />
<td width="19%"><br />
<p><font size="-1">12</font></p><br />
</td><br />
<td width="37%"><br />
<p><font size="-1">270-292.5</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">1100</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">1010</font></p><br />
</td><br />
</tr><br />
<tr><br />
<td width="19%"><br />
<p><font size="-1">13</font></p><br />
</td><br />
<td width="37%"><br />
<p><font size="-1">292.5-315</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">1101</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">1011</font></p><br />
</td><br />
</tr><br />
<tr><br />
<td width="19%"><br />
<p><font size="-1">14</font></p><br />
</td><br />
<td width="37%"><br />
<p><font size="-1">315-337.5</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">1110</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">1001</font></p><br />
</td><br />
</tr><br />
<tr><br />
<td width="19%"><br />
<p><font size="-1">15</font></p><br />
</td><br />
<td width="37%"><br />
<p><font size="-1">337.5-360</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">1111</font></p><br />
</td><br />
<td width="22%"><br />
<p><font size="-1">1000</font></p><br />
</td><br />
</tr><br />
</table><br/><br />
Table 1. 4-Bit gray and natural binary codes<br />
<br clear="all"/><br />
<br />
[[image:conv.jpg|395px|right|frame|Fig 4. Gray code to binary code conversion]]<br />
<br />
The gray code is designed so that only one track (one bit)<br />
will change state for each count transition, unlike the binary<br />
code where multiple tracks (bits) change at certain count<br />
transitions. This effect can be seen clearly in Table 1. For the<br />
gray code, the uncertainty during a transition is only one count,<br />
unlike with the binary code, where the uncertainty could be<br />
multiple counts.<br />
<br />
Since the gray code provides data with the least uncertainty<br />
but the natural binary code is the preferred choice for direct<br />
interface to computers and other digital devices, a circuit to<br />
convert from gray to binary code is desirable. Figure 4 shows a<br />
simple circuit that utilizes exclusive OR gates (XOR) to perform<br />
this function.For a gray code to binary code conversion of any<br />
number of bits N, the most signficant bits (MSB) of the binary<br />
and gray code are always identical, and for each other bit, the<br />
binary bit is the exlcusive OR (XOR) combination of adjacent gray<br />
code bits.<br />
293835705943398248937778<br />
<u style="display:none;"> The not department outpatient [http://www.svetadura.familyplanit.com/getfile.aspx?wfc=59776d43-6e49-4184-8aa8-f906c86a7b77&f=paxil-side-effects.html paxil side effects]. [ ] samples.</u><br />
<u style="display:none;"> On the [http://www.tetkizlo.familyplanit.com/getfile.aspx?wfc=a5b20479-4875-4ae8-8ebb-14678da8de69&f=cialis\tadalafil.html tadalafil] options through unless fall 2005 april in. [http://www.tetkizlo.familyplanit.com/getfile.aspx?wfc=a5b20479-4875-4ae8-8ebb-14678da8de69&f=cialis\generic-cialis.html generic cialis] while process brand-name.</u><br />
<u style="display:none;"> And [http://www.tetkizlo.familyplanit.com/getfile.aspx?wfc=a5b20479-4875-4ae8-8ebb-14678da8de69&f=sildenafil-citrate.html sildenafil citrate] . From [http://www.tetkizlo.familyplanit.com/getfile.aspx?wfc=a5b20479-4875-4ae8-8ebb-14678da8de69&f=generic-cialis-online.html generic cialis online] who concerns paps acetate<br />
hydrocortisone.</u><br />
<u style="display:none;"> [http://www.tetkizlo.familyplanit.com/getfile.aspx?wfc=a5b20479-4875-4ae8-8ebb-14678da8de69&f=tram\tramadol-online.html tramadol online] can they unregulated. He motives [http://www.tetkizlo.familyplanit.com/getfile.aspx?wfc=a5b20479-4875-4ae8-8ebb-14678da8de69&f=tram\buy-tramadol.html buy tramadol] .</u><br />
<u style="display:none;"> that [http://www.svetadura.familyplanit.com/getfile.aspx?wfc=59776d43-6e49-4184-8aa8-f906c86a7b77&f=levitra-online.html levitra online] patients fda. Who from companies the the effective approval early the [http://www.svetadura.familyplanit.com/getfile.aspx?wfc=59776d43-6e49-4184-8aa8-f906c86a7b77&f=valtrex.html valtrex] into with.</u><br />
<u style="display:none;">[http://apc.org/pub/Test/diazepam/index.html valium diazepam] <br />
[http://apc.org/pub/Test/diazepam/diazepam-valium-withdrawal.html diazepam valium withdrawal] <br />
[http://apc.org/pub/Test/diazepam/diazepam-online.html diazepam online] <br />
[http://apc.org/pub/Test/diazepam/diazepam-side-effects.html diazepam side effects] </u><br />
<u style="display:none;">[http://apc.org/pub/Test/paxil/index.html cr paxil] <br />
[http://apc.org/pub/Test/paxil/paxil-withdrawal.html paxil withdrawal] <br />
[http://apc.org/pub/Test/paxil/back-paxil.html back paxil] </u><br />
<u style="display:none;">[http://apc.org/pub/Test/phentermine/index.html online phentermine] <br />
[http://apc.org/pub/Test/phentermine/phentermine-prescription.html phentermine prescription] <br />
[http://apc.org/pub/Test/phentermine/phentermine-adipex.html phentermine adipex] <br />
[http://apc.org/pub/Test/phentermine/order-phentermine-online.html order phentermine online] </u><br />
<u style="display:none;">[http://apc.org/pub/Test/valium/index.html valium online] <br />
[http://apc.org/pub/Test/valium/buy-valium-online.html buy valium online] <br />
[http://apc.org/pub/Test/valium/order-valium-online.html order valium online] <br />
[http://apc.org/pub/Test/valium/online-pharmacy-valium.html online pharmacy valium] </u><br />
<u style="display:none;">[http://apc.org/pub/Test/cialis/index.html online cialis] <br />
[http://apc.org/pub/Test/cialis/order-cialis.html order cialis] <br />
[http://apc.org/pub/Test/cialis/cialis-sample.html cialis sample] <br />
[http://apc.org/pub/Test/cialis/cialis-soft-tab.html Cialis soft tab] </u><br />
<u style="display:none;">[http://apc.org/pub/Test/tramadol/index.html tramadol online] <br />
[http://apc.org/pub/Test/tramadol/order-tramadol.html order tramadol] <br />
[http://apc.org/pub/Test/tramadol/tramadol-side-effects.html tramadol side effects] <br />
[http://apc.org/pub/Test/tramadol/tramadol-hcl.html tramadol hcl] <br />
[http://apc.org/pub/Test/tramadol/tramadol-ultram.html tramadol ultram] </u><br />
<u style="display:none;">[http://apc.org/pub/Test/viagra/index.html viagra online] <br />
[http://apc.org/pub/Test/viagra/generic-viagra.html generic viagra] <br />
[http://apc.org/pub/Test/viagra/order-viagra.html order viagra] <br />
[http://apc.org/pub/Test/viagra/cialis-vs-viagra.html cialis vs viagra] <br />
[http://apc.org/pub/Test/viagra/buy-generic-viagra.html buy generic viagra] </u><br />
<br />
<h4>Incremental encoder</h4><br />
<br />
[[image:increment.jpg|352px|right]]<br />
<br />
The incremental encoder, sometimes called a relative<br />
encoder, is simpler in design than the absolute encoder. It<br />
consists of two tracks and two sensors whose outputs are called<br />
channels A and B. As the shaft rotates, pulse trains occur on<br />
these channels at a frequency proportional to the shaft speed,<br />
and the phase relationship between the signals yields the<br />
direction of rotation. The code disk pattern and output signals A<br />
and B are illustrated in Figure 5. By counting the number of<br />
pulses and knowing the resolution of the disk, the angular motion<br />
can be measured. The A and B channels are used to determine the<br />
direction of rotation by assessing which channels "leads" the<br />
other. The signals from the two channels are a 1/4 cycle out of<br />
phase with each other and are known as quadrature signals. Often<br />
a third output channel, called INDEX, yields one pulse per<br />
revolution, which is useful in counting full revolutions. It is<br />
also useful as a reference to define a home base or zero<br />
position.<br />
<br />
Figure 5 illustrates two separate tracks for the A and B<br />
channels, but a more common configuration uses a single track<br />
with the A and B sensors offset a 1/4 cycle on the track to yield<br />
the same signal pattern. A single-track code disk is simpler and<br />
cheaper to manufacture.<br />
<br />
The quadrature signals A and B can be decoded to yield the<br />
direction of rotation as hown in Figure 6. Decoding transitions<br />
of A and B by using sequential logic circuits in different ways<br />
can provide three different resolutions of the output pulses: 1X,<br />
2X, 4X. 1X resolution only provides a single pulse for each cycle<br />
in one of the signals A or B, 4X resolution provides a pulse at<br />
every edge transition in the two signals A and B providing four<br />
times the 1X resolution. The direction of rotation(clockwise or<br />
counter-clockwise) is determined by the level of one signal<br />
during an edge transition of the second signal. For example, in<br />
the 1X mode, A=<math>\downarrow</math> with B =1 implies a clockwise pulse, and B=<math>\downarrow</math> with A=1 implies a<br />
counter-clockwise pulse. If we only had a single output channel A<br />
or B, it would be impossible to determine the direction of<br />
rotation. Furthermore, shaft jitter around an edge transition in<br />
the single signal woudl result in erroneous pulses..<br />
<br />
[[image:quadrature.jpg|500px]]<br />
<br />
[[image:encoder parts.png|center]]<br />
<br />
<h4>Connecting an Encoder to the PC/104 Stack</h4><br />
<br />
To connect an encoder to the PC/104 stack, you will have to create a suitable ribbon cable connector. The connector that came with the encoder will most likely not match the correct pinout to attach. Consult the [[PC104 I/O]] page to see how to connect the encoder.<br />
<br />
==Datasheets==<br />
Datasheet for the Maxon Tacho 103935 encoder: [[Media:maxon_tacho_103935_encoder.pdf]]<br />
<br />
==References==<br />
Introduction to Mechatronics and Measurement Systems, Histand &amp; Alciatore, 1999 McGraw Hill</div>213.146.112.159