Author Topic: sonar ring  (Read 8535 times)

0 Members and 1 Guest are viewing this topic.

Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
    • DC/MD/VA Robotics and Automation Team
sonar ring
« on: July 05, 2008, 08:42:50 AM »
I'm trying to reverse engineer a ring of sonar provided on a robot I was given. There is no datasheet for the sonar unfortunately.
Recall that sonar sensor measure a distance to an obstacle by sending out a sound wave and then timing how long it takes for that wave to be reflected back to the unit.  So, the longer the time, the farther away the obstacle is.

Toward that end, I'm working out the timing for measuring sending and receiving for an 8-ring sonar. The sonars are eight ultrasonic transducer (range-finding sonar) sensors that sense a 180-degree forward coverage. They read ranges from 15cm to approximately 7m.






I have only the datasheet for the 3-8 line decoder on the sonar board.




so I will have to reverse engineer how the pulse-width relates to distance and that should not be too hard provided I have either an oscilloscope handy or can read the pulse-width from the MCU.

The truth table for the 3-8 line decoder gives a way to activate individual sonar one at a time or all at once to take measurements.



And the layout of the chip that corresponds to the truth table is also in the datasheet.


The concerns right now are the following:

1)   If you have several sonars going at once, one sensor might detect the reflection of another?  Is it best to take one sonar measurement at a time to avoid this problem?

2) Should the sonars sensors be synchronized in a way so that the power drain is spread out. What is the optimum timing to synchronize multipe sonar readings?


Thanks in advance,



« Last Edit: July 05, 2008, 08:44:03 AM by vidam »

Offline izua

  • Supreme Robot
  • *****
  • Posts: 682
  • Helpful? 0
    • izua electronics
Re: sonar ring
« Reply #1 on: July 05, 2008, 08:53:41 AM »
1. Yes, a sonar receiver will pick out any wave. There is no way for it to know if it is its own wave or someone else's, unless some filtering is applied. I think the purpose of the ring is another one - you send out one ping, and watch it with all 8 receivers, so you can understand more about how the signal reflected.

2. I do not know how power drain should be spread out, but picture this: if you are in a tight environment, echoes will come back quick. if you are in an open hall, they might never come back (or will come, but too faint to detect). Your best guess it to make the next sonar ping depending on the last echo + some reflection kill time or a timeout variable (if no echo will come back, timeout will occur)
Check out my homepage for in depth tutorials on microcontrollers and electronics.

Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
    • DC/MD/VA Robotics and Automation Team
Re: sonar ring
« Reply #2 on: July 05, 2008, 09:09:39 AM »
1. Yes, a sonar receiver will pick out any wave. There is no way for it to know if it is its own wave or someone else's, unless some filtering is applied. I think the purpose of the ring is another one - you send out one ping, and watch it with all 8 receivers, so you can understand more about how the signal reflected.

This is a very clever idea. Is possible to use the sonar in receive mode instead of ping mode.
Quote
2. I do not know how power drain should be spread out, but picture this: if you are in a tight environment, echoes will come back quick. if you are in an open hall, they might never come back (or will come, but too faint to detect). Your best guess it to make the next sonar ping depending on the last echo + some reflection kill time or a timeout variable (if no echo will come back, timeout will occur)

This is also very practical and clever--a timeout variable. Thank you I'll have to think about how this will be implemented in code.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: sonar ring
« Reply #3 on: July 05, 2008, 09:51:28 AM »
since this is a sensor you took off a robot, why not just reverse engineer the source code that came with it?

Offline hgordon

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 373
  • Helpful? 7
    • Surveyor Robotics Journal
Re: sonar ring
« Reply #4 on: July 05, 2008, 09:53:45 AM »
It is very slow to transmit from one sonar at a time, as you need to provide at least 50 milliseconds per ping/listen cycle (25 ft range).  Instead, if the hardware supports this (unclear because of their multiplexer circuit), you should fire all sonars at the same time and listen simultaneously to all receivers.  If you are only looking for the first sonar return on each channel, you will not have an issue with secondary reflections. However, this approach won't work if you are mapping based on multiple returns.
Surveyor Corporation
  www.surveyor.com

Offline izua

  • Supreme Robot
  • *****
  • Posts: 682
  • Helpful? 0
    • izua electronics
Re: sonar ring
« Reply #5 on: July 05, 2008, 10:46:42 AM »
Yes, put this implies that every individual receiver can recognise its emitter, and filter out the others.
Check out my homepage for in depth tutorials on microcontrollers and electronics.

Offline BANE

  • Supreme Robot
  • *****
  • Posts: 639
  • Helpful? 4
  • E=roboticsC^2
Re: sonar ring
« Reply #6 on: July 05, 2008, 10:53:14 AM »
do you have a picture of the robot that it came off of?

Bane

Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
    • DC/MD/VA Robotics and Automation Team
Re: sonar ring
« Reply #7 on: July 05, 2008, 11:24:57 AM »
do you have a picture of the robot that it came off of?

Bane

Yes, here is the previous setup with arduino mcu, webcam, compass, laptop, and sonar from Maxbotics (not using the sonar ring).


You can see that it is very messy with all of the wiring and the laptop taking most of the space.

I want to reduce my electronics down to just a camera-sonar-compass-encoder-speedcontroller-mcu perhaps.
« Last Edit: July 05, 2008, 11:32:58 AM by vidam »

Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
    • DC/MD/VA Robotics and Automation Team
Re: sonar ring
« Reply #8 on: July 05, 2008, 11:26:37 AM »
since this is a sensor you took off a robot, why not just reverse engineer the source code that came with it?

I don't have the source code as it is proprietary and I didn't pull it off the disk drive when I disassembled the old pc-104, windows 98 setup.

Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
    • DC/MD/VA Robotics and Automation Team
Re: sonar ring
« Reply #9 on: July 05, 2008, 11:37:15 AM »
It is very slow to transmit from one sonar at a time, as you need to provide at least 50 milliseconds per ping/listen cycle (25 ft range).  Instead, if the hardware supports this (unclear because of their multiplexer circuit), you should fire all sonars at the same time and listen simultaneously to all receivers.  If you are only looking for the first sonar return on each channel, you will not have an issue with secondary reflections. However, this approach won't work if you are mapping based on multiple returns.


The mcu I have only has 2 timers. I could use 1 timer for the front sonar and 1 timer for the back ring of sonar. When the timer reaches overflow, then read all sonar using a for loop. Then restart the timer.

Does this seem reasonable?

Code: [Select]
ISR(TIMER0_OVF_vect)
{
extern short adcChannel;

// Handle ADC conversions -- cycle through different
// inputs at a rate of 100KHz/Number of inputs = 12.5Ksps
if(!(ADCSRA & ADCSTART)){ // Conversion completed
adcOuts[adcChannel] = ADC; // Save conversion output
// adcStatus[adcChannel] = ADCVALID; //??Does this make a difference
adcChannel = (adcChannel +1) & 0x7; // Cycle through 8 channels
ADMUX = (ADCREF | (1 << adcChannel)); // Select next input
ADCSRA |= ADCSTART;  // Start conversions
}

// Handle system and delay timing
systime++;
if(systime == delaytime)
delaytime = 0;
TCNT0 = CLKTICK; // init counter

// TIFR1 &= (1 << TOV1); // Done automatically when ISR is executed
}


« Last Edit: July 05, 2008, 11:43:01 AM by vidam »

Offline vidamTopic starter

  • Supreme Robot
  • *****
  • Posts: 423
  • Helpful? 1
  • Robotronics.org
    • DC/MD/VA Robotics and Automation Team
Re: sonar ring
« Reply #10 on: August 27, 2008, 02:23:34 PM »
I just wanted to give an update on the sonar ring. It's been too long.

Using a multimeter and checking for continuity between the ribbon cable and the connection diagram I posted previous, the wires that had continuity occurred only between VCC, Y0-Y4. This means that the ribbon cable wires are not wired up in such a way that I can use the truth table that I posted previous.

So I can't use the sonar ring with the board. Instead of using the Pioneer ring, I now plan to use 4 of the Maxbotix MaxSonar-Ez1 for a ring of sonar for the Pioneer.


 


Get Your Ad Here