Shop OBEX P1 Docs P2 Docs Learn Events
gripper & IR ACCURACY HELP — Parallax Forums

gripper & IR ACCURACY HELP

kenner12kenner12 Posts: 7
edited 2012-08-03 09:15 in Robotics
Hello parallax moderators,

I have done a boe- bot robot with a gripper ''program'' to get the robot to spin around while looking for an object and when an object is detected it moves towards the object and grabs the object,stay still for 1 second,move for a few seconds and then stops for a second,drops the object and reverses and then start spinning agian and repeating the same routine.I'm using IR LED and Detectors for object detection but the only difficulty I'm having is to accurately get the gripper to grab the object exactly where it is.I have two IR LEDS on both front sides of the boe-bot. I have been just estimating the time it would take to reach the object,such as 2 seconds or so but I wonder is there any other better way I can get the gripper to be accurately within reach of the object before grabbing onto it.The gripper width is 5 inches.I want to maintain using IR for this project.

Here is my program code:
' {$STAMP BS2}
' {$PBASIC 2.5}

counter VAR Word
irDetectleft VAR Bit
irDetectRight VAR Bit

main:
DO
FREQOUT 8, 1, 38500 ' Check IR Detectors..
irDetectLeft = IN9
FREQOUT 2, 1, 38500
irDetectRight = IN0

PULSOUT 14, 500
PULSOUT 12,770
PULSOUT 13,770
PAUSE 20
LOOP UNTIL (irDetectleft=0) AND (irDetectRight=0)
HIGH 1
HIGH 10
PAUSE 20
LOW 1
LOW 10
FOR counter=1 TO 122 'move forward towards object'
PULSOUT 14,500
PULSOUT 12,650
PULSOUT 13,850
PAUSE 20
NEXT
FOR counter=1 TO 64 'stay still'
PULSOUT 14,500
PULSOUT 12, 750
PULSOUT 13, 750
PAUSE 20
NEXT
FOR counter=1 TO 122 'close gripper'
PULSOUT 14,1000
PAUSE 20
NEXT
FOR counter=1 TO 80 'move forward
PULSOUT 14,1000
PULSOUT 12,650
PULSOUT 13,850
PAUSE 20
NEXT
FOR counter= 1 TO 122 'drop object'
PULSOUT 14,500
PAUSE 20
NEXT
FOR counter= 1 TO 128 'reverse'
PULSOUT 12,850
PULSOUT 13,650
PAUSE 20
NEXT
GOTO main


Thanks.

Ken

Comments

  • ZootZoot Posts: 2,227
    edited 2012-08-02 15:41
    The Stamp Boe-bot book has some good code of examples of getting a rough distance range using the IR leds and detectors. You can download that here: http://www.parallax.com/Portals/0/Downloads/docs/books/edu/Roboticsv2_2.pdf

    If that will not be accurate enough for you (and it very well might not be), then you might want to think about using an IR ranger (which can give you accurate distances to within one cm. or less) or a sonar ranger like the Ping))). Both have advantages/disadvantages, but for this purpose I would probably use an IR ranger (faster sampling time, more consistent accuracy; cons = need an ADC to use with the Stamp, won't see some colors like matte black).
  • ercoerco Posts: 20,256
    edited 2012-08-02 16:25
    A simple light contact switch, like a Boebot whisker could detect the object. I'd put the whisker right inside the gripper claw, triggered when the object enters the gripper. Since you're sensing and picking up the same object , you can fine tune the whisker to the object.
  • msrobotsmsrobots Posts: 3,709
    edited 2012-08-03 01:51
    @erco,

    yes - a practical solution - you do not even need a relay!

    a small piece of plywood and a whisker will do the job.

    perfect!

    Mike
  • ercoerco Posts: 20,256
    edited 2012-08-03 09:15
    msrobots wrote: »
    a small piece of plywood and a whisker will do the job.

    Q: What else floats?
    A: Very small rocks...!

    Well, we did do the nose.
Sign In or Register to comment.