CTR Electronics CANCoder Cross The Road Electronics User Guide
- June 5, 2024
- CTR Electronics
Table of Contents
CTR Electronics CANCoder Cross The Road Electronics
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.
Kit Contents
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.
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
Magnat Specifications
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 |
General Specification
Parameter | Condition | Max | Unit |
---|
Discrepancy between Absolute
Position and Regular Position.[1]
| CANCoder is still when booting| 0.1| degrees
CANCoder is rotating < 60 RPM| 1.44| degrees
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
Brightness
| CAN Bus detection| Magnet Field
Strength
| Description
---|---|---|---|---
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.
Slow Red Blink| Bright| CAN bus has been lost. (Section 1.5.1)| —| Check CAN Bus health and connection to the 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
since boot (Section 1.5.1)
| Magnet is out of range (<25mT or >135mT).
Rapid Yellow Blink| Dim| CAN bus never detected since boot (Section
1.5.1)| Magnet in range with slightly reduced accuracy (25-45mT or 75-
135mT).
Rapid Green Blink| Dim| CAN bus never detected
since boot (Section 1.5.1)
| Magnet in range (between 45mT – 75mT).
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).
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.
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:
- Boot to Zero (relative mode) – CANCoder will immediately begin blinking according to the LED table in section 1.6
- 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
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.
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”)
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.
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.
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.
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.
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.
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.
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”).
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.
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.
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.
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.
Note – Image shows a CTRE Mag Encoder, however CANCoder also displays color LED indicating magnet field strength.
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.
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”).
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.
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.
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.
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.
FAQ
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.
Mechanical Drawings
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