Shop OBEX P1 Docs P2 Docs Learn Events
PAN and TILT with infra-red — Parallax Forums

PAN and TILT with infra-red

sushiandmorihikosushiandmorihiko Posts: 40
edited 2007-10-14 03:30 in BASIC Stamp
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
381 x 450 - 40K

Comments

  • D FaustD Faust Posts: 608
    edited 2007-10-06 12:10
    CR servos accept the same signals as standard servos, except on a standard servo the angle not the speed changes.
    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.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    LOOKDOWN ThisThread, [noparse][[/noparse]Your_?, My_?, Cool_Thing], looknum
    LOOKUP looknum, [noparse][[/noparse]1, 2, 3], subnum
    ON subnum GOTO Hope_this_helps, Thanks!, WOW!!
    END 
    
  • sushiandmorihikosushiandmorihiko Posts: 40
    edited 2007-10-06 14:48
    thanks for the reply d faust,

    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
  • D FaustD Faust Posts: 608
    edited 2007-10-06 14:56
    You need two different values for each of the servos to follow.· If you have one on the left and one on the right you can figure out whether you want to move left or right by moving the servo·toward the one that detects the least distance between your hand and it.···You are using the IR stuff that comes with the boe-bot right?· If so you would determine the zone that each sensor·detects·your hand in and use that as your distance.· If you want up-down and left right·movement you will need 4 IR pairs.· (you could probably use one reciever and 4 emitters w/ the reciever in the middle.)· Hope this clarifies it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    LOOKDOWN ThisThread, [noparse][[/noparse]Your_?, My_?, Cool_Thing], looknum
    LOOKUP looknum, [noparse][[/noparse]1, 2, 3], subnum
    ON subnum GOTO Hope_this_helps, Thanks!, WOW!!
    END 
    
  • sushiandmorihikosushiandmorihiko Posts: 40
    edited 2007-10-07 02:06
    thanks d faust,i got your idea,it gives me better picture on how to design my project

    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.
  • D FaustD Faust Posts: 608
    edited 2007-10-07 02:18
    It looks to me as if you would use the camera to follow an object with that turret (if that is what you are trying to do.· I have no clue how to incorporate a camera into code).· Another purpose would to just have a movable sensor platform to map the surroundings (not track anything).· Yeah you should be fine with 4 IR emitters and one receptor as long as you allow a short pause in between triggering the emitters.· It is probably better to use pings becasue they have less of a chance of being interfered, but 4 pings is a lot of $$ to track something.· Try it with IR and see if it works (it should) and if it doesn't post your problem here.· If nobody can solve·your problem·then go with the pings.

    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).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    LOOKDOWN ThisThread, [noparse][[/noparse]Your_?, My_?, Cool_Thing], looknum
    LOOKUP looknum, [noparse][[/noparse]1, 2, 3], subnum
    ON subnum GOTO Hope_this_helps, Thanks!, WOW!!
    END 
    
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-07 02:48
    1) Parallax sells a version of the CMUCAM. Have a look at their sample code. Note that the webstore pages for the products that Parallax sells have the links to the documentation and sample programs.

    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.
  • D FaustD Faust Posts: 608
    edited 2007-10-07 12:17
    Mike, I said 4 emitters because you would need 4 sensor inputs to detect up, down, left and right movements, not to illuminate more.· The need to be triggered separately to get 4 different values.· This is for track not obstacle avoidance.· Am I missing something?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    LOOKDOWN ThisThread, [noparse][[/noparse]Your_?, My_?, Cool_Thing], looknum
    LOOKUP looknum, [noparse][[/noparse]1, 2, 3], subnum
    ON subnum GOTO Hope_this_helps, Thanks!, WOW!!
    END 
    
  • sushiandmorihikosushiandmorihiko Posts: 40
    edited 2007-10-12 06:07
    d faust,

    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
  • D FaustD Faust Posts: 608
    edited 2007-10-12 18:35
    the ok_difference is the difference between the two values that is acceptable and doesn't require movement.

    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

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    LOOKDOWN ThisThread, [noparse][[/noparse]Your_?, My_?, Cool_Thing], looknum
    LOOKUP looknum, [noparse][[/noparse]1, 2, 3], subnum
    ON subnum GOTO Hope_this_helps, Thanks!, WOW!!
    END 
    
  • sushiandmorihikosushiandmorihiko Posts: 40
    edited 2007-10-13 05:33
    thanks d faust--i shall try it--anyway from now on i think i ll post inside "PERSONAL DEFENSE TURRET THREAD" as to reduce the number of thread altogether and that all these question comes from this one big project. is it okay?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-10-13 13:32
    sushiandmorihiko said,
    ...to reduce the number of thread altogether and that all these question comes from this one big project. is it okay?

    · 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
  • sushiandmorihikosushiandmorihiko Posts: 40
    edited 2007-10-14 03:30
    to PJ Allen,

    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
Sign In or Register to comment.