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

maxsonar

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

maxsonar

Post by plingboot » Tue Nov 14, 2006 4:31 pm

Post by plingboot
Tue Nov 14, 2006 4:31 pm

Has anyone got any test code they share with me for the chest mounted maxsonar module?

I've fiddled around with the test code supplied and bits from varius forum posts, but a combination of my poor BASIC and faulty code means i haven't managed to find out whether the sensor actually works yet!

thanks, ds
Has anyone got any test code they share with me for the chest mounted maxsonar module?

I've fiddled around with the test code supplied and bits from varius forum posts, but a combination of my poor BASIC and faulty code means i haven't managed to find out whether the sensor actually works yet!

thanks, ds
plingboot
Savvy Roboteer
Savvy Roboteer
Posts: 108
Joined: Thu Oct 26, 2006 1:00 am
Location: the gutter, south west london

Post by plingboot » Wed Nov 15, 2006 10:20 am

Post by plingboot
Wed Nov 15, 2006 10:20 am

bump, as they say...

Here's the code i've been using to test the sonar - which is plugged into AD port 2 (third one along from left).

I clear the controller and then upload just this snippet.

I figure that this should cause the led to blink more quickly as an object gets closer to the sensor and slower as it moves away. With the loop continuing until i stop it.

What i actually get is just a constant led blink. A couple of times it seemed to work correctly for a couple of seconds, but then it defaulted back to a steady blink.

Not sure whether the code is duff or the sensor.

Not sure whether it's worth mentioning, but i also have both a gyro and tilt sensor connected at the same time. Though i wouldn't have thought this made any difference.

Any help much appreciated.

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

dim a as integer

10:

a = sonar(2)
out 52,0
out 8,0
delay a

a = sonar(2)
out 52,1
out 8,1
delay a

goto 10

'===================================
bump, as they say...

Here's the code i've been using to test the sonar - which is plugged into AD port 2 (third one along from left).

I clear the controller and then upload just this snippet.

I figure that this should cause the led to blink more quickly as an object gets closer to the sensor and slower as it moves away. With the loop continuing until i stop it.

What i actually get is just a constant led blink. A couple of times it seemed to work correctly for a couple of seconds, but then it defaulted back to a steady blink.

Not sure whether the code is duff or the sensor.

Not sure whether it's worth mentioning, but i also have both a gyro and tilt sensor connected at the same time. Though i wouldn't have thought this made any difference.

Any help much appreciated.

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

dim a as integer

10:

a = sonar(2)
out 52,0
out 8,0
delay a

a = sonar(2)
out 52,1
out 8,1
delay a

goto 10

'===================================
plingboot
Savvy Roboteer
Savvy Roboteer
Posts: 108
Joined: Thu Oct 26, 2006 1:00 am
Location: the gutter, south west london

Post by i-Bot » Wed Nov 15, 2006 8:19 pm

Post by i-Bot
Wed Nov 15, 2006 8:19 pm

I think the sonar command is for the Devantech sonar only.

For the Max I guess you will have to read the analog voltage from AD2 for the distance.

This is good, much lower procesor load

Is your Max from Sparkfun or from Hitec ? Is it already cabled using the analog out from the max module
I think the sonar command is for the Devantech sonar only.

For the Max I guess you will have to read the analog voltage from AD2 for the distance.

This is good, much lower procesor load

Is your Max from Sparkfun or from Hitec ? Is it already cabled using the analog out from the max module
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by plingboot » Thu Nov 16, 2006 10:47 am

Post by plingboot
Thu Nov 16, 2006 10:47 am

Thanks for the reply.

The MaxSonar came as a kit from Hitec, the sensor was pre-wired and came with a predrilled chest plate too.

The code snippet is based on one supplied in the instructions.
Thanks for the reply.

The MaxSonar came as a kit from Hitec, the sensor was pre-wired and came with a predrilled chest plate too.

The code snippet is based on one supplied in the instructions.
plingboot
Savvy Roboteer
Savvy Roboteer
Posts: 108
Joined: Thu Oct 26, 2006 1:00 am
Location: the gutter, south west london

Post by i-Bot » Thu Nov 16, 2006 3:12 pm

Post by i-Bot
Thu Nov 16, 2006 3:12 pm

As far as I can see from the photo on the web the output is wired to the Max AN pin which is the analog out. The Max should be in free run if the other pins are disconnected and give a 10mV per inch analog voltage out on the AN pin. Try mearuring this with a meter, then use an analog read this is correct.
A = AD(2)

This is what is says here also
http://www.robonova.de/store/files/data/maxez1.pdf
As far as I can see from the photo on the web the output is wired to the Max AN pin which is the analog out. The Max should be in free run if the other pins are disconnected and give a 10mV per inch analog voltage out on the AN pin. Try mearuring this with a meter, then use an analog read this is correct.
A = AD(2)

This is what is says here also
http://www.robonova.de/store/files/data/maxez1.pdf
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by plingboot » Thu Nov 16, 2006 4:04 pm

Post by plingboot
Thu Nov 16, 2006 4:04 pm

Thanks.
I didn't spot that subtle difference in the code on the pdf. My instructions came with a second sheet which used:

A= SONAR(2)

This evening i'll swap that for: A= AD(2)

If that doesn't work i'll try putting a meter on it, though i could use some basic help on how to do this. (really showing my lack of skills now)

I have a simple multimeter with a couple of probes. A quick "how to test the module" would be much appreciated.

Thanks for the continued help.
Thanks.
I didn't spot that subtle difference in the code on the pdf. My instructions came with a second sheet which used:

A= SONAR(2)

This evening i'll swap that for: A= AD(2)

If that doesn't work i'll try putting a meter on it, though i could use some basic help on how to do this. (really showing my lack of skills now)

I have a simple multimeter with a couple of probes. A quick "how to test the module" would be much appreciated.

Thanks for the continued help.
plingboot
Savvy Roboteer
Savvy Roboteer
Posts: 108
Joined: Thu Oct 26, 2006 1:00 am
Location: the gutter, south west london

Post by plingboot » Fri Nov 17, 2006 10:03 am

Post by plingboot
Fri Nov 17, 2006 10:03 am

At last, success.

Changing the code to A=AD(2) fixed the problem and now, as objects get closer to the sensor, the head led blinks more quickly and as they move away it blinks more slowly.

So... next question(s).

1. Any hints on how i can grab a 'value' from the sensor and use it as a trigger for an action?

2. any hints on where to position this code within the main template - so that it's functioning all the time?
At last, success.

Changing the code to A=AD(2) fixed the problem and now, as objects get closer to the sensor, the head led blinks more quickly and as they move away it blinks more slowly.

So... next question(s).

1. Any hints on how i can grab a 'value' from the sensor and use it as a trigger for an action?

2. any hints on where to position this code within the main template - so that it's functioning all the time?
plingboot
Savvy Roboteer
Savvy Roboteer
Posts: 108
Joined: Thu Oct 26, 2006 1:00 am
Location: the gutter, south west london


7 postsPage 1 of 1
7 postsPage 1 of 1