Connecting external encoders to SPARK MAX

On our robot, we use the SRX Mag Encoder and the VersaPlanetary Integrated Encoder.
I was wandering whether it is possible to connect these directly to the port on SPARK MAX motor controllers.
I don’t need to perform any close loop control on the SPARK MAX motor controller, just be able to get a reading of the encoders from the robot program.
If it is possible, I would love to be referred to a code example of the configuration of the sensors (preferably in Java), as I was not able to find one.
Thanks a lot!

It appears the pinout for the Talon SRX is the same as the pinout for the Spark MAX, I believe the port is also physically the same and I would safely assume you can just plug the VersaPlanetary Integrated Encoder into the Spark MAX as if it was a Talon SRX

If you’re using the SPARK MAX with a NEO motor, there’s not yet a way to connect an external encoder (AFAIK). You need to plug the NEO motor cable into the data port so the the SPARK MAX can control the NEO based on its internal encoder.

If you only need the encoder input on the roboRIO and not to do internal closed-loop control, you can use a SRX mag encoder breakout board from CTRE, VexPro, AndyMark, or other places. You’d be using it backwards from the normal direction. Plugging the encoder into the SRX data cable port and wiring the solder pads to DIOs on the roboRIO.

Ok, I understand.
You said there’s not yet a way. Is it something that will be available soon?

I haven’t heard of anything in the works, but I don’t have any inside knowledge. @Greg_Needel might have more info.

1 Like

You can track upcoming features and bug fixes on their trello board. While this particular feature is accepted, it is in their backlog, so I would prepare to implement a different solution. The method mentioned by Ari will do the trick pretty easily, but note that it will probably be more difficult if you need the absolute position rather than just the quadrature signal.

But if you’re using a brushed motor, you can use the JST breakout board to connect and encoder to the encoder port right?

Iff you are using a brushed motor with the SPARK MAX, you can connect an encoder to the data port, yes. I’m not sure what encoders are supported though, but as I understand there is support for quadrature encoders in brushed mode.

There is not support for encoders in brushed mode at the moment. This feature is still in the backlog list on their Trello.