Hello! I’m a rookie to electrical, and I am still learning the in’s and outs. How would one go about connecting a potentiometer to a Talon SRX? Would it go into the Analog input port and how would one connect it from there? Would you soder it to the connection? Thanks
If you want to connect it directly to the Talon SRX, either the CTRE analog breakout or the AM universal breakout will help you out. Using either of these, you can invoke closed loop control on the SRX and let it do its thing.
If you want to connect to an analog input, you can do that as well, but you will have a slightly more involved task programming it.
In either case, the potentiometer has three terminals or leads. One of these is know as the sweep. You connect (usually solder, but depends on your terminals) the signal (usually white or yellow) wire of a PWM-style cable to the sweep, and the 5V and ground (red and black) wires each to another terminal. The other end of the PWM/servo wire should have a 3 pin female Dupont connector at the other end for the Analog IO or AM breakout (red in the center), and will solder to the appropriate pads on the CTRE breakout. (white/yellow to ANA, black to GND, red to 5V).
On most potentiometers of less than one turn, the sweep is the middle terminal. On multi-turn potentiometers, the sweep is usually the one farthest from the knob/stem. In either case, if you set the knob near the center position and measure the resistance between each pair of terminals, neither of the terminals involved in the largest resistance measurement is the sweep.
What would be the differences in programming if it was connected directly to the analog input?
I’ve provided a link above to the WPIlib screensteps live analog sensor page. With an Analog IO connection, you’d have to write code to read the sensor and use that value to specifically set the applied motor voltage, and ensure it runs frequently. It’s not difficult, but it is a bit more code than the direct SRX connection.
With the direct connection, you can set up the SRX to use the analog input, then “tell the SRX what you want to do” regularly and it will take care of it; you do not ever have to explicitly read that sensor, though you may retrieve that value from the SRX if you need it for something else.
For more specifics, we’d need to know what language you’re using to program.