View Single Post
  #1   Spotlight this post!  
Unread 14-01-2012, 17:47
nazgul42 nazgul42 is offline
Registered User
FTC #4115
 
Join Date: Jan 2012
Location: Mequon
Posts: 3
nazgul42 is an unknown quantity at this point
Tetrix Encoders not returning consistent values

On the robot that my team built, there are two motors with encoders on them. The software running on the NXT brick is written in robotC. It looks like:
Code:
// Motor definitions here
task main()
{
  nMotorEncoder[leftArm] = 0;
  nMotorEncoder[rightArm] = 0;
  while (true)
  {
    nxtDisplayTextLine(1,"RArm: %d", nMotorEncoder[rightArm]);
    nxtDisplayTextLine(3,"LArm: %d", nMotorEncoder[leftArm]);
  }
}
If I rotate one of the motors about 90 degrees, the displayed encoder value changes to about -200. If I then rotate the motor back to the position where it was at zero, the encoder value changes to about 250. Since the encoder changes faster in one direction than another, there is no actual 'zero position'. The other encoder displays this same behavior. Why does this happen?
Reply With Quote