3D Scanner

a point cloud generator

Overview

For my introductory electrical engineering course final project, I chose to make a 3D scanner. The scanner mapped contours of objects from the measurements of an infrared time of flight distance sensor. Data from multiple contours was then parsed and compiled to generate point clouds in MATLAB. The process of measuring contours was coordinated by an Arduino UNO.

Design

The design centered on a VL53L1X infrared time of flight (ToF) sensor. The sensor was mounted to a sliding track to fix its X-Y position while taking different contours. Objects to be scanned were placed on a platform driven by a continuous servo, which guided the object through 5 revolutions as distance measurements were taken. Each contour was written to a an SD card as a text file with the Z-position included in its name.

Slider mounted control electronics
Slider mounted control electronics
Full scanner setup
Full scanner setup
Slider mounted control electronics
Slider mounted control electronics
Full scanner setup
Full scanner setup

In order to generate contours from the distance measurements, the position of the revolution axis relative to the ToF sensor must be known. This information was gathered through supporting alignment and range finding programs. The alignment program, which was run prior to taking contours, measured the time a thin rod spent on the left and right sides of the ToF sensor when mounted to the servo platform. I adjusted the optical center of the VL53L1X’s photodiode array to equalize these times, such that it pointed to the revolution axis. The rangefinder program averaged 98 distance readings to a flat surface perpendicular to the ToF sensor’s line of sight and intersecting the revolution axis to find the distance to the axis.

An alignment plot showing sample number vs. left and right travel times in milliseconds. The travel times equalize as the optical center is adjusted.
An alignment plot showing sample number vs
An alignment plot showing sample number vs. left and right travel times in milliseconds. The travel times equalize as the optical center is adjusted.

The angular position of distance readings must also be known to generate contours. A continuous servo controlled the target objects’ angular velocity and allowed multiple revolutions while remaining within budget constraints. It did not, however, directly control the angular position as a standard servo, or stepper motor would have. Rotations were instead tracked by attaching a conductive pin to the servo platform’s underside which closed a circuit at the end of each revolution. Revolutions were marked in distance measurement files by a nonphysical “-99999999” reading.

Scanner platform supports and servo
Scanner platform supports and servo. Exposed wires for signaling revolution completion are to the right of the servo.
A snippet of a distance file
A snippet of a distance file. The first two lines show a revolution marker and its millisecond timestamp. These are followed by three pairs of millimeter distance readings and time stamps.
Scanner platform supports and servo
Scanner platform supports and servo. Exposed wires for signaling revolution completion are to the right of the servo.
A snippet of a distance file
A snippet of a distance file. The first two lines show a revolution marker and its millisecond timestamp. These are followed by three pairs of millimeter distance readings and time stamps.

Contour generation was completed by a MATLAB script which read the distance measurement files, parsing out revolution markers. The script interpolated the angular position of each distance reading within a revolution assuming constant angular velocity. After parsing all contours of an object, another script compiled them into a list of coordinates with Z-positions retrieved from the file names. The point cloud was then viewable as a 3D scatter plot.

Pictures and corresponding scatterplot views of a basket used for testing
Pictures and corresponding scatterplot views of a basket used for testing
Pictures and corresponding scatterplot views of a basket used for testing
Pictures and corresponding scatterplot views of a basket used for testing
Pictures and corresponding scatterplot views of a basket used for testing
Pictures and corresponding scatterplot views of a basket used for testing