gripper & IR ACCURACY HELP
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
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
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).
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
Q: What else floats?
A: Very small rocks...!
Well, we did do the nose.