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

Distance Sensor

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
6 postsPage 1 of 1
6 postsPage 1 of 1

Distance Sensor

Post by Bertha101 » Tue Mar 22, 2011 4:36 pm

Post by Bertha101
Tue Mar 22, 2011 4:36 pm

I have the distance sensor built into my Bioloid, I was wondering how to use it and how to incorporate it into task codes.
Thanks!
I have the distance sensor built into my Bioloid, I was wondering how to use it and how to incorporate it into task codes.
Thanks!
Bertha101
Robot Builder
Robot Builder
Posts: 7
Joined: Wed Feb 09, 2011 5:18 pm

Post by Dewey » Tue Mar 22, 2011 5:59 pm

Post by Dewey
Tue Mar 22, 2011 5:59 pm

The Sharp IR Ranger is connected to an analogue input port on the CM510 the value returned, when the port is read in a robo plus program, is not linear to distance and is in the range 0-1023!

A good approximation of the range in cms is 5524/Value returned.

Its good for ranges out to 80ish cms, google for a full datasheet on it.

Dewey
The Sharp IR Ranger is connected to an analogue input port on the CM510 the value returned, when the port is read in a robo plus program, is not linear to distance and is in the range 0-1023!

A good approximation of the range in cms is 5524/Value returned.

Its good for ranges out to 80ish cms, google for a full datasheet on it.

Dewey
Dewey
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 78
Joined: Sat May 12, 2007 1:17 pm
Location: Worcester UK

Post by Bertha101 » Wed Mar 23, 2011 4:53 pm

Post by Bertha101
Wed Mar 23, 2011 4:53 pm

How do i incorporate it into a taskcode?
How do i incorporate it into a taskcode?
Bertha101
Robot Builder
Robot Builder
Posts: 7
Joined: Wed Feb 09, 2011 5:18 pm

Post by Fritzoid » Wed Mar 23, 2011 6:03 pm

Post by Fritzoid
Wed Mar 23, 2011 6:03 pm

Take a look at the demo task program at label AutoWalkMode. The code goes something like this...

IF(PORT[5] > 200)
...WalkCommand = 3
ELSE
...WalkCommand = 1
CALL WalkExecute

WalkCommand 3 causes the robot to turn left. Otherwise WalkCommand 1 causes the robot to walk forward. A reading above 200 on I/O port 5 is the threshold for turning left. The DMS sensor is on port 5.
Take a look at the demo task program at label AutoWalkMode. The code goes something like this...

IF(PORT[5] > 200)
...WalkCommand = 3
ELSE
...WalkCommand = 1
CALL WalkExecute

WalkCommand 3 causes the robot to turn left. Otherwise WalkCommand 1 causes the robot to walk forward. A reading above 200 on I/O port 5 is the threshold for turning left. The DMS sensor is on port 5.
Fritzoid
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 331
Joined: Mon Dec 18, 2006 1:00 am

Post by Dewey » Wed Mar 23, 2011 6:04 pm

Post by Dewey
Wed Mar 23, 2011 6:04 pm

Just read the port you have connected the Sharp DMS to, convert to a range in cms if required.
If you put this code in a loop you can take different action in your program depending on range.
A very simple example to read the sensor and continuously display the range in cms is below:

http://robosavvy.com/Builders/Dewey/DMSTest.pdf

Dewey
Just read the port you have connected the Sharp DMS to, convert to a range in cms if required.
If you put this code in a loop you can take different action in your program depending on range.
A very simple example to read the sensor and continuously display the range in cms is below:

http://robosavvy.com/Builders/Dewey/DMSTest.pdf

Dewey
Dewey
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 78
Joined: Sat May 12, 2007 1:17 pm
Location: Worcester UK

Re: Distance Sensor

Post by siempre.aprendiendo » Wed Mar 23, 2011 7:44 pm

Post by siempre.aprendiendo
Wed Mar 23, 2011 7:44 pm

Bertha101 wrote:I have the distance sensor built into my Bioloid, I was wondering how to use it and how to incorporate it into task codes.
Thanks!


I think this example could help you:


http://support.robotis.com/en/software/ ... sk_dms.htm


This example executes a block of code if the value of the DMS sensor connected to Port 3 is less than 500.


Image


You have a lot of programming information at Roboplus Tasks pages

http://support.robotis.com/en/software/ ... k_main.htm
Bertha101 wrote:I have the distance sensor built into my Bioloid, I was wondering how to use it and how to incorporate it into task codes.
Thanks!


I think this example could help you:


http://support.robotis.com/en/software/ ... sk_dms.htm


This example executes a block of code if the value of the DMS sensor connected to Port 3 is less than 500.


Image


You have a lot of programming information at Roboplus Tasks pages

http://support.robotis.com/en/software/ ... k_main.htm
siempre.aprendiendo
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 559
Joined: Wed Aug 08, 2007 9:13 pm
Location: Barcelona


6 postsPage 1 of 1
6 postsPage 1 of 1