Skip to content

Commit 971d7cc

Browse files
authored
Refactor Encoder articles (#2191)
* Revamp Encoder articles Seperate out form factor of encoder from electrical characteristices. Document Duty Cycle encoders and move Analog Encoders from Potentiometer articles to encoder articles. Remove encoder examples that are better covered elsewhere * Don't omit leading/trailing 0s throughout document * Fix Lamprey formatting and add to output types * Address review comments * More capitalization * Resolve duplicate IDs * Add Duty Cycle connected
1 parent f41e35c commit 971d7cc

File tree

5 files changed

+356
-157
lines changed

5 files changed

+356
-157
lines changed

source/docs/hardware/sensors/analog-potentiometers-hardware.rst

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,6 @@ As mentioned before, a potentiometer is a voltage divider, as shown in the circu
2323

2424
Since the circuit is symmetric, it is reversible - this allows the user to choose at which end of the travel the measured voltage is zero, and at which end it is 5 volts. To reverse the directionality of the sensor, it can simply be wired backwards! Be sure to check the directionality of your potentiometer with a multimeter to be sure it is in the desired orientation before soldering your wires to the contacts.
2525

26-
Absolute encoders
27-
-----------------
28-
29-
.. image:: images/analog-potentiometers-hardware/absolute-encoder-to-roborio.svg
30-
:alt: Connecting a US Digital MA3 Absolute Encoder to the roboRIO.
31-
32-
An "absolute encoder" is an encoder that measures the absolute position of the encoder shaft, rather than the incremental movement (as a :doc:`quadrature encoder <encoders-hardware>`) does. In this respect, absolute encoders are more similar to potentiometers than to incremental encoders. Many absolute encoders offer a simple analog output - these can be used exactly in the same way as a potentiometer, except their wiring is not generally reversible. Absolute encoders have the advantage of lacking a hard travel limit - the signal will simply reset when the shaft crosses the zero point. The analog potentiometer pictured above can be found at `AndyMark <https://www.andymark.com/products/absolute-encoder-with-cable>`__.
33-
34-
Absolute encoders that do not offer a simple analog output require :doc:`more complicated communications with the RIO <serial-buses>`.
35-
36-
3726
Footnotes
3827
---------
3928

source/docs/hardware/sensors/encoders-hardware.rst

Lines changed: 94 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,66 +5,108 @@ Encoders - Hardware
55

66
.. note:: This section covers encoder hardware. For a software guide to encoders, see :ref:`docs/software/hardware-apis/sensors/encoders-software:Encoders - Software`.
77

8-
Quadrature encoders are by far the most common method for measuring rotational motion in FRC\ |reg|, and for good reason - they are cheap, easy-to-use, and reliable. As they produce digital signals, they are less-prone to noise and interference than analog devices (such as :doc:`potentiometers <analog-potentiometers-hardware>`).
9-
10-
The term "quadrature" refers to the method by which the motion is measured/encoded. A quadrature encoder produces two square-wave pulses that are 90-degrees out-of-phase from each other, as seen in the picture below:
11-
12-
.. image:: /docs/software/hardware-apis/sensors/images/encoders-software/encoding-direction.png
13-
:alt: The signal pattern in both directions and how using two channels allows us to tell the direction.
14-
15-
Thus, across both channels, there are four total "edges" per period (hence "quad"). The use of two out-of-phase pulses allows the direction of motion to be unambiguously determined from which pulse "leads" the other.
16-
17-
As each square wave pulse is a digital signal, quadrature encoders connect to the :doc:`digital input <digital-inputs-hardware>` ports on the RIO.
8+
Encoders are by far the most common method for measuring rotational motion in FRC\ |reg|, and for good reason - they are cheap, easy-to-use, and reliable. As they produce digital signals, they are less-prone to noise and interference than analog devices (such as :doc:`potentiometers <analog-potentiometers-hardware>`).
189

1910
Types of Encoders
2011
-----------------
2112

22-
There are three types of quadrature encoders typically used in FRC:
13+
There are three main ways encoders connect physically that are typically used in FRC:
2314

2415
- `Shafted encoders`_
2516
- `On-shaft encoders`_
2617
- `Magnetic encoders`_
2718

2819
These encoders vary in how they are mounted to the mechanism in question. In addition to these types of encoders, many FRC mechanisms come with quadrature encoders integrated into their design.
2920

30-
Shafted encoders
21+
There are also three main ways the encoder data is communicated that are typically used in FRC:
22+
23+
- `Quadrature encoders`_
24+
- `Duty Cycle encoders`_
25+
- `Analog encoders`_
26+
27+
.. note:: Some encoders may support more then one communication method
28+
29+
Shafted Encoders
3130
^^^^^^^^^^^^^^^^
3231

3332
.. image:: images/encoders-hardware/greyhill-63r-encoder.svg
3433
:alt: Diagram of the Greyhill 63R Optical Encoder.
3534
:width: 400
3635

37-
Shafted encoders have a sealed body with a shaft protruding out of it that must be coupled rotationally to a mechanism. This is often done with a helical beam coupling, or, more cheaply, with a length of flexible tubing (such as surgical tubing or pneumatic tubing), fastened with cable ties and/or adhesive at either end. Many commercial off-the-shelf FRC gearboxes have purpose-built mounting points for shafted encoders, such as the popular `Grayhill 63r <https://www.grayhill.com/documents/63R-Datasheet>`__, pictured above.
36+
Shafted encoders have a sealed body with a shaft protruding out of it that must be coupled rotationally to a mechanism. This is often done with a helical beam coupling, or, more cheaply, with a length of flexible tubing (such as surgical tubing or pneumatic tubing), fastened with cable ties and/or adhesive at either end. Many commercial off-the-shelf FRC gearboxes have purpose-built mounting points for shafted encoders.
3837

39-
On-shaft encoders
38+
Examples of shafted encoders:
39+
40+
- `Grayhill 63r <https://www.grayhill.com/documents/63R-Datasheet>`__
41+
- `US Digital MA3 <https://www.usdigital.com/products/encoders/absolute/shaft/ma3/>`__
42+
43+
On-shaft Encoders
4044
^^^^^^^^^^^^^^^^^
4145

4246
.. image:: images/encoders-hardware/amt10x-encoders.svg
4347
:alt: Diagram of the AMT103 and the AMT102 shaft encoders.
4448
:width: 600
4549

46-
On-shaft encoders (such as the `AMT103-V <https://www.cuidevices.com/product/motion/rotary-encoders/incremental/modular/amt10-v-kit/amt103-v>`__ available through FIRST Choice) couple to a shaft by fitting *around* it, forming a friction coupling between the shaft and a rotating hub inside the encoder.
50+
On-shaft encoders couple to a shaft by fitting *around* it, forming a friction coupling between the shaft and a rotating hub inside the encoder.
51+
52+
Examples of On-shaft encoders:
4753

48-
Magnetic encoders
54+
- `AMT103-V <https://www.cuidevices.com/product/motion/rotary-encoders/incremental/modular/amt10-v-kit/amt103-v>`__ available through FIRST Choice
55+
- `REV Through Bore Encoder <https://www.revrobotics.com/rev-11-1271/>`__
56+
- `US Digital E4T <https://www.andymark.com/products/e4t-oem-miniature-optical-encoder-kit>`__
57+
58+
Magnetic Encoders
4959
^^^^^^^^^^^^^^^^^
5060

5161
.. image:: images/encoders-hardware/ctre-magnetic-encoder.png
5262
:alt: Picture of the CTRE Mag Encoder.
5363
:width: 400
5464

55-
Magnetic encoders require no mechanical coupling to the shaft at all; rather, they track the orientation of a magnet fixed to the shaft. The `CTRE Mag Encoder <https://store.ctr-electronics.com/srx-mag-encoder/>`__ is a popular option, with many FRC products offering built-in mounting options for it. While the no-contact nature of magnetic encoders can be handy, they often require precise construction in order to ensure that the magnet is positioned correctly with respect to the encoder.
65+
Magnetic encoders require no mechanical coupling to the shaft at all; rather, they track the orientation of a magnet fixed to the shaft. While the no-contact nature of magnetic encoders can be handy, they often require precise construction in order to ensure that the magnet is positioned correctly with respect to the encoder.
66+
67+
Examples of magnetic encoders:
68+
69+
- `CTRE Mag Encoder <https://store.ctr-electronics.com/srx-mag-encoder/>`__
70+
- `Thrifty Absolute Magnetic Encoder <https://www.thethriftybot.com/bearings/Thrifty-Absolute-Magnetic-Encoder-p421607500>`__
71+
- `Team 221 Lamprey2 <https://www.andymark.com/products/lamprey-absolute-encoder>`__
72+
73+
74+
Quadrature Encoders
75+
^^^^^^^^^^^^^^^^^^^
76+
77+
The term "quadrature" refers to the method by which the motion is measured/encoded. A quadrature encoder produces two square-wave pulses that are 90-degrees out-of-phase from each other, as seen in the picture below:
78+
79+
.. image:: /docs/software/hardware-apis/sensors/images/encoders-software/encoding-direction.png
80+
:alt: The signal pattern in both directions and how using two channels allows us to tell the direction.
81+
82+
Thus, across both channels, there are four total "edges" per period (hence "quad"). The use of two out-of-phase pulses allows the direction of motion to be unambiguously determined from which pulse "leads" the other.
83+
84+
As each square wave pulse is a digital signal, quadrature encoders connect to the :doc:`digital input <digital-inputs-hardware>` ports on the roboRIO.
5685

57-
Encoder Wiring
58-
--------------
86+
Examples of quadrature encoders:
87+
88+
- `AMT103-V <https://www.cuidevices.com/product/motion/rotary-encoders/incremental/modular/amt10-v-kit/amt103-v>`__ available through FIRST Choice
89+
- `CTRE Mag Encoder <https://store.ctr-electronics.com/srx-mag-encoder/>`_
90+
- `Grayhill 63r <https://www.grayhill.com/documents/63R-Datasheet>`__
91+
- `REV Through Bore Encoder <https://www.revrobotics.com/rev-11-1271/>`__
92+
- `US Digital E4T <https://www.andymark.com/products/e4t-oem-miniature-optical-encoder-kit>`__
93+
94+
Quadrature Encoder Wiring
95+
~~~~~~~~~~~~~~~~~~~~~~~~~~
5996

6097
.. image:: images/digital-inputs-hardware/e4t-oem-miniature-optical-encoder-to-roborio.svg
6198
:alt: Wiring the E4T Optical Encoder to two DIO ports.
6299
:width: 400
63100

64-
Encoders that need two digital inputs, such as the `E4T OEM Miniature Optical Encoder <https://www.andymark.com/products/e4t-oem-miniature-optical-encoder-kit>`__, can be wired to two digital input ports. Other encoders, such as the on-shaft ones shown above, often need :doc:`an analog input port <analog-inputs-hardware>`. CTRE Magnetic encoders shown above can be wired to a :ref:`TalonSRX data port <docs/hardware/sensors/serial-buses:CAN Bus>` with a ribbon cable.
101+
Quadrature Encoders, such as the `E4T OEM Miniature Optical Encoder <https://www.andymark.com/products/e4t-oem-miniature-optical-encoder-kit>`__, can be wired to two digital input ports as shown above.
102+
103+
Index
104+
~~~~~
65105

66-
Encoder Resolution
67-
------------------
106+
Some quadrature encoders have a third index pin which pulses when the encoder completes a revolution.
107+
108+
Quaderature Encoder Resolution
109+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68110

69111
.. warning:: The acronyms "CPR" and "PPR" are *both* used by varying sources to denote both edges per revolution *and* cycles per revolution, so the acronym alone is not enough to tell which is of the two is meant when by a given value. When in doubt, consult the technical manual of your specific encoder.
70112

@@ -77,3 +119,33 @@ As encoders measure rotation with digital pulses, the accuracy of the measuremen
77119
Thus, a resolution stated in edges per revolution has a value four times that of the same resolution stated in cycles per revolution.
78120

79121
In general, the resolution of your encoder in edges-per-revolution should be somewhat finer than your smallest acceptable error in positioning. Thus, if you want to know the mechanism plus-or-minus one degree, you should have an encoder with a resolution somewhat higher than 360 edges per revolution.
122+
123+
Duty Cycle Encoders
124+
^^^^^^^^^^^^^^^^^^^
125+
126+
.. image:: /docs/software/hardware-apis/sensors/images/encoders-software/encoding-direction.png
127+
:alt: The PWM signal pattern for minimum and maximum angles.
128+
129+
Duty cycle encoders connect to a single digital input on the roboRIO. They output a pulse where the length of a pulse is proportional to the absolute position of the encoder.
130+
131+
Examples of duty cycle encoders:
132+
133+
- `AndyMark Mag Encoder <https://www.andymark.com/products/am-mag-encoder>`__
134+
- `CTRE Mag Encoder <https://store.ctr-electronics.com/srx-mag-encoder/>`__
135+
- `REV Through Bore Encoder <https://www.revrobotics.com/rev-11-1271/>`__
136+
- `Team 221 Lamprey2 <https://www.andymark.com/products/lamprey-absolute-encoder>`__
137+
- `US Digital MA3 <https://www.usdigital.com/products/encoders/absolute/shaft/ma3/>`__
138+
139+
Analog Encoders
140+
^^^^^^^^^^^^^^^
141+
142+
.. image:: images/encoders-hardware/absolute-encoder-to-roborio.svg
143+
:alt: The connection of a US Digital MA3 Analog encoder to the roboRIO analog input.
144+
145+
Analog encoders connect to a analog input on the roboRIO. They output a voltage proportional to the absolute position of the encoder.
146+
147+
Examples of analog encoders:
148+
149+
- `Team 221 Lamprey2 <https://www.andymark.com/products/lamprey-absolute-encoder>`__
150+
- `Thrifty Absolute Magnetic Encoder <https://www.thethriftybot.com/bearings/Thrifty-Absolute-Magnetic-Encoder-p421607500>`__
151+
- `US Digital MA3 <https://www.usdigital.com/products/encoders/absolute/shaft/ma3/>`__

0 commit comments

Comments
 (0)