View Single Post
  #4   Spotlight this post!  
Unread 03-02-2016, 04:54 AM
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: Talon SRX in Position Mode Won't keep zero

Quote:
Originally Posted by ProgrammerMatt View Post
So i have code that runs our actuators to set our zero's for our Closed Loop PID system. using setPosition(0.0); to set the zero.

It seems to loose its zero after switching positions a few times. its off by about 0.9 rotations about 6-8 inches on our actuator. im using the SRX Mag encoder with the pulse width position feedback selected.


Thanks,

Matthew Smith
We have found, for various reasons, encoders don't always return the same count if the motor has spun back and forth a number of times back to the original position. We suspect in some scenarios, where optical encoders are used, there could be slight scratches on the optical wheels that a small number of pulses may be missed by the counter. It is not significant to the overall tracking of position but enough to cumulate errors that it no longer "return to zero" when the actuator is moved back to "zero position". That's why we have put code in our library that when a limit switch is used to calibrate zero position, not only we called the zeroCalibrate() method during robot initialization, we also zero the encoder whenever the lower limit switch is hit. This will prevent the "zero point drifting" problem.
Here is an example on how we did it. The code is in the method setMotorPower.
https://github.com/trc492/Frc2016Fir...cPidMotor.java
__________________

Last edited by mikets : 03-02-2016 at 05:05 AM.
Reply With Quote