Thread: IR Seeker help?
View Single Post
  #3   Spotlight this post!  
Unread 27-12-2011, 22:42
kz2zx kz2zx is offline
Ruthlessly Insufficient
FTC #5246
Team Role: Coach
 
Join Date: Sep 2011
Rookie Year: 2011
Location: AZ
Posts: 14
kz2zx will become famous soon enough
Re: IR Seeker help?

Chuck,

Dunno if you still need help. I just got to our IR seeker code, and like you, want the robot to stop when in the parking zones near the beacon.

In testing on my bench, and using the HTIRS2readACDir() call from Xander's library/driver, the maximum I've gotten for any one sector of the five (and the brightest sector DOES vary by about 5 lsb for the same distance when I rotate the head in place) is about 142. This is with the IR beacon the game will use, with a fresh 9v battery in it.

HOWEVER, the IR Seeker seems to return 0 if you're saturated/too close. That seems to be about 9-12 inches.

So, the kids and I are writing this to center on zone 8 (it's about 6 deg wide) and have mounted the seeker transversely to the roll axis of the robot (i.e. sideways to the direction of forward travel). There exists evidence on the web to explain why... anyway, we've got a event-loop-and-event-list pattern going with some statemachine-like code to implement a PD hunt/seek on the zone 8 - and slow down the drive motors down to 20 percent at over 130 mean brightness on zone 8 (mean between reply array 4th and 5th element). We stop after the sensor reports 0 after exceeding 130 (and presumably park in the parking zone).

We haven't scrimmaged yet (that's in early Jan here in AZ), and we'll be testing this algorithm this weekend. If you're not at your competition yet, hope it helps :/
Reply With Quote