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

Stock RN1 Standup with no Sensors

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

Stock RN1 Standup with no Sensors

Post by DirtyRoboto » Sat Dec 30, 2006 4:38 pm

Post by DirtyRoboto
Sat Dec 30, 2006 4:38 pm

Here is some code that I am playing with (so it is still quite basic) that will test to see if the RN1 has fallen then to trigger the appropriate response of getting up.
This is done without additional sensors, just the basic RN1.

Instructions...
After uploading then press button '1' on your remote. this will start the checks. Next, place your robot face down and see if he triggers the standup pose.
Remember to do this with plenty of space.

Please note: This code is only for falling forward and was taken from a larger instruction set of which other fall checks are being tested.
This is just an example to get your creative juices flowing.

Here is the link to my upload.
http://robosavvy.com/Builders/DirtyRobo ... 0Check.bas


And here is the code for visual inspection or copy and paste.
Enjoy.

Marcus.

' === DirtyRoboto December 30 2006 ===============
' === DirtyRoboto@btinternet.com ===============
'== Servo check for forward standup ============
'== Remote key number 1 triggers this routine ====

DIM A AS BYTE
DIM A16 AS BYTE
DIM srv6 AS BYTE
DIM srv12 AS BYTE
DIM count AS INTEGER

count = 1


PTP SETON
PTP ALLON

'== motor diretion 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 ===================
GETMOTORSET G6A,1,1,1,1,1,0
GETMOTORSET G6B,1,1,1,0,0,0
GETMOTORSET G6C,1,1,1,0,0,0
GETMOTORSET G6D,1,1,1,1,1,0

SPEED 5

'== motor power on =============================
MOTOR G24

GOSUB standard_pose

'================================================
MAIN:

A = REMOCON(1)
IF A <> 1 THEN GOTO main

GOSUB standard_pose
GOTO MAIN

'================================================
standard_pose:
MOVE G6A,100, 76, 145, 93, 100, 100
MOVE G6D,100, 76, 145, 93, 100, 100
MOVE G6B,100, 30, 80, 100, 100, 100
MOVE G6C,100, 30, 80, 100, 100, 100
WAIT
counter:
count = count + 1
IF count = 300 THEN GOTO fall_fwd_chk
GOTO counter
'================================================
forward_standup:

SPEED 10

MOVE G6A,100, 130, 120, 80, 110, 100
MOVE G6D,100, 130, 120, 80, 110, 100
MOVE G6B,150, 160, 10, 100, 100, 100
MOVE G6C,150, 160, 10, 100, 100, 100
WAIT

MOVE G6A, 80, 155, 85, 150, 150, 100
MOVE G6D, 80, 155, 85, 150, 150, 100
MOVE G6B,185, 40, 60, 100, 100, 100
MOVE G6C,185, 40, 60, 100, 100, 100
WAIT

MOVE G6A, 75, 165, 55, 165, 155, 100
MOVE G6D, 75, 165, 55, 165, 155, 100
MOVE G6B,185, 10, 100, 100, 100, 100
MOVE G6C,185, 10, 100, 100, 100, 100
WAIT

MOVE G6A, 60, 165, 30, 165, 155, 100
MOVE G6D, 60, 165, 30, 165, 155, 100
MOVE G6B,170, 10, 100, 100, 100, 100
MOVE G6C,170, 10, 100, 100, 100, 100
WAIT

MOVE G6A, 60, 165, 25, 160, 145, 100
MOVE G6D, 60, 165, 25, 160, 145, 100
MOVE G6B,150, 60, 90, 100, 100, 100
MOVE G6C,150, 60, 90, 100, 100, 100
WAIT

MOVE G6A,100, 155, 25, 140, 100, 100
MOVE G6D,100, 155, 25, 140, 100, 100
MOVE G6B,130, 50, 85, 100, 100, 100
MOVE G6C,130, 50, 85, 100, 100, 100
WAIT
'standard_pose
MOVE G6A,100, 76, 145, 93, 100, 100
MOVE G6D,100, 76, 145, 93, 100, 100
MOVE G6B,100, 30, 80, 100, 100, 100
MOVE G6C,100, 30, 80, 100, 100, 100
count = 1
GOTO main
'================================================
fall_fwd_chk:

count = 1
'standard_pose
MOVE G6A,100, 76, 145, 93, 100, 100
MOVE G6D,100, 76, 145, 93, 100, 100
MOVE G6B,100, 30, 80, 100, 100, 100
MOVE G6C,100, 30, 80, 100, 100, 100
WAIT
MOVE G6B,120, , , , ,
MOVE G6C,120, , , , ,
DELAY 300
WAIT
srv6 = MOTORIN(6)
srv12 = MOTORIN(12)
DELAY 300
WAIT
IF srv6 < 120 AND srv12 < 120 THEN GOTO forward_standup
GOTO standard_pose
'=================================================
Here is some code that I am playing with (so it is still quite basic) that will test to see if the RN1 has fallen then to trigger the appropriate response of getting up.
This is done without additional sensors, just the basic RN1.

Instructions...
After uploading then press button '1' on your remote. this will start the checks. Next, place your robot face down and see if he triggers the standup pose.
Remember to do this with plenty of space.

Please note: This code is only for falling forward and was taken from a larger instruction set of which other fall checks are being tested.
This is just an example to get your creative juices flowing.

Here is the link to my upload.
http://robosavvy.com/Builders/DirtyRobo ... 0Check.bas


And here is the code for visual inspection or copy and paste.
Enjoy.

Marcus.

' === DirtyRoboto December 30 2006 ===============
' === DirtyRoboto@btinternet.com ===============
'== Servo check for forward standup ============
'== Remote key number 1 triggers this routine ====

DIM A AS BYTE
DIM A16 AS BYTE
DIM srv6 AS BYTE
DIM srv12 AS BYTE
DIM count AS INTEGER

count = 1


PTP SETON
PTP ALLON

'== motor diretion 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 ===================
GETMOTORSET G6A,1,1,1,1,1,0
GETMOTORSET G6B,1,1,1,0,0,0
GETMOTORSET G6C,1,1,1,0,0,0
GETMOTORSET G6D,1,1,1,1,1,0

SPEED 5

'== motor power on =============================
MOTOR G24

GOSUB standard_pose

'================================================
MAIN:

A = REMOCON(1)
IF A <> 1 THEN GOTO main

GOSUB standard_pose
GOTO MAIN

'================================================
standard_pose:
MOVE G6A,100, 76, 145, 93, 100, 100
MOVE G6D,100, 76, 145, 93, 100, 100
MOVE G6B,100, 30, 80, 100, 100, 100
MOVE G6C,100, 30, 80, 100, 100, 100
WAIT
counter:
count = count + 1
IF count = 300 THEN GOTO fall_fwd_chk
GOTO counter
'================================================
forward_standup:

SPEED 10

MOVE G6A,100, 130, 120, 80, 110, 100
MOVE G6D,100, 130, 120, 80, 110, 100
MOVE G6B,150, 160, 10, 100, 100, 100
MOVE G6C,150, 160, 10, 100, 100, 100
WAIT

MOVE G6A, 80, 155, 85, 150, 150, 100
MOVE G6D, 80, 155, 85, 150, 150, 100
MOVE G6B,185, 40, 60, 100, 100, 100
MOVE G6C,185, 40, 60, 100, 100, 100
WAIT

MOVE G6A, 75, 165, 55, 165, 155, 100
MOVE G6D, 75, 165, 55, 165, 155, 100
MOVE G6B,185, 10, 100, 100, 100, 100
MOVE G6C,185, 10, 100, 100, 100, 100
WAIT

MOVE G6A, 60, 165, 30, 165, 155, 100
MOVE G6D, 60, 165, 30, 165, 155, 100
MOVE G6B,170, 10, 100, 100, 100, 100
MOVE G6C,170, 10, 100, 100, 100, 100
WAIT

MOVE G6A, 60, 165, 25, 160, 145, 100
MOVE G6D, 60, 165, 25, 160, 145, 100
MOVE G6B,150, 60, 90, 100, 100, 100
MOVE G6C,150, 60, 90, 100, 100, 100
WAIT

MOVE G6A,100, 155, 25, 140, 100, 100
MOVE G6D,100, 155, 25, 140, 100, 100
MOVE G6B,130, 50, 85, 100, 100, 100
MOVE G6C,130, 50, 85, 100, 100, 100
WAIT
'standard_pose
MOVE G6A,100, 76, 145, 93, 100, 100
MOVE G6D,100, 76, 145, 93, 100, 100
MOVE G6B,100, 30, 80, 100, 100, 100
MOVE G6C,100, 30, 80, 100, 100, 100
count = 1
GOTO main
'================================================
fall_fwd_chk:

count = 1
'standard_pose
MOVE G6A,100, 76, 145, 93, 100, 100
MOVE G6D,100, 76, 145, 93, 100, 100
MOVE G6B,100, 30, 80, 100, 100, 100
MOVE G6C,100, 30, 80, 100, 100, 100
WAIT
MOVE G6B,120, , , , ,
MOVE G6C,120, , , , ,
DELAY 300
WAIT
srv6 = MOTORIN(6)
srv12 = MOTORIN(12)
DELAY 300
WAIT
IF srv6 < 120 AND srv12 < 120 THEN GOTO forward_standup
GOTO standard_pose
'=================================================
DirtyRoboto
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 412
Joined: Tue Sep 19, 2006 1:00 am
Location: London

RE:Stock RN1 Standup with no Sensors

Post by TheGuru » Sat Dec 30, 2006 10:47 pm

Post by TheGuru
Sat Dec 30, 2006 10:47 pm

First of all, may I introduce myself as a new RN-1 owner as of mid December :D .
Marcus, I like where you're going with this code. Although I haven't uploaded/tested it yet I can see where you are going with it. Just one question springs to mind and that is:
If you make the move at high speed and over say only 5 or 10 degrees this would greatly reduce the test period, but have you discovered how tightly it could be reduced and still remain effective? e.g. 10 degrees, 100ms.
In theory this routine would need to be called regularly throughout a routine or at least whenever a fallover was predicted.

Just my thoughts. I'd like to put together the algorithm that calculates a virtual CofG for RN-1 that would result in code to represent the Gyro sensor, but I think thats gonna be a lot of maths.

Regards

Mark
First of all, may I introduce myself as a new RN-1 owner as of mid December :D .
Marcus, I like where you're going with this code. Although I haven't uploaded/tested it yet I can see where you are going with it. Just one question springs to mind and that is:
If you make the move at high speed and over say only 5 or 10 degrees this would greatly reduce the test period, but have you discovered how tightly it could be reduced and still remain effective? e.g. 10 degrees, 100ms.
In theory this routine would need to be called regularly throughout a routine or at least whenever a fallover was predicted.

Just my thoughts. I'd like to put together the algorithm that calculates a virtual CofG for RN-1 that would result in code to represent the Gyro sensor, but I think thats gonna be a lot of maths.

Regards

Mark
TheGuru
Robot Builder
Robot Builder
User avatar
Posts: 10
Joined: Sun Dec 17, 2006 1:00 am
Location: Coventry, UK

Post by DirtyRoboto » Sun Dec 31, 2006 1:06 am

Post by DirtyRoboto
Sun Dec 31, 2006 1:06 am

Cheerz Bru.

The test bed that I am working on involves checking particular servos for sudden changes in the set position and the actual position. In effect I can make my RN1 detect and discriminate severe changes to its FOM (field of motion).
Due to the very slow speed that the code is executed on this platform, it makes this sort of code unreal for normal usage. This does not mean that it cannot be explored, only that the results need to be examined in context to the limits of the platform, namely RN1.

Your idea of increasing the speed of the test period, while good, is flawed by the nature of the problem. The bot has fallen and any increase in the decision process would be minor and could be tweaked out in the self right moves. Also the Bot needs to make a definate decision. the accuracy of this decision depends on a greater period of sampling the position of the servos.

The code I have on the testbed is quite clunky but does sense a fall and will examine its position using the methods above to execute the aproptiate move.

The code is at the stage where I can start the routine, and then push the RN1 over in any fashion and get it to trigger due to the fall. It then goes onto the front/back/sides check before executing the required moves.

Marcus.
(90% drunk ATM)
Cheerz Bru.

The test bed that I am working on involves checking particular servos for sudden changes in the set position and the actual position. In effect I can make my RN1 detect and discriminate severe changes to its FOM (field of motion).
Due to the very slow speed that the code is executed on this platform, it makes this sort of code unreal for normal usage. This does not mean that it cannot be explored, only that the results need to be examined in context to the limits of the platform, namely RN1.

Your idea of increasing the speed of the test period, while good, is flawed by the nature of the problem. The bot has fallen and any increase in the decision process would be minor and could be tweaked out in the self right moves. Also the Bot needs to make a definate decision. the accuracy of this decision depends on a greater period of sampling the position of the servos.

The code I have on the testbed is quite clunky but does sense a fall and will examine its position using the methods above to execute the aproptiate move.

The code is at the stage where I can start the routine, and then push the RN1 over in any fashion and get it to trigger due to the fall. It then goes onto the front/back/sides check before executing the required moves.

Marcus.
(90% drunk ATM)
DirtyRoboto
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 412
Joined: Tue Sep 19, 2006 1:00 am
Location: London

Post by Humanoido » Sun Dec 31, 2006 9:41 am

Post by Humanoido
Sun Dec 31, 2006 9:41 am

Marcus, this is a very good and efficient way to test if RN has fallen over front or backwards (no sensors are required). I commend you on your ingenuity.

Mark, I also like your idea of developing a virtual gyro. I have yet to explore the servo position reporting and additional features, but do believe all the tools are present to accomplish this goal.

Humanoido
Marcus, this is a very good and efficient way to test if RN has fallen over front or backwards (no sensors are required). I commend you on your ingenuity.

Mark, I also like your idea of developing a virtual gyro. I have yet to explore the servo position reporting and additional features, but do believe all the tools are present to accomplish this goal.

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


4 postsPage 1 of 1
4 postsPage 1 of 1