go_away

Author Topic: Phase Shift of a Modulated Signal  (Read 3328 times)

0 Members and 1 Guest are viewing this topic.

Offline krichTopic starter

  • Robot Overlord
  • ****
  • Posts: 165
  • Helpful? 0
Phase Shift of a Modulated Signal
« on: June 16, 2008, 11:43:52 PM »
I have several projects going on at once.  That way, if I get bored with one, I can work on another.  This one is admittedly WAY out of my range, but its also one I don't mind making slow progress on.

I'm messing around on a breadboard with some ideas that I've had regarding phase shift measurements.  I haven't gotten too far.  Certainly not far enough to worry about the fact I'm trying to do analog circuits on a breadboard.

One is to see if I can figure out how to use phase shift of a modulated signal (sonic at first) to determine distance.  I know how to transmit a modulated ultrasonic signal.  I (theoretically) know how to receive that signal after its been reflected by something.  What I'm still working on is how to determine the phase shift between the two signals.  Now, according to my Internet reading, one of the benefits of this method is that there is no need to have a "quiet" phase for the transmitter.  Because you are keying in on phase shift and not the presence of the waveform itself, you can blast away with the transmitter.  This gives you lots of options aside from just time of flight measurements.  (loss of amplitude, hase shift, keyed waveforms, etc.)  I gather you can "simply" subtract the transmitter's waveform from the received waveform to get the phase shifted echo waveform and then perform comparisons between the two.  I've read up on Phase Comparators and Phase Detectors as they apply to PLL circuits.  I think I can use this to detect the phase shift between my two signals, but I'm not sure how I can separate them first.  I was also considering squaring off the waveform and using edge detection and timers.  Not sure that'll be accurate enough though.

I'm looking at the AD8302 as a potential starting point for my experiments.  Are there others?

If anyone has some experience with this type of project, I would welcome some feedback.  As I said before, I have no specific problem to solve and no real timeframe to solve it.  I am looking for confirmation that my studies are following an appropriate path and perhaps a point in the right direction.


Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: Phase Shift of a Modulated Signal
« Reply #1 on: June 17, 2008, 03:28:11 AM »
the main problem i see is the relatively long wavelength of sound waves.
if you want to use a long wavelength then you have to put up with a low frequency signal.
to be sure that it is your actual transmitted sound you are receiving you will have to listen for several "peaks" to make sure it is in fact your transmitted sound. with a low frequency signal (ie, long wavelength) it will take a long time to get enough useful data.

for example, at 6 meter wavelength the frequency (in air) would be around 60Hz (approximately).
to be sure you are not reading background noise you would have to listen for many sound waves to pass.
lets say you need 15 waves to pass to be sure. that will take 0.25 seconds. which is not any better than using a high frequency burst and allowing a quiet period.

what you may be able to use this theory for is measuring speed rather than distance.
if you don't care how far away something is, just how much that distance is changing you are no longer limited to using long wavelength/low frequency sound.
if you drop the wavelength down to 1mm your frequency goes up to 35kHz. more than fast enough for some sort of precision speed trap.


dunk.

Offline ALZ

  • Full Member
  • ***
  • Posts: 75
  • Helpful? 1
Re: Phase Shift of a Modulated Signal
« Reply #2 on: June 17, 2008, 03:48:17 AM »
Hi: I think I know what you are talking about. Here comes the but. If the object you are "looking" at is moving and your robot is moving, you are not just looking at a  phase shift  anymore from the echo. You are looking at a different frequency. Old  ultrasonic alarms would transmitter all the time. They could tell how fast someone was moving by the fact that the  echo frequent was a different frequency then what was being sent out. A  modulated signal was not needed for this. Are you talking about something else? I know you can use phase shift to measure distance when using light but in a different way.
« Last Edit: June 17, 2008, 03:58:07 AM by ALZ »

Offline krichTopic starter

  • Robot Overlord
  • ****
  • Posts: 165
  • Helpful? 0
Re: Phase Shift of a Modulated Signal
« Reply #3 on: June 17, 2008, 09:41:03 AM »
Well, I was thinking I could use modulation to send 100hz pulses of 40khz sound and then key in on the phase shift of the 100hz signal.  Alternatively, and this might be easier, I could mix a 100hz and 40khz wave, remove the 40khz wave from the resulting echo and key in on the phase shift of the remainder (roughly 100hz wave).  Either way, with a 100hz modulation, I should be able to range about 50-100 feet, depending on how sensitive my circuit is.  (1129 ft/s * 1/100 s/pulse = 112.9 ft/pulse)

Folks do this modulation trick with lasers.  I figure I could do it with ultrasonic sound so that I can see what's happening on my, soon to be purchased, oscilloscope.  Once I get the basics down, I'll move on to the faster wavelengths.

Offline ALZ

  • Full Member
  • ***
  • Posts: 75
  • Helpful? 1
Re: Phase Shift of a Modulated Signal
« Reply #4 on: June 18, 2008, 12:10:41 AM »
Sorry you still lost me. I know they can measure a small  distances by measuring the phase shift of the laser  but I never heard it had to be modulated other than maybe to keep it cool. They are dealing with less than one wave length with no echos or movement.

With sound the distances is going to be more than 1 wave length to the object. So how will you know how many?  Like I said as soon as anything moves the echo is going to be a different frequency. You are going to get more than just one echo also.


Well, I was thinking I could use modulation to send 100hz pulses of 40khz sound and then key in on the phase shift of the 100hz signal.  Alternatively, and this might be easier, I could mix a 100hz and 40khz wave, remove the 40khz wave from the resulting echo and key in on the phase shift of the remainder (roughly 100hz wave).  Either way, with a 100hz modulation, I should be able to range about 50-100 feet, depending on how sensitive my circuit is.  (1129 ft/s * 1/100 s/pulse = 112.9 ft/pulse)

Folks do this modulation trick with lasers.  I figure I could do it with ultrasonic sound so that I can see what's happening on my, soon to be purchased, oscilloscope.  Once I get the basics down, I'll move on to the faster wavelengths.

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: Phase Shift of a Modulated Signal
« Reply #5 on: June 18, 2008, 01:23:02 AM »
Quote
Well, I was thinking I could use modulation to send 100hz pulses of 40khz sound and then key in on the phase shift of the 100hz signal.
how will that have any advantage over conventional sonar? you will still have to leave a pause between pings so you don't end up mistaking one for the next.

or am i missing your point?

dunk.

Offline krichTopic starter

  • Robot Overlord
  • ****
  • Posts: 165
  • Helpful? 0
Re: Phase Shift of a Modulated Signal
« Reply #6 on: June 18, 2008, 09:46:59 AM »
Quote
Well, I was thinking I could use modulation to send 100hz pulses of 40khz sound and then key in on the phase shift of the 100hz signal.
how will that have any advantage over conventional sonar? you will still have to leave a pause between pings so you don't end up mistaking one for the next.

or am i missing your point?

dunk.

ALZ, modulation of a laser is also used for this very purpose.  If I blast my modulated laser at something and the reflection is received 1us later and the modulation is 10 degrees out of phase, you can get a really, really good distance measurement out of that information.  Use the time of flight to get an "order of magnitude" of the distance, and use the phase shift of the modulation to fine tune it.  If you're smart (and rich) enough to take it a step further and measure the phase shift of the light frequency, then you would gain another level of precision.  This is all very high level, currently, and likely falls in the category of "much easier said than done".

Dunk, the ping and wait for a pong method is definitely much more documented out there in Google land.  It's a great method for those more comfortable with digital circuits and 0/1 logic.  The idea (and this is why it's current WAY over my head) is that if you take this idea into the analog realm, using sine waves rather than square waves, there's a lot more that can be determined from the echo.  Phase detection and amplitude are two things that come to mind.  Phase detection for distance and amplitude, perhaps, for type of material.  Think pillow vs. wall.

I'm not terribly educated on this yet, but my understanding is that since this is in the analog realm, you can use devices such as analog multipliers and phase detectors to manipulate the received signal as it comes in so that you can boil it down to a varying voltage based on the phase shift of the received signal compared to the transmitted signal.  I just don't know if I can figure out how to detect phase on my modulated frequency vs. the carrier frequency.

If you have the original signal and also the echoed signal, isn't it reasonable to think that you could remove the interference of the transmitter from the waveform you see at the receiver?  Similar things (and much more complicated things) are done routinely to receive broadcast radio, for example.  The difference is that they don't have an exact source for the carrier frequency, so they use a PLL circuit to adjust a locally generated frequency.  If you can accomplish this, and I'm pretty sure it's possible, you wouldn't have to have your sonar sitting around doing nothing but listening most of the time.

I know it can be done.  Whether I can do it or not is a different question.   I'll let you know in a few years...    ;)

Offline dunk

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 1,086
  • Helpful? 21
Re: Phase Shift of a Modulated Signal
« Reply #7 on: June 18, 2008, 11:11:15 AM »
Krich,
everything you say there makes complete sense but the part (i think) you are missing when comparing lasers to sonar is the speed of light vs the speed of sound.
your theory will work fine for distances up to a few millimeters. (exact distance depends on the frequency you are using.
as soon as you move far enough away from your transducer for the sound to be reflected back *after* the next wave is sent then you run into problems differentiating which pulse you are looking at.

what might work is if you stick with your idea of having a carrier frequency and a signal frequency but alter the signal frequency for each pulse.
this way each pulse has a unique signature so you could work out in software which pulse you are looking at.


dunk.

Offline krichTopic starter

  • Robot Overlord
  • ****
  • Posts: 165
  • Helpful? 0
Re: Phase Shift of a Modulated Signal
« Reply #8 on: June 18, 2008, 12:51:33 PM »
Now, that's a really good idea.  I'd probably set up an array of "detectors" for detecting the different signal frequencies, since I'd rather not do the frequency detection in software.  I guess I'd pick anywhere from 2 to 8, or so, frequencies to do this with.  Probably just two at first.

Yep, I know about how if you're more than one cycle out of phase with the frequency you're working with bad data.  For example, detecting the phase shift of a 40khz tone will only ever get you max distance of  0.34" ( 1/40,000 sec/pulse * 1130 ft/sec ~= 0.028 ft * 12 ~= 0.34 in ) before the phase wraps.  It could be less than that because "from what I've read" (I have no experience in this), its sometimes hard to figure out the difference between phase differences of 0-180 degrees vs. 180-360 degrees.  My thought is that if I can figure out how to measure the phase shift of the 100hz signal that's riding on the 40khz carrier signal, then I'll get much  more range (theoretically  1/100 sec/pulse * 1130 ft/sec ~= 11.3 ft). 

Then, also, using the typical ping/pong time of flight method, I could extend that distance much further (until the air attenuates the echo to nothing).  So,

1)  Take a time of flight measurement.  For the sake of the example, let's say it comes back with 30'
2)  At 30', the phase will have wrapped twice, so calculate the phase distance anyway
3)  Then add 11.3 twice to account for the phase wrapping
4)  Theoretically, you've got a more accurate distance measurement.

This is all predicated on figuring out how to detect the phase of the modulated signal and that nothing is moving, not even the air.   ;)

I just want to say that I'm so glad I can have a discussion with the folks in this community on this topic (and others).  I've not even bothered to talk to my engineer neighbors about this stuff.  They already think I'm nuts.   ;D

Quote from: Tim the Neighbor
Neighbor:  Hey Ken, what's new?
Me:  Hey Tim, I'm working on plans to build a Sonar.
Neighbor:  Oh really?  What happened to your robot project?
Me:  Oh, that's part of it.  You see I'm trying to...blah...blah...
Neighbor:  I see.  Well...ahem...ahhh...you look like you could use a beer.

Tim is coming around, though.  He just bought one of those robot gutter cleaners.   ;D

Offline bukowski

  • Robot Overlord
  • ****
  • Posts: 219
  • Helpful? 0
Re: Phase Shift of a Modulated Signal
« Reply #9 on: June 18, 2008, 02:11:32 PM »
Quote
what might work is if you stick with your idea of having a carrier frequency and a signal frequency but alter the signal frequency for each pulse.
this way each pulse has a unique signature so you could work out in software which pulse you are looking at.

Yeah, thats what our older analog radar did when I was in the service. It also had a digital signature it sent out before each pulse.
Also, doppler may affect your calculations. if the "target" is moving inbound or outbound, the returning frequency will be compressed or stretched out. The neat thing is, if you calculate it, you can determine the speed of your target.

Keep us posted. I know that my radar had a TON of circuitry concerned with keeping the pulses as square and noise free as it got amplified... and amplified... and amplified again. It'd be interesting to see a sine wave able to have similar results.
« Last Edit: June 18, 2008, 02:13:10 PM by bukowski »

Offline ALZ

  • Full Member
  • ***
  • Posts: 75
  • Helpful? 1
Re: Phase Shift of a Modulated Signal
« Reply #10 on: June 19, 2008, 03:27:56 AM »
Hi krich:

"If you're smart (and rich) enough to take it a step further and measure the phase shift of the light frequency, then you would gain another level of precision."
That is what I was talking about.

You just keep on over looking the problems with your idea. The frequency is going to change as soon as anything moves and the phase shift will have no meaning unless you are planning on doing a lot of math to make up for it.

The biggest error with the ping pong system was a lost of some of the cycles.
When you pulse the transducer it started up slow. So some of the waves were too weak to stop the timer when they came back.  So to make up for this I counted the waves that  left and the waves that came back. This way I knew what was lost and got a better idea of the real distance. Yes I played around with this stuff over 35 years ago. Also if you don't stop the timer the 1st time the echo comes back, you can also "see"  what is behind the 1st object. I can also tell you that phase shift does not work for very short distances.  It might have something to do with air pressure. That was what I was trying to use phase shift for.
Have fun!

Offline krichTopic starter

  • Robot Overlord
  • ****
  • Posts: 165
  • Helpful? 0
Re: Phase Shift of a Modulated Signal
« Reply #11 on: June 19, 2008, 01:35:30 PM »
Yep, I have no doubt I'm missing lots of stuff.  Most of it is going right over my head.  For now, i just want to measure non-moving objects from a non-moving platform, with no significant wind.  Hopefully that'll get me started. 

To combat the relatively slow ramp up and settle times of the transducer, I was thinking of sending a key pulse of a much higher amplitude during the ping, so that would be visible in the return echo and I could try to key off that.  I like your idea of pulse counting as well.


Offline ALZ

  • Full Member
  • ***
  • Posts: 75
  • Helpful? 1
Re: Phase Shift of a Modulated Signal
« Reply #12 on: June 19, 2008, 03:06:32 PM »
Hi krich:

I am all most sure of what you are trying to do. You are trying to add to ideas together but that is not going to work well. But you learn by trying. Before I tell you the problems I see.

You can stop the settle down times of the transducer very fast. When you want to stop the transducer you put a short across it by using a 4016 chip then have the chip take the short away.

You want to "key" on something that has an error then feed it to  a phase ckt that gives you a little error. The best that is going to happen is you will have a little more error then if you didn't use the phase ckt at all. 



Yep, I have no doubt I'm missing lots of stuff.  Most of it is going right over my head.  For now, i just want to measure non-moving objects from a non-moving platform, with no significant wind.  Hopefully that'll get me started. 

To combat the relatively slow ramp up and settle times of the transducer, I was thinking of sending a key pulse of a much higher amplitude during the ping, so that would be visible in the return echo and I could try to key off that.  I like your idea of pulse counting as well.



 


Get Your Ad Here

data_list