Encoders for Kitbot Drivetrain

Hey CD,

Team 5811 is back for another year of kitbot drive train use. I’m wondering what the best option is for drivetrain encoders for the kitbot. I have already read this thread, but I was hoping to hear about best practices and experience for integrating encoders with the Toughbox Mini.

Also, these encoders are being offered in FIRST Choice again this year, and are well recommended. Have you used them on the kit gearboxes? If so, how did you mount them and how did they work? Thanks!

That thread leaves out a new challenger: the CTRE Magnetic Encoder. http://www.andymark.com/SRX-MAG-Encoder-p/am-3445.htm

A magnet is in the box and you can do a little lathe work to get them to replace the encoder mounting nub on a TB Mini’s output shaft. Or you can just buy a new shaft with the magnet installed and the mounting kit.

Iron Kings took the former route and had minimal trouble across two robots driving around. Only issue we had was when one shaft on one gearbox would slide out of its expected place (and you could see it on the outer plate, so it was definitely not an encoder problem but we never tore into the gearbox to diagnose). I would totally do it again.

We used the CTRE Mag encoder with the Andymark magnetic shaft during TIGER.

To mount the encoder we 3d printed this spacer, which has holes for screws to mount to both the encoder and the gearbox, while keeping the encoder out of the way of the CIMs and at the right distance from the magnet.

Cool, that mounting kit looks like a simple solution, and luckily our team has access to a lathe. However, our team does not use Talon SRX’s so how exactly do we get the output from an encoder like the CTRE Magnetic Encoder to the roboRio?

These products seem just to describe how to connect an encoder to the Talon SRX. Do you use the same breakout board to get from the 10 pin encoder to the roboRio? In that case, is there any wiring to do from there?

Talon SRXs are really what they’re designed for, and it’s an excellent combination. (And they’re in FIRST Choice!)

That said, the pinout is documented (PDF link, page 6, section 1.3) and CTRE has a breakout module.

In order to wire from the 10 pin connector of the SRX mag encoder to the digital I/O’s on the RoboRIO, you should aim to wire it as a quadrature encoder. This means you will need 4 lines: 5V power, Ground, Quadrature Channel A, and Quadrature Channel B. From page 6 here:

You can see that pins 2, 5, 7, and 10 will allow you to get relative position, by treating the sensor as a quadrature encoder. This would be sufficient for drive train applications like “drive a certain distance in auton” or if you want to know your speed. This diagram I found on another post should explain how wiring a quadrature encoder to the RoboRIO is done:

The SRX mag encoder is a good option.

Another option I would recommend would be sealed shaft optical encoders. For example:

Notice how all of those have 4 pins. Those all match the same wiring as the SRX mag encoder referenced above.

You can use a piece of surgical tubing with zip ties to couple the encoder’s shaft to the rotation of a 1/4" diameter nub on the drive gearbox shaft, as shown here (blue is the sensor, surgical tubing is the black):

As compared to a rigid coupler, the surgical tubing method is more forgiving of misalignment. That forgiveness is useful in a short FRC build season…one less thing you have to get exactly right.

On my current team we have used the AMT encoder successfully on the TB mini for the last 3 years and are still using the pair. We mount them with the 3M tape included in the KOP. The included tools make it easy to install in proper alignment.

+1 to this. Used 3M foam tape to mount the AMT encoders on KOP TB mini. We found that you have to mount them at an angle so they don’t interfere with the CIM locations.

My team is currently using sparks; is there a similar sort of “good combination” encoder not specifically for SRXs?

Now that Jaguars are no longer supported via CAN, the SRX is the only brushed motor controller which is a specifically “good combination” with specific encoders. When using a PWM brushed motor controller (e.g. SPARK), the key things to look for in an encoder are:

  • How can you mount it to your drive/manipulator?
  • What is the angular resolution (ticks per rotation)?
  • Can I interface it to the RIO DIOs and/or an external (e.g. CAN) sensor board?

In my experience, for FRC the toughest of these criteria is the first. Consider your motor and gearbox, and look for encoders which will engage it. As a few examples: If you’re using something in the AM toughbox series, consider the “E4P-250 and E4T series encoders” and the SRX encoder which are designed to work with the TB backshaft. If you’re using a Versaplanetary, consider the VP encoder stage. If you’re using an AM PG motor or NeveRest, consider the encoders built in to the system. Among these, look for one which meets the other two requirements. Also consider how many ports each encoder requires - most quadrature encoders require two DIOs, though if there’s an index channel, that’s a third. Some absolute encoders do not require any DIOs, but do require an analog input. Designing for the RIO, there are few if any encoders you are likely to select which will overload the hardware, but if you are designing for a slower chip (e.g. arduino), you need to check that the encoder will not send pulses faster than the processor can track.

Does anyone have photos of the AMT encoder installed on the toughbox mini? We’d like to use these encoders, but getting them to fit looks tricky.

Here is a (somewhat low-quality) picture of the AMT series encoder mounted on a toughbox. You will see a small 1/4" shaft on the back of the gearbox. You can use hot glue, or as others suggested, 3M foam tape, to get the encoder in place using the specified ring (which I think is white, for the 1/4" shaft). I would definitely check to see how they are fairing after any tough falls (i.e. climbing and fall or just general drops, etc) as they can come off if they aren’t put on well.

They are quite reliable. The only issue we had with them was when we fell from the davit last year, and one lost the black inner race thing (I don’t know what it’s called). We didn’t diagnose the issue until after the season. DEFINITELY leave clearance to be able to check this location on the encoder, along with space to give it maintenance. We made that mistake last year ::ouch:: .

Just out of curiosity, does anyone know if the TB Mini shafts included with this year’s kit bot are the ones that come with the magnet pre-installed?

These were in the kit of parts back in 2016 (or was it first choice?), when I first heard of them. We used them that year and are using them again this year.

The way they work is that the shaft of the motor or gearbox goes through the hole that you see in the encoder illustration. The encoder comes with a collection of different sized collars, (the collars are those colored plastic things in the illustration) and you choose the one that matches the shaft size. The collar fits in the little black sleeve on the encoder, which turns with the output shaft. The encoder senses the rotation of that mechanism.

I’m no expert, but what I like about these things, comparted to other encoders I have seen, is that it is a low profile device. The packaging is easier than the style of encoder that has its own shaft. Those take up more space, and the output shaft of the motor or gearbox has to somehow be coupled to the shaft of the encoder.

I haven’t used enough encoders to talk about reliability, quality, or whatever else one might want in an encoder. However, they worked for us in 2016, and they are generally easier to mount than several others I have seen. I hesitate to recommend them, because I don’t feel all that qualified, but our team will be using them again this year.

Last season my team used the SRX Mag Encoder. We weren’t using the Kitbot but it was a very good encoder that gave us no issues at all. It always worked as we planned and being able to plug it right into the SRX made tuning and programming it easy.

the amt103 encoders from the first choice are cute! you can also order more of them with your digikey vaucher from the KOP.
we use them on a toughbox mini with a resolution of 100 ppr.
i used the mounting plastic thingy to accuratly drill into the gearbox housing new 3mm holes with a tapping bit, and connected it with short (6-8mm) M3 screws. holds on fine for now

Yes they are.

Do you have a source for this? Just to ease my mind.

So to be clear, the CTRE magnetic encoders should work with the shaft as is (on the KOP drivetrain)?

There is no need for an online source (if you want to test it grab the shaft and a piece of metal and you will see that its magnetic) my team just finished the KOP DT and it’s magnetic we are installing the CTRE mag encoders tomorrow.

You need two of everything on that link for each gearbox there is an andymark video on how to install

Not exactly. The included shafts w/ the magnets are longer than needed for the mag encoder install. You need to space out the encoder when you mount it. I read where some teams are 3D printing a spacer or AM sells a mounting kit for $3.00 that uses a rubber grommet as a spacer, so its basically adjustable. They have a video on installing it. http://www.andymark.com/product-p/am-3565.htm