CANCoder User's Guide
CANCoder User's Guide
com 02/13/2023
CANCoder
User’s Guide
Revision 1.4
www.ctr-electronics.com
Table of Contents
1. Device description ........................................................................................................................................................................ 4
1.1. Kit Contents........................................................................................................................................................................... 4
1.2. Features ................................................................................................................................................................................ 4
1.3. Electrical Specifications ......................................................................................................................................................... 5
1.4. Magnet Specification ............................................................................................................................................................ 5
1.5 General Specification ............................................................................................................................................................. 5
1.6. LED States ............................................................................................................................................................................. 6
1.6.1. Dim Rapid-Blink LED ...................................................................................................................................................... 7
1.6.2 LED Behavior on Boot ..................................................................................................................................................... 7
2. Installation .................................................................................................................................................................................... 8
2.1. Magnet Placement ................................................................................................................................................................ 9
Figure 2.1.1. ............................................................................................................................................................................ 9
Figure 2.1.2. ............................................................................................................................................................................ 9
2.2. Wiring.................................................................................................................................................................................. 10
2.3. Encoder Mounting .............................................................................................................................................................. 11
2.4. Confirming Proper Installation ............................................................................................................................................ 11
3. Modifications to COTS Components ........................................................................................................................................... 12
3.1. AndyMark Toughbox Mini (am-0654) ................................................................................................................................. 12
3.1.1. Extrusion removal ....................................................................................................................................................... 12
3.1.2. Facing Off the Shaft End .............................................................................................................................................. 13
3.1.3. Boring the Magnet Pocket ........................................................................................................................................... 14
3.1.4. Mounting the Encoder ................................................................................................................................................ 15
3.1.5. Verifying Magnet Placement. ...................................................................................................................................... 16
3.2. VEX PRO Single Speed Double Reduction Gearbox (217-2454) .......................................................................................... 17
3.2.1. Extrusion removal ....................................................................................................................................................... 17
3.2.2. Facing Off The Shaft End ............................................................................................................................................. 18
3.2.3. Boring the Magnet Pocket ........................................................................................................................................... 19
3.2.4. Mounting the Encoder ................................................................................................................................................ 20
3.2.5. Verifying Magnet Placement. ...................................................................................................................................... 21
4. FAQ ............................................................................................................................................................................................. 22
4.1. Is there a way to tell if the sensor is present/powered? ..................................................................................................... 22
5. Mechanical Drawings .................................................................................................................................................................. 22
6. Errata .......................................................................................................................................................................................... 23
6.1. Fix for Too-Long Housing Tab .............................................................................................................................................. 23
7. Revision History .......................................................................................................................................................................... 24
It is our intention to provide our valued customers with the best documentation possible to
ensure successful use of your CTRE products. To this end, we will continue to improve our
publications, examples, and support to better suit your needs.
If you have any questions or comments regarding this document, or any CTRE product, please
contact [email protected]
1. Device description
The CTR CANCoder is a rotary sensor that can be used to measure rotational position and velocity. The device
senses the magnetic field of a diametrically polarized magnet to determine rotational position with 12 bit
precision. The device is capable of providing a relative position measurement and an absolute position
measurement simultaneously over the CAN bus.
1.2. Features
• Tri-color LED indicator for magnetic field strength and CAN connectivity
• Conformal coating helps protect against foreign body debris (FOD)
• Built in ESD protection diodes
• Measures both absolute and relative positioning.
Yellow/Green Bright --- --- Device is in boot-loader, most likely because field-
upgrade failed in middle of event.
Red/Green Bright --- --- Device has Phoenix Pro firmware and is unlicensed.
Slow Red Blink Bright CAN bus has been lost. --- Check CAN Bus health and connection to the
(Section 1.5.1) CANCoder.
Rapid Red Blink Dim CAN bus never detected Magnet is out of range (<25mT or >135mT).
since boot (Section 1.5.1)
Rapid Yellow Blink Dim CAN bus never detected Magnet in range with slightly reduced accuracy (25-45mT or 75-
since boot (Section 1.5.1) 135mT).
Rapid Green Blink Dim CAN bus never detected Magnet in range (between 45mT – 75mT).
since boot (Section 1.5.1)
Rapid Red Blink Bright CAN bus present Magnet is out of range (<25mT or >135mT).
Rapid Yellow Blink Bright CAN bus present Magnet in range with slightly reduced accuracy (25-45mT or 75-
135mT).
Rapid Green Blink Bright CAN bus present Magnet in range (between 45mT – 75mT).
However it may be useful to indicate the magnet field strength during prototyping / hardware-bring up, even if
CAN-bus is not wired. If CANCoder does not detect CAN bus for 8 seconds after boot, LED state will transition from
slow blink red to the dim rapid-blink patterns for Magnet Strength. This allows magnet placement to be verified
without requiring a CAN bus. If CAN bus is detected at any time, CANCoder will leave and never re-enter the dim
LED mode without a full power cycle.
2. Installation
Proper alignment of the magnet, rotary shaft and encoder is necessary to ensure reliable performance. The
magnet should be placed at the end of a rotary shaft so that the magnet, shaft and encoder are coaxial. The
encoder will tolerate some eccentricity, however steps should be taken to ensure that the magnet is concentric to
the shaft and encoder. If a nonferrous shaft is used it is recommended that an adhesive is used to keep the
magnet from rotating inside the rotary shaft. A press fit may be used to avoid this, however the magnet material is
brittle and can be damaged if a tight press fit is required.
Although similar to the CTRE “Magnetic Encoder”, the CANCoder requires CAN bus and power leads to be wired to
the CANCoder circuit board. This is also covered in the sections below.
LED color Minimum distance from detent Maximum distance from detent “Z”
Rapid Red Blink NA >2.95mm (.116”)
Rapid Yellow Blink 0.0mm 2.95mm (.116”)
Rapid Green Blink .75mm (.030”) 1.5mm (.059”)
This table assumes the use of supplied magnet. If a different magnet is used, the LED may be used to determine correct distancing.
Figure 2.1.1.
Rotary Shaft
Magnet
Housing Detent
The magnet’s center axis must be aligned within an offset radius Rd of 0.25mm (.009”) from the defined center of
the encoder housing, see Figure 2.2. This is the recommendation from the silicon manufacturer. The ideal
application would have the magnet, rotary shaft and encoder all coaxial. However, the encoder will function
without any noticeable performance loss if this tolerance cannot be held.
Figure 2.1.2.
2.2. Wiring
The CANCoder printed circuit board features six through-holes to make soldering easier.
Note the CAN H and CAN L lines each have two through-holes. This allows two CAN
bus pigtails, each with a CANH/CANL pair.
Strip ~20 AWG wire and pass through the 100mil through-hole.
Once all six wires are solder in, the should package with the enclosure, see image below for reference.
Figure 3.1.
.250” Extrusion
Figure 3.1.1.
Figure 3.1.2.1.
Figure 3.1.2.2.
Figure 3.1.3.1.
Figure 3.1.3.2.
Figure 3.1.5.
Figure 3.2.
.250” Extrusion
Figure 3.2.1.
Figure 3.2.2.1
Figure 3.2.2.2
Figure 3.2.3.1
Figure 3.2.3.2
Figure 3.2.5.1
4. FAQ
4.1. Is there a way to tell if the sensor is present/powered?
To determine visually if the sensor is powered and functioning, check the built-in LED, see Section 1.5.
5. Mechanical Drawings
6. Errata
6.1. Fix for Too-Long Housing Tab
Some units in Fall of 2022 include a housing that has a tab that is too long.
This prevents wires from passing through the housing as intended.
Fix:
If the housing included with your CANcoder has a too-long tab (as shown on the left of Figure 6.1.1), use diagonal cutters to cut
the tab to the length shown on the right of Figure 6.1.1.
7. Revision History
Revision Date Description