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

Using remocon

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

Using remocon

Post by Voelker » Mon Oct 15, 2007 9:17 pm

Post by Voelker
Mon Oct 15, 2007 9:17 pm

Hi,

I am trying to use the remocon to capture the number of steps my robonova has to perform, but i can't capture the value. Does anyone ever tried to do the same ?


continuous_walk:
DIM steps AS BYTE
DIM limit AS BYTE

limit = REMOCON(1)
limit = limit - ID

FOR steps = 0 TO limit
OUT 52,1
DELAY 500
OUT 52, 0
NEXT steps

SPEED 5
MOVE24 85, 71, 152, 91, 112, 60, 100, 40, 80, , , , 100, 40, 80, , , , 112, 76, 145, 93, 92, 60,

FOR steps = 0 TO limit
OUT 52, 1
SPEED 14
'left up
MOVE24 90, 107, 105, 105, 114, 60, 90, 40, 80, , , , 100, 40, 80, , , , 114, 76, 145, 93, 90, 60,
'---------------------------------------
'left down
MOVE24 90, 56, 143, 122, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 113, 80, 145, 90, 90, 60,
MOVE24 90, 46, 163, 112, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 112, 80, 145, 90, 90, 60,

SPEED 10
'left center
MOVE24 100, 66, 141, 113, 100, 100, 90, 40, 80, , , , 100, 40, 80, , , , 100, 83, 156, 80, 100, 100,
MOVE24 113, 78, 142, 105, 90, 60, 100, 40, 80, , , , 100, 40, 80, , , , 90, 102, 136, 85, 114, 60,
OUT 52, 0
SPEED 14
'right up
MOVE24 113, 76, 145, 93, 90, 60, 100, 40, 80, , , , 90, 40, 80, , , , 90, 107, 105, 105, 114, 60,

'right down
MOVE24 113, 80, 145, 90, 90, 60, 105, 40, 80, , , , 80, 40, 80, , , , 90, 56, 143, 122, 114, 60,
MOVE24 112, 80, 145, 90, 90, 60, 105, 40, 80, , , , 80, 40, 80, , , , 90, 46, 163, 112, 114, 60,

SPEED 10
'right center
MOVE24 100, 83, 156, 80, 100, 100, 100, 40, 80, , , , 90, 40, 80, , , , 100, 66, 141, 113, 100, 100,
MOVE24 90, 102, 136, 85, 114, 60, 100, 40, 80, , , , 100, 40, 80, , , , 113, 78, 142, 105, 90, 60,
'---------------------------------------
NEXT steps

RETURN
Hi,

I am trying to use the remocon to capture the number of steps my robonova has to perform, but i can't capture the value. Does anyone ever tried to do the same ?


continuous_walk:
DIM steps AS BYTE
DIM limit AS BYTE

limit = REMOCON(1)
limit = limit - ID

FOR steps = 0 TO limit
OUT 52,1
DELAY 500
OUT 52, 0
NEXT steps

SPEED 5
MOVE24 85, 71, 152, 91, 112, 60, 100, 40, 80, , , , 100, 40, 80, , , , 112, 76, 145, 93, 92, 60,

FOR steps = 0 TO limit
OUT 52, 1
SPEED 14
'left up
MOVE24 90, 107, 105, 105, 114, 60, 90, 40, 80, , , , 100, 40, 80, , , , 114, 76, 145, 93, 90, 60,
'---------------------------------------
'left down
MOVE24 90, 56, 143, 122, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 113, 80, 145, 90, 90, 60,
MOVE24 90, 46, 163, 112, 114, 60, 80, 40, 80, , , , 105, 40, 80, , , , 112, 80, 145, 90, 90, 60,

SPEED 10
'left center
MOVE24 100, 66, 141, 113, 100, 100, 90, 40, 80, , , , 100, 40, 80, , , , 100, 83, 156, 80, 100, 100,
MOVE24 113, 78, 142, 105, 90, 60, 100, 40, 80, , , , 100, 40, 80, , , , 90, 102, 136, 85, 114, 60,
OUT 52, 0
SPEED 14
'right up
MOVE24 113, 76, 145, 93, 90, 60, 100, 40, 80, , , , 90, 40, 80, , , , 90, 107, 105, 105, 114, 60,

'right down
MOVE24 113, 80, 145, 90, 90, 60, 105, 40, 80, , , , 80, 40, 80, , , , 90, 56, 143, 122, 114, 60,
MOVE24 112, 80, 145, 90, 90, 60, 105, 40, 80, , , , 80, 40, 80, , , , 90, 46, 163, 112, 114, 60,

SPEED 10
'right center
MOVE24 100, 83, 156, 80, 100, 100, 100, 40, 80, , , , 90, 40, 80, , , , 100, 66, 141, 113, 100, 100,
MOVE24 90, 102, 136, 85, 114, 60, 100, 40, 80, , , , 100, 40, 80, , , , 113, 78, 142, 105, 90, 60,
'---------------------------------------
NEXT steps

RETURN
Voelker
Savvy Roboteer
Savvy Roboteer
Posts: 85
Joined: Thu Sep 06, 2007 7:32 pm

Post by Humanoido » Tue Oct 16, 2007 4:04 am

Post by Humanoido
Tue Oct 16, 2007 4:04 am

The remocon sends an IR pulse to initiate a step sequence. What are you trying to capture? Can you be more specific? The software will capture motion positions as detailed in the manual. Is this what you want?

humanoido
The remocon sends an IR pulse to initiate a step sequence. What are you trying to capture? Can you be more specific? The software will capture motion positions as detailed in the manual. Is this what you want?

humanoido
Humanoido
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 574
Joined: Tue Dec 05, 2006 1:00 am
Location: Deep in the Heart of Asia

Post by Voelker » Tue Oct 16, 2007 6:33 am

Post by Voelker
Tue Oct 16, 2007 6:33 am

I would like to capture the remocon value. In fact i would like t be able to tell the robot to perform N (0,1,2,3,4,5,6,7,8,9,10) steps. So when i press the 'E' button of the recomcon, the controller goes to my subroutine, and i would like to capture another remocon value to know how many steps i have to perform.
Since the remocon doesn't seem to be a buffered device i tried to include a waiting loop in my sequence, with no success.
I would like to capture the remocon value. In fact i would like t be able to tell the robot to perform N (0,1,2,3,4,5,6,7,8,9,10) steps. So when i press the 'E' button of the recomcon, the controller goes to my subroutine, and i would like to capture another remocon value to know how many steps i have to perform.
Since the remocon doesn't seem to be a buffered device i tried to include a waiting loop in my sequence, with no success.
Voelker
Savvy Roboteer
Savvy Roboteer
Posts: 85
Joined: Thu Sep 06, 2007 7:32 pm

Post by DirtyRoboto » Tue Oct 16, 2007 12:22 pm

Post by DirtyRoboto
Tue Oct 16, 2007 12:22 pm

In servo's we trust!
DirtyRoboto
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 412
Joined: Tue Sep 19, 2006 1:00 am
Location: London

Try This

Post by quickster47 » Tue Oct 16, 2007 12:50 pm

Post by quickster47
Tue Oct 16, 2007 12:50 pm

Voelker,

I would try something like the code below this text. What you are doing is using a flag to get the first and second commands from the RemCon. You start with the flag set false, get the frist command into RRCmd, set the flag true and then return to get the next command. On the second pass you get the value and put it into the limit count for the for-next loop.

I did not get to try this cause I am at work but it should do what you are wanting. And I know the do_move routine is not correct but is should demonstrate the principle.

DIM RR AS BYTE
DIM A AS BYTE
DIM A16 AS BYTE
DIM A26 AS BYTE
DIM I AS BYTE

DIM rrcmd AS BYTE
DIM steps AS BYTE
DIM limit AS BYTE
DIM flag0 AS BYTE


CONST ID = 0 ' 1:0, 2:32, 3:64, 4:96

RR = 0

rrcmd = 0
flag0 = 0

PTP SETON
PTP ALLON

'=={ set motor diretions }======================================================
DIR G6A,1,0,0,1,0,0
DIR G6B,1,1,1,1,1,1
DIR G6C,0,0,0,0,0,0
DIR G6D,0,1,1,0,1,0

'===============================================================================

MAIN:

'GOSUB robot_voltage
'GOSUB robot_tilt

'-------------------------------------------------------------------------------

IF RR = 0 THEN GOTO MAIN1

ON RR GOTO MAIN,K1,K2,K3, ... ,K30,K31,K32
GOTO main_exit

'-------------------------------------------------------------------------------

MAIN1:

get_input:
IF flag0 = 0 THEN
flag0 = 1
rrcmd = REMOCON(1)
rrcmd = rrcmd - ID
GOTO get_input
ELSE
limit = REMOCON(1)
limit = limit - ID
flag0 = 0

ON rrcmd GOTO MAIN,K1,K2,K3, ... ,K30,K31,K32

GOTO MAIN

'-------------------------------------------------------------------------------

main_exit:
IF RR > 50 THEN RETURN
RR = 0
GOTO MAIN

'===============================================================================

K1:
GOSUB do_move
GOSUB standard_pose
GOTO main_exit
K2:
GOSUB standard_pose
GOTO main_exit
K3:
GOSUB standard_pose
GOTO main_exit
K4:
GOSUB standard_pose
GOTO main_exit
K5:
GOSUB standard_pose
GOTO main_exit
K6:
GOSUB standard_pose
GOTO main_exit
K7:
GOSUB standard_pose
GOTO main_exit
K8:
GOSUB standard_pose
GOTO main_exit
K9:
GOSUB standard_pose
GOTO main_exit
K10:
GOSUB standard_pose
GOTO main_exit
K11: ' ^ 1
GOSUB standard_pose
GOTO main_exit
K12: ' _ 1
GOSUB standard_pose
GOTO main_exit
K13: ' > 1
GOSUB standard_pose
GOTO main_exit
K14: ' < 1
GOSUB standard_pose
GOTO main_exit
K15: ' A
GOSUB standard_pose
GOTO main_exit
K16:
GOSUB standard_pose
GOTO main_exit
K17: ' C
GOSUB standard_pose
GOTO main_exit
K18: ' E
GOSUB standard_pose
GOTO main_exit
K19: ' P2
GOSUB standard_pose
GOTO main_exit
K20: ' B
GOSUB standard_pose
GOTO main_exit
K21: ' ^ 2
GOSUB standard_pose
GOTO main_exit
K22: ' *
GOSUB standard_pose
GOTO main_exit
K23: ' F
GOSUB standard_pose
GOTO main_exit
K24: ' #
GOSUB standard_pose
GOTO main_exit
K25: ' P1
GOSUB standard_pose
GOTO main_exit
K26: ' [] 1
GOSUB standard_pose
GOTO main_exit
K27: ' D
GOSUB standard_pose
GOTO main_exit
K28: ' <2> 2
GOSUB standard_pose
GOTO main_exit
K31: ' _ 2
GOSUB standard_pose
GOTO main_exit
K32: ' G
GOSUB standard_pose
GOTO main_exit

'===============================================================================

do_move:

SPEED 5

FOR steps = 0 TO limit

MOVE G6A, 100, 58, 135, 160, 100, 100
MOVE G6B, 100, 30, 80, 100, 100, 100
MOVE G6C, 100, 30, 80, 100, 100, 100
MOVE G6D, 100, 58, 135, 160, 100, 100
WAIT

DELAY 1000

NEXT steps

RETURN

'===============================================================================

standard_pose:

MOVE G6D, 100, 76, 145, 93, 100, 100
MOVE G6A, 100, 76, 145, 93, 100, 100
MOVE G6B, 100, 30, 80, 100, 100, 100
MOVE G6C, 100, 30, 80, 100, 100, 100
WAIT

RETURN
Voelker,

I would try something like the code below this text. What you are doing is using a flag to get the first and second commands from the RemCon. You start with the flag set false, get the frist command into RRCmd, set the flag true and then return to get the next command. On the second pass you get the value and put it into the limit count for the for-next loop.

I did not get to try this cause I am at work but it should do what you are wanting. And I know the do_move routine is not correct but is should demonstrate the principle.

DIM RR AS BYTE
DIM A AS BYTE
DIM A16 AS BYTE
DIM A26 AS BYTE
DIM I AS BYTE

DIM rrcmd AS BYTE
DIM steps AS BYTE
DIM limit AS BYTE
DIM flag0 AS BYTE


CONST ID = 0 ' 1:0, 2:32, 3:64, 4:96

RR = 0

rrcmd = 0
flag0 = 0

PTP SETON
PTP ALLON

'=={ set motor diretions }======================================================
DIR G6A,1,0,0,1,0,0
DIR G6B,1,1,1,1,1,1
DIR G6C,0,0,0,0,0,0
DIR G6D,0,1,1,0,1,0

'===============================================================================

MAIN:

'GOSUB robot_voltage
'GOSUB robot_tilt

'-------------------------------------------------------------------------------

IF RR = 0 THEN GOTO MAIN1

ON RR GOTO MAIN,K1,K2,K3, ... ,K30,K31,K32
GOTO main_exit

'-------------------------------------------------------------------------------

MAIN1:

get_input:
IF flag0 = 0 THEN
flag0 = 1
rrcmd = REMOCON(1)
rrcmd = rrcmd - ID
GOTO get_input
ELSE
limit = REMOCON(1)
limit = limit - ID
flag0 = 0

ON rrcmd GOTO MAIN,K1,K2,K3, ... ,K30,K31,K32

GOTO MAIN

'-------------------------------------------------------------------------------

main_exit:
IF RR > 50 THEN RETURN
RR = 0
GOTO MAIN

'===============================================================================

K1:
GOSUB do_move
GOSUB standard_pose
GOTO main_exit
K2:
GOSUB standard_pose
GOTO main_exit
K3:
GOSUB standard_pose
GOTO main_exit
K4:
GOSUB standard_pose
GOTO main_exit
K5:
GOSUB standard_pose
GOTO main_exit
K6:
GOSUB standard_pose
GOTO main_exit
K7:
GOSUB standard_pose
GOTO main_exit
K8:
GOSUB standard_pose
GOTO main_exit
K9:
GOSUB standard_pose
GOTO main_exit
K10:
GOSUB standard_pose
GOTO main_exit
K11: ' ^ 1
GOSUB standard_pose
GOTO main_exit
K12: ' _ 1
GOSUB standard_pose
GOTO main_exit
K13: ' > 1
GOSUB standard_pose
GOTO main_exit
K14: ' < 1
GOSUB standard_pose
GOTO main_exit
K15: ' A
GOSUB standard_pose
GOTO main_exit
K16:
GOSUB standard_pose
GOTO main_exit
K17: ' C
GOSUB standard_pose
GOTO main_exit
K18: ' E
GOSUB standard_pose
GOTO main_exit
K19: ' P2
GOSUB standard_pose
GOTO main_exit
K20: ' B
GOSUB standard_pose
GOTO main_exit
K21: ' ^ 2
GOSUB standard_pose
GOTO main_exit
K22: ' *
GOSUB standard_pose
GOTO main_exit
K23: ' F
GOSUB standard_pose
GOTO main_exit
K24: ' #
GOSUB standard_pose
GOTO main_exit
K25: ' P1
GOSUB standard_pose
GOTO main_exit
K26: ' [] 1
GOSUB standard_pose
GOTO main_exit
K27: ' D
GOSUB standard_pose
GOTO main_exit
K28: ' <2> 2
GOSUB standard_pose
GOTO main_exit
K31: ' _ 2
GOSUB standard_pose
GOTO main_exit
K32: ' G
GOSUB standard_pose
GOTO main_exit

'===============================================================================

do_move:

SPEED 5

FOR steps = 0 TO limit

MOVE G6A, 100, 58, 135, 160, 100, 100
MOVE G6B, 100, 30, 80, 100, 100, 100
MOVE G6C, 100, 30, 80, 100, 100, 100
MOVE G6D, 100, 58, 135, 160, 100, 100
WAIT

DELAY 1000

NEXT steps

RETURN

'===============================================================================

standard_pose:

MOVE G6D, 100, 76, 145, 93, 100, 100
MOVE G6A, 100, 76, 145, 93, 100, 100
MOVE G6B, 100, 30, 80, 100, 100, 100
MOVE G6C, 100, 30, 80, 100, 100, 100
WAIT

RETURN
quickster47
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 29
Joined: Sat Sep 22, 2007 5:57 pm

Post by Voelker » Tue Oct 16, 2007 10:19 pm

Post by Voelker
Tue Oct 16, 2007 10:19 pm

I finally got it working.



'================================================
' templet program
'
' RR : internal parameter variable / ROBOREMOCON / Action command
' A : temporary variable / REMOCON
' A16,A26 : temporary variable
'
'== auto_main ===================================
GOTO AUTO
FILL 255,10000

DIM RR AS BYTE
DIM A AS BYTE
DIM A16 AS BYTE
DIM A26 AS BYTE
DIM limit AS BYTE
DIM flag0 AS BYTE
DIM steps AS BYTE

CONST ID = 0 ' 1:0, 2:32, 3:64, 4:96,

'== Action command check (50 - 82)
IF RR > 50 AND RR < 83 THEN GOTO action_proc

RR = 0
flag0 = 0

PTP SETON
PTP ALLON

'== motor direction setting ======================
DIR G6A,1,0,0,1,0,0
DIR G6B,1,1,1,1,1,1
DIR G6C,0,0,0,0,0,0
DIR G6D,0,1,1,0,1,0


'== motor start position read ===================
TEMPO 230
MUSIC "CDE"
GETMOTORSET G24,1,1,1,1,1,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,1,1,0
'== motor power on =============================
SPEED 5
MOTOR G24
GOSUB standard_pose

'================================================
MAIN:
GOSUB robot_voltage
'GOSUB robot_tilt

'-----------------------------
IF RR = 0 THEN GOTO MAIN1

ON RR GOTO MAIN,K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,K15,K16,K17,K18,K19,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K30,K31,K32
GOTO main_exit
'-----------------------------
MAIN1:
get_input:
IF flag0 = 0 THEN
A = REMOCON(1)
A = A - ID
flag0 = 1
GOSUB get_input
ELSE
limit = 0
limit = REMOCON(1)
limit = limit - ID
IF limit = 0 AND A = 18 THEN GOSUB get_input
flag0 = 0

ON A GOTO MAIN,K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,K15,K16,K17,K18,K19,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K30,K31,K32
GOTO MAIN
I finally got it working.



'================================================
' templet program
'
' RR : internal parameter variable / ROBOREMOCON / Action command
' A : temporary variable / REMOCON
' A16,A26 : temporary variable
'
'== auto_main ===================================
GOTO AUTO
FILL 255,10000

DIM RR AS BYTE
DIM A AS BYTE
DIM A16 AS BYTE
DIM A26 AS BYTE
DIM limit AS BYTE
DIM flag0 AS BYTE
DIM steps AS BYTE

CONST ID = 0 ' 1:0, 2:32, 3:64, 4:96,

'== Action command check (50 - 82)
IF RR > 50 AND RR < 83 THEN GOTO action_proc

RR = 0
flag0 = 0

PTP SETON
PTP ALLON

'== motor direction setting ======================
DIR G6A,1,0,0,1,0,0
DIR G6B,1,1,1,1,1,1
DIR G6C,0,0,0,0,0,0
DIR G6D,0,1,1,0,1,0


'== motor start position read ===================
TEMPO 230
MUSIC "CDE"
GETMOTORSET G24,1,1,1,1,1,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,1,1,0
'== motor power on =============================
SPEED 5
MOTOR G24
GOSUB standard_pose

'================================================
MAIN:
GOSUB robot_voltage
'GOSUB robot_tilt

'-----------------------------
IF RR = 0 THEN GOTO MAIN1

ON RR GOTO MAIN,K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,K15,K16,K17,K18,K19,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K30,K31,K32
GOTO main_exit
'-----------------------------
MAIN1:
get_input:
IF flag0 = 0 THEN
A = REMOCON(1)
A = A - ID
flag0 = 1
GOSUB get_input
ELSE
limit = 0
limit = REMOCON(1)
limit = limit - ID
IF limit = 0 AND A = 18 THEN GOSUB get_input
flag0 = 0

ON A GOTO MAIN,K1,K2,K3,K4,K5,K6,K7,K8,K9,K10,K11,K12,K13,K14,K15,K16,K17,K18,K19,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K30,K31,K32
GOTO MAIN
Voelker
Savvy Roboteer
Savvy Roboteer
Posts: 85
Joined: Thu Sep 06, 2007 7:32 pm


6 postsPage 1 of 1
6 postsPage 1 of 1