Quote:
Originally Posted by mikets
What do you mean by it resetting itself to zero? Is there a fixed location in the revolution at which when passing through will clear the position to zero? If so since you are using the SRX Mag encoder and I have read this sensor can be used in absolute or relative mode. In absolute mode, it will reset the reading back to zero when wrapped around. Could it be what you have observed is a behavior of absolute mode?
https://www.ctr-electronics.com/Talo...e%20Manual.pdf
|
I'm using the Talon in Position mode with the feedback device as pulse width, in this mode you can read positions over multiple rotations but the reference (zero) must be set, so if you look at my code the first thing we do is run the two motors down until it reaches the limit switch then sets the reference to zero using setPosition(0). during teleop i noticed after switching to a position a few times it suddenly stops going to the reference point when commanded to. I printed out the position of each talon and preformed a self test and it seems it just randomly at some point during teleop it will just change its zero (reference) to the last position it was at even know there is no setPosition being called.
Hope this clarifies anything,