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

Autonomous RN1 or Spare Head 2

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

Autonomous RN1 or Spare Head 2

Post by Pev » Thu Mar 16, 2006 9:28 pm

Post by Pev
Thu Mar 16, 2006 9:28 pm

Well I finally got around to sorting out the mount for the Sonar. Yep it's on his head - or rather on his new head. In honour of my favorite mechanoid Kryten in Red Dwarf lets call this Spare Head 2.

Basically added a servo (Hitec HS300) in place of Robonova's head and attached the sonar to it. The servo is attached to port 9 and accessed using the servo command, format SERVO 9, {degree} where {degree} is a value from 10 to 190.

Image

it currently pans and now I guess I will have a busy weekend getting the software sorted.

Kind of think it makes him look a bit KHR-1'ish

Image

Will also be checking out his tumbling/cartwheel moves to see how it effects them.

Pev
Well I finally got around to sorting out the mount for the Sonar. Yep it's on his head - or rather on his new head. In honour of my favorite mechanoid Kryten in Red Dwarf lets call this Spare Head 2.

Basically added a servo (Hitec HS300) in place of Robonova's head and attached the sonar to it. The servo is attached to port 9 and accessed using the servo command, format SERVO 9, {degree} where {degree} is a value from 10 to 190.

Image

it currently pans and now I guess I will have a busy weekend getting the software sorted.

Kind of think it makes him look a bit KHR-1'ish

Image

Will also be checking out his tumbling/cartwheel moves to see how it effects them.

Pev
Carl
-------------------------
www.alt-view.co.uk
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Post by bauermech » Thu Mar 16, 2006 11:11 pm

Post by bauermech
Thu Mar 16, 2006 11:11 pm

Awesome! He does look a bit KHR1-ish.
Awesome! He does look a bit KHR1-ish.
bauermech
Site Admin
Site Admin
User avatar
Posts: 318
Joined: Sat Feb 04, 2006 1:00 am
Location: Defiance, Ohio, USA

Post by limor » Fri Mar 17, 2006 11:43 am

Post by limor
Fri Mar 17, 2006 11:43 am

Image

See the resemblance ? :)
Image

See the resemblance ? :)
limor
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1845
Joined: Mon Oct 11, 2004 1:00 am
Location: London, UK

Post by Pev » Fri Mar 17, 2006 12:41 pm

Post by Pev
Fri Mar 17, 2006 12:41 pm

limor wrote:Image

See the resemblance ? :)


LOL - hadn't thought of Johnny Five lol

Pev
limor wrote:Image

See the resemblance ? :)


LOL - hadn't thought of Johnny Five lol

Pev
Carl
-------------------------
www.alt-view.co.uk
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Post by Pev » Sun Mar 19, 2006 3:06 pm

Post by Pev
Sun Mar 19, 2006 3:06 pm

Okay I have to admit defeat. I have spent most of the weekend trying to stablise the sonar readings enough to get a working basic set of autonomous behaviour - walk forward until the way is not clear - check left and right then turn to the clearest path and walk forward again.

Basically the erractic readings from the sonar are making this virtually impossible. As you can never be sure if you will get a valid reading you need to trigger the sonar until a valid reading is read, which from experience can take anything from 5 to 200 triggers - grrrrrrr. This is taking time and subsequently isn't good. Also am getting erratic actual readings which is making the program behave erractically. Think I will be delpoying this sonar unit on another 'bot I am working on and putting his standard head back on.

Would be interested in any I2C sonar results subpilot as I can see myself going down the I2C route for future sonar needs. May have a play with the Sharp proximity detectors too.

Pev
Okay I have to admit defeat. I have spent most of the weekend trying to stablise the sonar readings enough to get a working basic set of autonomous behaviour - walk forward until the way is not clear - check left and right then turn to the clearest path and walk forward again.

Basically the erractic readings from the sonar are making this virtually impossible. As you can never be sure if you will get a valid reading you need to trigger the sonar until a valid reading is read, which from experience can take anything from 5 to 200 triggers - grrrrrrr. This is taking time and subsequently isn't good. Also am getting erratic actual readings which is making the program behave erractically. Think I will be delpoying this sonar unit on another 'bot I am working on and putting his standard head back on.

Would be interested in any I2C sonar results subpilot as I can see myself going down the I2C route for future sonar needs. May have a play with the Sharp proximity detectors too.

Pev
Carl
-------------------------
www.alt-view.co.uk
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Post by Pev » Sun Mar 19, 2006 3:39 pm

Post by Pev
Sun Mar 19, 2006 3:39 pm

Have raised an issue report with Robonova support in Germany - will update when I get a response

Pev
Have raised an issue report with Robonova support in Germany - will update when I get a response

Pev
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Post by limor » Sun Mar 19, 2006 3:43 pm

Post by limor
Sun Mar 19, 2006 3:43 pm

have you tried normalizing the results of the readings?

with noisy data sources, it sometimes helps.

for example you can use a decaying avarage like:
distance = distance*0.95 + newvalue*0.05

where distance is initiated with say 0 and newvalue is a new reading from the sonar. the 0.95 and 0.05 depend on how many readings/sec you are able to do and how often do you want to react to a distance threshold change.
have you tried normalizing the results of the readings?

with noisy data sources, it sometimes helps.

for example you can use a decaying avarage like:
distance = distance*0.95 + newvalue*0.05

where distance is initiated with say 0 and newvalue is a new reading from the sonar. the 0.95 and 0.05 depend on how many readings/sec you are able to do and how often do you want to react to a distance threshold change.
limor
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1845
Joined: Mon Oct 11, 2004 1:00 am
Location: London, UK

Post by Pev » Sun Mar 19, 2006 5:55 pm

Post by Pev
Sun Mar 19, 2006 5:55 pm

limor wrote:have you tried normalizing the results of the readings?

with noisy data sources, it sometimes helps.

for example you can use a decaying avarage like:
distance = distance*0.95 + newvalue*0.05

where distance is initiated with say 0 and newvalue is a new reading from the sonar. the 0.95 and 0.05 depend on how many readings/sec you are able to do and how often do you want to react to a distance threshold change.


I did try averaging across a result set but also found that between result sets without moving the robot the averages were still very erratic. Have just ordered an I2C sonar unit so am going to try that and the Sharp proximity unit too. Have stuck the SRF04 onto the wheeled platform I am working on for my CMU CAM so it hasn't gone to waste lol

Pev
limor wrote:have you tried normalizing the results of the readings?

with noisy data sources, it sometimes helps.

for example you can use a decaying avarage like:
distance = distance*0.95 + newvalue*0.05

where distance is initiated with say 0 and newvalue is a new reading from the sonar. the 0.95 and 0.05 depend on how many readings/sec you are able to do and how often do you want to react to a distance threshold change.


I did try averaging across a result set but also found that between result sets without moving the robot the averages were still very erratic. Have just ordered an I2C sonar unit so am going to try that and the Sharp proximity unit too. Have stuck the SRF04 onto the wheeled platform I am working on for my CMU CAM so it hasn't gone to waste lol

Pev
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

Post by ucrobots » Mon Mar 20, 2006 12:16 am

Post by ucrobots
Mon Mar 20, 2006 12:16 am

Hi pev,

have you tried
Motor 6
Motor 7
Motor 8
Motor 9

instead of MOTOR G24 ?

For example you can use SONAR(5) without noise if you don't enable Motor 10 and Motor 11, resp. Port 10 and 11.

hope this helps

ulli
Hi pev,

have you tried
Motor 6
Motor 7
Motor 8
Motor 9

instead of MOTOR G24 ?

For example you can use SONAR(5) without noise if you don't enable Motor 10 and Motor 11, resp. Port 10 and 11.

hope this helps

ulli
ucrobots

Post by Pev » Mon Mar 20, 2006 8:13 am

Post by Pev
Mon Mar 20, 2006 8:13 am

ucrobots wrote:Hi pev,

have you tried
Motor 6
Motor 7
Motor 8
Motor 9

instead of MOTOR G24 ?

For example you can use SONAR(5) without noise if you don't enable Motor 10 and Motor 11, resp. Port 10 and 11.

hope this helps

ulli


Ulli,

Thanks we have tried not enabling the motors infact the I ran with this as the total program in the robonova and still got noise.

GOTO AUTO
FILL 255,10000

LCDINIT

MOTOROFF 10
MOTOROFF 11
'================================================
MAIN:

PRINT "Working "
GOTO MAIN

If you have succeeded I'd love to see the code.

Thanks again

Pev
ucrobots wrote:Hi pev,

have you tried
Motor 6
Motor 7
Motor 8
Motor 9

instead of MOTOR G24 ?

For example you can use SONAR(5) without noise if you don't enable Motor 10 and Motor 11, resp. Port 10 and 11.

hope this helps

ulli


Ulli,

Thanks we have tried not enabling the motors infact the I ran with this as the total program in the robonova and still got noise.

GOTO AUTO
FILL 255,10000

LCDINIT

MOTOROFF 10
MOTOROFF 11
'================================================
MAIN:

PRINT "Working "
GOTO MAIN

If you have succeeded I'd love to see the code.

Thanks again

Pev
Pev
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 547
Joined: Sun Feb 26, 2006 1:00 am
Location: UK

SONAR

Post by UCROBOTS » Mon Mar 20, 2006 10:24 am

Post by UCROBOTS
Mon Mar 20, 2006 10:24 am

Pev,

try this code:

DIM A AS BYTE
DIM I AS BYTE
DIM B AS INTEGER

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
'================================================
MAIN:

TEMPO 230
MUSIC "o23ggaagg"
DELAY 1000

MOTOR 6
MOTOR 7
MOTOR 8
MOTOR 9

loop1:

MOVE G6B, 100,33,100, , , , 'left arm
MOVE G6B, 120,33,100, , , ,
WAIT


FOR I = 0 TO 255

B=SONAR(5)
PWM 2,I

Next I

GOTO loop1
GOTO MAIN

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


and tell me what happens

Ulli
Pev,

try this code:

DIM A AS BYTE
DIM I AS BYTE
DIM B AS INTEGER

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
'================================================
MAIN:

TEMPO 230
MUSIC "o23ggaagg"
DELAY 1000

MOTOR 6
MOTOR 7
MOTOR 8
MOTOR 9

loop1:

MOVE G6B, 100,33,100, , , , 'left arm
MOVE G6B, 120,33,100, , , ,
WAIT


FOR I = 0 TO 255

B=SONAR(5)
PWM 2,I

Next I

GOTO loop1
GOTO MAIN

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


and tell me what happens

Ulli
UCROBOTS

Sonar SRF04

Post by ucrobots » Thu Mar 23, 2006 12:14 pm

Post by ucrobots
Thu Mar 23, 2006 12:14 pm

Last night I tried this code:


DIM A AS BYTE
DIM I AS BYTE
DIM B AS INTEGER


PTP SETON
PTP ALLON

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

TEMPO 230
MUSIC "o23ggaagg"
DELAY 1000

MOTOR 6
MOTOR 8
MOTOR 9

LCDINIT

loop1:

A = AD(6)
I = I+1

L2:
DELAY 50

B = SONAR(5) 'SRF04

'IF B = 0 THEN GOTO L2

PRINT "Analog Input 6: "
PRINT FORMAT(A, DEC)
PRINT "Sonar(5): "
PRINT FORMAT(B, DEC)
PRINT " I= "
PRINT FORMAT(I, DEC)

PRINT 13, 10

GOTO loop1
GOTO MAIN

The LCD port was connected via a MAX232 to Hyperterm.
The triggerpulses and the echopulses were reasonable, not noisy and the pulsewith of the echopulse was also ok.
But the measurement result was always 0000, sometimes 2948.

So I think the SONAR(5) command is basically not working in version 2.5.

I am not amused. :evil:
Last night I tried this code:


DIM A AS BYTE
DIM I AS BYTE
DIM B AS INTEGER


PTP SETON
PTP ALLON

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

TEMPO 230
MUSIC "o23ggaagg"
DELAY 1000

MOTOR 6
MOTOR 8
MOTOR 9

LCDINIT

loop1:

A = AD(6)
I = I+1

L2:
DELAY 50

B = SONAR(5) 'SRF04

'IF B = 0 THEN GOTO L2

PRINT "Analog Input 6: "
PRINT FORMAT(A, DEC)
PRINT "Sonar(5): "
PRINT FORMAT(B, DEC)
PRINT " I= "
PRINT FORMAT(I, DEC)

PRINT 13, 10

GOTO loop1
GOTO MAIN

The LCD port was connected via a MAX232 to Hyperterm.
The triggerpulses and the echopulses were reasonable, not noisy and the pulsewith of the echopulse was also ok.
But the measurement result was always 0000, sometimes 2948.

So I think the SONAR(5) command is basically not working in version 2.5.

I am not amused. :evil:
ucrobots
Robot Builder
Robot Builder
User avatar
Posts: 12
Joined: Mon Mar 20, 2006 1:00 am
Location: Essenrode near Braunschweig, Germany

Post by RubikCube » Thu Mar 23, 2006 2:32 pm

Post by RubikCube
Thu Mar 23, 2006 2:32 pm

Just try your code without the template. Try your sonar code as a standalone code. My sonar works in port 10 and 11. I want to remind you that the port count start with 0 to 11 (down -up) at the left side and 12 to 23 (up-down) at the right side. If does not work swtich the Echo and Pulse ports.

Try putting a wait command your code.

B = SONAR(5) 'SRF04

'IF B = 0 THEN GOTO L2

PRINT "Analog Input 6: "
PRINT FORMAT(A, DEC)
PRINT "Sonar(5): "
PRINT FORMAT(B, DEC)
PRINT " I= "
PRINT FORMAT(I, DEC)

PRINT 13, 10
WAIT
Just try your code without the template. Try your sonar code as a standalone code. My sonar works in port 10 and 11. I want to remind you that the port count start with 0 to 11 (down -up) at the left side and 12 to 23 (up-down) at the right side. If does not work swtich the Echo and Pulse ports.

Try putting a wait command your code.

B = SONAR(5) 'SRF04

'IF B = 0 THEN GOTO L2

PRINT "Analog Input 6: "
PRINT FORMAT(A, DEC)
PRINT "Sonar(5): "
PRINT FORMAT(B, DEC)
PRINT " I= "
PRINT FORMAT(I, DEC)

PRINT 13, 10
WAIT
RubikCube
Robot Builder
Robot Builder
User avatar
Posts: 23
Joined: Mon Mar 06, 2006 1:00 am

Post by ucrobots » Thu Mar 23, 2006 5:39 pm

Post by ucrobots
Thu Mar 23, 2006 5:39 pm

My sonar is also connected to port #10 and #11, the 2 upper left ones.
I checked the signals with a scope and they seems to be ok.

Further I tried WAIT and DELAY 10, 20,30, 50 but the result was negative.

So one question, is your sonar realy working ?
My sonar is also connected to port #10 and #11, the 2 upper left ones.
I checked the signals with a scope and they seems to be ok.

Further I tried WAIT and DELAY 10, 20,30, 50 but the result was negative.

So one question, is your sonar realy working ?
ucrobots
Robot Builder
Robot Builder
User avatar
Posts: 12
Joined: Mon Mar 20, 2006 1:00 am
Location: Essenrode near Braunschweig, Germany

Post by RubikCube » Fri Mar 24, 2006 4:35 am

Post by RubikCube
Fri Mar 24, 2006 4:35 am

This is my entire code. This code works. I don't use LCD to trasnmit the results I use ETX (TX and RX line).

Clear the memory of the contorller before running it.

Check your SONAR, put it besides your ear you should hear a tick maybe 2 ticks per second or 1 per second. Wait for your LCD to display the values the processor is a lot faster than your LCD.

You have to recomile your template program after this test so your robonova will function back to normal.

'FILL 255,10000
'$device MRC3024
DIM A16 AS BYTE
DIM object AS INTEGER

main:

GOSUB SONAR5
WAIT
a16 = object / 64
WAIT
ETX 9600,a16
WAIT
GOTO main


SONAR5:

object = 0
WAIT
object = SONAR(5)
DELAY 500
WAIT

RETURN
This is my entire code. This code works. I don't use LCD to trasnmit the results I use ETX (TX and RX line).

Clear the memory of the contorller before running it.

Check your SONAR, put it besides your ear you should hear a tick maybe 2 ticks per second or 1 per second. Wait for your LCD to display the values the processor is a lot faster than your LCD.

You have to recomile your template program after this test so your robonova will function back to normal.

'FILL 255,10000
'$device MRC3024
DIM A16 AS BYTE
DIM object AS INTEGER

main:

GOSUB SONAR5
WAIT
a16 = object / 64
WAIT
ETX 9600,a16
WAIT
GOTO main


SONAR5:

object = 0
WAIT
object = SONAR(5)
DELAY 500
WAIT

RETURN
RubikCube
Robot Builder
Robot Builder
User avatar
Posts: 23
Joined: Mon Mar 06, 2006 1:00 am

Next
30 postsPage 1 of 21, 2
30 postsPage 1 of 21, 2