Shop OBEX P1 Docs P2 Docs Learn Events
LIDAR Lite — Parallax Forums

LIDAR Lite

John AbshierJohn Abshier Posts: 1,116
edited 2015-04-08 05:47 in Accessories
Progress on this will be slow since the weather is getting nice and I will spend more time shooting and traveling. Attached object and demo reads range in centimeters and inches and velocity in centimeters per second. Velocity not really tested. Range testing so far is limited to range from table to ceiling and seeing if it changes when I place my hand over the LIDAR Lite. Occasionally there is a one shot reading that is way off. I am not sure why the code is so slow, a call to get range in centimeters is running at 8 Hz. I am posting code now because I saw that Diver Bob just bought this sensor.

John Abshier

P.S. Latest version in post #11

Comments

  • DiverBobDiverBob Posts: 1,115
    edited 2015-03-20 12:15
    Thanks for posting the code. I'll try it out and let you know how it goes. When I first heard about these type of units I knew I wanted one, just needed a good excuse to get one!
  • Patrick ColemanPatrick Coleman Posts: 43
    edited 2015-03-23 11:59
    I have one of these, as a sample for my Kickstarter and my International Aerial Robotics Competition (IARC) work. but its set as the I2C master, so the propeller i guess needs to recieve as a slave, which is the opposite one would expect.

    I also have a 360 degree one from the roomba or some other vacuum bot. TTL and HEX make that one work. Im trying these on my autonomous tri-copter. I think collaboration would benefit us all.
  • prof_brainoprof_braino Posts: 4,313
    edited 2015-03-23 14:12
    Patrick Coleman: Is yours working with sensor as master? Does this mean the lidar light initiates the I2c communication when it is ready with the next reading? I did notice that possibility from the datasheet, but maybe I had an early version.

    I thought the microcontroler must be the master, and the sensor must be the slave? That's how mine is working, Prop asks for next reading.
  • Patrick ColemanPatrick Coleman Posts: 43
    edited 2015-03-24 11:37
    I had the first generation version, maybe they changed it, or i misunderstood. i know the STM32 can be configured oddly to be slave. but id like to get towards the propeller series of ICs. but i thought they internally permanently wrote the lidar to be master... sensors dont usually do that.

    im sick but will contact them.
  • prof_brainoprof_braino Posts: 4,313
    edited 2015-03-24 12:44
    Here's my notes from LIDAR lite I2C. Its written in FORTH but you might be able to see the addresses etc from the code. I also have an early version, from the earliest backer discount.

    http://code.google.com/p/propforth/wiki/LIDARLite#I2C
  • Patrick ColemanPatrick Coleman Posts: 43
    edited 2015-03-24 17:13
    Boooo, I guess I misunderstood.


    In any case, Ive wasted a lot of time muddling through the STM32. And the LiDAR was a sample for academic purposes for flight. So I owe Dennis a full demo for flight and other purposes. I have high hopes for the propeller, since this IC is so heavily adapted to interrupt-less embedded work.

    Kick Starter : https://www.kickstarter.com/projects/215756405/uav-for-humanitarian-aid-and-environmental-researc

    IARC mission 7 : http://aerialroboticscompetition.org/
  • John AbshierJohn Abshier Posts: 1,116
    edited 2015-03-26 13:12
    Conditions of test: LIDAR Lite on table ranging to ceiling. Fairly bright room. I took 256 reading with the following distribution.

    Bin Frequency
    160 0
    161 2
    162 5
    163 19
    164 39
    165 49
    166 48
    167 32
    168 36
    169 12
    170 12
    171 1
    1190 1

    You can see the one way out reading. A histogram of the rest look "normalish" I didn't do any statistical tests for normality. Mean 166, standard deviation 2 (not including the 1190 reading). I implemented an offset or zero method but am getting results I don't understand. I have a support ticket opened with Pulsed Light

    John Abshier
  • John AbshierJohn Abshier Posts: 1,116
    edited 2015-03-26 14:56
    Turn off velocity measurement after reading velocity. Range measurement speeds up from 8+ Hz to 50+ Hz. Tweaking registers could increase sample rate, but as Robert Heinlein said in The Moon is a Harsh Mistress, "There is no such thing as a free lunch." Sample rate up, accuracy down. If you (or your boss/funder) can afford multiple LIDAR Lites, I think the way to go would be to use a Prop to control and filter the sensors and report back to the master. You could even add some Pings to catch things that the laser rangefinders miss. Next step is to implement a 3 element median filter to get rid of the 1190 reading in previous post.

    John Abshier
  • John AbshierJohn Abshier Posts: 1,116
    edited 2015-03-27 10:34
    I have implemented a filter. First method is PUB GetCentMedianFilter which makes 3 range measurements and applies a 3 element median filter. The other and better is PUB GetCentimetersFiltered which passes the results of a 3 element median filter into a user defined order moving average. The GetCentimetersFiltered method requires a call to PUB SetupFilter prior to use. The attached graph is for 256 raw measurements of distance from workbench to ceiling and 256 calls to GetCentimetersFiltered using a 5 element moving average. The attachment is a WordPad rich text document.

    Raw-Filter.rtf

    John Abshier
  • John AbshierJohn Abshier Posts: 1,116
    edited 2015-04-08 05:47
    Attached is my latest version. I contains Sleep and Wake methods for power saving. I cannot get the Offset method to work. The latest suggestion from Pulsed Light is to do the offset in the application code instead of in the sensor. Left as an exercise for the user.

    John Abshier
Sign In or Register to comment.