I’ve hinted at this project in a couple other other threads and there were a few teams interested. Thought it would be fun to share our work.
Last year we ran a CANcoder on our swerve module. It worked well (no issues) but it added another 4 devices to our CAN bus, and required a 12V input. That adds a lot of wires to the robot, and we felt that there was room for improvement.
While digging into the features of the SparkMax, we found there was a seemingly underutilized feature where there was a 0-3.3V input and a 3.3V power output. This seemed really convenient since the Spark Maxes are always mounted near our Neos. The problem is there were no 3.3V analog output absolute encoders on the market (kinda).
We also had a student interested in PCB design and a mentor excited to teach it. This seemed like a really neat project to take on.
The idea here is that 3 wires can be soldered on (with some strain relief built in) and then connectors can be added to the wire. We like using Molex SL connectors. We have also been working on a custom Spark Max breakout board (will release once we are 100% happy with the design).
All said and done, we have a Spark Max breakout board that is held on by M3 screws to our Spark Max Mount. Then only 3 wires go to the Spark Max. You can see the clean solution below.
As far as testing…we have made 1 that works, and mounted it to our spare swerve module. We haven’t run it on the robot yet (mostly due to our programmers having other priorities). It works great on the bench though, and we are fairly confident it will work fine on the robot.
As an added bonus, the total cost of 1 complete encoder (assuming we don’t mess up with the soldering) is $6.07. Still requires the CTRE case, so total it is $12.06 with the case and magnet.
If a team likes this concept, but custom PCBs are too much, there is a way to do something similar with COTS parts. The Rev Spark Max Breakout allows for a 0-5V analog input. The TTB Encoder should be able to interface with it. This still requires a little soldering, but far less than a custom PCB. We considered this solution (even tested it out a bit). Our solution we think is a little bit cleaner over all, but took a lot more time.
Feel free to reach out with any questions.