View Single Post
  #8   Spotlight this post!  
Unread 12-02-2007, 20:55
oddjob oddjob is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Earth
Posts: 118
oddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to beholdoddjob is a splendid one to behold
Re: Problems with Encoder Counting

We use the banebot encoders and had concerns with the mounting method and getting knocked out of calibration if the robot gets bumped. So we simply use only the pulsecount and ignore the direction signal. (meaning that you don't have to use the encoder board and can wire either encoder output directly to an FRC interrupt input)

Your code can assume the direction is the way you expected from the pwm setting to the motor. Use the Optical Encoder block in easyc rather than the Optical Quad Encoder block.

Code:
 if(pwm<127) encoder_count = -encoder_count;
This isn't quite as accurate as using the direction signal in circumstances where the wheel changes direction between successive passes through your timer loop. But it works well in practice.