G-code to engrave numbers on cylinders

More
29 Sep 2017 20:44 #99642 by Smokeys
Replied by Smokeys on topic G-code to engrave numbers on cylinders
I guess I envisioned a sub for each g code.

I could do this is fusion 360, but incrementing the serial number for each one seems better suited to a gcode program. There must be something like this out there already.

Please Log in or Create an account to join the conversation.

  • andypugh
  • andypugh's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
More
03 Oct 2017 21:38 #99860 by andypugh
Replied by andypugh on topic G-code to engrave numbers on cylinders
I am pretty sure that you could write a G-code sub to carve sequential alphanumeric strings as serial numbers.
I thought you wanted to carve arbitrary strings. In that scenario the hard part is passing the strings to the G-code.

Please Log in or Create an account to join the conversation.

More
10 Jul 2018 00:53 - 10 Jul 2018 01:21 #113914 by Boltonbrass
Replied by Boltonbrass on topic G-code to engrave numbers on cylinders
Andy you are my savior. All I need is Bolton Brass engraved on a 1/2" round piece of brass with a single letter or number below it. And I agree with BigJohnT, that is slick as hell. Please tell me you make money doing this......
I know I am late to this post, but where do I start with xza?
Sonny
Last edit: 10 Jul 2018 01:21 by Boltonbrass. Reason: Adding a question.

Please Log in or Create an account to join the conversation.

  • andypugh
  • andypugh's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
More
10 Jul 2018 10:04 #113935 by andypugh
Replied by andypugh on topic G-code to engrave numbers on cylinders

Andy you are my savior. All I need is Bolton Brass engraved on a 1/2" round piece of brass with a single letter or number below it.


This might not be too hard, you only need a few extra letters (B,o,l,t,n,r,a,s)

But: The point of this routine was to generate the numbers on-the-fly for scale rings of various types (0-360, -180-180, 0-10. 0-25 etc)
For engraving the same words many times it is probably sensible just to use a CAM system like Fusion360 to create the G-code once :

If you want to use this G-code, then it might help to explain how it works.
Each number is created by joining points on two octagons. (generally). I worked out the coordinates of the required points, typed them in (probably in Excel) and then formed them in to the subroutines (again, probably using Excel, but it was quite a while ago)

This is the number 8
 O8 sub
 G92 A0 X0
 G0 A[0.2357 * #41] X[0.5690 * #42] Z[#<_dia> / 2 + 1]
 G1 Z[#<_dia> / 2 - #<_depth>]
 A[-.2357 * #41] X[0.5690 * #42]
 A[-.3333 * #41] X[0.3333 * #42]
 A[-.2357 * #41] X[0.0976 * #42]
 A[0.0000 * #41] X[0.0000 * #42]
 A[0.2357 * #41] X[0.0976 * #42]
 A[0.3333 * #41] X[0.3333 * #42]
 A[0.2357 * #41] X[0.5690 * #42] 
 A[0.3333 * #41] X[0.6667 * #42]
 A[0.2357 * #41] X[0.9024 * #42]
 A[0.0000 * #41] X[1.0000 * #42]
 A[-.2357 * #41] X[0.9024 * #42]
 A[-.3333 * #41] X[0.6667 * #42]
 A[-.2357 * #41] X[0.5690 * #42]
 G0 Z[#<_dia> / 2 + 1]
 G92.1
 O8 endsub

The factors #41 and #42 are used to scale in the A and X directions. Here are the points plotted in Excel:



You would Need to create the letters you need in the same way, and form them into a subroutine looking like the existing digits.
I would suggest using ASCII to name the subroutines:

B = 66
o = 111
l = 108
t = 116
n = 110
r = 114
a = 97
s = 115


. Please tell me you make money doing this......

I actively avoid making money from this. It's important to me to keep it a hobby.
Attachments:
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

  • andypugh
  • andypugh's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
More
30 Aug 2018 20:46 #116888 by andypugh
Replied by andypugh on topic G-code to engrave numbers on cylinders
I have modified the code to also do the tick marks.

Attachments:

Please Log in or Create an account to join the conversation.

More
01 Feb 2026 18:10 #342288 by mosvic514
Replied by mosvic514 on topic G-code to engrave numbers on cylinders
Hi. This is almost what I was looking for . I need to make a cylindrical dial for a leadscrew with 1/8 inch move per rotation. So it would be 125 ticks, each 5th is slightly bigger, each 10th is bit more bigger. And numbers 0, 10, 20,...110, 120 beside 10th ticks. How I can modify your code?
BTW, other dials, 1/10" per rotation or even metric would very useful. 

Please Log in or Create an account to join the conversation.

  • andypugh
  • andypugh's Avatar Topic Author
  • Offline
  • Moderator
  • Moderator
More
06 Feb 2026 22:03 #342575 by andypugh
Replied by andypugh on topic G-code to engrave numbers on cylinders
Try just changing #<_inc> to 28.8 degrees (and see what the preview looks like)
That's 360 / 12.5 though it sounds a bit too large without testing, and I don't know what it will do at 120.
(Sorry, not at a LinuxCNC machine at the moment to test it)

Please Log in or Create an account to join the conversation.

Time to create page: 0.127 seconds
Powered by Kunena Forum