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

Robonova tilt sensor

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

Robonova tilt sensor

Post by saview » Tue Feb 26, 2008 10:19 pm

Post by saview
Tue Feb 26, 2008 10:19 pm

I'm sure this has been posted somewhere, I just cant find it. I've just installed the tilt sensor into AD0, and pasted the exact code that is found on the instructions. But nothing is happening when i place him down. Not sure what I have missed. Any help would be appreciated.
robot_tilt:
A = AD(0)
IF A > 250 THEN RETURN

IF A <30> 200 THEN GOTO tilt_high

RETURN
tilt_low:
A = AD(0)
'IF A < 30 THEN GOTO forward_standup
IF A < 30 THEN GOTO backward_standup
RETURN
tilt_high:
A = AD(0)
'IF A > 200 THEN GOTO backward_standup
IF A > 200 THEN GOTO forward_standup
RETURN
I'm sure this has been posted somewhere, I just cant find it. I've just installed the tilt sensor into AD0, and pasted the exact code that is found on the instructions. But nothing is happening when i place him down. Not sure what I have missed. Any help would be appreciated.
robot_tilt:
A = AD(0)
IF A > 250 THEN RETURN

IF A <30> 200 THEN GOTO tilt_high

RETURN
tilt_low:
A = AD(0)
'IF A < 30 THEN GOTO forward_standup
IF A < 30 THEN GOTO backward_standup
RETURN
tilt_high:
A = AD(0)
'IF A > 200 THEN GOTO backward_standup
IF A > 200 THEN GOTO forward_standup
RETURN
saview
Robot Builder
Robot Builder
Posts: 11
Joined: Tue Feb 12, 2008 9:49 am

Post by Midas » Tue Feb 26, 2008 10:29 pm

Post by Midas
Tue Feb 26, 2008 10:29 pm

I suppose you forgot to call "robot_tilt" routine from the main cycle.
I suppose you forgot to call "robot_tilt" routine from the main cycle.
Midas
Robot Builder
Robot Builder
User avatar
Posts: 12
Joined: Fri Dec 14, 2007 2:29 pm
Location: Moscow, Russia

Post by badlands » Tue Feb 26, 2008 10:32 pm

Post by badlands
Tue Feb 26, 2008 10:32 pm

I got mine on AD2.


robot_tilt:
A = AD(2)
IF A > 250 THEN RETURN

IF A <30> 200 THEN GOTO tilt_high

RETURN
tilt_low:
A = AD(2)
'IF A < 30 THEN GOTO forward_standup
IF A < 30 THEN GOTO backward_standup
RETURN
tilt_high:
A = AD(2)
'IF A > 200 THEN GOTO backward_standup
IF A > 200 THEN GOTO forward_standup
RETURN

Dont forget to add...

GOSUB robot_tilt

I got mine after the battery check...

MAIN:
GOSUB robot_voltage
GOSUB robot_tilt

Good luck
I got mine on AD2.


robot_tilt:
A = AD(2)
IF A > 250 THEN RETURN

IF A <30> 200 THEN GOTO tilt_high

RETURN
tilt_low:
A = AD(2)
'IF A < 30 THEN GOTO forward_standup
IF A < 30 THEN GOTO backward_standup
RETURN
tilt_high:
A = AD(2)
'IF A > 200 THEN GOTO backward_standup
IF A > 200 THEN GOTO forward_standup
RETURN

Dont forget to add...

GOSUB robot_tilt

I got mine after the battery check...

MAIN:
GOSUB robot_voltage
GOSUB robot_tilt

Good luck
badlands
Savvy Roboteer
Savvy Roboteer
Posts: 28
Joined: Thu Feb 07, 2008 11:23 pm

Post by saview » Tue Feb 26, 2008 10:38 pm

Post by saview
Tue Feb 26, 2008 10:38 pm

Thanks! the GOSUB ROBOT_TILT worked. but right now it works when he is on his back. Am i also supposed to add DIM A AS INTEGER also? the DIM A AS BYTE is already shown.
Thanks! the GOSUB ROBOT_TILT worked. but right now it works when he is on his back. Am i also supposed to add DIM A AS INTEGER also? the DIM A AS BYTE is already shown.
saview
Robot Builder
Robot Builder
Posts: 11
Joined: Tue Feb 12, 2008 9:49 am

Post by i-Bot » Tue Feb 26, 2008 10:41 pm

Post by i-Bot
Tue Feb 26, 2008 10:41 pm

Maybe I am missing something.
How would you ever get to tilt_low ?
Maybe I am missing something.
How would you ever get to tilt_low ?
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by badlands » Tue Feb 26, 2008 10:55 pm

Post by badlands
Tue Feb 26, 2008 10:55 pm

Hmmm.. well spotted i-Bot.
The above code works for me but i can see it doesnt seem right. I have been hacking around a bit with my default code.

Here is how it started b4 i messed...


robot_tilt:
A = AD(2)
IF A > 250 THEN RETURN

IF A <30> 200 THEN GOTO tilt_high

RETURN
tilt_low:
A = AD(2)
'IF A < 30 THEN GOTO forward_standup
IF A < 30 THEN GOTO backward_standup
RETURN
tilt_high:
A = AD(2)
'IF A > 200 THEN GOTO backward_standup
IF A > 200 THEN GOTO forward_standup
RETURN
Hmmm.. well spotted i-Bot.
The above code works for me but i can see it doesnt seem right. I have been hacking around a bit with my default code.

Here is how it started b4 i messed...


robot_tilt:
A = AD(2)
IF A > 250 THEN RETURN

IF A <30> 200 THEN GOTO tilt_high

RETURN
tilt_low:
A = AD(2)
'IF A < 30 THEN GOTO forward_standup
IF A < 30 THEN GOTO backward_standup
RETURN
tilt_high:
A = AD(2)
'IF A > 200 THEN GOTO backward_standup
IF A > 200 THEN GOTO forward_standup
RETURN
badlands
Savvy Roboteer
Savvy Roboteer
Posts: 28
Joined: Thu Feb 07, 2008 11:23 pm

Post by badlands » Tue Feb 26, 2008 11:02 pm

Post by badlands
Tue Feb 26, 2008 11:02 pm

Got it - i needed to disable a few options in this post to get a clean C&P.

hehe...


'robot_tilt:
robot_tilt:
A = AD(2)
IF A > 250 THEN RETURN
IF A < 30 THEN GOTO tilt_low
IF A > 200 THEN GOTO tilt_high

RETURN
tilt_low:
A = AD(2)
'IF A < 30 THEN GOTO forward_standup
IF A < 30 THEN GOTO backward_standup
RETURN
tilt_high:
A = AD(2)
'IF A > 200 THEN GOTO backward_standup
IF A > 200 THEN GOTO forward_standup
RETURN

Sorry - that should work now.
Got it - i needed to disable a few options in this post to get a clean C&P.

hehe...


'robot_tilt:
robot_tilt:
A = AD(2)
IF A > 250 THEN RETURN
IF A < 30 THEN GOTO tilt_low
IF A > 200 THEN GOTO tilt_high

RETURN
tilt_low:
A = AD(2)
'IF A < 30 THEN GOTO forward_standup
IF A < 30 THEN GOTO backward_standup
RETURN
tilt_high:
A = AD(2)
'IF A > 200 THEN GOTO backward_standup
IF A > 200 THEN GOTO forward_standup
RETURN

Sorry - that should work now.
badlands
Savvy Roboteer
Savvy Roboteer
Posts: 28
Joined: Thu Feb 07, 2008 11:23 pm

Post by saview » Tue Feb 26, 2008 11:07 pm

Post by saview
Tue Feb 26, 2008 11:07 pm

will that solve the problem of him not standing up from his belly, right now he is only standing up when placed on his back.
will that solve the problem of him not standing up from his belly, right now he is only standing up when placed on his back.
saview
Robot Builder
Robot Builder
Posts: 11
Joined: Tue Feb 12, 2008 9:49 am

Post by badlands » Tue Feb 26, 2008 11:10 pm

Post by badlands
Tue Feb 26, 2008 11:10 pm

Is yout tilt sensor mounted correctly?
Is yout tilt sensor mounted correctly?
badlands
Savvy Roboteer
Savvy Roboteer
Posts: 28
Joined: Thu Feb 07, 2008 11:23 pm

Post by saview » Tue Feb 26, 2008 11:18 pm

Post by saview
Tue Feb 26, 2008 11:18 pm

I installed it exactly like the instructions show.
http://www.superrobotica.com/download/R ... sensor.pdf

I just dont know if i should have added DIM A AS INTEGER. like step 2 is showing..
I installed it exactly like the instructions show.
http://www.superrobotica.com/download/R ... sensor.pdf

I just dont know if i should have added DIM A AS INTEGER. like step 2 is showing..
saview
Robot Builder
Robot Builder
Posts: 11
Joined: Tue Feb 12, 2008 9:49 am

Post by badlands » Tue Feb 26, 2008 11:34 pm

Post by badlands
Tue Feb 26, 2008 11:34 pm

Hmmm... i havent got DIM A AS INTEGER at all in my code.

??
Hmmm... i havent got DIM A AS INTEGER at all in my code.

??
badlands
Savvy Roboteer
Savvy Roboteer
Posts: 28
Joined: Thu Feb 07, 2008 11:23 pm

Post by badlands » Wed Feb 27, 2008 12:10 am

Post by badlands
Wed Feb 27, 2008 12:10 am

Hmm... so he isnt getting to the tilt_high sub routine.

Try lowering the threshold:

IF A > 150 THEN GOTO tilt_high

Remember it appears twice in the sub routine.
Hmm... so he isnt getting to the tilt_high sub routine.

Try lowering the threshold:

IF A > 150 THEN GOTO tilt_high

Remember it appears twice in the sub routine.
badlands
Savvy Roboteer
Savvy Roboteer
Posts: 28
Joined: Thu Feb 07, 2008 11:23 pm

Post by saview » Wed Feb 27, 2008 12:17 am

Post by saview
Wed Feb 27, 2008 12:17 am

i tried lowering the threshold, He still wont get up from his belly. Works perfectly while on his back. Maybe something is wrong with the sensor?
i tried lowering the threshold, He still wont get up from his belly. Works perfectly while on his back. Maybe something is wrong with the sensor?
saview
Robot Builder
Robot Builder
Posts: 11
Joined: Tue Feb 12, 2008 9:49 am

Post by Kilroym42 » Wed Feb 27, 2008 11:32 am

Post by Kilroym42
Wed Feb 27, 2008 11:32 am

where did you get the tilt sensor?
I'm having a hard time finding it in the usa.
where did you get the tilt sensor?
I'm having a hard time finding it in the usa.
Kilroym42
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 32
Joined: Sat Oct 20, 2007 6:41 am

Post by saview » Wed Feb 27, 2008 11:57 am

Post by saview
Wed Feb 27, 2008 11:57 am

I was using bauermech's kung-fu script and reverted to the origional script from the CD and now its working like it should, but when if i change it back to the kung-fu, it only works on its back.. I got the sensor from robosavvy. The USA is pretty disappointing when it comes to supplying Robonova parts.
I was using bauermech's kung-fu script and reverted to the origional script from the CD and now its working like it should, but when if i change it back to the kung-fu, it only works on its back.. I got the sensor from robosavvy. The USA is pretty disappointing when it comes to supplying Robonova parts.
saview
Robot Builder
Robot Builder
Posts: 11
Joined: Tue Feb 12, 2008 9:49 am


15 postsPage 1 of 1
15 postsPage 1 of 1