3D scanner with two cameras. DIY D Scanner

Once again the store offered to take something for review. Since I have long been interested in the question of using this thing for the needs of decorative 3D printing, I chose a scanner.

So, the scanner itself was developed by the Spanish company BQ, which has now stopped supporting it (allegedly due to Chinese counterfeits, but it is doubtful. Now this scanner is also sold by the American CowTech. Sources for 3D printing of scanner parts are freely available on (there links to software and electronics).

In the kit we have this “loose”:

The assembly is straightforward, but there are a few points:
1. There is no need to rush to tighten all the nuts - you will also have to adjust the geometric dimensions - the convergence of the lasers in the center of the site, the distance to the turntable.
2. In my stand, the camera “wobbled” a little, by a fraction of a millimeter - but this was enough to skew the picture. Eliminated by adding foam material.
4. The turntable was transparent and did not have a coating (as in the original) - I painted it with plastidip.
5. Check the calibration checkerboard patterns. I don’t know how they printed the one from my set, but the proportions of the squares were off. I took it from the Internet and reprinted it myself.
6. Camera focus is not adjusted to the distance to the platform. I took off the cover and adjusted the focus in place.











As you can see, the “brains” of the scanner is a regular Arduino Uno combined with a ZUM Scan shield and an A4988 stepper motor driver. The farm is managed by native Horus software from BQ.

After assembly, the scanner went through calibration procedures in native Horus software.

Since by this time I already knew that the quality of scanning very much depends on the quality of lighting (stability, diffuseness, color temperature), I took care in advance of having a small lightbox in order to at least provide more or less comparable conditions for testing.

Having selected “candidates” for auditions, I got ready.

The requirements for the object are as follows:
1. The object must be larger than 5x5 cm, but less than 20x20cm
2. The object must be opaque and motionless
3. The object must weigh no more than 3 kg

Difficult to scan:
1. Shiny, luminous objects
2. Objects are too dark
3. Objects with blurred surfaces (such as stuffed animals)

The result of the scan is a cloud of points in PLY format (which then needs to be converted into a surface). This is where you prepare the STL file.

After reading the scans, I decided to try it with a simple cylindrical object.
After several attempts, I became convinced that I had a common problem - the point clouds from the right and left lasers did not match, and there was an issue with the proportions.



We couldn’t find anything useful on this matter other than trying to calibrate the webcam settings (they are not calibrated when the calibration wizard is running) (a guy named Jesus from BQ support has not answered questions for a long time). To do this, you need to take several pictures with different positions of the calibration table. I did. The situation has improved, but not completely.
I had to manually edit the calibration file (calibration.json in the Horus-a folder) and by trial and error, scanning a cylindrical object, to ensure that the clouds matched.
And everything seems to be ok:



But no - on complex objects, cloud fragments sometimes still do not match, and many “blind” zones are formed:





In addition, it is obvious that scanning bright red objects will be impossible, at least with standard lasers.

You can, of course, continue to experiment with scanning with separate lasers and attempts to combine all this in third-party software, and then try to bring it into a form viable for STL.

All this reminds me of one joke about ships in bottles.

How do you make boats in bottles?
-I put sand, silicate glue, sticks into the bottle and shake it.
It turns out all sorts of shit, and sometimes - boats.


In general, I realized that I am not an adherent of this kind of creativity, and I have a suspicion that it is easier to model objects from scratch that are within the power of a scanner.

And complex ones - the scanner cannot cope with complex ones in normal mode; two lasers are not enough for it - blind spots remain. To eliminate this problem, you need to scan in other positions and then again struggle with combining the clouds. No thanks.

As a result, the thing is only suitable for studying the basics of laser scanning, for anything more it is absolutely useless. No, of course, it’s possible to get something similar in outline to the original model, but that’s all (and this is taking into account all the tambourines with cloud processing). It’s not for nothing that the Spaniards abandoned this matter.
The store played it safe - the description honestly states that the result depends on the position of the planets and the mood of Aunt Sonya from the third floor. Open source and all that, let's dance together. No thanks.

The conclusion is not to take it, but if you want extreme hunting, assemble it yourself from the same thing that the friend in the joke makes boats from.

The product was provided for writing a review by the store. The review was published in accordance with clause 18 of the Site Rules.

I'm planning to buy +9 Add to favorites I liked the review +101 +156

FabScan is an open source, do-it-yourself laser 3D scanner. I assembled mine from MDF sheets and various available materials and, as an example, I decided to lay out the creation process for you.

Step 1: What you'll need




For the official FabScan scanner you need:

  • Arduino UNO
  • Stepper motor A4988
  • FabScan-Shield 3D laser scanner module for Arduino
  • 5mW red laser module
  • Power supply 12V - 1A
  • Logitech C270 webcam

To create a box you will need 4 sheets of MDF measuring 600*300*5 mm.

In my project I used:

  • Arduino UNO
  • Bipolar Stepper Motor - NEMA 17 (200 steps)
  • Stepper motor A4988
  • 5mW red laser module
  • Power supply 12V - 2A
  • Logitech C270 webcam

Since we will be using FabScan software, I recommend sticking to their parts list; you can easily find all the documentation for the FabScan reference 3D scanner on the Internet.

Step 2: Assembling the gallery box for the 3D scanner




Show 4 more images





I used a Dremel and my imagination to assemble the scanner box. This is not so simple, because in order to obtain the correct 3D image, the camera, laser and stepper motor must be in the correct positions. If you don’t want to bother, you can just buy ready-made parts, but it won’t be cheap.

Step 3: Connecting the Modules


Assembling the hardware is quite simple:
Connect the FabScan module to the Arduino, and set the A4988 motor to its first step position. Connect the motor to the output pins and the laser module to the analog pin A4. Finally, connect the power supply and USB cable.

If you decide to assemble the scanner according to my parts list:
Then you need to connect the A4988 motor to pins 10, 11, 9, 8 on the Arduino (if desired, the pins can be changed), and connect the laser module to pin A4. At the end, also connect the power supply and USB cable.

Step 4: Code for Arduino

We will use the official code from FabScan. Upload it to the Arduino and you're done.

If you have the Codebender plugin installed, you can upload the code to Arduino by following this link.

If you are assembling the scanner according to my parts list, then click the Edit button and do the following:

  • Add lines #include const int stepsPerRevolution = 200;//change to the number of steps of your engine Stepper myStepper(stepsPerRevolution, 10, 11,8,9);
  • Replace the step() function with the following: void step() ( myStepper.setSpeed(1); myStepper.step(1); )

Step 5: Computer Software






We will use the "FabScan Ubuntu Live DVD" image. You can download it. In this image, FabScan software is already pre-installed. The image can be written to a flash drive; how to do this can be found on the Internet.

Important note: If you chose the “Try Ubuntu” option, then save your files before turning off your computer!

Look at the attached photos and follow the steps:

  • Select the port in SerialPort
  • Select the camera in Camera
  • File - Control Panel
  • Click on detect laser (don't put anything in the scanner at this stage) and select 'enable'
  • Click on "Fetch Frame" and make sure the blue horizontal line touches the top of the turntable and the yellow horizontal line touches the bottom. The vertical yellow line should go through the center of the turntable. A loose camera can cause distorted scans!

After setting, close the control panel window, place the object in the scanner, and click on the start scan button.

Saving 3D image:
When the scanning process is completed, you can save the 3D object to a file in .pcd or .ply formats. You can also save it in stl format, but it is not supported on all platforms. You can also open a previously scanned item by selecting File - OpenPointCloud.

What to do with 3D files?
You can open them in MeshLab and print them on a 3D printer.
To print objects in MeshLab:

  • Save the object in .ply format
  • Open the file in MeshLab
  • In MeshLab, calculate normals (Filters/Point Set/Compute normals for point sets)
  • Reconstruct the surface using poisson reconstruction (Filters/Point Set/Surface Reconstruction: Poisson)
  • Ready

FabScan is an open-source, DIY 3D laser scanner.

The project began during the development of Francis Engelmann's bachelor's project. The official project page is located.

Based on this project, an analogue was developed, which is discussed in the article. MDF is used for boxing. The electronic filling is also somewhat different.

The Arduino program is taken from the original project. So thanks to the FabScan team for an excellent open-source 3D scanner!

So let's get started.

Required Components

Parts and components for the original FabScan project:

  • A4988 stepper motor driver;
  • Shield FabScan;
  • NEMA 17 bipolar stepper motor (200 steps);
  • Power supply 12 V - 1 A;
  • Logitech C270 webcam.

For the body you need 4 sheets of MDF. Dimensions - 600 mm by 300 mm. Thickness - 5 mm. More detailed information.

Parts and assemblies used in this manual:

  • (200 steps);
  • Stepper motor driver L298N;
  • 5 mW laser module - manufacturer Red Line;
  • Power supply 12 V - 2 A;
  • Logiteck C270 webcam.

That is, we simply will not use the FabScan shield and use a different stepper motor driver module

Development of a housing for a 3D scanner

The process and result of developing the body of our 3D scanner are shown in the photographs. The main difficulty is the most accurate installation of the camera, laser module and stepper motor. If you want to make your life easier, you can order these parts for 35 euros.

3D scanner assembly







1. With shield.

Install FabScan shield on Arduino. The A4988 stepper motor driver is installed on the provided rails. The stepper motor is connected to the corresponding contacts on the nameplate. The laser module is connected to analog pin A4. After this, you can connect the power and USB cable. More detailed instructions are available.

2. Without shield.

If you decide to build the scanner without using a shield, connect the L298 stepper motor driver to pins 10, 11, 9, 8 on the Arduino (in principle, these pins can be changed with appropriate edits in the sketch). The laser module is connected to pin A4 on the Arduino. All. You can connect power and USB cable.


Sketch for Arduino

Important note! If you use the "Try Ubuntu" option, make sure you save your files before turning off your personal computer!

Follow the instructions, photos of which are given below:

  • Select SerialPort;
  • Select Camera;
  • File - Control Panel;
  • Click detect laser (don't place any objects in front of the scanner for now) and select "enable";
  • Click "Fetch Frame" and make sure the blue horizontal line touches the top of the turntable and the yellow horizontal line touches the bottom of the turntable. In addition, the yellow vertical line must coincide with the center of the turntable. If the camera is not installed correctly, the scanning result will not be clear!

After setting, close the window, place the object in the 3D scanner and click the Start Scan button.

Note: additional materials on setting up the configuration.xml File are presented in this guide.

Saving 3D images

When the 3D scanning process is completed, you can save the scanned 3D object with a .pcd or .ply extension. You can also save it as a 3D stl file, but this feature is not available on all platforms. You can open a previously scanned and saved object by selecting File - OpenPointCloud.

What's next?

You can use MeshLab to process a 3D scanned object and print it on a 3D printer!

When processing a file in MeshLab:

1. Make sure you save the object as a .ply file.

2. Open the file using MeshLab.

3. In MeshLab, calculate the normals (Filters/Point Set/Compute normals).

4. After that, rebuild the surface using Poisson reconstruction (Filters/Point Set/Surface Reconstruction: Poisson)

The final assembled structure is shown in the photo below.


Video of the original FabScan 3-D scanner in operation:

Many thanks to the FabScan team for the amazing open-source scanner on Arduino!!!

Leave your comments, questions and share personal experience below. New ideas and projects are often born in discussions!

It is an analogue of the famous FabScan laser scanner, which was developed by Francis Engelmann. The author used MDF as a box for such a scanner; as for the filling, it is also slightly different from the original.

The original program is for Arduino, it was taken from the original project.

Materials and tools for creating a scanner:

4 sheets of MDV 600X300 mm, thickness 5 mm (they are needed to create the case);
- stepper motor (NEMA 17 for 200 steps);
- driver for stepper motor L298N;
- 5 mW laser module (used from the manufacturer Red Line);
- to power the device you need a source of 12 V - 2 A;
- webcam model Logiteck C270.






The original homemade product uses an A4988 stepper motor driver, and as for the stepper motor, it is also NEMA 17. Otherwise, the elements of the homemade product are exactly the same as in the original version.

Scanner manufacturing process:

Step one. Making the body
The entire process of creating a housing for the scanner can be seen in the photo. The most important thing in this matter is accuracy. The laser module, stepper motor and webcam must be located clearly in the right places, in accordance with the project.













Step two. We connect electrical equipment


There are two ways to connect equipment, with and without a shield. Let's take a closer look at each of these options.

Connection without shield
If you decide to assemble the device without using a shield, then the leads of the L298 stepper motor are connected to the Arduino pins numbered 10, 11, 9, 8. In principle, you can use other contacts, but you will need to make changes to the sketch.
As for the laser module, it needs to be connected to pin A4 on the Arduino controller. After this, you can connect the USB cable and power.

Connection with shield
You need to install the FabScan shield on Arduino. As for the stepper motor driver, it needs to be installed on the rails that are provided for this. The stepper motor contacts are connected to the corresponding contacts on the nameplate.
The laser module must be connected to pin A4 on the Arduino. That's all, after that connect the power and USB cable.

Step three. Installing the sketch
Now you need to download and install the official sketch for FabScan. To flash the Arduino, you need to download the Codebender plugin and then click the "Run on Arduino" button. In this case, the sketch can be installed directly through the browser from the official website.


If the shield was not used, then you need to click the Edit button and then add the following lines:

const int stepsPerRevolution = 200; // change this parameter to adjust the number of steps per rotation of your stepper motor shaft

Stepper myStepper(stepsPerRevolution, 10, 11,8,9);
Replace the step() function:

myStepper.setSpeed(1);

myStepper.step(1);

Step four. Scanner software
To install the program you need to download the “FabScan Ubuntu Live DVD” image, after installation it will appear software FabScan.

You need to make some settings in the program:

First you need to select SerialPort;
- then select Camera;
- after that File - Control Panel;
- then click detect laser and select “enable” (there is no need to place any objects in front of the laser);
- well, now click “Fetch Frame”, while the blue horizontal line should touch the bottom of the rotating table. The yellow line should be in the center of the table. If the camera is not installed correctly, the image will be Bad quality.












That's all, the program is configured. Now you can put some object into the scanner, and after that press the Start Scan button.

Step five. Save the image
After scanning the object is completed, the image can be saved in .pcd or .ply format. You can also save it in stl format, but this depends on the platform you are using.
To open an object that was previously saved, you need to select File - OpenPointCloud.

) we decided to try our hand at assembling it and, if possible, improve its design. We couldn’t even imagine what would come of it, much less imagine that we would win several scientific and engineering exhibitions with it. But in order. Who is interested in knowing the result, welcome to the cat (lots of photos).

First prototype

First we decided to collect laser rangefinder. It was made based on an article on an amateur radio forum. Just a laser pointer and a camera. A program was written in Java to process images. For one measurement, two photographs were taken: with and without laser. After comparing them, we could definitely find the laser point. Once this was working, the rangefinder was mounted on a platform that could rotate in two planes. Before I show you what I got, I need to warn you - there isn't a lot of materials at the summer school, so we put together a prototype from what we had:

The camera is immediately visible, and the laser is that brass cylinder above it. To rotate the platform, we used two stepper motors, which in turn were connected to a control board on an Atmega32 microcontroller. The laser was connected to it. The board itself was connected to the computer via a USB->UART adapter. The program on the computer took pictures, processed them, entered the coordinates of the obtained points into a file and sent commands to the control board.

The result was interesting. Yes, we found the distance. Yes, we could “target” any point in the hemisphere above the scanner. And our joy knew no bounds. But when we assessed the scanning time for this hemisphere, it turned out to be 48 hours. And it's not about the camera. And not even in Java. The problem was that the installation was so flimsy that it wobbled after each turn for five seconds. I had to take a measurement, turn around and wait five seconds until it stopped swaying. And in addition, the library for the camera turned it on and then off before each shot. This took 1-2 seconds. But summer school was ending, and there was no time to redo it: it was already the night before the project was due. Or rather morning. The next day we presented our project at a competition in front of a scientific jury and unexpectedly won. It was probably because of this victory that we decided to continue our work on this project.

Version two

In fact, summer is over and the school year has begun. The desire to work disappeared. The installation was planned to be completed by the next competition, which was a whole month away. Month. And then suddenly three days. But within a month we decided to change the setting. Assemble it tightly, install a lens on the laser pointer, which will create a laser line. This would allow scanning 720 points at once (the scanner had an HD camera). Only three days have made their own adjustments:

The second scanner is assembled from plastic rulers, glue, masking tape and is held in place only by blue electrical tape. Instead of a lens there is a test tube. A green laser shines on this test tube. The reflected beam creates a more or less uniform laser stripe on the screen. The rangefinder is attached to only one motor, which rotates it in a horizontal plane. The control board was replaced with STM32VLDiscovery. It’s just that I know STM32 better, and besides, Atmega burned out, and the programmer was lost a long time ago. It doesn't look very good, but it works! The vibrations decreased and the speed increased accordingly. But not much. A very interesting catch was discovered here - the Chinese laser pointer did not turn on immediately, but gradually increased its power over the course of a second. Thus, a second to oscillate, a second to warm up the laser, a second to take a picture, and there are two of them. So we get 4 seconds. But in one measurement we find distances of up to 720 points! The scanning process looked something like this:

And the result is like this:

The picture doesn't look very interesting, but the mug was voluminous in the program. You could look at it from different angles.

What is the actual competition? But nothing! We finished scanning everything at 4 am, and at 9 am at the stand we discovered that the laser had burned out. As it turned out, while we were carrying it from the hotel to the stand, rain got into it, and when turned on, it burned out. And when it’s not working, it looks so bad that it’s hard to believe the words “it worked 5 hours ago.” We were upset. The desire to continue disappeared with the smoke from the laser. But still it was collected...

Third version

And it was assembled again for the competition. Moreover, we prepared for it long and thoroughly. More than a week. And here is the result:

The first thing that catches your eye is that now we are scanning not the area around the scanner, but an object that is rotating on the platform. We also got the required lens, assembled everything correctly, rewrote the program, and also replaced the debug board with a homemade one. And now we only take one photo per measurement. The laser is powerful enough and the lens is good enough to uniquely locate the laser in a photograph. Thanks to this, we do not wait for the laser to warm up - it is always on. And now we turn on the camera only once. That is, time is spent mostly on rotating the platform and processing the image. A menu for selecting accuracy has been added to the program. Scanning time is from two to ten minutes. Depending on the selected accuracy. With maximum accuracy, it turns out that the platform rotates 0.5 degrees per step, and the distance is determined with an accuracy of 0.33 mm. The platform is driven by a stepper motor through a gearbox. The platform itself is a large disk, and the rubber roller on the motor shaft is small. The motor and laser were controlled by an STM32F050F4 microcontroller via field effect transistors. At the very beginning of the article is a scan of the toy obtained using this scanner. Since the scanner produces a point cloud in .obj format, after triangulation we can print the scanned object on a 3D printer, as can be seen in the same photograph. On the screen we can see the model after triangulation. No manual work was done on the model.

We won the competition. And he gave entry to the international competition Intel ISEF. So we started working on the next scanner.

Fourth version

On this moment This latest version scanner that we assembled. For comparison, there is a second version on the platform. We tried to approach the development of the fourth scanner as thoroughly as we could. The installation was drawn in CAD, the parts were laser cut, everything was painted, nothing unnecessary stuck out from the outside. Changes: The platform is now actually a gear. It is cut out of plexiglass and has 652 teeth along the edges. This solves a problem that severely damaged scans in the previous scanner: the rubber roller would slip a little, which is why the platform often did not rotate 360 ​​degrees. The scans were either “cut out” or overlapped. Here we always knew exactly how rotated the platform was. The laser power was made adjustable by software. Thanks to this, it was possible to change the laser power on the fly, avoiding illumination of unnecessary parts in low-light conditions. To control all electronics, we decided not to separate new board, but simply use the debug F401RE-Nucleo. It has ST-LinkV2.1 installed, which works as a debugger and USB->UART adapter.

The accuracy was amazing: Angular resolution 0.14 degrees. At a distance of 0.125 mm. The scanning area is a cylinder with a height of 20 cm and a diameter of 30 cm. The price of all parts and laser cutting at the time of its creation (May 2014) was less than 4,000 rubles.

During use, we only set it to maximum accuracy once. The scan lasted 15-20 minutes. We received almost 2 million points. The laptop refused to calculate the model from the point cloud. The experiment was not repeated.

Conclusion

In the near future we plan to resume work on the project, and therefore we will finalize both the program and the installation. I hope we'll write about it soon step by step assembly, we will post drawings, programs and everything else. This will no longer fit into this article.

Thanks to everyone who read to the end!

UPD:
A colleague found a video about the operation of the scanner that we filmed at ISEF:

Yes, most of the video is not interesting, but at the end there is a model on a laptop.

And here are examples of scanned objects. But they all belong to the third version of the scanner.
Dropbox
In the model.obj file you can clearly see what happens when this rubber roller slips on the motor - the dog has three eyes. The scan was stopped, causing a cutout. All files are point clouds. You can open it using MeshLab. The models were not processed by hand. Completely raw data. From above you can see “white spots” - areas without dots. The camera doesn't see them. White spots can also be seen in other places. They appear either in areas that are too dark or when surfaces overlap. For example, in the stn_10.obj file, the goat's horns overlap each other, which is why the inner surface of the horns was not scanned.




Top