Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

Robonova grip idea

Hitec robotics including ROBONOVA humanoid, HSR-8498HB servos, MR C-3024 Controllers and RoboBasic
3 postsPage 1 of 1
3 postsPage 1 of 1

Robonova grip idea

Post by firefox » Fri Apr 06, 2007 8:05 pm

Post by firefox
Fri Apr 06, 2007 8:05 pm

Hi all
I am new to this (just recieved my RN-1 5 days ago :D ) I have assembled my RN-1 with no problems and installed matts grips ( Thanks Matt there great). I have been looking at the post and seen were some people are looking for ways to sense when the grips have grabbed somthing. I had a idea on using the motorin to check the servo position after telling the servo to move :? . If the grip closes on a object then the servo position will not match the servo commanded position. I have tried the following program and it works. even got brave and put my finger in the grip 8) ( with my other hand on the power switch just in case). Anyway this is only my 3rd day playing with robobasic so as a beginner I was would like to see if some more experienced programmers could rework my idea and post a improved version for all to share. I beleave there my be a simpler way to do the programming I just have to get some programming time under my belt.

SETUP:
DIM SER AS BYTE
DIM LOC AS BYTE
DIM GRP AS BYTE
GRP=0
SER = 50
GETMOTORSET G6A, 1,1,1,1,1,1
GETMOTORSET G6B, 1,1,1,1,1,1
GETMOTORSET G6C, 1,1,1,1,1,1
GETMOTORSET G6D, 1,1,1,1,1,1
LOC=MOTORIN(9)
MOTOR G24
SERVO 9,50
DELAY 1000


MAIN:
SER=SER+1
SERVO 9,SER
LOC=MOTORIN(9)
DELAY 300
LOC=LOC+1
IF LOC = SER THEN OUT 52,1
IF LOC <SER> 120 THEN GOTO QUIT
GOTO MAIN

GRIPCHECK:
GRP = GRP + 1
IF GRP = 6 THEN GOTO QUIT
RETURN

QUIT:
OUT 52,1
DELAY 4000
GOTO SETUP
Hi all
I am new to this (just recieved my RN-1 5 days ago :D ) I have assembled my RN-1 with no problems and installed matts grips ( Thanks Matt there great). I have been looking at the post and seen were some people are looking for ways to sense when the grips have grabbed somthing. I had a idea on using the motorin to check the servo position after telling the servo to move :? . If the grip closes on a object then the servo position will not match the servo commanded position. I have tried the following program and it works. even got brave and put my finger in the grip 8) ( with my other hand on the power switch just in case). Anyway this is only my 3rd day playing with robobasic so as a beginner I was would like to see if some more experienced programmers could rework my idea and post a improved version for all to share. I beleave there my be a simpler way to do the programming I just have to get some programming time under my belt.

SETUP:
DIM SER AS BYTE
DIM LOC AS BYTE
DIM GRP AS BYTE
GRP=0
SER = 50
GETMOTORSET G6A, 1,1,1,1,1,1
GETMOTORSET G6B, 1,1,1,1,1,1
GETMOTORSET G6C, 1,1,1,1,1,1
GETMOTORSET G6D, 1,1,1,1,1,1
LOC=MOTORIN(9)
MOTOR G24
SERVO 9,50
DELAY 1000


MAIN:
SER=SER+1
SERVO 9,SER
LOC=MOTORIN(9)
DELAY 300
LOC=LOC+1
IF LOC = SER THEN OUT 52,1
IF LOC <SER> 120 THEN GOTO QUIT
GOTO MAIN

GRIPCHECK:
GRP = GRP + 1
IF GRP = 6 THEN GOTO QUIT
RETURN

QUIT:
OUT 52,1
DELAY 4000
GOTO SETUP
firefox
Newbie
Newbie
Posts: 5
Joined: Fri Apr 06, 2007 7:45 pm

RN-1 GRIP DETECTION

Post by firefox » Sat Apr 07, 2007 2:29 am

Post by firefox
Sat Apr 07, 2007 2:29 am

I have played around, learned some more and improved my results. This is just to much fun :) . Now if I could just get him to let go of my finger :P .

close_grip:
DIM SER AS BYTE
DIM LOC AS BYTE
DIM loc1 AS BYTE
DIM GRP AS BYTE

GRP=0
LOC=MOTORIN(15)
SER = loc
LOC1 = 0

closegrip1:

SER=SER-1 ' NEXT SERVO POSITION
SERVO 15,SER
DELAY 500 ' ALLOW SERVO TIME TO TRAVEL
LOC=MOTORIN(15)
loc=loc-1 ' CHECK SERVO POSITION
IF LOC = SER THEN ' CHECK TO SEE IF SERVO HAS MOVED
LOC1= 0
OUT 52,0
ENDIF
IF LOC <> SER THEN ' IF SERVO DID NOT MOVE ADD 1 TO LOC1
LOC1 = LOC1 + 1
OUT 52,1
ENDIF

IF LOC1 >= 3 THEN GOTO QUIT ' IF SERVO DID NOT MOVE AFTER 3 TRIES THEN QUIT

IF SER < 80 THEN GOTO QUIT ' IF SERVO REACHES FULL CLOSED THEN QUIT
GOTO closegrip1



QUIT:
OUT 52,1
GOSUB sit_down_pose
RETURN
I have played around, learned some more and improved my results. This is just to much fun :) . Now if I could just get him to let go of my finger :P .

close_grip:
DIM SER AS BYTE
DIM LOC AS BYTE
DIM loc1 AS BYTE
DIM GRP AS BYTE

GRP=0
LOC=MOTORIN(15)
SER = loc
LOC1 = 0

closegrip1:

SER=SER-1 ' NEXT SERVO POSITION
SERVO 15,SER
DELAY 500 ' ALLOW SERVO TIME TO TRAVEL
LOC=MOTORIN(15)
loc=loc-1 ' CHECK SERVO POSITION
IF LOC = SER THEN ' CHECK TO SEE IF SERVO HAS MOVED
LOC1= 0
OUT 52,0
ENDIF
IF LOC <> SER THEN ' IF SERVO DID NOT MOVE ADD 1 TO LOC1
LOC1 = LOC1 + 1
OUT 52,1
ENDIF

IF LOC1 >= 3 THEN GOTO QUIT ' IF SERVO DID NOT MOVE AFTER 3 TRIES THEN QUIT

IF SER < 80 THEN GOTO QUIT ' IF SERVO REACHES FULL CLOSED THEN QUIT
GOTO closegrip1



QUIT:
OUT 52,1
GOSUB sit_down_pose
RETURN
firefox
Newbie
Newbie
Posts: 5
Joined: Fri Apr 06, 2007 7:45 pm

Post by DirtyRoboto » Sat Apr 07, 2007 6:47 am

Post by DirtyRoboto
Sat Apr 07, 2007 6:47 am

Nice one.
I used the same technique for sensing if the bot had fallen over front or back and executing the correct standup code.
You will also see the same type of code in my handshake routine and Bullit's compliance routine.

http://robosavvy.com/forum/viewtopic.ph ... compliance
Nice one.
I used the same technique for sensing if the bot had fallen over front or back and executing the correct standup code.
You will also see the same type of code in my handshake routine and Bullit's compliance routine.

http://robosavvy.com/forum/viewtopic.ph ... compliance
In servo's we trust!
DirtyRoboto
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 412
Joined: Tue Sep 19, 2006 1:00 am
Location: London


3 postsPage 1 of 1
3 postsPage 1 of 1