Sonar sensor disturbancies

Discussion specific to the intelligent brick, sensors, motors, and more.
Post Reply
ricardocrl
Posts: 117
Joined: 27 Dec 2010, 19:27

Sonar sensor disturbancies

Post by ricardocrl »

Hello all,

I've been experiencing some issues with the sonar sensor. It sometimes sense short distances when there is nothing in its front.

The scenario is the following: emmiter and receiver quite close to the table floor. Some other NXT's around using sonar sensor as well, but pointing to other directions, not agains the one I'm using.

I'm guessing the lights (fluorescent) can be messing with the sensor by the reflection occured near the table's floor. Can it be the problem? Could there be any programming way to calibrate/overcome somehow this situation, like configuring signal frequences (just blind shot :-).

Another question. Would EOPD HiTechnic sensor be a more robust solution?

/Ricardo
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Sonar sensor disturbancies

Post by mattallen37 »

What kind of other sensors are you using? If you are using two ultrasonic sensors near each other, you should most definitely use them in single-shot mode so they don't mess up the readings of each other.

Light should have absolutely no effect on the ultrasonic sensor. The only way for a fluorescent light to have any effect, would be it the light was making noise (like the transformer running at the frequency of the ultrasonic sensor).

An EOPD is supposed to be fairly good in a situation without controlled lighting, but it will be a lot more likely to give problems due to light than an ultrasonic sensor.
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
ricardocrl
Posts: 117
Joined: 27 Dec 2010, 19:27

Re: Sonar sensor disturbancies

Post by ricardocrl »

I have just one sensor alone in a robot, but I'm using several robots with the same sensor configuration in the surroundings. What do you mean by single-shot mode? Is there any options to control it with NXC? I thought there was only a single way to run it.

Then, the lights shouldn't be a problem, because they are not even close to the sensors (more than 5 meters distance, in the ceil).
mattallen37
Posts: 1818
Joined: 02 Oct 2010, 02:19
Location: Michigan USA
Contact:

Re: Sonar sensor disturbancies

Post by mattallen37 »

If you have any other Lego ultrasonic sensors within the area, they will most likely cause an error in the read value.

Single-shot mode is a way that you can control when the ultrasonic sensor "makes noise". It sends a single burst of sound, and waits for it to return. It only does it once per command, instead of constantly. So if you have a robot with 4 ultrasonic sensors, you can read them all in single-shot mode, one at a time. That way they won't hear each other and get confused.

I don't think the functions have been implemented by John, so you probably can't use a fancy API for it. However, you can "tell" the sensor to use single-shot mode by issuing an I2C write. All the register info is in the hardware dev kit you can download from the mindstorms website (the name of the PDF you want, has something to do with ultrasonic I2C protocol).
Matt
http://mattallen37.wordpress.com/

I'm all for gun control... that's why I use both hands when shooting ;)
HaWe
Posts: 2500
Joined: 04 Nov 2014, 19:00

Re: Sonar sensor disturbancies

Post by HaWe »

I can copy the issue with US sensor noise.
This is why I always use a median filter (of 3) to filter out the low or high peaks.
ricardocrl
Posts: 117
Joined: 27 Dec 2010, 19:27

Re: Sonar sensor disturbancies

Post by ricardocrl »

Hm, good solutions, both the filter and single shot.

The filter is straight forward, but still uncertain (a little) that it can succeed.

Regarding the single-shot, I got your point. I will check the documentation. The interesting thing is that I was thinking that I was using single shot, because I only check the sensor every 500ms. But the truth is that the distance is asked and read from a register, and not actually read by the hardware at that time.

Nice tips. ;) Thanks!
linusa
Posts: 228
Joined: 16 Oct 2010, 11:44
Location: Aachen, Germany
Contact:

Re: Sonar sensor disturbancies

Post by linusa »

The EOPD is pulsed, so ambient light shouldn't be a problem. However, the range of the EOPD is very limited, roughly about 10 to 20cm...
RWTH - Mindstorms NXT Toolbox for MATLAB
state of the art in nxt remote control programming
http://www.mindstorms.rwth-aachen.de
MotorControl now also in Python, .net, and Mathematica
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 0 guests