Shop OBEX P1 Docs P2 Docs Learn Events
Project: Laser range finder... big distance! — Parallax Forums

Project: Laser range finder... big distance!

Sniper KingSniper King Posts: 221
edited 2011-08-12 17:30 in Propeller 1
this is something I have wanted to do for a really long time.· I ave had a few claiming to hit 1000 yrds but in reality at 1000 yrds it had to be a white building facing you in the dark.· So I started looking for the "build your own laser Range Finder" sites.· Their are some clever rangefinder plans bassed on angular measurement and even some good hardware ideas to support that.· But alas...· I want the real thing and I want miles not yards!!!


OK optics, i think i am good.· Two childrens (for now) reflecting telescopes.· One for transmit and one for recieve.... Columnated.... ready for laser and detector.· Now...· How do we amplify our received laser energy?· Think the propeller could handle the speed of light?·

What do you say?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.



Michael King
Application Engineer
R&D
Digital Technology Group
«134

Comments

  • MightorMightor Posts: 338
    edited 2008-07-01 05:23
    Surely, the Propeller should be able to handle 8 times the speed of light, no? [noparse]:)[/noparse]

    Regards,
    Xander

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    | To know recursion, you must first know recursion.
    | Current projects and ramblings: I'd Rather Be Building Robots
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2008-07-01 06:07
    Sniper King,

    The speed of light is 299,792,458 meters per second... so taking the inverse, that's about 3.33ns per meter.

    Running at 80MHz, the resolution of the Propeller is 12.5ns which would give you a distance resolution of roughly 1.88 meters.
    The value of 1.88 meters is half of what you would expect from dividing 12.5ns by 3.33ns, because you apply the "round trip" distance in this circumstance.

    "Two childrens (for now) reflecting telescopes.· One for transmit and one for recieve...."
    I like this idea, but why not use a laser (transmit) and only one reflecting telescope (receive)?

    "Now...· How do we amplify our received laser energy?"
    There are several ways this could be done... most commonly you would modulate the laser (transmitter) at a specific frequency or carrier.
    On the receiver look for the presence or non-presence of that carrier frequency... apply the same principles that you would for radio when detecting a "carrier", but apply them to the laser beam instead.
    ·








    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Sniper KingSniper King Posts: 221
    edited 2008-07-01 06:43
    Here is what I have come up with so far...

    (Links)

    ···· Detector· ' 940nm +/- 50nm

    ·····Laser· ' 30mw 904nm



    Add a opAmp· to the detector and a amplitude modulated 38khz signal and we have a rangefinder hardware.· Make the output binary and now we can feed it into the Propeller.· For best results i would imagine a assembly routine to handle the speed at its finest.





    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.



    Michael King
    Application Engineer
    R&D
    Digital Technology Group
  • Sniper KingSniper King Posts: 221
    edited 2008-07-01 06:52
    Beau Schwabe (Parallax) said...
    I like this idea, but why not use a laser (transmit) and only one reflecting telescope (receive)?
    ·· Beam divergence is a huge problem with range.· While at night with your 5mw laser you may see the spot a a pretty great distance. If you are at the spot (physically,at the great distance) you would see a very large circle of light. In the day that dot disapears at a few meters.··At a large distance you cannot see the light for the ambient light present. ·However,· when you columnate the laser beam, the spead happens·at a much slower rate.· The beam leaving the columnator will be wider but the rate at which it expands is slower.· Therefore allowing the detector, focused on the same spot, to get the maximun amount of light return.

    The telescope for the TX portion is to get as much laser energy as possible in the smallest area we can.· Doing a little research brought me to a page where somebody did just that and had great results.· As for infrared, I'm sure I am not going to get lense transmission data from XYZ toy/telescope company.· That brings me to mirrors.· One small· convex lense from Edmund scientific designed for IR·and the front surface mirror of the telecope and we have a TX/RX pair that is reasonably priced for the expected ranges we could get.··

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.



    Michael King
    Application Engineer
    R&D
    Digital Technology Group

    Post Edited (Sniper King) : 7/1/2008 7:03:58 AM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2008-07-01 14:55
    Sniper King,

    "Add a opAmp· to the detector and a amplitude modulated 38khz signal and we have a rangefinder hardware."

    An opAmp by itself may not be enough... you may need an LC·tuned·to 38kHz·excited by the IR receiver, and then use an opAmp.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Ken PetersonKen Peterson Posts: 806
    edited 2008-07-01 15:11
    If you are using op amps, why not put together an active band-pass filter with gain?· Better noise rejection and a sharper knee.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • Sniper KingSniper King Posts: 221
    edited 2008-07-01 15:27
    That is a good idea.· However,·how much 38khz ambient light is there in nature?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.



    Michael King
    Application Engineer
    R&D
    Digital Technology Group
  • Sniper KingSniper King Posts: 221
    edited 2008-07-01 15:29
    I dont know if i can pull 38khz from the detector listed above.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.



    Michael King
    Application Engineer
    R&D
    Digital Technology Group
  • Ken PetersonKen Peterson Posts: 806
    edited 2008-07-01 15:50
    I imagine there's not much at 38kHz, but there's a lot of random IR noise in nature. That's why a good band pass filter is important so you're only measuring the 38kHz component.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • Sniper KingSniper King Posts: 221
    edited 2008-07-01 16:11
    Ok, Im convinced you are right.· Can we have a cog create a stable 38khz frequency?· If we can i can build a circuit that constantly pushes 6 volts with a 38khz carrier and then turn that on and off with a high speed transistor switch.·

    I see having the detector on.· Turn on the laser and 'listen' for a return.· In assembly i can imagine this is only going to take a few lines of code...

    In spin it would be something like this...


    Outa[noparse][[/noparse]laser]:=1
    repeat I from 0 to 500_000_000
    if ina[noparse][[/noparse]detector]==1
    ··· range:=i

    ·' Do some math to get actual range in meters






    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.



    Michael King
    Application Engineer
    R&D
    Digital Technology Group
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-07-01 16:27
    Okay, suppose you send a burst of light that's modulated for ten cycles at 38KHz and bounce it off a target 500 meters away. The round trip is 1000m and takes 3.33usec. How much of the 38KHz burst does this encompass? Well, 38E+3 * 3.3E-6 is 0.1254, so the leading edge of the "pulse" will have returned before 7/8 of the first cycle has even left! So what is the time delay and how do you measure it? By the time a tuned circuit has detected and demodulated the pulse, the uncertainty in it's actual location will be much greater than the distance you're trying to measure.

    I think a better approach would be to use continuously-modulated light and run the outgoing modulation and incoming modulation through a phase comparator. The phase difference will give the distance. Even better would be to modulate the light at a much higher frequency with a maximal-length sequence from an LFSR. Assuming a phase detector can be programmed into the Propeller that's fast enough to lock onto the returning signal, this approach should yield better results when the return signal is weak. The Prop's video output may be a key factor it making this work.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • johnfl68johnfl68 Posts: 72
    edited 2008-07-01 16:42
    Sniper King said...
    Beam divergence is a huge problem with range.

    To explain to others - typical laser pointer has a beam diameter of let say 5 mm and a divergence of 1.2 mRad - At line of sight maximum to the horizon on the ground, a distance of 2.89 miles, the beam would be over 18 feet in diameter.

    John
  • Sniper KingSniper King Posts: 221
    edited 2008-07-01 17:35
    Phil said...
    I think a better approach would be to use continuously-modulated light and run the outgoing modulation and incoming modulation through a phase comparator.
    So are you saying send out a pulse and when it is detected send out another pulse then measure the frequency we created by doing this?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.



    Michael King
    Application Engineer
    R&D
    Digital Technology Group
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-07-01 17:42
    No. Just keep transmitting a continuously modulated beam and compare the phase of the return signal with that of the transmitted signal. There will be a phase shift proportional to the distance.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • Sniper KingSniper King Posts: 221
    edited 2008-07-01 18:03
    OK, I see what you mean now. So in essense a higher frequency pulse would be preferable because at lower frequecies the resolution in pahse would be small. How do we do that and can the propeller handle that or should we move to an external piece?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.



    Michael King
    Application Engineer
    R&D
    Digital Technology Group
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-07-01 18:32
    You could use an external phase detector or two. Analog multipliers would probably work best in this scenario. Two of them, one driven by the transmit signal and incoming signal and the other driven by the transmit signal in quadrature (90 degrees out of phase), plus the incoming signal, would give you the most accurate phase info.

    Another way to do this would be to convert the incoming signal back to a digital clock train. Then you'd feed the digital signal, together with the original clock into one of the Propeller's counters, using the LUT logic mode configured as an exclusive OR gate. In this mode the counter will increment only when the two signals are different. The amount the counter increments over several cycles will then be proportional to the phase shift between the two signals.

    I've never done any of this, so there's a good dose of speculation here. It's your ball now. Good luck!

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • Sniper KingSniper King Posts: 221
    edited 2008-07-01 18:35
    Would a phase comparator chip work and then use a pulse count on the propeller?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.



    Michael King
    Application Engineer
    R&D
    Digital Technology Group
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-07-01 18:52
    Which phase comparator did you have in mind? There are a bunch of different kinds.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2008-07-01 19:03
    Sniper King,

    I think Phil is on the right track here... "Another way to do this would be to convert the incoming signal back to a digital clock train. Then you'd feed the digital signal, together with the original clock into one of the Propeller's counters, using the LUT logic mode configured as an exclusive OR gate. In this mode the counter will increment only when the two signals are different. The amount the counter increments over several cycles will then be proportional to the phase shift between the two signals."

    The modulated frequency·at 38kHz is ok, the wavelength at this frequency is slightly less than 5 miles. (4.9 miles) ... in other words, after every 4.9 miles the phase offset should complete 360 Deg.··If you are going further than 2.45 miles (<-round trip) then you could introduce a second frequency with a longer wavelength as a way to get a course adjustment reading, and then go with a shorter wavelength for finer readings.·

    Still think you might be limited to about 1.9 meters resolution.






    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Sniper KingSniper King Posts: 221
    edited 2008-07-01 19:12
    1.9 meters is totally acceptable range. I wanted to tie this to a camera on a very accurate pan and tilt system to get global coordinates based on knowing my location, distance and direction. 1.9 meters will get me close enough if we can indeed design this!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.



    Michael King
    Application Engineer
    R&D
    Digital Technology Group
  • Sniper KingSniper King Posts: 221
    edited 2008-07-01 19:16
    Beau, I like your way only because it does drop the hardware requirement a bit.· I already know how to make the signal back to digital.· The programming you speak of is a little foreign to me as I am new to spin but what a great time to learn.· I may have to try both methods of Measuring distance to see which one better performs.



    I will put together an Eagle layout of the schematic.· If any really good EEs out there can check me that would be helpful.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.



    Michael King
    Application Engineer
    R&D
    Digital Technology Group
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-07-01 21:03
    One thing you'll need to watch out for: your analog frontend may introduce a phase shift of its own before the signal is converted back to digital. Hopefully, the added shift won't be amplitude or temperature sensitive. Assuming not, it should be easy to calibrate it out. If this turns out to be an issue, one possible corrective measure would be to run a diminished version of the the transmit clock through a duplicate of the analog receive circuitry so it gets the same treatment before it's introduced to the phase detector.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • quick questionquick question Posts: 50
    edited 2008-07-02 01:58
    If I am not mistaken, cheaper commercial laser range finders use "pulse stretching" to overcome the clock speed issue to get about 1 meter resolution.·

    something like - charge a cap with a series of pulses and let it decay-·to remove error.

    I seem to remember a pulse that looks like a 3-4-5 triangle with the hyp's on the x -axis.·Used a flip-flop ....

    The Bushnell's· use this i am almost sure....



    let me do a bit of digging- might be from an old issued patent from the USPTO site....

    At least I know there are old patents (read dead) with schematics on

    how to do this with clocks much slower than the propeller.... .

    ·
  • quick questionquick question Posts: 50
    edited 2008-07-02 02:05
    although I'm new, wasn't there a nuts and volts article that had a program which had a function where you could wait until two pins are the same?

    read the counter - then wait until·(laser_out:=1 and laser_in:=1) read the counter again to get flight time?



    the article was not for this purpose of course - I think it had to do with timing in an RC circuit ....
  • quick questionquick question Posts: 50
    edited 2008-07-02 02:24
    see: us patent 5,926,259

    even has the pulses from my minds eye ...
  • quick questionquick question Posts: 50
    edited 2008-07-02 02:48
    last post i promise:
    from the patent:

    "A method has been developed to obviate the need for such high frequency clocks in a laser range finder. This method, developed by Laser Tech, Inc. of Colorado, is described in application for U.S. patent Ser. No. 08/375,945, entitled LASER RANGE FINDER HAVING SELECTABLE TARGET ACQUISITION CHARACTERISTICS AND RANGE MEASURING PRECISION, filed Jan. 19, 1995, which is incorporated herein by reference. In the Laser Tech circuit, a series of 30 or more individual laser pulses are emitted each time a trigger switch is engaged. A charging circuit is triggered with the emission of each pulse whereby a capacitor is charged at a first, relatively rapid rate during the time of flight for each pulse. After each return pulse is detected, a discharging circuit is triggered which discharges the capacitor at a second, much slower rate. A microcontroller times the discharge period and calculates a range based upon the time of discharge by the use of a calibrated formula. In one example, the capacitor discharge rate was 1000 times slower than the charging rate, thus allowing an 8 MHz crystal oscillator to be used as a timer clock source to yield an accuracy of .+-.1 meter at a 1000 meter range. An automatic noise threshold circuit sets a minimum threshold noise level which allows reliable detection of reflected laser pulses and a dithering circuit selectively provides increased accuracy."
  • Sniper KingSniper King Posts: 221
    edited 2008-07-02 04:57
    Hey quick Question, that would be awesome. I really want to do this and any help would be great.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.



    Michael King
    Application Engineer
    R&D
    Digital Technology Group
  • Sniper KingSniper King Posts: 221
    edited 2008-07-02 05:33
    Ok, after looking at the patent, I am getting the jist of this.· Now my daddy always said if it is too good to be true then it probably is.· So tell me if I am crazy here..



    This may be a little over simplified but it is close I think.··



    Fire a pulse. at the same time start charging a capacitor very fast.··· When you detect· your pulse after bouncing off your target, stop charging the capacitor.· Using a much larger resistor, discharge the capacitor and measure the time.· Kind of like an RC Circuit x 1.5.



    Am I crazy or it that all it will take?

    This got really easy (NEVER say easy) if it is true.



    I am getting excited!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.



    Michael King
    Application Engineer
    R&D
    Digital Technology Group
  • Beau SchwabeBeau Schwabe Posts: 6,557
    edited 2008-07-02 06:15
    Sniper King,
    ·
    That method will work, but there are a few things, actually several things that I would be concerned with.
    ·
    First of all your using somebody's patent that is there to provide proof of prior art to persuade someone else from using their design.
    ·
    One thing that I think you will have problems·with in the·patent design·is in·trying to compensate for how temperature·and humidity·will affect the capacitor.· By charging/discharging the capacitor at different rates you can sort of compensate for this, but that only assumes that the charge and discharge rate·have a similar response to one another which may not always be the case.
    ·
    I don't believe that it would be completely necessary to initially charge a capacitor very fast at the beginning.·
    Really, all that you need to do, and this would compensate for temperature/humidity variations as well, is to...
    ·
    1)·Turn on a laser while pulling the trigger and at the same time charge a capacitor to a very specific voltage.
    2) Discharge the capacitor for a specific amount of time at a specific rate and note the voltage
    3) Recharge the capacitor back to the very specific voltage used in step #1 and turn the laser off
    4) While the receiver still "sees" the laser, discharge the capacitor at the same rate as in step #2 and note the voltage when the receiver·no longer· "sees" the laser
    ·
    The purpose for step #2 is for calibration to determine a specific voltage drop over a known amount of time and discharge rate that may drift due to temperature.· Step #4 uses information obtained from step #2 to solve for an unknown amount of time, which later gets translated into a distance.
    ·
    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 7/2/2008 6:25:20 AM GMT
  • Sniper KingSniper King Posts: 221
    edited 2008-07-02 07:25
    OK,·I am really liking the charge capacitor way of measuring the time of flight.· I have attached a schematic.· If this is totally out of the ballpark let me know.· It is based on the RC circuit Parallax supplies for the basic stamp for the RCTIME command.· I have added a couple of transistors and a secon resistor.· i have done absolutely no RC time calculations so the resistor values are just to exagerate the simplicity of the idea.· Charge fast during time of flight and then discharge really slow for measurement of the time of flight.



    Timeline of rangefinder operation:


    1. Pin 18 high
    2. pin 26 high
    3. pin 1 high
    4. when pin 0 goes high then pin18 low
    5. Make pin 26 an input
    6. pin 16 high
    7. measure discharge time on pin 26

    I would imagine a voltage comparator circuit would be more accurate and temperature stable too.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·- Was it pin 11 or 26?· Hmmm....··I think the smell of smoke tells the whole story.· Must be 26.



    Michael King
    Application Engineer
    R&D
    Digital Technology Group
    1551 x 1088 - 81K
Sign In or Register to comment.