Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   General Forum (http://www.chiefdelphi.com/forums/forumdisplay.php?f=16)
-   -   IR Seeker help? (http://www.chiefdelphi.com/forums/showthread.php?t=97511)

chuckmerja 23-09-2011 18:26

IR Seeker help?
 
We have been successful in writing code for our IR seeker for the past 2 years, and i was wondering if anyone knows how to measure distance? i read in the discription on the seeker that it gives you a signal strength measurement, but i cant seem to find it anywhere, any help would be appreciated :)

EricH 23-09-2011 18:34

Re: IR Seeker help?
 
Here's a simple test: Set up the rangefinder (the proper name, BTW) at one end of a tape measure, attached to your controller, which is printing out the readings from that sensor to a screen. Put a target at some short distance, say 6", and note what the reading is. Move the target to some other distance within range and note the reading then. That will give you a couple of calibration points. Repeat as needed (you want several points), and plot all the points. You should be able to generate an equation for distance based on reading. Then all you need to do is use that equation in your code.

chuckmerja 23-09-2011 18:44

Re: IR Seeker help?
 
Yes, ive tried this, but im not using a rangefinder, im using the IR Seeker from Hitechnic, for this years ftc game, it only gives me a number 1-9 and i know that those are the numbers for which section of its 240 degree range the seeker senses IR light.

EricH 23-09-2011 18:58

Re: IR Seeker help?
 
Quote:

Originally Posted by chuckmerja (Post 1078339)
Yes, ive tried this, but im not using a rangefinder, im using the IR Seeker from Hitechnic, for this years ftc game, it only gives me a number 1-9 and i know that those are the numbers for which section of its 240 degree range the seeker senses IR light.

You may want to try doing that test with an IR source aiming at a known section (the same section--let's just say section 1) from various differences. You'll probably want an oscilloscope to look at the signal itself, instead of just an output number.

If you're right, you'll see the signal change (get stronger) as you move closer with the IR source. If not, then you may want to find some other way of measuring distance.

chuckmerja 23-09-2011 19:09

Re: IR Seeker help?
 
We just have no way of measuring how strong the signal is, once we can do that we can measure distance, the Hitechnic website said there was a way to measure intensity and power of a signal but gives no RobotC examples.

EricH 23-09-2011 19:13

Re: IR Seeker help?
 
Do you have any access at all to an oscilloscope?

If you do, you should be able to use that. If not, it may be worthwhile to get access to one--it's a handy little device when it comes to measuring sensor and circuit output, even handier than a multimeter for some circuits.

Jared Russell 23-09-2011 19:28

Re: IR Seeker help?
 
http://www.hitechnic.com/blog/ir-seeker/hockey-bot/
or
http://www.hitechnic.com/cgi-bin/com...on&key=NSK1042

And the RobotC function calls are here...
http://bricxcc.sourceforge.net/nbc/n...nic_a_p_i.html

biojae 24-09-2011 02:25

Re: IR Seeker help?
 
Quote:

Originally Posted by EricH (Post 1078349)
Do you have any access at all to an oscilloscope?

If you do, you should be able to use that. If not, it may be worthwhile to get access to one--it's a handy little device when it comes to measuring sensor and circuit output, even handier than a multimeter for some circuits.

The HiTechnic IRSeeker is an I2C sensor.
In this case, a logic analyzer would be a better tool.

Quote:

Originally Posted by Jared341 (Post 1078350)
And the RobotC function calls are here...
http://bricxcc.sourceforge.net/nbc/n...nic_a_p_i.html

Those are the NXC (Not eXactly C) documents.

http://botbench.com/blog/2011/09/10/...er-suite-v2-1/
These are the RobotC sensor drivers by Xander Soldaat.
The first directory has examples on how to read the sensors.

Here is a snippet from HTIRS2-test1.c that shows how to read the direction, and the strength:
Code:

// read the current modulated signal direction
_dirAC = HTIRS2readACDir(HTIRS2);
// read the AC sensor strengths, where acS1 - acS5 are the 5 internal IR sensors
if (!HTIRS2readAllACStrength(HTIRS2, acS1, acS2, acS3, acS4, acS5 ))
        break; // I2C read error occurred

// You want to use the AC readings as the IR beacons that are on the field are modulated at 1200hz

Al Skierkiewicz 25-09-2011 00:28

Re: IR Seeker help?
 
Chuck,
There is no real distance info in the intensity of the received signal. You could/should be able to use two receivers positioned so that there is some distance between them. You only have 9 segment positions but that might be enough to approximate a distance from two sensors.

dtengineering 25-09-2011 01:15

Re: IR Seeker help?
 
Why not spend $15 and save yourself a lot of hassle?

http://www.robotshop.com/ca/producti...-02&lang=en-US

Be aware, however, that while these are excellent rangefinders, they aren't that good when trying to find the distance to diamond plate or other shiny surfaces... darn physics.

Jason

PAR_WIG1350 25-09-2011 13:56

Re: IR Seeker help?
 
Quote:

Originally Posted by dtengineering (Post 1078482)
Why not spend $15 and save yourself a lot of hassle?

http://www.robotshop.com/ca/producti...-02&lang=en-US

Be aware, however, that while these are excellent rangefinders, they aren't that good when trying to find the distance to diamond plate or other shiny surfaces... darn physics.

Jason

$15 for the sensor, $40 more to interface it with the NXT, plus the analog inputs are only designed to read 0-3.3 volt signals (This might not be an issue, the rangefinders data sheet wouldn't load)

More importantly, It likely wouldn't be legal. It uses a non-visible light LED while only visible light LEDs are allowed in custom circuits <R5>c32. Also, the infrared LED could cause trouble if another robots IR seeker picks it up, which could be seen as a violation of <R5>d7. However, I am not capable of making an official ruling, the Q&A forum would be the place for that.

kz2zx 27-12-2011 22:42

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 :/

kz2zx 29-12-2011 23:02

Re: IR Seeker help?
 
well, the alg needs some fine tuning ('close' readings are about 180-190), and the seeker is really hard to use, IMO, over long distances, and I can't put my finger on why.

I think this would be a lot easier with two seeker heads.

cosmo 07-01-2012 21:57

Re: IR Seeker help?
 
FTC question regarding IR. The field docs show a "master" and "slave" IR beacon set up on the schematic. We have beacons from last year "Get Over It", are these the same ones? We're just setting them up now and i want to make sure they haven't changes things up. Last year we got screwed over during a match when the battery on our beacon went too low and the beacon stopped broadcasting. Our bot couldn't find it and spent the auton going in a circle. We lost big points on that. TIA


All times are GMT -5. The time now is 11:17.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi