View Single Post
  #10   Spotlight this post!  
Unread 09-02-2013, 16:17
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 3,721
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: 60 / getPeriod() returns 3,000,000

You definitely don't have the Hall sensor oriented correctly. The "flat" part of the sensor should be perpendicular to the magnet. If you don't bend anything, then the correct orientation is with your mounting board parallel to the face your magnets are mounted on. Preferably with all those components on the side facing the wheel.

Or, you can bend the Hall sensor backwards, towards the back of the mounting board, away from the side all the components are mounted from.

(30 seconds later) EDIT: Also, why not put something in your GetRate function that tosses out obviously incorrect values like a period less than 0.0001 seconds or something?
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter