Shop OBEX P1 Docs P2 Docs Learn Events
PING))) Firmware — Parallax Forums

PING))) Firmware

JSWrightOCJSWrightOC Posts: 49
edited 2007-10-29 14:00 in BASIC Stamp
Is the PING))) firmware available to the public? I want to adjust the minimum distance sensitivity because I'm getting near reflections, and there's not much I can do about them. I'm trying to sense water level through a pipe based on the Parallax application note, but I keep getting responses about 5" from the sensor while the water is at least 3-5 feet from the sensor. If I use foam to line the pipe I can minimize the false reflections by dampening the near reflections, but that only works part of the time.

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2007-10-26 14:09
    Would averaging your distances give you more reliable operation?
  • JSWrightOCJSWrightOC Posts: 49
    edited 2007-10-26 14:53
    Not when I can accurately sense the water level at 42" about 85% of the time, but get 5" back the other 15%. Averaging the two together at that rate would give me 36.45" which would mean the tank is overflowing. When it works, it works very well. but once in a while I'll pick up a reflection off the walls of the pipe, and averaging that into the result would be A Bad Thing.
  • JonathanJonathan Posts: 1,023
    edited 2007-10-26 15:02
    How about biasing the ping sensor so that the TX is directly in the center and the RX to the side? Seems like that might minimize unwanted eraly reflection. Might help, I dunno. Also, can the water ever be 5" away? If not, dump all readings that are =< 5, get ten readings that are OK and average them.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • JSWrightOCJSWrightOC Posts: 49
    edited 2007-10-26 15:06
    Jonathan,

    Both good thoughts, I found that by offsetting the Tx and Rx so that when one of them (I forget which) was in the center, I did seem to get more reliable results. I could also discard any measurements that are less than xx inches, but for some reason the erroneous measurements seem to come in a run. I need to be able to reliably measure the water level all of the time, not when everything is feeling good...

    When it's not erroneous, the data I get is always good. there is very little fluctuation in multiple return pulses, so I probably won't even have to average the output.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-10-26 16:05
    A long shot: How much time elapses between successive pings? If they're too closely spaced, you might be getting a secondary echo (water->top of tank->water->Ping) from a prior ping that registers as a near-field return.

    In general, it's very difficult to "pipe" ultrasound, but here are some random thoughts regarding the pipe:

    1. Can you make the pipe diameter bigger? This would help to keep the sidewalls out of range.
    2. If you use foam, use the flimsiest, open-cell foam you can get your hands on. Dense or closed-cell foam will be much less effective.
    3. Without foam, if the inside walls of the pipe were shiny smooth instead of rough, the echoes would be more likely to ricochet down the pipe than to bounce back.
    4. Instead of foam, a series of baffles spaced to cancel the energy from near-field echoes might eliminate the problem entirely.

    -Phil
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-10-26 16:11
    Sorry, the PING))) firmware is not available. Another suggestion I have is that since in applications like this there should never be a sudden change of that magnitude you can simply discard sudden large changes rather than ranges. I had to do this on a fuel tank monitoring system to keep the meters from fluctuating during turns, take-offs and stops.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • WhitWhit Posts: 4,191
    edited 2007-10-26 20:09
    Could a barrel, small tube·or cone of some material focus the PING))) to a more narrow·beam without creating other problems?

    Or could a barrel or small tube be placed around the reciever of the PING))) so that only roughly perpendicular echos were recieved? See sketch of this idea below

    Just a thought... Dumb idea? Or does this create other problems?

    attachment.php?attachmentid=50133

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Whit+


    "We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney

    Post Edited (Whit) : 10/28/2007 8:24:20 PM GMT
    167 x 193 - 3K
  • JSWrightOCJSWrightOC Posts: 49
    edited 2007-10-29 02:41
    All great thoughts, once again I am happy to be a member of a group of individuals with such inquisitive minds.

    -The foam that I used was thin (about 1/4" thick) open cell foam, the kind you might see used for a window air conditioner filter. It actually came as padding in a motherboard box (not to be confused with the antistatic bubble wrap however).

    -I might have to try the baffles. That could provide the isolation I need.

    -The pipe I am using is 3" PVC, and the inside wall is smooth. Unfortuniately I cannot make the pipe any larger in diameter.

    -Something that came to mind, related to the baffles - perhaps if I use one or two small pieces of pipe that fit snugly over the transmitter and/or receiver transducers, to help focus the energy, I might get more consistent results.

    -The repetition rate is about 2-3 times a second. The upper end of the pipe where the PING))) module is at is open, so any remaining reflected sound would dissipate into the open air above the unit.

    And in closing, it's too bad that the firmware is not available, as it would (theoretically) be a simple matter of reprogramming the SX28 with an SX-Key. I'm sure it's quite a simple routine generating ultrasonic pulses and listening for them to come back...the hardest part I imagine would be tracking down the traces on the PCB to see what I/O pins are in use. That, however, is an easy matter of reverse engineering. wink.gif Again, I would often get a "run" of bad input data, as in many successive measurements that were not accurate. For some reason it also seemed that it would get "stuck" on reporting these false measurements, until I would shift or reposition the PING))) module at the top of the pipe. Obviously during this time period, even if I know that the measurement is invalid, I am unable to measure the actual water level in the tank which could result in a malfunction of the system. In any event, if there was a lack of monitoring ability, I would likely have to SCRAM the system and shut down all pumps connected to the tank in question.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-10-29 04:02
    The great bugaboo with ultrasonics (or any wave phenomenon for that metter) is that the smaller you make the orifice, the wider the beam pattern. So a smaller pipe will only make things worse.

    Most single-transducer ultrasonnic sensors have a deadtime, before which they won't report an echo. This is to allow any ringing in the transducer from the transmit pulse to dissipate. Since the Ping))) has separate transmit and receive transducers, the deadtime is unnecessary, so echoes from nearby "targets" can be recorded. This behavior is beneficial in robotics, where the obstacles you need to detect may be closeby.

    The idea behind the internal baffles is that, since you're getting reflected energy from the pipe interior anyway, why not make it interfere with itself destructively and cancel itself out? Getting the baffle spacing just right could be tricky, though.

    A much simpler option might be to form a cone that extends from the Ping))) to the end of the pipe. The attached images are from an online simulation contrasting emissions from a straight pipe with those from a long cone. The confused-looking waves within the straight pipe are the result of internal reflections. The cone, on the other hand, shows little of this effect.

    -Phil
    696 x 557 - 96K
    696 x 557 - 58K
  • allanlane5allanlane5 Posts: 3,815
    edited 2007-10-29 14:00
    Why in heaven's name are you trying to find the distance "2 or 3 times a second"? Sound reverberates, you know, especially in a pipe with water at the bottom.

    Is the water level changing that fast, that checking it once a second or so is insufficient?
Sign In or Register to comment.