Magnosaur!- Interactive Dinosaur Puzzle

by magnasour in Workshop > Laser Cutting

94 Views, 0 Favorites, 0 Comments

Magnosaur!- Interactive Dinosaur Puzzle

WhatsApp Image 2024-05-01 at 18.14.31_b0987f64.jpg
PXL_20240501_114336415.jpg

Magnosaur’ is a 3D interactive puzzle where users can build or solve a dinosaur silhouette with the given blocks. Once the silhouette is recognised by the system, facts about the recognised dinosaur silhouette will be displayed. Based on the studies by James et al., it has been proven that ’active exploration’ of a 3D object rather than passively observing the object during initial learning could facilitate the recognition of a given 3D object. This could assist anyone with little to no knowledge about dinosaurs in learning more and actually remembering the information displayed by the ’Magnosaur’.


Link to our GitHub page

Supplies

  • 9mm thick plywood sheets
  • Laser cutter
  • 60x 10mm diameter Neodymium Magnets
  • Hot Glue
  • 10x Raspberry Pico W
  • a lot of Red and Black wires
  • Copper sheets
  • Projector
  • Tripod Stand
  • 120cmx60cm plywood
  • L-square angle ruler

Laser Cutting Plywood

IMG-20240325-WA0000.jpg
IMG-20240325-WA0002.jpg
IMG-20240314-WA0005.jpg

From our GitHub link, go to: ID24-TeamA>DinoFullBody_Final


There is a list of *.dxf files in the folder.


Open the following *.dxf files in Coreldraw or similar software that is used for your laser cutting machine. In our case we are using the Trotec laser cutter.


Cut:

  • 1x Main_Body.dxf
  • 1x Main_Head.dxf
  • 2x Main_spike.dxf
  • 2x Main_Neck.dxf
  • 4x Main_Limbs.dxf


Assemble each laser-cut box

Magnets

F7OF3N0LVP9AGOU.png
PXL_20240502_125621882.jpg

On each piece plywood that has been cut that has two diagonal holes, we need to add two magnets of different polarities.

For each piece with diagonal circular holes:

  1. First, take two circular magnets and test its polarity. If it sticks together, the faces of the magnets that are attracted together will be facing up. It does not matter which of the two diagonal holes you put the two magnets in as long as the face that is facing up has different polarities.
  2. Now, take a hot glue gun and fill the holes until there is about 2mm of space between the surface of the glue and the surface of the wood.
  3. Wait for 20 seconds and put the magnets with tested polarity into the holes.


Make sure to do this piece by piece as the hot glue gun dries up quickly and the magnets won't hold

Wiring the Head

Head wiring.png

Follow the simplified diagram to wire the Pico W's.


  • The VCC (Pin39) and the Ground(Triangle symbol) (Pin38) is the power supply which is 2x 1.5V AA Batteries
  • Solder a pair of black and red wires to the pins shown in the image above


Make sure to have a decent length of the pairs of wires, at least the length of a Magnosaur block piece. When preparing the terminals later we could cut off excess wires.

Wiring the Neck, Tail and Legs

Leg wiring.png

Follow the simplified diagram to wire the Pico W's.


  • The VCC (Pin39) and the Ground(Triangle symbol) (Pin38) is the power supply which is 2x 1.5V AA Batteries
  • Solder two pairs of black and red wires to the pins shown in the image above


Make sure to have a decent length of the pairs of wires, at least the length of a Magnosaur block piece. When preparing the terminals later we could cut off excess wires.

Wiring the Body

Body wiring.png

Follow the simplified diagram to wire the Pico W's.


  • The VCC (Pin39) and the Ground(Triangle symbol) (Pin38) is the power supply which is 2x 1.5V AA Batteries
  • Solder nine pairs of black and red wires to the pins shown in the image above


Make sure to have a decent length of the pairs of wires, at least the length of a Magnosaur block piece. When preparing the terminals later we could cut off excess wires.

Terminals

Blueprint_port.PNG
PXL_20240502_125621882.jpg
PXL_20240502_125454708.jpg
PXL_20240502_125530500.jpg

The '+' holes are meant to assist in making the terminals.

  1. At each edge of the '+' hole, wrap a thin copper tape from the surface of a piece to the back of the piece. The surface and the back of a piece should look like the second image.
  2. Now, choose three out of 4 terminals as the ground.
  3. Bridge the 3 ground terminals using the copper tape in a 'U' shape as shown in the 3rd image.
  4. Now take one of the pairs of red and black wires soldered on the Pico and route it through the '+' port.
  5. Copper tape the metal bit of the red wire on the terminal where the back is not bridged and the black wire opposite the red wire as shown in the 4th image

Repeat for all available ports.

Preparing the Pico Ws

PXL_20240423_124642868.jpg

For all Pico Ws, do:

  • Download and install Thonny on your PC.
  • Open Thonny and connect your Pico W using a Micro USB cable to your PC.
  • In Thonny, ensure the correct Python interpreter is selected. Go to "Run" -> "Select Interpreter" and choose "MicroPython (Raspberry Pi Pico W)" if not already selected.
  • You can now write Python code in the Thonny editor and execute it on your Pico W by clicking the "Run" button or pressing F5.

Uploading the Software on the Pico W's

For each Pico W, go to 'ID24-TeamA>software>client_leg.py' :

  • Update code:
  • In the 'client_leg.py' file, Label each pico in the 'pico_name' field with its corresponding parts, in the format of the first letter of the body part, underscore, a unique number for that part i.e.:
  • Body -> 'b_1'
  • Head -> 'h_1'
  • Legs 1, 2, 3, 4 -> 'l_1', 'l_2', 'l_3', 'l_4'
  • Tail -> 't_1'
  • Neck -> 'n_1'
  • To update Pin numbers, machine.PIN function needs to be copied so that there are as many of them as there are connections on the box and pico. Ensure that each variable has a unique name.
  • For each machine.PIN, also ensure there is a corresponding 'last_state' in the global variables, and 'button_state' in the while loop.
  • Each machine.PIN function should have its first argument be the number of the GPIO pin that the specific connection is attached to
  • Then the if-else statement that checks whether the button state is 0 or 1 needs to be copied for each machine.PIN function
  • The correct face for the corresponding pin needs to be sent in each if statement in the convention “top.1” for the first top, or “bottom.3” for the third bottom
  • The specific locations for each connection ID can be checked against the main code running on the server, at the top of the code are each face and the connections in order
  • In the 'client_leg.py', Update 'ap_ip_address = connect_to_internet('Angusosaur', '123456789')' to your WiFi name and password.
  • In the 'client_leg.py' file, update the 'SERVER_ADDRESS' field with the IP address of the server. If running the server on a Windows PC, go to the terminal and type 'ipconfig', and it will show you the IP address of your devices. Find the correct one and copy it into the 'SERVER_ADDRESS' field. (If you are using the built in 'Mobile Hotspot' for Windows computers, the default IP Address is: 192.168.137.1)
  • Flash the Pico Ws:
  • Ensure the Pico has no batteries in the battery holder.
  • Plug in the Pico with a Micro USB cable to your PC/Laptop.
  • Save the code with updated parameters and rename the file to 'main.py'. This is necessary for the code to run without it being plugged in. Upload it to the Pico W by clicking 'Run' or pressing F5
  • Unplug the Micro USB cable and put in 2x AA batteries in the battery holder.
  • LED lights on the Pico W will blink indicating it is trying to connect to the specified WiFi, wait until the LED stops blinking indicating it is connected to WiFi.
  • Seal the box/component and the block is ready to be used.

Working Surface

PXL_20240501_123253459.jpg

For calibration purposes, we must make a physical projection surface.

  • We need to draw 5cmx5cm voxel grids on the 120cmx60cm plywood
  • Use an L-Square angle ruler to draw the grids to make sure the gridlines are as straight as possible
  • Place the plywood on a table with the edges of the plywood aligning with the edges of the table

Projection

projector setup.png

The principle used in the projection involves treating the projector like a point light in a computer graphic context.

We can then compute a shadow map from the perspective of the projector. This involves determining the regions of the table (we will assume this to be an infinite planar surface) that are occluded by the geometry. If we ensure that the projector's image aligns with the table during setup, where the calibration is done in Step 10, we can create a mapping from world space coordinates on the plane to pixel coordinates in the projector.

In other words, if we define the top left corner of the table to be at the origin of the system (0, 0, 0) and the bottom right to be at (table width, 0, table depth) it follows that the projector's image will map from (0, 0) at the top left to (projector resolution width, projector resolution height) at the bottom right of the table.


Once we have computed the "shadows" cast by the geometry, we will have a polygon in the world space of the form (x, 0, z), allowing us to linearly map from world space to screen space.

Setting Up & Calibrating the Projector

PXL_20240501_100401057.jpg
PXL_20240501_101404385.TS-Trim-ezgif.com-video-to-gif-converter.gif
Screenshot 2024-05-04 140658.png

Go to 'ID24-TeamA>software>projection.py'

Setting Up:

  • Set up the rig as shown in the first picture. Then, mount the projector at the centre of the rig.
  • The height of the projector should be about 20 voxels tall (100cm from the surface of the table).
  • Projectors usually have a calibrating feature, using the projector's corner correction to align the image with the voxel grid on the working surface. (GIF shows an example of aligning the projector to the working surface)

Update the Projection Software:

  • Take all measurements mentioned in the parameter definition section of the 'projection.py' file
  • Update the parameters
  • Now, the projection be calibrated.

Running

  • Connect your PC to the projector.
  • Go to 'ID24-TeamA>software>magnosaur.py'
  • Update the IP address in the 'SERVER_ADDRESS' field with the similar IP address setup on the Pico Ws
  • Save magnosaur.py
  • Run magnasour.py
  • The server and projection software should run simultaneously
  • Magnosaaur is good to go!