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

Gyro calls

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

Gyro calls

Post by DirtyRoboto » Wed May 02, 2007 9:23 pm

Post by DirtyRoboto
Wed May 02, 2007 9:23 pm

Here is some goddamn simple code to see what the gyro is doing. Please set the AD read to the AD channel you have the gyro input on.

This is part of the technique I use to get Takeshi to stop at boundries or solid objects.
Please bare in mind that this an infinate loop routine just to show the simplicity of an Gyro call.

Marcus.


' DIRTYROBOTO 02 May 2007
' Press 5 on the Remcon to activate
gm:
' Gyro to arm feedback. DIRTYROBOTO 02 May 2007
' please set the AD read to whatever AD input u r using
DIM t AS BYTE
t = AD(5)
t = t + 90
SERVO 12,t
GOTO gm
Here is some goddamn simple code to see what the gyro is doing. Please set the AD read to the AD channel you have the gyro input on.

This is part of the technique I use to get Takeshi to stop at boundries or solid objects.
Please bare in mind that this an infinate loop routine just to show the simplicity of an Gyro call.

Marcus.


' DIRTYROBOTO 02 May 2007
' Press 5 on the Remcon to activate
gm:
' Gyro to arm feedback. DIRTYROBOTO 02 May 2007
' please set the AD read to whatever AD input u r using
DIM t AS BYTE
t = AD(5)
t = t + 90
SERVO 12,t
GOTO gm
In servo's we trust!
DirtyRoboto
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 412
Joined: Tue Sep 19, 2006 1:00 am
Location: London

Post by i-Bot » Thu May 03, 2007 10:26 am

Post by i-Bot
Thu May 03, 2007 10:26 am

I don't understand how this works, I couldn't make it work.

You are reading a pulse input from the Gyro using an analog input. Do you have the Gyro actually enabled ?

I would propose the following to see the Gyro working:


MOTOR G24
SPEED 10
GYROSET G6A,0,1,1,1,0,0
GYROSET G6D,0,1,1,1,0,0

GYRODIR G6A,0,0,0,0,0,0
GYRODIR G6D,0,0,0,0,0,0

GYROSENSE G6A,0,250,200,250,0,0
GYROSENSE G6D,0,250,200,250,0,0

gm:
DIM t AS BYTE
t = PEEK(1328)
t = t * 3
SERVO 12,t
GOTO gm

The location 1328 will have a value which is proportional to the Gyro angular velocity in the range 4 to 56. (1329..1331 for other gyro)
I don't understand how this works, I couldn't make it work.

You are reading a pulse input from the Gyro using an analog input. Do you have the Gyro actually enabled ?

I would propose the following to see the Gyro working:


MOTOR G24
SPEED 10
GYROSET G6A,0,1,1,1,0,0
GYROSET G6D,0,1,1,1,0,0

GYRODIR G6A,0,0,0,0,0,0
GYRODIR G6D,0,0,0,0,0,0

GYROSENSE G6A,0,250,200,250,0,0
GYROSENSE G6D,0,250,200,250,0,0

gm:
DIM t AS BYTE
t = PEEK(1328)
t = t * 3
SERVO 12,t
GOTO gm

The location 1328 will have a value which is proportional to the Gyro angular velocity in the range 4 to 56. (1329..1331 for other gyro)
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by DirtyRoboto » Thu May 03, 2007 8:35 pm

Post by DirtyRoboto
Thu May 03, 2007 8:35 pm

The example I use works for me. When I pick up the robot and tilt him, his arm moves in response to the gyro input.

Where did you learn the PEEK location for the gyro.
I wonder how much other information like this I am missing.
The example I use works for me. When I pick up the robot and tilt him, his arm moves in response to the gyro input.

Where did you learn the PEEK location for the gyro.
I wonder how much other information like this I am missing.
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