I am one of the programming mentors for team 2052. This year our team has over 10 new programmers with almost no prior experience, this combined with a brand new TalonSRX API has introduced a number of interesting challenges this year.
One of the larger issues we have encountered is the TalonSRX config setting being persistent across power off/on cycles. Students try different config settings to attempt to accomplish something. They set the value, then when it doesn’t work, they delete that line of code and try a new setting. What they often don’t realize is that the config setting they tried is now “forever” part of the Talon’s behavior. This has the potential to cost programming teams many hours of trying to figure out why their code isn’t working correctly, not realizing that the talon now has max speed limits, ramp rates, or other configurations that are no longer in the code.
The solution is to factory reset the talons periodically. Currently the only way to do this is to press the physical button on the Talon. Perhaps our team is unique in our control board configuration, but we will often stack our talons two high, especially for our drive train which usually has two motors on each side. We stack the left and right talons. This year is better, but in 2016 and 2017, we had so many space issues the talons were pushed into tight corners of the robots, under other mechanical components. This makes it very hard to factory reset the Talons because it means some, or perhaps significant, disassembly of the robot to get to the physical buttons on the Talons.
Yesterday I emailed CTRE support requesting they add a software reset in their API so we could reset all configuration values back to factory defaults, to avoid the need to press the buttons on the Talons. I explained it was a “big problem” (for us) that the only way to baseline a Talon back to a “known state” was to press the physical buttons on the Talon.
The response from CTRE was polite and professional. In the response they said.
It is a poor design decision to place Talons in such a configuration where the reset button is not easily accessible.
It isn’t a “big problem” because I was the first to every request a configuration reset in the software API. They have discussed adding a reset method to the API, but it isn’t certain they will do it and probably won’t add it until next year.
When a previously working robot, suddenly starts to exhibit strange behavior, a great troubleshooting step is to go into version control and rollback your code to the last time you knew the code was working correctly. This is especially true when the software group says it is a hardware issue and the build people say it is a software bug. Before taking apart any parts on the robot, the best thing to do is to get the code back to a “last known good state”. If the old (good) code works, then yes it is a new software bug, if not, something physical happened. Unfortunately rolling back the software isn’t enough with the TalonSRX. You must also factory reset the Talons to ensure you are at a guaranteed “known state”. For us, factory resetting the talons is something we have had to do several time as part of the troubleshooting step of getting back to a “known good state”, and pressing those buttons is not trivial given our control board layout.
I’m writing this CD post for three reasons.
Not everyone realizes that config settings are saved forever. If you accidentally set the wrong config settings, or remove a config that is no longer needed, it isn’t gone. The only thing that is gone when you delete the code is the clue that it was ever set, which can make troubleshooting a challenge. Please share this with your programming team.
The support person at CTRE was awesome. He replied to my email on a Sunday within only a few hours. It was clear that he was interested in our procedures for managing our code and asked several questions in response. CTRE is interested in feedback on their product. If you agree that there should be software option for config reset, or a way to turn off config persistence, please email [email protected] I was surprised I was the only person to email about this feature. Perhaps more people requesting this feature will encourage them to add it. CTRE is super responsive to support and very friendly.
Has any team created their own way of putting all config settings back to default values by finding all config settings, discovering their default values, and then writing code to baseline every value in every slot index? If so, are you willing to share? We have not done this yet. We probably will, but I thought I would ask if anyone has already written the code to do this.