Multiple SRF02s in rapid fire sequence?

General & specific discussions on our Ultrasonic Rangers

Moderator: chris

Multiple SRF02s in rapid fire sequence?

Postby jsharlan » Thu Apr 05, 2007 10:16 pm

I'm using (5) SRF02s on the same I2C bus in a star configuration. I can read all sensors in a round robin mode when the time between pings is >= 70 ms as you would expect. This gives me a total loop time of 350ms, I would like to reduce this time. My program sequence is: ping(0), read(1), delay(70), ping(1), read(2), delay(70)... ping(4), read(0), delay(70), ping(1).... the reads are going into a Ranges[] array. In theory I should be able to sequence through all 5 sensors within a 100ms cycle and get back to read the first one within the minimum time. When I try to reduce the delay(70), I start to get bad numbers. I have isolated the sensors from each other to eliminate interference without success. When viewed with a scope, the I2C signals are just where they should be. I'm using an ATmega32(16MHz) and am reading the Ranges[] array via the serial port at 19200 connected to a PC.

Any ideas on the subject would be appreciated.

Thanks,
jsharlan
 
Posts: 4
Joined: Wed Feb 07, 2007 4:33 pm

Re: Multiple SRF02s in rapid fire sequence?

Postby Gerry » Fri Apr 06, 2007 1:38 pm

jsharlan wrote:I'm using (5) SRF02s on the same I2C bus in a star configuration. I can read all sensors in a round robin mode when the time between pings is >= 70 ms as you would expect. This gives me a total loop time of 350ms, I would like to reduce this time. My program sequence is: ping(0), read(1), delay(70), ping(1), read(2), delay(70)... ping(4), read(0), delay(70), ping(1).... the reads are going into a Ranges[] array. In theory I should be able to sequence through all 5 sensors within a 100ms cycle and get back to read the first one within the minimum time. When I try to reduce the delay(70), I start to get bad numbers. I have isolated the sensors from each other to eliminate interference without success. When viewed with a scope, the I2C signals are just where they should be. I'm using an ATmega32(16MHz) and am reading the Ranges[] array via the serial port at 19200 connected to a PC.

Any ideas on the subject would be appreciated.

Thanks,


The "ping" takes 60-70mS to fade away to the point where it will not interfere with the next ranging. During this time it is bouncing around all over the place. If you start the next SRF02 too soon, it will detect this fading echo giving the bad results. You need to wait 60-70ms between rangings - OR ....
You could try firing all 5 SRF02's at the same time (no delay at all). i.e.
ping(0), ping(1) ... Ping(4)
then wait 70mS
then read(0), read(1) ... read(4).
This works well with the SRF08 where we can fire all rangers together using the general call at address 00. The pic chip used on the SRF02 doesn't have the general call, so you will need to write to all 5 SRF02's as quickly as possibe to set them ranging.
It works because each SRF02 completes its ranging to the nearest target before the collective "ping" spreads out and bounces around enough to be troublesome. I have to say though, that I've never acually tried this with the SRF02's, only the SRF08's so I'd be interrested in the feedback.

Not sure wherethe 100mS comes from, since 5*70 = 350mS. Is that the upload time to the PC?
User avatar
Gerry
Site Admin
 
Posts: 245
Joined: Wed Nov 08, 2006 12:28 pm

Multiple SRF02s in rapid fire sequence

Postby jsharlan » Fri Apr 06, 2007 3:59 pm

I'll give the all at once method a try.

I am applying a pseudo-fuzzy filter to deal with flyers and a 3 element averaging filter to the range data. I got this idea from an article on "Fuzzy Range Sensor Filtering for Reactive Autonomous Robots".

The 100ms was what I was using for the total cycle time instead of 70ms. That number gave me just a bit of head room (20ms) between pings. 5 * 20ms = 100ms
jsharlan
 
Posts: 4
Joined: Wed Feb 07, 2007 4:33 pm

Re: Multiple SRF02s in rapid fire sequence?

Postby knickels » Tue Jul 17, 2007 9:42 pm

Gerry wrote:The "ping" takes 60-70mS to fade away to the point where it will not interfere with the next ranging. During this time it is bouncing around all over the place. If you start the next SRF02 too soon, it will detect this fading echo giving the bad results. You need to wait 60-70ms between rangings - OR ....

Also depending on your configuration, you may want to do these in opposition
(1,3,5,2,4).

Gerry wrote:You could try firing all 5 SRF02's at the same time (no delay at all). i.e.
ping(0), ping(1) ... Ping(4)
then wait 70mS
then read(0), read(1) ... read(4).

Does the SRF02 not have a current spike the way the old SRF04s did? I had a robot with two of those that would reboot if I fired them at the same time :)
knickels
 
Posts: 3
Joined: Tue Jul 17, 2007 9:12 pm
Location: San Antonio TX


Return to Ultrasonic Sensors

Who is online

Users browsing this forum: No registered users and 1 guest