Let's Make Robots!

Free Range Robots (IR Beacon) **UPDATED**

**Update 4.14.09***

OK, when you watch the video... 

First of all, it is like, 5 minutes -sorry. There is a point though promise, and that point starts at about 3:40 or so. Now, I can't stress enough, the code is wicked chunky as it was written in about 10 min. It is all "bang-bang" and not proportional at all. The final code should be about 10x faster, much more accurate with a lot less trial and error. For now, this is just proof of concept and indeed it has been proven. 

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

The IR sensor and IR LED are done exactly per the picaxe manual's instructions, period. To get the sensor to respond "directionally" I simply put it at the end of a small tube and crimped down the other end leaving just a small hole. The inside is painted black. Like this:

 

Walter_Autodrive_Update_015.jpg

That's it.

I have the IR led's on the transmitter (beacon) sending out a constant command (the equivalant of holding down a button on a remote) and the servo scans and sees if the sensor can see the IR beam at each location. With the set-up I have now, it can find/miss the beacon withing 5 servo steps. I.e. if I have the servo go in 5-step steps, it will jump over the beam a lot... In 2-step steps it will find it every time.

Here's the code I am using:

pause 1000
gosub clearscreen
gosub mainscreen
servo 1,225
pause 500


buttonmain:
if pin1=1 then
gosub clearscreen
setfreq m8
serout 0,T9600_8,(254, 128)    'Sets line 1 position 1
serout 0,T9600_8,("Starting Sweep  ")
serout 0,T9600_8,(254, 192)    'Sets line 2 position 1
serout 0,T9600_8,("IR Beacon       ")
setfreq m4
servo 1,225
pause 500
gosub roomone
endif
goto buttonmain


mainscreen:
setfreq m8
serout 0,T9600_8,(254, 128)    'Sets line 1 position 1
serout 0,T9600_8,("Button 1        ")
serout 0,T9600_8,(254, 192)    'Sets line 2 position 1
serout 0,T9600_8,("To Start Sweep  ")
setfreq m4
return

clearscreen:
setfreq m8
serout 0,T9600_8,(254, $01)
pause 10
serout 0,T9600_8,(254, $01)
pause 10
setfreq m4
return

roomone:
let b2=200
gosub servomove

let b2=180
gosub servomove

let b2=145
gosub servomove

let b2=120
gosub servomove

let b2=90
gosub servomove

let b2=68
gosub servomove

let b2=35
gosub servomove


goto buttonmain

servomove:
servo 1,b2
pause 500
gosub ircheck
return

ircheck:
IRIN [100,ircheck2],4,b1
if b1=11 then foundit
ircheck2:
return

foundit:
gosub clearscreen
setfreq m8
serout 0,T9600_8,(254, 128)    'Sets line 1 position 1
serout 0,T9600_8,("Beacon Heading")
serout 0,T9600_8,(254, 192)    'Sets line 2 position 1
serout 0,T9600_8,(#b2," O'clock")
setfreq m4
pause 5000
gosub clearscreen
gosub mainscreen
goto buttonmain

 

I will do a proper post tonight (with pretty pictures) and all the componants I am using. Promise
Cheers dude, looking forward to it. 
The 360 comes from the gear ratio. The jitter comes from the fact that I am running on only 3 AA's and the backlight of the LCD is stealing a lot of the servo's juice.

Of that, what a great way to do it. Saves you opening the servo case and medling. 

Do you alter the code for it at all, like halfing the degrees?

 

e.g

 

180* 2 = 360 

turn a full 360 degrees or is it some kind of jiggery pokery with the gears? 

 

 

looks like an interesting project dude.  

This is just the basic picaxe IR set-up, the one with the 3-pin receiver. The only difference is that I stuck the receiver in the end of a tube with the inside painted black. With the receiver shielded this way, it can only see a signal coming directly in front of it. Badda boom badda bing.

ohhhhh thanks ! never got that thing working.

Am I the only one that sees a problem with the idea of 2 becons in a room?

Yeah rik,

Using the IRIN command, you have 128 available codes that can be spit-out and read. Each beacon would have it's own "frequency" and there would be 2 per room again, each having its own code number. With a beacon in each corner, walter could center himself between the two, be a given distance back from them (from the triangulation), know which one is on the left and right and know what room he is in. Using these beacons in a few stratigic locations, and an eeprom table of distances to and from other places... well. In terms of false triggers turning the beacons on, I really don't have a problem with that --anything is better than having them blinking away all day and night. -or- get a good deal on some wall-plug transformers and have all the beacons AC powered and simply blinking all the time -but now plugged in.

cool ! is there a page explaning how to make a beacon , transmitter or reciver?