Automatic Pet Tag Engraver

by wildanvin in Workshop > CNC

2377 Views, 28 Favorites, 0 Comments

Automatic Pet Tag Engraver

IMG_20220626_082124~2.jpg

I made an Automatic Pet Tag Engraver using a Raspberry Pi, a mini CNC machine and Open Source Software. You only need to enter the name of the pet and then press "Engrave".

Supplies

tags.jpg
optional2.png
jumpers.jpg
endStops.jpg
  • Jump wires
  • 3 End stop switches
  • Double sided tape
  • Raspberry Pi model 3
  • A monitor with HDMI input
  • Mini CNC machine (Aliexpress link)
  • Tungsten bit (optional) (Amazon link). You can use the bits that come with the mini CNC to get started but since it is going to engrave in aluminium they won't last too long. At the time of writing this is the only tungsten bit that I found on Amazon
  • ER11 6mm (optional) (Amazon link). Since the shaft diameter of the tungsten bit is 6mm we have to use this ER11.
  • Aluminium Pet tags (Alibaba link). It is important that you use the tags from the supplier in the link. The bed (where the tags are placed) is specially designed for this models. Of course you can design the bed with any shape you want but that is out of the scope of this instructable. If you need help making a bed that fits your tags feel free to reach out on twitter. Meanwhile, you can print in a sheet of paper this file and see if your tags will fit

Tools:

  • Soldering Iron
  • Multi meter

Making the Bed

bed1.jpg
bed2.jpg
bedSVG.png

You will need access to a laser cutter to make the bed. Grab the SVG file in this link, right click on it, save it and laser cut it. You will have to sand paper the holes a little bit, make sure that the tags fit tight.

You can print the SVG file with a normal printer in a sheet of paper to see if your tag will fit. If you are using other tags with different shape you will have to modify the file with Inkscape or make one from scratch.


Assembly of the Mini CNC

cncStart.jpg
cncBackLabeled.png
cncFrontLabeled.png
motor.jpg
controller.jpg
Testing movement in mini CNC

Normally, when you buy the machine from Aliexpress, it comes with the instruction on how to assemble it. They are very well guided, it should take you about 3 hours to complete it. In case they don’t provide the instructions here is a link with them.

I will be using the ER11 of 6 mm and the tungsten bit. You can use the bits included in the package as well but they won’t last long engraving the aluminum tags. I know that the bit I am using is a little big and maybe it is not designed to engrave; but so far it has been working pretty good.

Be careful to wire the motors to the board according to the axis they will be controlling

Now, that everything is wired, we can connect the DC power supply and move the spindle with the mini controller they provide.

Adding the End Stops

solderedSwitches.jpg
switchXYAxisCircles.png
switchZAxis.jpg
boardBefore.jpg
boardAfter.jpg

We are going to install 3 end stops switches in the machine, one for each axis. These switches will be connected to the CNC board and when they are hit, the CNC will know that it has reached its limits. By installing these end stop switches we will be able to "home" the machine and return to the same spot (home) every time we want.

So let's start with the soldering. We have to solder the jumpers in the Normally Open terminal (in the end stop switch, it is represented as “NO”) and the Common terminal (represented as “COM”) of the switch. If for some reason your switch doesn’t have these descriptions (which is very uncommon) you can use your multi meter and test for continuity; when you close the switch and the multi meter beeps, that would be Normally Open (“NO”) and Common (“COM”) terminal.


There is a picture of the 3 end stop switches soldered. There are 2 large ones (for the z and x axis) and one small (for the y axis). Notice that at the end, we are using the female terminal, this is because it will be easier to connect to the board.


Now we have to install the switches in the CNC. For the X axis, the spindle will have to hit the end stop; in the Y axis the bed will have to hit it. In the Z axis I am going use a 3D printed piece in order to hit the switch. I am just going to use double sided tape, feel free to use other methods if you like, just make sure the end stops are hit, otherwise the motors will keep moving indefinitely and will take damage


Now we have to wire the switches to the board. In my board, there are 2 pairs of pins labeled Xen, 2 pairs for Yen and 2 for Zen (Xen for the X axis, Yen for the Y axis and Zen for the Z axis). In theory, you can put 2 end stops switches per axis that is why there are 2 pairs of pins per axis. We are going to wire just one switch per axis.

Note: In some newer boards I have found that the manufacturer has swapped the labels for the Xen and Zen pins. Take this into account for the next step.

Also, you can check out this awesome blog post from Shahada Abubakar about installing end stops to a CNC machine. He uses 3D printed parts and 6 end stops.

Configuring the End Stops in the Board

ugsDownload.png
ugsExecutable.png
ugsWelcome.png
ugsReset.png
ugsSettingChange.png
ugsSettings.png
ugsTable.png
Homing cycle in mini CNC with UGS


Now that we installed the end stops we need to tell the CNC machine to start "listening" when the switches are pressed. We are going to do that using a software called Universal Gcode Sender (UGS). We are going to install that software in the Raspberry Pi and configure the board from there. You should have the Raspberry Pi with its operating system (Raspberry Pi OS) and an HDMI monitor.

  1. Download UGS. We are going to use the version 2.0.11 for the Raspberry Pi.
  2. Decompress the file and navigate to the bin folder. You should see 3 files now, double click the one that says ugsplatform and click Execute in the dialog that appears, the program should start now.
  3. In UGS select GRBL as the firmware, choose the right port and press connect.
  4. If it shows an alarm alert you can press the Unlock and Soft Reset buttons (that will be useful when you are testing the end stops)
  5. Test that you can move the spindle with the Jog Controller that UGS provides

Now that we can move the spindle with UGS, we can change the settings of the board. Here is the link for the settings that I will be using; you will need to change your board to those settings.

At the bottom of the screen there is an input field to enter commands. If you enter $$ you will see all the settings of the board. Before changing these settings take a picture of them in case something goes wrong.

To change a setting, you enter: $setting-number = new-value. For example, to change the maximum spindle speed to 12000 RPM, you enter: $30 = 12000. The $$ command gives you a good description of what each setting controls.

To enable Homing, set $22 = 1 (Homing cycle, enabled). Now when you send the $H command, or press the “Homing” button, the CNC should raise the bit, and seek to the home position. If you find it is seeking in the wrong direction, you can tell it to invert an axis for homing, by setting the value of $23 according to the table attached.

If moving the spindle bit using the Jog Controller moves it in the “wrong” direction that you expect, you most likely have to invert that particular axis. This can be done using the $3 variable, using the table attached.

Please, if you have any problems check out the blog post from Shahada Abubakar as he goes into more detail in the configuration.

If everything is correct your machine should home like in the video attached.

Note: As I mentioned in the last step, in some boards the Xen and Zen pins are mislabeled, they are switched. If during the homing cycle, the Z motor doesn't stop after it has activated its end stop, try activating the switch in the X axis, if the Z motor stops you know there is an issue with the labels in the board. The solution is simple, you only need to interchange the wiring between the X and Z end stop switches.

Calibration

github-tessie.png
home-and-zero.png
calibrateSetting.png
Calibrate Automatic Pet Tag Engraver

Now we are going to download Tessie, it will provide the user interface to select the tag, generate the gcode and send it to the CNC through UGS. Decompress the file and go to the settings folder, there should be a settings.json file. You need to change startX, startY and startZ for each tag.

"tag1": {
	    "startX": -153,
	    "startY": 54,
	    "startZ": -4.09,
	    "width": 31,
	    "realWidth": 31,
	    "height": 17
	  }


The first 3 settings determine where the spindle will start engraving relative to the home position (the home position is 0,0,0), So, before looking for these values you have to home the machine and set to zero.

For some tags, it is not possible to position the spindle in the bottom-left corner of the "Printable area"; for that reason the "width" is less that the "realWidth" in some tags. "height" is the height of the printable area. Please refer to the image that I attached in this step as reference.

To find startX and startY place an aluminium tag in the bed and using the Jog Controller move the spindle to the position marked with an "X" in the image attached. Update your settings.json file (startX and startY) with the values that you get in UGS when you reach that position.

To find the startZ value move your spindle to the center of the "Printable area" and start moving the spindle down until a sheet of paper can barely move between the tag and the spindle. You can adjust the step to 0.01 mm to reach a very precise value. Now, update your settings.json file with the value of startZ.

You have to find these 3 values for each tag. The width, realWidth and height should only be changed if you are using other tags.


Engrave

Automatic Pet Tag Engraver - Final configuration and testing

Before engraving we need to install node.js in the Raspberry Pi. There are many tutorials on the web, but I used this one

Now open the folder that you decompressed when downloading Tessie and press F4. A terminal should open, now run:

npm install

After the packages are installed run:

npm run dev


If everything is OK you should be able to go to localhost:5000 in your browser and see the interface.

Now go to UGS and start the web pendant, you should be able to access it in your browser on localhost:8080.

We are ready to engrave now. Select a tag, enter your text and engrave! Right now you can only engrave capital letters and numbers.

Thanks for reading until the end! Hope your machine is working fine. If you have suggestions, ideas or feedback feel free to reach out.