View Single Post
  #2   Spotlight this post!  
Unread 07-03-2016, 22:31
Poseidon5817's Avatar
Poseidon5817 Poseidon5817 is offline
"Cool" Squad
AKA: Mitchel Stokes
FRC #5817 (Uni-Rex)
Team Role: Mentor
 
Join Date: Aug 2013
Rookie Year: 2014
Location: Clovis, CA
Posts: 365
Poseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud of
Re: Talon SRX in PID Speed mode won't stop!

Quote:
Originally Posted by mhaeberli View Post
Hi!

We have a Talon SRX (to a CIM motor, with a quadrature encoder) - it's attached via a pullup / breakout board to the encoder.
On our test robot board (no robot, just control system), it seems to behave as expected:

using control mode kSpeed - ...

(pseudo-code):

if (button1) {
talon.Set(1000.0); //turn it on.
}

if (button2) {
talon.Set(0.0); //turn it off.
}

- the talon starts and stops when commanded.

On our real bot, though, it won't stop once started.

(we also tried putting it in voltage mode; in that case

(pseudo-code):

if (button1) {
talon.Set(1.0); //turn it on.
}

if (button2) {
talon.Set(0.0); //turn it off.
}

Which works fine.

Stumped!

Martin Haeberli
(de-)mentor, FRC 3045 Gear Gremlins (formerly SWAT)
If you read the software reference manual, you'll see a section on how to set up speed PID control on the Talons. Based on the first step of that section, your encoder and Talon outputs are probably opposite directions. So try either:

Code:
talon.reverseOutput(true);
or

Code:
talon.reverseSensor(true);
Either of those should fix it. If it fixes it but the motor is the wrong direction, you can switch which one you are using. If for some reason it still doesn't work after that, you might want to check the roboRIO webpage and make sure you are getting encoder feedback on that Talon. Also, make sure you have the correct feedback device selected, PID parameters, etc.
__________________
My FRC History:

2014 - Team 1671: Central Valley Regional Finalist and Chairman's Award Winner, Sacramento Regional Finalist, Archimedes Quarterfinalist
2015 - Team 1671: Central Valley Regional Semifinalist, Sacramento Regional Semifinalist and Chairman's Award Winner, Newton Winner, Einstein Winner
2016 - Team 5817: Central Valley Regional Finalist and Rookie All-Star, Orange County Regional Quarterfinalist and Rookie All-Star, Newton Division
2017 - Team 5817: Return of the bench grinder


Reply With Quote