Swerve Module Question: Steering Encoder?

Most of the modern/popular swerve modules I see for sale today are designed to accommodate either Falcon500 motors or NEO motors, both of which have built-in encoders. But some of these modules (like the sds mk4 for example) also feature a “centrally located steering encoder” separate from the motors, to reduce “encoder backlash”. But to me this seems like kind of a waste of money given that the motors themselves already have integrated encoders, and it’s not too hard to simply divide the encoder counts by the gear ratio. So is this additional steering encoder absolutely necessary, or could we get by just fine without it using the integrated encoders in the motors only?

The encoder port is for an absolute encoder input generally. The encoders in the falcon/neo are relative.

You can zero your modules every time you start a match, or you can purchase an absolute encoder.

We found the absolute encoder to be much more predictable on our robot. It also saved us time pre-match.

We still use the internal encoders on the neos, and the internal PID functions on the Spark for rotation.

1 Like

The absolute encoder can be used both to acquire the initial position of the module as well as for steering control feedback. As you noted, steering control loop feedback can also be acquired from the built in motor encoder in the modern brushless motors.

It is possible to set the initial position of the modules manually before the match using some sort of alignment device and then use the motor encoder for steering control from that point onward. But, if for some reason the setup was not done correctly, you might be unable to drive effectively for an entire match. So having an absolute encoder avoids this possibility for setup error.

In terms of control, some teams like to use the absolute encoder for their control variable as the steering angle is being directly measured by the absolute encoder. While this is completely valid, the backlash in the geartrain between the motor and the module rotation results in “deadband” in the control loop that is a little tricky to manage and generally requires a fairly highly damped PID loop to keep stable. Conversely, using the integrated motor encoder for control allows you to directly measure the the rotation of the motor and therefore there is no deadband in the control loop, but you are indirectly measuring the module steering angle such that the backlash between the motor and the module ends up being uncertainty (error) in the steering angle. The end result is that using the absolute encoder for control results in a slower rotation but more accurate control whereas using the motor encoder for control results in a faster rotation response with less accurate control.

A decent compromise is to use the motor encoder for control but then use the absolute encoder in your odometry such that the accuracy of the module position does not result in odometry errors that will mess up your auto routines. You can feed back the odometry errors into a path following routine and correct for these errors with steering input corrections.

Bottom line, you can get by without an absolute encoder, but you will be giving up the reliability of the initialization and the accuracy of the odometry.

3 Likes

Others have hit directly on the technical background, and they are correct.

I will speak from experience implementing a swerve drive without them:

Yes.

1 Like

Haha okay, sounds good. Thank you everyone for all the info, your posts were very helpful!

2 Likes

Without it you’d need some other way to ensure your modules are starting out at the same position every time the robot starts (which is really not possible in Our competitions), or a way to indicate when those are in a certain absolute position.

If you are looking for affordable solutions
you can use a micro-switch that will be clicked once every turn of the azimuth (part which rotates the wheel) and with it you could zero the relative encoders using this one absolute position.
(this is similar to what many teams do to control turrets)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.