0% found this document useful (0 votes)
34 views

CANCoder User's Guide

Uploaded by

dehoxa5754
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

CANCoder User's Guide

Uploaded by

dehoxa5754
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

CANCoder User’s Guide www.ctr-electronics.

com 02/13/2023

CANCoder
User’s Guide
Revision 1.4

Cross The Road Electronics

www.ctr-electronics.com

Cross The Road Electronics Page 1 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

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

Cross The Road Electronics Page 2 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

TO OUR VALUED CUSTOMERS

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]

To obtain the most recent version of this document, please visit


www.ctr-electronics.com.

Cross The Road Electronics Page 3 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

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.1. Kit Contents

Clear ABS housing .25”x .5” diametrically polarized magnet. CANCoder

2 x 3-48 machine screws for mounting.


1 x 2-28x7/16” housing screw.
*packaged inside of housing

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.

Cross The Road Electronics Page 4 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

1.3. Electrical Specifications

Symbol Parameter Condition Min Typ Max Unit


Tamb Ambient temperature -40 +85 °C
Isupp Supply Current DC supply 12.0V 50 60 mA
Vdd Supply voltage 6.0 12.0 16.0 V
ESD Rating
ESD Protection Contact Discharge ±30 kV
ESD Protection Air-Gap Discharge ±30 kV
Resolution
CPR Counts per revolution 4096
Output
Vmax Rotational Velocity 15000 RPM

1.4. Magnet Specification

Parameter Condition Value Unit


Length ±0.004 .500 INCH
Diameter ±0.004 .250 INCH
Material Grade N42 NdFeB
Plating Nickel
Magnetization Direction Diametrical
Weight .106 OUNCE
Surface Field 6898 GAUSS
Max Operating Temperature 176° F
Brmax (Residual Induction) 13200 GAUSS
BHmax (Maximum Energy Product) 42 MGOe

1.5 General Specification

Parameter Condition Max Unit


Discrepancy between Absolute CANCoder is still when booting 0.1 degrees
Position and Regular Position.[1] CANCoder is rotating < 60 RPM 1.44 degrees

Note 1: CANCoder is configured to boot to absolute position

Cross The Road Electronics Page 5 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

1.6. LED States


The CANCoder features a tri color LED that indicates magnetic field strength and CAN bus health. This feature can
be used to confirm proper magnet distancing and proper CAN bus wiring. The table below shows the possible
color states and their respective magnetic field strength.
LED Color LED CAN Bus detection Magnet Description
Brightness Field
Strength

Off --- --- --- CANCoder is not powered/ plugged in.


Check power cabling to the CANCoder.

Yellow/Green Bright --- --- Device is in boot-loader, most likely because field-
upgrade failed in middle of event.

Inspect CAN bus wiring and re-field-upgrade using


Phoenix Tuner.

If device has valid firmware, turn device off, wait 10


seconds, and turn device on to boot strap it.

Red/Green Bright --- --- Device has Phoenix Pro firmware and is unlicensed.

Either connect this device to a Phoenix Pro licensed


CANivore, apply a Phoenix Pro device license, or
change firmware to use Phoenix v5.

Slow Red Blink Bright CAN bus has been lost. --- Check CAN Bus health and connection to the
(Section 1.5.1) CANCoder.

If the goal is simply to test magnet placement, wait 8


seconds and use the dim rapid blink LED patterns.

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).

Cross The Road Electronics Page 6 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

1.6.1. Dim Rapid-Blink LED


In a typical setup, if the CAN bus is not healthy, the CANCoder will slow blink red, regardless of the magnet field
strength. This is ideal in most circumstances because a wiring/CAN-bus issue must be addressed first for successful
operation.

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.

1.6.2 LED Behavior on Boot


Immediately when CANCoder powers up, it will hold solid orange LEDs to indicate it has begun operation.
Following that, it will do one of the following depending on its initialization strategy:
1. Boot to Zero (relative mode) – CANCoder will immediately begin blinking according to the LED table in section 1.6
2. Boot to Absolute – CANCoder will go solid red LED as it seeds its position register to the absolute position. If the magnet is
too far away the LED will be solid red for up to 500ms.[1]
Note 1: This applies for CANCoder firmware > 22.0.1

Cross The Road Electronics Page 7 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

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.

Cross The Road Electronics Page 8 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

2.1. Magnet Placement


The typical distance “Z” between the magnet and the housing detent, as illustrated in Figure 2.1, is .75mm (.030)
to 1.5mm (.059”). The table below shows the relationship between LED color and magnet Z distance.

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.

Cross The Road Electronics Page 9 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

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.

Tin the exposed portion of the wire-lead, until solder hole


completely fills with solder. Cut the excess lead with diagonal
cutters.

Once all six wires are solder in, the should package with the enclosure, see image below for reference.

Cross The Road Electronics Page 10 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

2.3. Encoder Mounting


The encoder should be mounted to a surface that is rigid and in a fixed position relative to the magnet and rotary
shaft. A center hole is not required provided the material the encoder is mounted to has a relative magnetic
permeability similar to air (~1.0). Aluminum and most plastics meet this requirement.

2.4. Confirming Proper Installation


When properly installed, the LED should be green. A yellow LED is acceptable however there is less tolerance to
mechanical deviation that may cause the Z distance to change, as this state is farther away from ideal. The LED
should remain green through the shafts full range of motion and speed. If the LED transitions or “blips” a color
other than green, confirm that the mechanical relationship between the encoder, shaft and magnet are consistent.
This can be done through manual movement of the components until the cause is isolated. Determine whether
the problem is shaft end play, encoder mounting or magnet installation.

Cross The Road Electronics Page 11 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

3. Modifications to COTS Components


There are several companies that make commercial off the shelf, or COTS, transmissions and gear boxes. Some of
these components contain interfaces for optical or shaft type encoders. This section describes modifications of
two COTS transmissions, the AndyMark Toughbox Mini (am-0654) and the VEX PRO Single Speed Double Reduction
gearbox (217-2454). Both gearboxes require modification to the output shaft.

3.1. AndyMark Toughbox Mini (am-0654)


The output shaft of the Toughbox Mini features a .250” diameter extrusion located at the housing side of the
gearbox Figure 3.1. This extrusion needs to be removed before boring the pocket that will house the magnet. The
recommended tools for this procedure are: lathe, .250” drill bit, dial calipers, parting tooling and a cutting tool for
facing off the end of the shaft. A hacksaw or cutoff wheel may be used in place of the parting tool. This user
manual is not intended to be a substitute for proper training and use of machinery. A lathe can be the most
dangerous piece of machinery in a shop. Please exercise caution and follow recommended safety procedures for
your particular piece of equipment. The shaft pictured is from a CIMple box. The procedure for both the
Toughbox Mini and CIMple box are the same.

Figure 3.1.

.250” Extrusion

3.1.1. Extrusion removal


The first step is to remove the .250” extrusion from the output shaft. Figure 3.1.1 illustrates how a parting tool
and a lathe can be used for this task. Completely remove the extrusion so that only a small portion of the .250”
diameter is remaining (about ~.020” - .050”).

Figure 3.1.1.

Cross The Road Electronics Page 12 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

3.1.2. Facing Off the Shaft End


Once the Extrusion has been removed, the end of the shaft will need to have a smooth even surface. This will
make the following steps go smoother. Using a facing tool, turn the face of the shaft down until it is smooth and
all of the remaining .250” extrusion is removed. Figure 3.1.2.1 illustrates the tooling used for this step. Figure
3.1.2.2 shows what the shaft should look like after this step has been completed.

Figure 3.1.2.1.

Figure 3.1.2.2.

Cross The Road Electronics Page 13 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

3.1.3. Boring the Magnet Pocket


After the shaft has been faced, a pocket will need to be bored to house the magnet. The depth of this pocket is
determined by the distance the encoder is located from the magnet. For the stock mounting location the pocket
should be deep enough so the magnet is flush with the outside of the plastic housing after assembly. A bore depth
of ~ .350” should be sufficient. This of course is dependent on how much material was removed during step 3.1.2.
A centering drill should be used to start the hole prior to boring with a .250” drill. If the hole is bored too deep,
shims may be placed inside the pocket to correct the over bore. The goal is the make the final seated depth of the
magnet so that the face is flush with the encoder housing (not the detent). Figure 3.1.3.1 shows the final hole
being bored with a .250” drill. Figure 3.1.3.2 shows the output shaft with all the necessary modifications and
magnet installed.

Figure 3.1.3.1.

Figure 3.1.3.2.

Cross The Road Electronics Page 14 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

3.1.4. Mounting the Encoder


After the shaft has been completely modified, the encoder housing should be mounted using the two supplied 3-
48 machine screws (Figure 3.1.4.1). Next place the encoder inside the housing (Figure 3.1.4.2). Insert the data
cable (sold separately) then place the housing cover and secure it with the supplied 2-28 x 7/16” screw (Figure
3.1.4.3). DO NOT OVER TIGHTEN THE 2-28 SCREW AS THIS MAY RESULT IN PERMANENT DAMAGE TO THE
HOUSING. HAND TIGHTEN UNTIL RESISTANCE IS FELT.

Figure 3.1.4.1. Figure 3.1.4.2.

Note – Image shows a CTRE Mag Encoder,


Figure 3.1.4.3. however CANCoder mounting is identical.

Note – Image shows a CTRE Mag Encoder,


however CANCoder mounting is identical.

Cross The Road Electronics Page 15 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

3.1.5. Verifying Magnet Placement.


Once the CANCoder has been installed, magnet placement should be verified. A properly distanced magnet should
result in a green LED at all speeds and positions. This test only requires the CANCoder to be powered. Wait 8
seconds after boot if CAN bus is not wired (to use the dim-rapid LED pattern - Section 1.5.1). Verify the LED is
green. If the LED is yellow the encoder will still perform with a small reduction in accuracy. If the LED is red, the
magnet is either too close or too far away from the encoder. Using the supplied magnet, the LED should only be
red if the magnet is too far away. This is only true when the encoder is mounted in its supplied housing. Increase
or decrease the magnet distance until the LED is green. Once magnet position is confirmed, the magnet should be
secured using Loctite or epoxy. Loctite/Epoxy is usually not necessary for steel shafts.

Figure 3.1.5.

Note – Image shows a CTRE Mag Encoder,


however CANCoder also displays color LED
indicating magnet field strength.

Cross The Road Electronics Page 16 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

3.2. VEX PRO Single Speed Double Reduction Gearbox (217-2454)


The output shaft of the VEX pro Gearbox has a .250” diameter extrusion located at the housing side of the gearbox
Figure 3.2. This extrusion needs to be removed before boring the pocket that will house the magnet. The
recommended tools for this procedure are: lathe, .250” drill bit, dial calipers, parting tooling and a cutting tool for
facing off the end of the shaft. A hacksaw or cutoff wheel may be used in place of the parting tool. This user
manual is not intended to be a substitute for proper training and use of machinery. A lathe can be the most
dangerous piece of machinery in a shop. Please exercise caution and follow recommended safety procedures for
your particular piece of equipment.

Figure 3.2.

.250” Extrusion

3.2.1. Extrusion removal


The first step is to remove the .250” extrusion from the output shaft. Figure 3.2.1 illustrates how a parting tool
and a lathe can be used for this task. Completely remove the extrusion so that only a small portion of the .250”
diameter is remaining (about ~.020” - .050”).

Figure 3.2.1.

Cross The Road Electronics Page 17 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

3.2.2. Facing Off The Shaft End


Once the Extrusion has been removed, the end of the shaft will need to have a smooth even surface. This will
make the following steps go smoother. Using a facing tool, turn the face of the shaft down until it is smooth and
all of the remaining .250” extrusion is removed. Figure 3.2.2.1 illustrates the tooling used for this step. Figure
3.2.2.2 show’s what the shaft should look like after this step has been completed.

Figure 3.2.2.1

Figure 3.2.2.2

Cross The Road Electronics Page 18 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

3.2.3. Boring the Magnet Pocket


After the shaft has been faced, a pocket will need to be bored to house the magnet. The depth of this pocket is
determined by the distance the encoder is located from the magnet. For the stock mounting location the pocket
should be deep enough so the magnet is flush with the outside of the gearbox plastic housing after assembly. A
bore depth of ~ .380” should be sufficient. This of course is dependent on how much material was removed during
step 3.2.2. A centering drill should be used to start the hole prior to boring with a .250” drill. If the hole is bored
too deep, shims may be placed inside the pocket to correct the over bore. The goal is to make the final seated
depth of the magnet so that the face is flush with the encoder housing (not the detent). Figure 3.2.3.1 shows the
final hole being bored with a .250” drill. Figure 3.2.3.2 shows the output shaft with all the necessary modifications
and magnet installed.

Figure 3.2.3.1

Figure 3.2.3.2

Cross The Road Electronics Page 19 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

3.2.4. Mounting the Encoder


After the shaft has been completely modified, the encoder housing should be mounted using the two supplied 3-
48 machine screws (Figure 3.2.4.1). Next place the encoder inside the housing (Figure 3.2.4.2). Insert the data
cable (sold separately) then place the housing cover and secure it with the supplied 2-28 x 7/16” screw (Figure
3.2.4.3). DO NOT OVER TIGHTEN THE 2-28 SCREW AS THIS MAY RESULT IN PERMANENT DAMAGE TO THE
HOUSING. HAND TIGHTEN UNTIL RESISTANCE IS FELT.

Figure 3.2.4.1 Figure 3.2.4.2

Note – Image shows a CTRE Mag Encoder,


Figure 3.2.4.3 however CANCoder mounting is identical.

Note – Image shows a CTRE Mag Encoder,


however CANCoder mounting is identical.

Cross The Road Electronics Page 20 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

3.2.5. Verifying Magnet Placement.


Once the Encoder has been installed, magnet placement should be verified. A properly distanced magnet should
result in a green LED at all speeds and positions. This test only requires the CANCoder to be powered. Wait 8
seconds after boot if CAN bus is not wired (to use the dim-rapid LED pattern - Section 1.5.1). Verify the LED is
green. If the LED is yellow the encoder will still perform with a small reduction in accuracy. If the LED is red, the
magnet is either too close or too far away from the encoder. Using the supplied magnet the LED should only be
red if the magnet is too far away. This is only true when the encoder is mounted in its supplied housing. Increase
or decrease the magnet distance until the LED is green. Once magnet position is confirmed, the magnet should be
secured using Loctite or epoxy.

Figure 3.2.5.1

Note – Image shows a CTRE Mag Encoder,


however CANCoder also displays color LED
indicating magnet field strength.

Cross The Road Electronics Page 21 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

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

Cross The Road Electronics Page 22 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

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.

Figure 6.1.1: Bad vs Good CANcoder Housing

Cross The Road Electronics Page 23 02/13/2023


CANCoder User’s Guide www.ctr-electronics.com 02/13/2023

7. Revision History
Revision Date Description

1.0 02-Dec-2019 Initial Creation.

1.1 23-Jan-2020 Added Max RPM

1.2 31-March-2022 Added general specifications & LED Boot behavior

1.3 03-Nov-2022 Added Errata Section

1.4 13-Feb-2023 Added Phoenix Pro unlicensed LED state

Cross The Road Electronics Page 24 02/13/2023

You might also like