PAN and TILT with infra-red
sushiandmorihiko
Posts: 40
hello,
as you have read my project in the previous thread, i want to mount infra-reds on the PAN and TILT so that she will turn its head up and down,left to right(2servo)according to the lets say the movements of my hands.however,i got on how to code this infra red to react as i want it to be.
i really wanted to make use of following boe-bot codes from boe-bot book page 282.however i didnt know how to synchronize these codes to my standard servos as this codes are meant for continous rotation servo--and somemore their movements are different ( boe-bot with PAN and tilt).
this is quite a big project to me and if anyone can help or experienced in this,i would gladly welcome but please note that i am just a beginner in this field although i study although my major is engineering (boe-bot standard electronic--somewhere there).
thank you in advance
HERE IS THE SAMPLE OF THE DEVICE PAN AND TILT[noparse]:([/noparse]THE INFRA-REDS ARE TO MOUNTED ON TOP SO IT WILL DETECT AND FOLLOW MY HAND).
if possible--i would gladly welcome complete and long winded guidance from anyone.
thank you again
as you have read my project in the previous thread, i want to mount infra-reds on the PAN and TILT so that she will turn its head up and down,left to right(2servo)according to the lets say the movements of my hands.however,i got on how to code this infra red to react as i want it to be.
i really wanted to make use of following boe-bot codes from boe-bot book page 282.however i didnt know how to synchronize these codes to my standard servos as this codes are meant for continous rotation servo--and somemore their movements are different ( boe-bot with PAN and tilt).
this is quite a big project to me and if anyone can help or experienced in this,i would gladly welcome but please note that i am just a beginner in this field although i study although my major is engineering (boe-bot standard electronic--somewhere there).
thank you in advance
HERE IS THE SAMPLE OF THE DEVICE PAN AND TILT[noparse]:([/noparse]THE INFRA-REDS ARE TO MOUNTED ON TOP SO IT WILL DETECT AND FOLLOW MY HAND).
if possible--i would gladly welcome complete and long winded guidance from anyone.
thank you again
Comments
You'll probably need some logic like this:
If Top_IR > Bottom_IR + OK_Difference Then
···· pulse = pulse + 10
···· If pulse > 1000 Then 'all the way one direction
········· pulse = 1000
···· EndIf
EndIf
If Bottom_IR > Top_IR + OK_Difference Then
···· pulse = pulse - 10
·····If pulse < 500 Then 'all the way the other direction
········· pulse = 500
···· EndIf
EndIf
Pulsout vertical_servo, pulse
Note: these pulsout values are for a BS2 a faster processor will need different values. Hope this helps, no guarantees. I am assuming that you will have one set of IR sensors on the top and bottom (you will need them on the left and right too) that return an analog value/zone.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
hhmm,actually i was thinking of having 2 set of infra-red mounted on top only---there is none on the bottom.can i do this?can it still detect movements and follow it?
i roughly got your idea but i didnt really get what kind of value for the TOP_IR and BOTTOM_IR is that/
does it work like--if the top_ir sense something bigger than bottom_ir,it will move to the direction of the top_ir and vice versa?
thank you for your attention
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
i was wandering about this turret when i happened to spot this beuty too-- http://www.roboticsconnection.com/pc-42-6-cmucam2-cmucam2-cmucam3-robot-turret.aspx
what do you think about this pan and tilt? i was wandering how this thing suppose to follow my hand if the PINGs are mounted only on top or this thing is not meant to follow movements?can you explain to me how this design works.
i was considering to purchase this device too but the price for the camera was too expensive and somemore each of the sensors mounted there would do a large damage to my credit card...,so i was thinking about buying those sensors and camera myself or at least the sensors kit from parallax--at least i am familiar with the interface and i luv this very supportive community.
ok--back to your concept, is it ok to have 4 infra-reds and just one receiver in the middle--it wont do any harm or interference right? my PAN and tilt will be coming 2 more days and from that day i ll inform you my latest work.
another simple question--for my purpose,is it better to use PING or INFRA-RED ?
thanks D Faust...greatly appreciated your advices.
PS the pan and tilt that you linked to looks much bigger than what you would need unless you were using a camera.· Don't ask me about cameras I know nothing (FYI).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
2) Why have 4 IR emitters? Parallax tends to use 2 to give a little broader illumination pattern because the BoeBot is doing obstacle avoidance. One emitter will give a relatively narrow field of illumination and may give better results for object detection.
3) See the previous comments in some of the other threads you've started on IR vs PING. Both have limitations and advantages.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
can you explain to me this part of the program;
If pulse > 1000 Then 'all the way one direction
pulse = 1000
and what is the ok_difference for?
thanks man--u ve been a great help
About
"If pulse > 1000 Then 'all the way one direction
pulse = 1000"
1000 is the end of the range for a servo (typically and with a BS2) It may needed to be adjusted for the max range of your servo. If the value is set higher than the max by the program it is not going to affect the servo properly. This might be easier to read:
If pulse > max_pulse Then
pulse = max_pulse"
Hope this helps
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
· What's the effect?·
· Now you have 5 active threads in this particular forum and they're all related.·
· What's your theory?
Update --
5 being this one and these:
http://forums.parallax.com/showthread.php?p=682592
http://forums.parallax.com/showthread.php?p=680776
http://forums.parallax.com/showthread.php?p=682275
http://forums.parallax.com/showthread.php?p=682359
Post Edited (PJ Allen) : 10/13/2007 1:39:00 PM GMT
my theory and question here posted in the forum will all sum up to "personal defense turret" that i am making.therefore right now,i will be postion more inside that thread as to save space and confusion because all the questions are from that one project.
hope this clarify
pls join me in that latest thread-you are most welcomed