Shop OBEX P1 Docs P2 Docs Learn Events
Ping and TOF? — Parallax Forums

Ping and TOF?

I know, Ping already does time of flight... that is not what I am asking.

The P2 supports Goertzel computations from smart pins configured as ADC’s.
A while back, someone asked Chip about the Goertzel computations... what are they good for?
Part of his response was ... to make TOF measurements... meaning optical time of flight.
The problem is I have only the slimmest of ideas about all of this, and won't understand it until I
actually try to do it. I want to do it cheap... and not waste the effort.

I read somewhere... a while back that a company had improved ultrasound resolution for
distance measurements by encoding the output and then using TOF logic to make
the measurement.

My question to anyone who actually understands this stuff... is the Ping implementation amenable
to this kind of application?

Thanks

Rich

Comments

  • I have been thinking about that. If you had a transmitter and receiver bouncing a continuous ultrasonic, or radio signal off a surface, and then mixed the transmit and receive signals, you would get a DC voltage. If you change the distance, that voltage would change in step with the sine of the wavelength. (I think this is how you get the pulses from those doppler radar motion detectors)

    What is missing, is the ability to sense the direction. If you mixed those same signals in a quadrature detector, taking the outputs each into a smart pin performing the Goertzel, you would have Sine AND cosine of the angle of the return signal, potentially providing not only direction, but a resolution considerably smaller than the wavelength! Use the sine and cosine together with a revolution counter just like implementing a resolver.
  • I'm not sure how you get direction using Goertzel. Can you explain?

    Also, the distance will only be some fraction of the wavelength, if you radiate continuously. If the radiated signal has a wavelength shorter that the distances to be measured, you will not get the total number of wavelengths or the total distance. To get the total distance, if you're not doing time-of-flight with short pulses, you will have to modulate the radiator with a wavelength that's on the order of the distance to be measured. Then, after filtering the return signal, mix that with the modulating signal to get the distance.

    Also, multi-path reflections will make things a lot harder...

    -Phil
  • ceptimusceptimus Posts: 135
    edited 2018-01-20 13:26
    Wouldn't you need two receiver antennas with one physically mounted a quarter of a wavelength in front of the other if you wanted to get sine and cosine?
  • First, I need to specify that I am only considering direction as direction of travel of the target, as in closer or further away.

    I do not pretend to fully understand Goertzel, but I seem to remember that Chip said that it would provide the result as a vector. this still doesn't get direction by itself (Or does it?) until you mix with a quadrature detector, which by definition provides sine and cosine.
    I haven't 'done the math' on this yet, and I may be all wet about the quadrature detector being able to provide 'real' sine and cosine.

    Yes, one sure way to accomplish this is with two receivers at a 90 degree spacing. That would certainly work!

    Yes, as Phil says, Before 'homing' there will be uncertainty about how many full wavelengths exist between tx/rx and the target. This would need some calibration, a reference point, and the maintenance of a revolution counter to keep track of full wavelength+ travel. (Exactly like a resolver over multiple revolutions) The modulation idea could certainly work as well.

    In any case, clearly, the Ping hardware isn't up to this. Far too coarse granularity of measurement. This would need to be implemented entirely in the P2 with dedicated hardware.

    Can't wait to try it!
  • rjo__rjo__ Posts: 2,114
    Thanks guys.
Sign In or Register to comment.