G-code to engrave numbers on cylinders

More
9 years 1 month ago #99642 by Smokeys
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 to join the conversation.

More
9 years 3 weeks ago #99860 by andypugh
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 to join the conversation.

More
8 years 3 months ago #113914 by Boltonbrass
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

Please Log in to join the conversation.

More
8 years 3 months ago #113935 by andypugh

Boltonbrass wrote: 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
Code:
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:

Attachment not found



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.

Please Log in to join the conversation.

More
8 years 2 months ago #116888 by andypugh
I have modified the code to also do the tick marks.

Attachment not found

Please Log in to join the conversation.

More
8 months 4 weeks ago #342288 by mosvic514
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 to join the conversation.

More
8 months 3 weeks ago #342575 by andypugh
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 to join the conversation.

Time to create page: 0.066 seconds
Powered by Kunena Forum