G-code to engrave numbers on cylinders
- Smokeys
- Offline
- New Member
-
Less
More
- Posts: 3
- Thank you received: 0
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.
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
-
Topic Author
- Offline
- Moderator
-
Less
More
- Posts: 19802
- Thank you received: 4609
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.
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.
- Boltonbrass
- Offline
- Junior Member
-
Less
More
- Posts: 31
- Thank you received: 0
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
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
-
Topic Author
- Offline
- Moderator
-
Less
More
- Posts: 19802
- Thank you received: 4609
10 Jul 2018 10:04 #113935
by andypugh
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
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
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 endsubThe 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
I actively avoid making money from this. It's important to me to keep it a hobby.. Please tell me you make money doing this......
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
- andypugh
-
Topic Author
- Offline
- Moderator
-
Less
More
- Posts: 19802
- Thank you received: 4609
30 Aug 2018 20:46 #116888
by andypugh
Replied by andypugh on topic G-code to engrave numbers on cylinders
Please Log in or Create an account to join the conversation.
- mosvic514
- Offline
- New Member
-
Less
More
- Posts: 1
- Thank you received: 0
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.
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
-
Topic Author
- Offline
- Moderator
-
Less
More
- Posts: 19802
- Thank you received: 4609
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)
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