Close
0%
0%

Open Source LiDAR - Unruly

We've been waiting a long time for someone to post the plans of a working LiDAR. Is it really going to happen?

Similar projects worth following
Open hardware, open software and a detailed explanation of how LiDAR works right down at the component level. These are the objectives of this ambitious project.

The name "Unruly" was suggested by my 6 year old, "Dad, it measures without a ruler!"

Primary objectives:
1. Design a simple LiDAR module that is relatively easy to understand.
2. Use as many COTS (commercial-off-the-shelf) electronic components as possible.
3. The software must be easy to modify without a complicated IDE.
4. Mechanical parts must be 3D printable.
5. Optical components must be available at a reasonable price.

The Unruly specifications: Make it hack worthy

The Unruly is not just a crazy hack but is also a serious educational tool with lots of capabilities added to allow for experimentation. Here's the Unruly feature list in no particular order:

  • The Unruly is a time-of-flight LiDAR that uses a pulsed laser diode (PLD) to generate a flash of light, an avalanche photodiode (APD) to detect the return signals and a high speed timer (TDC) to measure the return time.
  • The total circuit board area is one square inch.
  • The measuring range can be adjusted to over 100m on natural surfaces and 250m on reflective surfaces, outdoors in bright sunlight.
  • The resolution can be configured down to 1 cm.
  • The measuring rate is up to 1000 readings per second or maybe more ;).
  • The laser power, pulse width and eye safety ratings are all under software control and can be set to Class 1, Class 1M or Class 3R to suit the application.
  • The APD detector can be adjusted under software control to operate at optimum sensitivity taking into account temperature and ambient conditions.
  • The amplifier gain can be adjusted under software control to achieve the best SNR (signal-to-noise ratio).
  • The detection threshold can be adjusted under software control to set the false return error rate.
  • Up to five different target returns can be measured on each laser shot.
  • The total power consumption is less than 0.5 W.
  • USB, serial and I2C communications are available at the same time.
  • Two servo driver ports are available to control scanning (https://youtu.be/IirAJO5H0yI).
  • A digital I/O for alarms or other purposes is available.
  • Mechanical parts are 3D printable.
  • EMC emissions are low enough for use with RTK and GPS systems without interference.
  • EMC immunity is high enough to allow for use with BLE, WiFi, LoRa or other radios in close proximity (still to be tested).

The Unruly use of open source hardware: ItsyBitsy M4 Express

The Unruly uses existing open source hardware as a starting point, the Adafruit ItsyBitsy M4 Express. This is a small microcontroller board with a SAMD51 processor, extra flash memory and almost nothing else. Why, you are asking, have you chosen such a basic controller board to manage the complicated hardware of a LiDAR? Well, my wife likes how small it is and it has a cute name. Of course it helps that the SAMD51 runs at 120MHz and has a bunch of really interesting peripherals.

The Unruly use of open source software: CircuitPython

Another reason for choosing the ItsyBitsy M4 Express board is that it can run a version of the programming language Python called CircuitPython. This is by far the least likely language to be used in a high speed embedded system, especially one that needs to work at the speed of light. Python is an interpreted, high level language that manages variables and memory in a vague, non-specific way. There are only a few APIs and these do stuff that is no use to a LiDAR.

But CircuitPython is easy to write, easy to read and can be programmed without an IDE by using a basic text editor. This seems like a good enough reason to use it.

Servo scanner.MOV

Unruly scanner using a single servo.

quicktime - 4.45 MB - 01/27/2019 at 17:10

Download

Unruly_Rev1.pdf

Unruly Rev 1 schematic.

Adobe Portable Document Format - 1017.38 kB - 01/20/2019 at 14:21

Preview
Download

  • Rev3 - Getting closer to production

    Laser Developer02/22/2019 at 07:32 4 comments

    DESIGN

    • This revision will use the MAX3658 or MAX40658 TIA. The two different versions will be catered for on the PCB so that the manufacturer can chose the one with the best price.
    • There will be no VGA post-amplification. This will reduce the measuring range a little but make the product much cheaper.
    • The unit will be able to run on a 3.6V battery.

  • Rev2 - Unruly design for lower cost

    Laser Developer02/02/2019 at 14:53 0 comments

    DESIGN CHANGES

    Once the design of a product is complete the hard work begins. The principle of operation and basic functionality remain the same but new constraints must be considered such as the availability and price of parts, ease of manufacture, tooling for lower costs and so on. These constraints make the difference between an idea and a product that can be made and sold. Hence the Unruly Rev2 has:

    • New amplifier chain chipset - lower price but similar performance.
    • Started adding test points for production.
    • Get quotes for tooling optical carrier component.
    • Get commitment from a manufacturer.
    • Get commitment from a distributer or two.

    ----------------------------------------

    TESTS

    The boards have arrived and test results are as follows:

    1. The first test is to evaluate the performance of a new LiDAR specific TIA from Analog/Linear called LTC6560.

    Positives: In terms of sensitivity, noise characteristics, overdrive recovery and stability this is a great component. It provides enough gain that there is no need for a post amplification stage thereby saving on component costs. It operates right at the theoretical limits of performance, meaning that you are not likely to be able to design a better TIA circuit yourself.

    Negatives: This device may have limited application in battery powered LiDARs because it needs a +5V power supply. It is also draws more power than the Maxim equivalents. To get full speed operation it needs a pull down resistor on the output which draws additional power.

    ----------------------------------------

    CONCLUSIONS

    On balance, I have decided not to use the LTC6560 TIA. I think that the requirement of running on a 5V supply will make battery powered operation painful. Everything else runs perfectly on a 3.6V battery so it doesn't make sense to lose that capability.

    On the matter of production, LightWare has offered to produce the Unruly provided that we can get the retail price below US$100. Using the MAX4658 TIA is the cheapest option so this fits well with this requirement.

    Additionally, we can remove the VGA post amplifier to reduce the price further. This will bring the useful measuring range down to about 60m but for most robotics applications this is more than enough. The maximum range is still beyond 100m but it needs a large white wall as a target.

    So, on to Unruly Rev3!

  • Rev1 - Final test article

    Laser Developer01/20/2019 at 16:33 7 comments

    Rev1 is a stable test board for further software development. New features specifically for educational purposes have been added:

    • Laser pulse width controls added.
    • Laser power controls added.
    • Updated laser CAD model to improve optical alignment.
    • Made I2C pins available to the user.
    • Increased mounting holes size for optical parts.
    • Moved main supply to HVI to allow for battery operation.
    • Added power controls on VGA through D2 PWM.

    You will notice on the circuit board overlays that there are lots of small holes and very few visible tracks. The holes bridge the inner ground layers and outside layers together to reduce transmitted interference and cross talk between the laser driver and receiver circuits. The signal tracks are on the inner layers, shielded by ground plains, to reduce electromagnetic susceptibility.

    Above is the top side of the board and below is the other side showing the pulsed laser diode (PLD) and the avalanche photodiode (APD). At the moment we're using a laser from Laser Components and an APD from Hamamatsu.

    In order to test Unruly it's important to be able to access the components on both sides of the board while it is running. This is done by adding "wings" instead of headers. These wings are just headers soldered on at right angles.

    The optics are then screwed on.

    Using the wings, jumper cables connect the ItsyBitsy M4 Express to the Unruly LiDAR leaving the back of the circuit board accessible to an oscilloscope.

    Test 1 - Unfiltered signal stability - indoors:

    Results:

    Single shot STDEV (standard deviation) = 1.0 cm (33 ps)

    Single reading APD bias voltage measurement STDEV = 0.11 V

    Single reading APD temperature measurement STDEV = 0.2 C

  • Rev0 - Initial test article

    Laser Developer01/20/2019 at 16:24 0 comments

    The following tests were conducted on Rev0:

    • CircuitPython APIs tested. Note that import order is important for correct hardware configuration and pin assignments.
    • Range confirmed >100m on grass and tress, >250m on reflector.
    • Resolution  confirmed <1cm for nearby targets indoors.
    • Update rate set to 1024 readings per second to allow for interleaved software functions.
    • EMC - emission levels extremely low especially around 2.4GHz and all satellite bands.
    • EMC - susceptibility minimal over wide range of frequencies and power levels.
    • Power consumption - VGA draws significant current (48mA) so power control added to Rev1.
    • With VGA power control on the average consumption is approximately 70mA at 5V.
    • Operation on battery connection confirmed.
    • Serial port tested (not I2C).
    • Servo ports tested. Note that port D4 produces 3.3V logic but port D5 produces 5V logic.
    • Initial eye safety testing done. Repeat for Rev1 to include the laser power controls.
    • Confirmed laser SMPS draws 2.5mA at firing rate of 2048 shots per second.
    • Confirmed APD high voltage supply draws 2.0mA at operating point.
    • Lenses and optical filter characterized through functional testing.

View all 4 project logs

  • 1
    Unruly glossary: TLAs (Three Letter Acronyms)
    • LiDAR = Light Detection And Ranging - a sensor that measures distance using laser light.
    • TOF = Time Of Flight - measuring distance by timing how long it takes a flash of light to reach a target surface.
    • PLD = Pulsed Laser Diode - a semiconductor chip that produces bright flashes of laser light.
    • APD = Avalanche Photo Diode - an optical detector with high sensitivity.
    • TDC = Time to Digital Converter - an IC that uses digital codes to represent short time periods.
    • SMPS = Switch Mode Power Supply - a circuit that changes voltage levels by switching current through an inductor.
    • TIA = TransImpedance Amplifier - an IC that converts current from a photosensor into a voltage.
    • IBM4 = ItsyBitsy M4 Express - a microcontroller breakout board manufactured by Adafruit Industries.
    • PWM = Pulse Width Modulation - a method of changing the duty cycle of a digital signal to produce different analog voltages.
    • SNR = Signal to Noise Ratio - an indication of how big a signal is compared to unwanted noise.
    • VGA = Variable Gain Amplifier - an amplifier with a digital interface to select the gain.
  • 2
    Unruly overview: How does it work?

    The Unruly LiDAR is made up of electronic circuits, optical parts and software. None of these are trivial even though they may look simple at first glance.

    The electronic circuits are on two circuit boards that plug together. The first board is the ItsyBitsy M4 Express controller and this is the brains of the LiDAR. The other board carries all the LiDAR specific components including the optics.

    The electronic circuits on the LiDAR board perform a number of functions. The measuring sequence starts when the TDC (time-to-digital converter) receives a start signal from the processor. At the same time the laser driver circuit fires a PLD (pulsed laser diode) to produce the outgoing flash of laser light.

    The return signal is detected by an APD and amplified in two stages. Firstly, a TIA (transimpedance amplifier) converts the current from the APD into a differential voltage. Secondly, a VGA (variable gain amplifier) increases the amplitude of the signal to a useable level.

    The analog signal is then converted into a digital signal using a comparator and this digital signal stops the TDC. The results from the TDC are transmitted back to the processor via an SPI bus.

  • 3
    Unruly optics: Seeing a long way...

    The optical components give the Unruly LiDAR its performance. Many thanks to Tracy for the hundreds of hours that she put into designing these critical parts.

    The PLD (pulsed laser diode) produces short flashes of light forming a beam that spreads out over a wide area. Without additional optical components the beam loses intensity and the measuring range is reduced. To correct for this beam divergence the Unruly has a lens placed in front of the laser, making the beam come out nearly parallel. This optical collimation significantly increases the measuring range.

    Photons in the outgoing laser beam hit the target surface and scatter in all directions. Only a small proportion of these photons head straight back, most of them are lost. In order to collect the returning photons a focussing lens is placed in front of the optical detector. The  lens collects more photons than the detector could do on its own so the measuring range is again extended.

    Mixed in with the returning photons are additional photons from various sources of background light such as the sun. These unwanted photons create noise in the detector making it hard to pick out the laser photons. To reduce this noise a narrowband optical filter is placed directly in front of the detector. This filter allows light through that is the exact color of the outgoing laser light and blocks light from other sources, letting the Unruly work even in bright sunlight.

    The detector is a very sensitive APD (avalanche photodiode) that converts the returning photons into electrons. The APD is 100 times more sensitive than a regular photodiode and it produces many electrons for each photon that it detects. This sensitivity helps the Unruly pick up very weak signals from distant target surfaces.

    A precision 3D printed holder keeps all the optical parts in place. The optical alignment is critical to the Unruly performance and errors as small as 0.1 mm can reduce the measuring range significantly. Tracy used a resin printer with an industrial grade, black resin to make the holder.

View all 15 instructions

Enjoy this project?

Share

Discussions

iliasam wrote 01/23/2019 at 13:07 point

Thank you very much  for this project! It is very interesting.
Please, can you answer this questions:
- You write "The measuring rate is up to 1000 readings per second". What is the limiting factor?
- You write "Resolution  confirmed <1cm for nearby targets indoors". Is it true for single measurement (without averaging)?
- APD S10341 is looking hard to find. Is it possible to use AD500-8?
- You write "The TIA has a differential output impedance of 150 ohms so its bandwidth can be controlled by a capacitor (C23)"
I think that amplifier for a TOF rangefinder must have maximum possible bandwidth. So what is the reason for decreasing bandwidth by this capacitor?
- Are you going to publish the oscillograms from different points of the device?




  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates