Best encoder for swerve drive

Our team is trying out swerve drive for the first time this year (using AM Swerve and Steer) and we want to know what other people have used in terms of controlling the position of the wheels. We thought we could test basic functionality just by setting the power to the x value of the joystick but that didn’t work at all, as the wheels were facing different directions after just one rotation.

Absolute encoders sound good, but do we need to mount them to the output shaft of the PG71? I would think so since they are 0-360, the motor will spin more than once with each rotation of the wheel.

How have other teams overcome this problem?

I don’t know how good these encoders are, but AM sells a PG-71 with an encoder attached to it that is the same price as one without it. This would be the easy fix but I’m not sure if it’s the optimal solution.

Gearbox: http://www.andymark.com/product-p/am-2971.htm

Be careful using encoders attached to the motor shaft, rather than at the output. There is backlash in the system(planetary gearbox + external reduction) that will not be seen at the motor shaft.

So we have these encoders, but they’re incremental. Meaning we have to calibrate them every time we turn the robot on. What we need is a good absolute encoder. I’ve heard the am-2899 is pretty good, but not sure if it’s exactly what I want.

You need a way to determine a zero position and those encoders don’t have an index.

We had a lot of luck with the US Digital MA3 this past year(MA3 Absolute Encoder with Cable - AndyMark, Inc) though we didn’t buy ours from AM and went straight to US Digital. We also used The AMT encoders for speed and are likely to use a similar setup this year if we go with swerve again.

You might also consider the new magnetic encoders from Cross the Road: CTR Electronics but I’m not sure about the maximum speed it supports and if it would be a good fit or not for this application.

How do I connect a PWM output to the encoder breakout? Or the 3-pin MA3?

We have used incremental in the past. We do have to zero them each time.

We use this one from USDigitial.
http://www.usdigital.com/products/encoders/incremental/rotary/shaft/S4T

We mount them one stage up from our modules on a flexible shaft adapter. They are easy to change. We use to use 10 turn pots…that was a nightmare! They worked, but one short or loss of connection and they were toast.

I am very interested in the new embedded magnetic encoder in the vex planetary gearboxes. They have absolute, incremental, and index. That would be nice.

Does zeroing require ultimate precision or does it just have to be ‘close enough’?

Please see my response in this thread.

Not really we just always said pulleys or sprockets one way, and we make marks on the sides of the module and the robot to help with remembering line up. One issue with our encoders is that if they ever reset they will rezero wherever they are. With the new system and the abundance of dedicated power ports, this has never been an issue. Just make sure they are connected somewhere with dedicated power i.e. the voltage regulator.

CTRE Mag Encoder: Max is 15000 RPM for the relative mode, 6600 RPM for the absolute mode. If you need faster than 6600RPM and absolute mode, you can just set the relative sensor position to match the absolute and use relative from then on.

MA3’s also have a max of 15000RPM.

Checkout the magnetic encoder user’s guide for more info (particularly section 5.3)

1 Like

Well there you have it… Good to know about the speeds. I hadn’t looked at the specs but I think that using a combination of the two modes should work well for most applications.

Hey Marshall, not to distract from the OP, but when it comes to swerve, I’ve been giving you guys props…

1 Like

LOL! We’re only doing it right because we found 20 ways to fail first. Thanks for the props though!

Now, if only CTRE would make our encoder breakout boards! Actually, we’re partnering with another team this year on making them and we’re hopefully going to put out some source files before build season for others to have them made too! We’ve got some great revisions in the works hopefully.