Using the VEX SRX Mag Encoders with Spark Max

Hi,
We are trying to use the VEX SRX Mag Encoders with our Spark Maxes so we can get accurate encoder values when going through a gearbox. We have had issues with getting this to work. We know that the wiring for the output of the Mag Endocers and the input the Spark Max requires for endorsers are different so we tried to rewire the ribbon connection to fix this problem. We have the Spark Maxes in alternate encoder mode. The Spark Maxes kept on sputtering like they had a limit switch input however this was disabled in the config. To fix this problem we cut the unnessacary wires and just left power, ground, and quarantine A and B. This fixed the sputtering issue however we were getting no values from the encoders now in code. We have tried everything double-checked the Spark Max config and the wiring and we don’t know what is wrong.

Hopefully we can get you up and running quickly, but first a question:

Are you running the SPARK MAX in Brushless (NEO/NEO 550) or Brushed Mode?

The SPARK MAX Data Port matches the same pinout as the SRX, so the encoder should work with the default ribbon connection in Brushed Mode only.

In Brushless Mode, the default encoder pins are shared with the NEO hall sensor lines so you cannot use an external encoder in the default configuration. This is the purpose of Alternate Encoder Mode. There are instructions on which pins and how to connect to them on the page I linked to.

We are using NEOs and we are in alternate Encoder mode. We rewired the ribbon cable from the CTRE Mag Encoder to the spark max using the connections outlined in the manual. When we first did this we left all connections connected and got sensor errors from the spark max. We then cut all non necessary wires and just left Power, Ground, Quadrature A and Quadrature B. When we did this we no longer got sensor errors however we got no encoder output values.

Please send me some detailed photos of all your connections to support@revrobotics.com. Please be as detailed as possible as this is the next best option to me being in your shop with you.

Not meaning at all to hijack @dyanoshak’s help, but to give more info on the first pass and help get you through this quickly:

Specifically which wires did you cut at this point?

'-------------------------------------------------

Include especially how you

1 Like

We had this same problem when we tried to use the Spark Max Alternate Encoder mode (specifically, no values being pulled from the encoder). Even after a back-and-forth with rev support it was still not working properly, so I decided it was time to cut my losses after a week of time wasted troubleshooting.

Instead, I simply broke out the ribbon cable into A, B, 5v, and ground and plugged into the DIO ports on the Rio. Much easier, no issues with detection, and no more time wasted troubleshooting. Now this may not be possible for you in your case depending on what you need the encoder for, but that is how I got around this particular issue.

Looking back at our support emails, you told us on January 16th that the 1.5.2 firmware update fixed the issue you were having. My apologies, we didn’t see your reply from the next day, the 17th, since we marked the thread as “complete”.

In your followup you stated that things were working until your encoders stopped receiving 5V power, resulting in no values being read. You then reverted to older firmware and saw other unrelated issues while also undoing the Alternate Encoder bug we fixed in 1.5.2.

We will followup on email today, but I want to clarify for the topic of this thread that the continued issues don’t seem to be related to the Alternate Encoder features of the MAX.

2 Likes

Ok, I was under the impression that the issues did appear to be a firmware bug as Will started that he “could replicate the issue” and was sending over the firmware candidate build. My apologies for the confusion.
In addition, I’m not super concerned with resolving the issue as the reversion to Rio-based encoder reading has caused no issues for me and further testing would require reverting our whole setup back, but thanks for the offer. :+1:

To close out this thread, after updating to the latest SPARK MAX firmware, the issue was resolved.

3 Likes

Is it necessary to rewire the SRX ribbon cable to connect a CTRE Mag Encoder to the Alternate Encoder Port on the SPARK MAX? It’s our first year using Spark Max/NEO and we are having some problems, especially with the encoder. When the encoder isnt connected all is fine, but when we connect the encoder the status LED blinks magenta/orange (Sensor Fault), and we can’t read data from it through getAlternateEncoder(). Is it possible that the problem is from incorrect wiring of the encoder?

What motor are you using? If a brushless motor, then yes, you need to have the NEO* encoder as the primary and any other encoder as a secondary, if you want to connect it to the MAX. If using a brushless motor (*CIM, 775pro, RedLine, BAG, etc), No. You can connect it directly and use it as a primary encoder.

We are using a NEO , so that explains the problem… Is there a list of what needs to be soldered to where that I can give our electrical team? We will probably connect them to the DIO for our first competition, but maybe for later it would be good to be able to connect directly. Thanks for the explanation…

The re-wire info is in the SPARK MAX manual:
http://www.revrobotics.com/sparkmax-users-manual/
Section 2.4 describes the normal wiring, section 3.6.1 the alternate wiring. Essentially, pins 1, 2, 3, and 10 are straight through, and 9/4, 8/5, and 7/6 are crossed over. If I were doing this, I’d probably get two cables and two of the five modules in this guy to make the crossover.

At a minimum, you need to connect 2-2, 10-10, 5-8, 7-6, with those on the left being the encoder and those on the right being the controller. If you add 8-5 and 6-7, it’ll work either direction.

We’ve purchased these boards to use them with an SRX Mag encoder – http://www.revrobotics.com/rev-11-1278/
Can we connect the SRX Mag encoder data cable directly into the port on the upper part of the breakout board and then connect the board to the SparkMAX or do we need to re-wire something?

For Alternate Encoder Mode, you must re-wire it based on the pinout described in the User’s Manual under Alternate Encoder Mode. Do not plug it into the 2x5 connector.

Thank you for your super-fast reply. Would you please outline exactly which pin to which pin I need to connect from SRX Mag to SparkMAX breakout board. I need to make this work tonight for the programmers, so they can program the autonomous mode.

GeeTwo said:

you need to connect 2-2, 10-10, 5-8, 7-6, with those on the left being the encoder and those on the right being the controller. If you add 8-5 and 6-7, it’ll work either direction.

Is this accurate?

The documentation I linked above, and the pinout from the SRX Mag Encoder documentation:

image

confirms @GeeTwo’s pin-to-pin suggestion.

Since you’re using the Data Port Breakout, I recommend looking at the SRX Mag Pin labels, and matching those to the Breakout Board Pad Labels shown in the documentation:

image

Thank you, I will try to rig something up tonight.

Ok, so I took a data cable that connects to the SRX Mag encoder and spliced it to connect it to the SparkMAX Breakout board per picture below.
image

Connected the SparkMAX with USB to the computer, ran REV SparkMAX Client (as Administrator). Under ‘Advanced’, selected ‘Alternate Encoder’, under ‘kDataPortConfig’ - selected Alternate Encoder.

Under ‘Run’ I’ve added ‘Alternate Encoder’ Position and Velocity - two graphs. Saved the configuration on the SparkMAX. Then I connected the SparkMax to a NEO motor, and a 12V battery. Attached the magnet that comes with the SRX Mag encoder to the NEO motor shaft.
I started spinning the NEO motor by pressing ‘Run’ and moving the slider slowly and placed the SRX Mag encoder in top of the magnet keeping it at the proper distance - LED green.

No movement on the graphs, no RPMs showing.
Also used an oscilloscope to trace the signal generated by the mag encoder - it gets all the way to the SparkMAX.

What else is needed?
Thank you.