View Single Post
  #5   Spotlight this post!  
Unread 03-02-2016, 02:46 PM
ProgrammerMatt ProgrammerMatt is offline
Programmer-Electrical-Mechanical
FRC #0228 (Gus)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Southington
Posts: 138
ProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really niceProgrammerMatt is just really nice
Re: Talon SRX in Position Mode Won't keep zero

Quote:
Originally Posted by mikets View Post
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
This should not happen with the magnetic encoders though. if i watch the position of the mag encoder it will just randomly set its self to zero after switching to a position.
__________________
2015-2016 CSA
Software Engineering Student @ Johnson & Wales University
Team 228, Gus Robotics Inc.
Facebook
FLL Mentor for 1107, Edison Eagles!
2015- CT State Champions
2012- WPI Finalist(Thanks 1884 and 549), Spirt, Best Website
2011- WPI Chairman's award winners!
2010- WPI Champions! (thanks 230 & 20), WPI Engineering Inspiration, CT Best Website, CT VEX Champions (VRC228, VRC228b) (21-1-0)
2009- QCC VEX Champions (VRC228) (11-0-0), Innovate Award (VRC228)
Reply With Quote