View Single Post
  #11   Spotlight this post!  
Unread 29-02-2016, 16:15
cantdecide cantdecide is offline
Registered User
FRC #5773 (YAFL Mechatronics)
Team Role: Programmer
 
Join Date: Jan 2016
Rookie Year: 2016
Location: Turkey
Posts: 31
cantdecide is an unknown quantity at this point
Re: Encoder instability

Quote:
Originally Posted by Ether View Post

What programming language are you using? To rule out a coding problem, try loading and running a standalone example program.


I'll try to check tomorrow.

Quote:
Originally Posted by Alan Anderson View Post
Grasping at straws...

It's a Hall Effect sensor, right? Perhaps there's magnetic interference. Might you have a high-current conductor running too close, or the side of a really powerful motor jammed up against it?

Do you have anything in the program that resets the encoder value? Maybe it's being told to do it at an inappropriate time.
The closest motor to it, obviously other than the gearmotor itself, is our drive motors, and it seems to happen even while we're not driving. In fact, it can happen without any of the other motors moving. However, the PID loop does often drive the gearmotor at ~20-30% to keep the arm in place. Maybe that creates some interference?
There is a command to reset the encoder(which I added because of this problem), but the actual accumulated value doesn't go to zero when the problem happens. It just stops accumulating(and the encoder rate goes down to 0) for a period of time.