This project is DEPRECATED, therefore might not be on par with my current coding standards and will not receive any updates now or in the future.
This is a jigsaw puzzle solving robot I designed. It is programmed in C++ using OpenCV for image recognition and LibSerial for communicating with a custom Arduino firmware. For further information take a look at the overview video overview.mp4
or the result images 6-part-result.jpeg
and 24-part-result.jpeg
.
I generally try to minimize dependencies, but I'm a one man crew and can therefore only support Debian-based Linux distributions as I'm running one myself. Anyway, you need to have the following packages installed for everything to work properly:
- FreeCAD for editing and exporting the CAD files. Install it with
sudo apt install freecad
. - A2Plus for assemblying the different components in FreeCAD. Install it via the integrated addon manager.
- freecad.gears for creating the needed gears in FreeCAD. Install it via the integrated addon manager.
- Arduino IDE as a way to compile the Arduino code. Install it with
sudo apt install arduino
. - GCC, G++, GDB and CMake for building the C++ code. Install them with
sudo apt install build-essential gdb cmake
. - OpenCV as the used computer vision library. Install it with
sudo apt install libopencv-dev
. - LibSerial as the used serial communication library. Install it with
sudo apt install libserial-dev
.
The process of solving a jigsaw puzzle automatically involves the following major steps:
- Locating the somewhat randomly positioned parts.
- Creating detailed pictures of all the parts.
- Moving the parts to known positions inside a predefined matrix.
- Locating each part in the provided overview picture of the puzzle.
- Translating the digital positions to a real world ones.
- Moving all the pieces to their final position.
jgswpzzlbt's mechanics mainly consist of a big 110x120cm chipboard, a 1m long 20x80mm aluminium extrusion and some custom 3D printed parts. For further information take a look at the assembly overview image cad/assembly.png
as well as the assembly overview CAD model cad/assembly.FCStd
. But please don't expect any parts to fit perfectly or be easy to assamble as only one prototype has been build so far.
Below is a full bill of materials with German sources for all non printable parts:
Quantity: | Item: | Source: |
---|---|---|
1 | MKS Base motherboard | Amazon |
1 | HBV-1716WA USB camera | Amazon |
1 | USB extension | Amazon |
3 | NEMA 17 1.8deg stepper motor | Amazon |
1 | NEMA 11 1.8deg stepper motor | Amazon |
1 | Power supply | Amazon |
1 | SG90 micro servo | Amazon |
2 | Endstop | Amazon |
1 | Vacuum pump | Amazon |
1 | Vacuum nozzle | Amazon |
1 | Vacuum valve | Amazon |
1 | Vacuum tubing | Amazon |
1 | Vacuum tubing connectors | Amazon |
1 | GT2 belt | Amazon |
1 | Cable ties and cable tie mounts | Amazon |
1 | Double sided tape | Amazon |
1 | Instant glue | Amazon |
1 | Cable chain | Amazon |
1 | Cables | Amazon |
1 | Pin header | Amazon |
1 | Jigsaw puzzle mat | Amazon |
1 | 110x120cm chipboard 8mm | Globus Baumarkt |
42 | 3x12mm TX10 wood screw | Globus Baumarkt |
1 | Aluminium profile 20x80 I-type slot 5 1000mm | Motedis |
8 | M5 t-nut I-type groove 5 | Motedis |
1 | GT2 motor pulley 20 teeth, 5mm bore | Motedis |
11 | 625 2RS ball bearing | Motedis |
4 | DIN 912 M2x20 screw | Schraubenkasten |
4 | DIN 934 M2x0.4 nut | Schraubenkasten |
4 | DIN 912 M2.5x8 screw | Schraubenkasten |
32 | DIN 912 M3x8 screw | Schraubenkasten |
18 | DIN 934 M3x0.5 nut | Schraubenkasten |
12 | DIN 912 M5x14 screw | Schraubenkasten |
5 | DIN 912 M5x25 screw | Schraubenkasten |
3 | DIN 912 M5x50 screw | Schraubenkasten |
16 | DIN 934 M5 nut | Schraubenkasten |
3 | DIN 7349 M5 washer | Schraubenkasten |
9 | Cable clip | 3D printer |
8 | Cable tie mount | 3D printer |
1 | C axis gear | 3D printer |
1 | C axis motor mount | 3D printer |
1 | C axis turntable | 3D printer |
8 | Puzzle mat clamp | 3D printer |
1 | Vacuum tube fitting | 3D printer |
1 | X axis bottom carriage | 3D printer |
4 | X axis camera spacer | 3D printer |
1 | X axis motor mount | 3D printer |
1 | X axis pulley | 3D printer |
1 | X axis pulley mount | 3D printer |
1 | X axis pulley spacer | 3D printer |
3 | X axis roller | 3D printer |
6 | X axis roller spacer | 3D printer |
1 | X axis top carriage | 3D printer |
2 | Y axis carriage | 3D printer |
4 | Y axis gear | 3D printer |
1 | Y axis stop | 3D printer |
12 | Y axis track | 3D printer |
1 | Z axis carriage | 3D printer |
1 | Z axis gear | 3D printer |
1 | Z axis motor mount | 3D printer |
All parts were printed on my Sovol SV01 in standard PLA with a custom super fast profile. The following settings have been used with great success:
- 0.3mm layer height
- 0.6mm line width
- 1.2mm wall thickness
- 0.9mm top/bottom tickness
- 20% line infill
- 215°C nozzle temperature
- 60°C build plate temperature
- 75mm/s print speed (37.5mm/s for the initial layer, 75mm/s for infill, 37.5mm/s for walls, 120mm for travel)
- 100% cooling from the second layer on
- Zig zag support and 5mm raft, where necessary
As this robot uses a special simplified type of jigsaw puzzles, you have to create the puzzles to solve with it yourself. You can simply use the given example puzzle by going to a photo shop (they offer a way better print quality than an average home printer), printing the file(s) reference-with-cutting-lines.png
or in case of the 24 part version reference-with-cutting-lines-NUMBER.png
in the common 15x10cm format and cutting it into pieces. But creating your own puzzle entirely isn't to difficult either. To do so you need to create a reference image of the whole jigsaw puzzle, a variant of this image with cutting lines as well as part images to help with labeling the cut parts later on. Then just print it out in your desired size and cut it into pieces. Keep in mind that the parts shouldn't get to small to work properly, 5x5cm per part is optimal.
After installing all the necessary tools and libraries mentioned above as well as building the hardware, you can flash the firmware to the MKS Base motherboard via the Arduino IDE and compile the camera calibration, manual control and main program with CMake. To do so simply create a build directory in each program's folder via mkdir build
, move to it via cd build
and run CMake via cmake ..
followed by make via make
. Then test the whole system with the manual control program via ./manual-control
. If everything works correctly, the next step is to perform the automatic camera calibration via ./camera-calibration
. Finally you can run the dang awesome thing with the main software via ./software
to solve some puzzles! Have fun ;)