View Single Post
  #15   Spotlight this post!  
Unread 11-02-2013, 00:16
Azrathud's Avatar
Azrathud Azrathud is offline
Computer Nerd
AKA: Bryce Guinta
FRC #2945 (BANG)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Colorado
Posts: 24
Azrathud is on a distinguished road
Re: Magnetic encoders? Anybody else having trouble?

Quote:
Originally Posted by Al Skierkiewicz View Post
One fundamental to keep in mind is these devices are intended to give angular info over a 360 degree rotation. These do not replace rotational encoders they are a "rotational position sensor".
That is simply not true. The this year's magnetic encoder allows for absolute and incremental reading. Reading A/B pinouts on the magnetic encoder allows for one to record the 'ticks' the encoder has read for incremental output.

I don't know how the encoder truly works, but one can, with the WPILIB, read the amount of ticks(in one direction) the encoder has moved since the start of the robot's program. The get() function of the Encoder class will give you the ticks (1024 per full revolution of a shaft). Say you move the shaft 3 revolutions counterclockwise since the start of the encoder class; the get() function would read 3072. Move the shaft 1 revolution clockwise, and the get() function will read 2048.(I don't know which way -- clockwise or counterclockwise, reads 'positive ticks')
The library(or encoder) accounts for ticks read in the opposite direction One can also see what direction the shaft the encoder is reading and weather the encoder is moving or not(which is probably don't at the library level).

Last edited by Azrathud : 11-02-2013 at 00:27.