Looking at the Falcon 500 User Guide, the TalonFX has no data port but it has a 4-pin JST limit switch connector with pin 1 being reverse, 2 and 3 being ground, and 4 being forward. What kind of limit switches would have a compatible pinout and is there some way to use a REV Magnetic Limit Switch with the TalonFX?
All standard mechanical limit switches have a 2 wire pinout.
After looking at the data sheet for the Falcon and the REV limit switch, they don’t immediately seem to be compatible. I can’t seem to find a wiring solution that would suffice with that sensor, though someone else may have more luck.
Can you clarify why you don’t think the REV limit switch would be compatible? As you mentioned above, limit switches typically have a 2-wire pinout. That’s because the switch is simply closing (or opening) a circuit. Sometimes a device may have a 3rd pin for power input as well.
In the case of the REV switch, it has a 4-wire pinout, though per the datasheet, 2 of them appear to be parallel signal pins. In this case, you need to provide 3.3-5.0V from somewhere(likely from one of the DIO pins of the RoboRio), but the GND and one of the Signal pins would go to your Talon FX limit switch pins (GND to GND, and Signal to FWD or REV)
(EDIT: Disclaimer: there is a decent chance I am incorrect about something here, I am not an electrical engineer, and I haven’t even finished AP Physics C: E&M)
(EDIT: Yeah… I had a misplaced resistor. Everything should work fine assuming the Falcon limit switch pins are specced for 5v. They should be, it is the FRC standard for digital signals.)
The limit switch pins on the Falcon rely on the two pins being shorted together. The signal pin on the Talon FX is an output that provides a voltage. The ground pin is ground. On the RLS, the signal pin outputs Vin (should be 3.3v, same voltage as the red “power” wire). Wiring that to signal or ground on the Falcon will do nothing since the Falcon is looking for 0v on the signal pin, and it doesn’t care what is on the ground pin. You could in theory power the 3.3v on the RLS from the signal pin on the Falcon (probably outputs 5v, but possibly 3.3v and 5v might be fine for the RLS), wire the ground to RoboRio ground and wire either of the RLS signal pins to ground on the Falcon, but this would produce potentially unexpected and harmful results. For one, the Falcon signal pin is not intended to power sensors. Also, when you short the Vin on the RLS (wired to signal on the Falcon) to the Signal 1 or 2 on the RLS (wired to ground on the Falcon), the sensor may have unexpected outputs due to extremely low voltage/power loss. DIO is designed to have power, ground, and signal (the RLS needs all 3), whereas the Falcon only has signal and ground. Standard mechanical limit switches just close a circuit, shorting the two pins, making the microchip read zero volts at the signal pin on the Falcon. The rev limit switch is intended as a digital input sensor, which are sensed by providing a voltage on a certain pin. Mechanical limit switches do this by shorting Vin to the sensing pin. These may seem similar, but the wiring schematics are fairly different. The signal pin with DIO acts sort of like “ground”, but it doesn’t sink voltage because of a high resistance, allowing the sensor to stay powered while providing a voltage on the signal pin The RLS has no method to divert power from the microchip on the Falcon unless you power it from the signal pin and short the RLS’s signal pin to the Falcon’s ground pin. Problem is, if you short the signal from the RLS to ground (very low resistance, lower than the resistor in the RLS) it will divert power from the RLS’s sensing electronics, whereas when you short the signal on the RLS to the DIO signal pin (very high resistance, higher than the resistor in the RLS) it will continue to have power for its sensing electronics. (EDIT: Sorry for all of the edits, I’m just trying to make sure my explanation is clear and not blatantly wrong lmao.)
This should work fine, but I’d ask CTRE/Vex to say for sure. The limit switch pins on the Falcon may or may not be 5v tolerant. I haven’t checked the Falcon datasheet- it may be spec’d there. If they are not 5v tolerant, a 3.3v power is necessary.
Powering the sensor from the Falcon seems unlikely.
See my diagram above for why that won’t work. The spec of a limit switch port pinout is nothing like a DIO pinout.
The way most limit switch inputs work, a weak pull-up resistor holds the pin at 3.3v until it’s shorted to ground by the limit, pulling the pin down to 0v. You can easily shove a 3.3v or 0v signal into the pin to achieve the same effect.
The resistor in your schematic should be from the signal pin to 3.3v, and the limit switch pin should connect directly to the chip.
Hmmm, wouldn’t that mean that with 0v on the signal pin (RLS 0v signal wired to Falcon signal pin), the chip would still get 3.3v? I can see how the 0v signal from the RLS would pull the pin to 0v with the way I already have the schematic, but moving the resistor to where you said doesn’t seem to make sense…
Your diagram seems to short v+ to gnd when the limit switch is triggered (closed). Check again.
Oop. Yeah… Somehow missed that. Thanks.