Talon(SR and SRX)/Victor SPX and Limit Switches

Do any of these support limit switch input or is that only a Spark thing? Also, can one spark take both a reverse and forward limit switch?

We’ve never used a Spark’s integrated limit switches, but I can assure you that the TalonSRX can use limit switches, both forward and reverse. (I’ve helped a team use a DIO limit switch and write the code to use it with a Spark, but my team only uses Talon integrated limit switches.)

Victor SPX’s don’t have data ports, but as far as I know (we haven’t actually done it but the methods show up in the code) you can use a limit switch plugged into a Talon as a remote limit switch for a Victor.

Something we have done before is use a limit switch plugged into a follower talon as a limit switch for the master talon.

I’d highly recommend checking out the Phoenix Examples if you haven’t used a Talon before (you should, they’re great).

How are you supposed to wire the limit switches? My team is thinking of using the REV magnetic limit switch for our arm but still not sure how to wire it.

Take a look at the datasheet on the Magnetic Limit Switch product page. You’ll see which sensor wires correspond to ground (GND), power, and signal.

You’ll need to match up the following sensor wires to the corresponding Data Port pins on the motor controller you are using:

Magnetic Limit Switch → Motor Controller (SPARK MAX or Talon SRX)

GND → GND
+3.3V (or +5.0V) → +3.3V (or +5.0V)
Signal n (or n+1) → Forward or Reverse Limit Switch Input

The Magnetic Limit Switch is an “active-low” sensor. In other words, the signal line will go low (0V) when it detects the magnet. This acts like a “normally open” limit switch, so be sure that your motor controller is configured for this limit switch polarity (usually the default configuration).

For reference, the original SPARK does not provide power to the limit switch inputs, so you would need some extra wiring to get power to the Magnetic Limit Switch. SPARK MAX and Talon SRX both provide power in their Data Ports.

Finally, both the SPARK MAX and the Talon SRX have breakout boards that make soldering limit switches relatively easy.

1 Like

Ah but if I wanted to have a limit switch for arm being up and down, then I would need two limit switches correct?

That’s certainly the most common way to do it - one at the top, the other at the bottom. If you wired one switch to both inputs, when it closed (or opened if NC), the motor would be disabled both directions.

So then, can i wire both of the switches to the ground pin on the SPARK Max?

Assuming you mean pin 10 on the data port, yes.

Yes you can. The SPARK MAX Data Port Breakout has two ground pads, so you can use both, or just one of them, whichever is most convenient to you.

Thanks, this helped us with our talon limit switches.

Adding to this…

Automatic Limiting Options

A Talon SRX supports forward and reverse limiting via:

  • the Gadgeteer connector’s reverse and forward limit switch pins - see Talon SRX User manual for details
  • the reverse and forward limit switch pins of another Talon on the bus, see Phoenix docs/examples.
  • the reverse and forward limit switch pins of another CANifier on the bus, see Phoenix docs/examples.

A Victor SPX supports forward and reverse limiting via:

  • the reverse and forward limit switch pins of another Talon on the bus, see Phoenix docs/examples.
  • the reverse and forward limit switch pins of another CANifier on the bus, see Phoenix docs/examples.

Docs

Links for posterity…
https://phoenix-documentation.readthedocs.io/en/latest/index.html
Examples…
https://phoenix-documentation.readthedocs.io/en/latest/ch19_Support.html#github-examples
C++/Java API…
http://www.ctr-electronics.com/downloads/api/cpp/html/index.html
http://www.ctr-electronics.com/downloads/api/java/html/index.html

Are the n/n+1 identical for the purposes of Talon limit switches? (eg. does the forward/rev only matter for Sparks and Talons will only care about the pin that it is wired to)

Also is there a way to utilize the 5V from the Talon data port when wiring a limit switch to the SRX Mag Encoder pads? (aside from a using a separate breakout board and using the remote features)

Not unless you’re comfortable doing a soldering job I wouldn’t attempt if everything were three times as large. The four limit switch pads are the only solderable points on encoder larger than about a square millimeter. Using a multimeter in continuity (beep) mode, I identified a few SMT solder points which were “equivalent” to pin 2, the 5V supply, but each of them was in use to mount a component.

Note - you do not need to use the “remote features”. You can easily use two of the gadgeteer breakouts to give you 0.1" pin access to the 5V line.

Edit: If I were in dire straits, I might split out wire 2 from the cable and tap into it to get the 5V.