Obstacle Avoidance

hi !!
im trying to do an obstacle Avoidance with a Lynx 5 Robotic arm
i want to know the best sensors for that. the sharp GP2D12 measure only between 10cm and 80 cm. and for an effective distance measurement i need from 1 cm to more than 50 cm.
with Best regards
Firas :slight_smile:

Try the PING ultrasonic sensor. Several of us have those and they have been accurate down to at least 2 cm.

8-Dale

Hello !!

may be the sharp GP2D120XJ00F (measure 4cm to 30 cm and has a more light weight ) better for using with the robot Lynx 5 Arm. i want to ask why there is no (sharp GP2D120XJ00F) in Lynx motion company.
and my second question if i want to do an obstacle avoidance not only for the robot gripper but also for the robot links. how many sensors i need?
and
the way to put these sensors to the arm and to the SSC-32 electronic controller?

with Best regards
Firas :slight_smile:

We focus the majority of our energy in creating servo based robot parts and related hardware components that exists nowhere else. We offer some of the most popular sensors, but we have never tried to carry all of the sensors that are useful. Perhaps we can add to the sensors offerings at some point in the future.

The ultrasonic sensor such as Devantech SRF05 the range is 3cm to 6m.

I am not sure I understand what you need exactly.

If you are looking for the arm gripper not to bump into obstacles, you will need to place the sensor in such way that it can detect the obstacle that is as close as possible to the tip of the gripper.

For example if you use the ultrasonic sensor, you can place it about 3 cm away from the tip of the gripper.

Alternately you could also use bumper switches (with shorter whiskers) instead of the sensor.
You can find that here:
lynxmotion.com/Product.aspx?productID=60

hi all :slight_smile:

i have a question again about the obstacle avoidance with lynx arm 5. i want to put from 6-8 infra-red distance sensors GP2D120 to cover all the arms area according to my application. but i don’t know exactly where i must connect the three wires of every sensor to the SSC-32 interface board. in the manual written it must connected to analog input #A.
and the second question how many GP2D120 sensors can be connected to the SSC-32 interface board.
the third question how can i read their values using Matlab software.

thanks

Firas

The SSC-32 only has 4 analog inputs, and they are only 8 bit resolution, which is just fine for many things. For more than four IR sensors, you will have to use an MCU like the Basic Atom (4 analog inputs) or Atom PRO (8 analog inputs) on a Mini Atom Bot Board. The Atom chips have 10 bit resolution on the analog inputs.

The other option is to add an external analog to digital controller chip, with as many as 8 analog ports per chip and control it with an MCU like above.

8-Dale

lam sorry but where these four analog inputs in the SSC-32 interface board. the I/O ports numbered from 0-31 . and how can i read them from Matlab?

Thanks
:slight_smile:

The below discussion might be of interest as to the analog inputs on the ssc32. The ssc32 manual bottom has the input pin locations.

lynxmotion.net/phpbb/viewtop 
 90&start=0
lynxmotion.com/images/data/ssc-32.pdf

Firas
The analog ports are in the middle of the scc32 board. The image link from zoomkat shows this well.

The 4 return input wires are ABCD for sensors 1,2,3,4

There are only 2 sets of ± so you have to join 2 sensors to each ±

You can attach sensors 1 and 2 to one set of ± and sensors 3,4 to the 2nd set of ±

There is an ASCII return value of 8bits which from other discussion here on the forum has already been filtered from 10 bit so the 0-255 value is quite accurate.

It would be great to have 8 or 16 ports onboard the ssc32 or perhaps an add-on analog board. we can only hope for the future.

HI
Thanks for all
but i want to know how can i read the value of these 4 input sensors (GP2D120) when i use Matlab. because now i am using Matlab programming to control the servo motors to do my application.
what is the possible instructions to read these sensors in Matlab.

thanks again
Firas
:slight_smile:

Hi Firas,

You need to send SSC32 command strings, and read back the values. Check the SSC32 manual.

What is Matlab? Sounds like a program for I/O from National Semiconductor. Can you provide a link to it?

Edit: Make that National Instrument.

Alan KM6VV

Hi

I use the following Matlab instructions to read the analog input port #A of the SSC-32. i used one supply ± from the pair inside the board SSC-32. my sensor was GP2D120
fopen(S)
fprintf(S,‘VA’)
out = fread(S)
fclose(S)
i used a USB-Serial port converter.
i got some results but i have the following problems:
1- very slow response to have a results. the result appears after 30-40 second. this delay makes the reading process not useful for me.
2- the battery 9V has lost its energy quickly and the robot stop working.

how can solve these problems and especially problem number (1).

THANKS
Firas :slight_smile:

I looked at the data sheet for the GP2D120. As for running the 9v battery down, the GP2D120 appears to pull 30-50 ma, so it may need to be supplied from a source independent of what is supplying the ssc32 board (especially if you are using more than one). From power up, it looks like one should wait ~60 ms before taking a reading. Have you done any testing using a terminal program to see if you are getting appropriate readings? This would help determine if it is a matlab issue or other issue. As the output voltage is from .4v to 3.0v, you may want to look at the below post on how you might get better better resolution from the detector. Also, have you considered that using more than one sensor, they may interfere with each other if they are operating at the same time?

lynxmotion.net/phpbb/viewtopic.php?t=2748

Hello

I solved the problem of the power using external power supply. but till now i cant solve the problem of reading my sensor through Serial port and Matlab software. its very slow and usefulness. using the following instructions:
fopen(S)
fprintf(S,‘VA’)
out = fread(S)
fclose(S)
i got a results but the following message appears:

Warning: The specified amount of data was not returned within the Timeout period.
(Type “warning off MATLAB:serial:fread:unsuccessfulRead” to suppress this warning.)

it means that the four input ports on SSC-32 not useful with the Serial port.
i don’t no what to do really may be i have only one solution. to build an external ADC circuit with using the parallel port only for reading the sensors

i wait answer plz

THANKS
:slight_smile:
FIRAS

Hello,
I can’t tell you anything about the sensors, but I can assure you that Matlab works quick enough with the SSC-32 ! No lagging at all 

The only lagging happens when the batteries discharge (and they do discharge at an incredible rate !!) where the motors don’t work correctly 

Hope that helps !

Hi

I don’t Know Really what is the reason. but what i can tell that till now i used only one GP2D120 connected to a port A in SSC-32 and using Matlab. I have accurate results but very slow after 30-40 seconds with the following message appears:

Warning: The specified amount of data was not returned within the Timeout period.
(Type “warning off MATLAB:serial:fread:unsuccessfulRead” to suppress this warning.)

I hope that anyone can tell me the reason to find a solution without using another interface. i hope that i will use the four ports A,B,C,D in the SSC-32 without any problem.

Thanks

Firas
:slight_smile:

Is it possible Matlab missed the answer from the ssc-32 and then timed out waiting for it to arrive? You could try setting up the communications for 9600 baud which would give Matlab more time to get ready to receive. You might want to be be certain that Matlab does not flush the serial receive buffer at the time you send the read command or anything sitting in the rx buffer would go away.

HI ALL

I have an error in Matlab programming. my program has 500 iterations. but the the program stops after 44 iterations with the following error message:

??? Error using ==> serial.fprintf
The number of bytes written must be less than or equal to OutputBufferSize-BytesToOutput.

anyone can help me to solve this problem to continue running my matlab program with Lynx5 robot arm and SSC-32 .

Thanks
Firas
:smiley:

HI ALL

I Have Found a Solution for the last problem

it needs either to open and close a file at every program iterations or to put a suitable time delay for one file. also the variables must save as a one number every iteration not as a vector.

Firas

:smiley: