• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
[4]

G Code for Chess piece

[3]
[10] Like what you see?
Click here to donate to this forum and upgrade your account!

Glen

Active Member
Active Member
Joined
Jun 27, 2011
Messages
39
Likes
4
#1
Ok, I have drawn my chess piece and I am still trying to figure out how to put it into Gcodes..
I have a CNC Sherline Lathe w/Servo Motors, running DeskCNC on my lap top...
Here is my chess piece I am trying to do.. Can someone please help me on this..
Thanks,
Glen
 

Attachments

Wreck™Wreck

Active User
H-M Supporter-Premium Member
Joined
Sep 29, 2014
Messages
1,943
Likes
1,514
#2
That is a bitmap file, very large and mostly unusable, save the cad drawing as a .jpg file and post it again, include all pertinent dimensions including the center positions of every radius in absolute coordinates, someone then may come along and help you without a tremendous amount of work.

Better yet, upload a .dxf, .dwg or similar 2D format file to a file hosting site and then post the link here.
 

Glen

Active Member
Active Member
Joined
Jun 27, 2011
Messages
39
Likes
4
#3
I just drew it in paint..
I don't know how to put all the parameters or the lines for cutting..
when it comes to that, well just say out the window with me, not
to smart when it comes to stuff like that.. Now I have written my own G Code for
turning my pen and pencils, which was easy just straight cuts, but trying to figure
out the tapper cuts I'm totally lost..
 

Karl_T

Active User
Active Member
Joined
Oct 14, 2014
Messages
823
Likes
288
#4
2nd the .dxf. i have a program that will convert it to gcode.

Look at it carefully. looks like you'll need more than one tool. It's easiest to put each tool in a separate layer on your CAD program.

I do most of my gcode work this way
 

JimDawson

Global Moderator
Staff member
Director
Joined
Feb 8, 2014
Messages
6,444
Likes
4,225
#5
OK, I just whipped up a DXF from your picture, but it needs to be scaled for size, the current dimension is 4.133 on the long axis.

View attachment ChessPiece.zip

I could not upload it as a DXF so you'll have to un-zip it.
 

Karl_T

Active User
Active Member
Joined
Oct 14, 2014
Messages
823
Likes
288
#6
OK, I woke up in the middle of the night with nuthin to do....

Using <free > Draftsight X64 I just learned you can't draw in the XZ plane. For my <el cheapo -NCplot) .dxf to gcode converter to work the lines have to be exactly where you want tool paths. The drawing for a lathe part should generally start at Z0 X0 and be in the +X -Z quadrant.

So I tired putting the drawing in the Y-X plane thinking I could just hand edit the gcode changing Y to Z and J to K. Couldn't get this to go last night.

Anyway, for my NCplot software to work you need the actual toolpaths drawn in the locations the machine works.

Sorry,

Karl

PS my gcode converter was $50 when under development, now $360. Its not worth that much. Look here for another one.
https://search.yahoo.com/yhs/search?p=dxf+to+gcode+converter&ei=UTF-8&hspart=mozilla&hsimp=yhs-001
 

Glen

Active Member
Active Member
Joined
Jun 27, 2011
Messages
39
Likes
4
#7
Thanks Jim,
Now my next question is, what is the bet program to
convert it to g code, I don't know if my DeskCNC will do it,
I know I can load dxf,nc, and another one..
Thanks
Glen
 

JimDawson

Global Moderator
Staff member
Director
Joined
Feb 8, 2014
Messages
6,444
Likes
4,225
#8
Thanks Jim,
Now my next question is, what is the bet program to
convert it to g code, I don't know if my DeskCNC will do it,
I know I can load dxf,nc, and another one..
Thanks
Glen
I made this with CamBam, and compiled it with a Mach-Turn post. You might see if this will run on your machine.

( Made using CamBam - http://www.cambam.co.uk )
( ChessPiece 2/10/2015 14:30:38 )
( T0 : 0.01 )
G20 G90 G91.1 G61 G40
G0 X0.25
( T0 : 0.01 )
T0 M6
( Lathe1 )
G17
M3 S1000
G0 Z-0.1975
G0 X1.0214
G1 F5.0 X0.9439
G1 F10.0 X0.9334
G3 X0.6951 Z-0.4521 I0.1357 K-0.3659
G1 Z-0.4895
G2 X0.6901 Z-0.4945 I-0.005 K0.0
G1 X0.6867
G1 X0.6861 Z-0.6285
G2 X0.6816 Z-0.6335 I-0.005 K0.0
G3 X0.5238 Z-0.7855 I0.0168 K-0.1754
G1 Z-0.8731
G2 X0.5216 Z-0.8772 I-0.005 K0.0
G3 X0.4176 Z-1.2491 I0.1748 K-0.2494
G2 Z-1.2492 I-0.0046 K-0.002
G1 X0.5863 Z-1.6564
G2 X0.5847 Z-1.6624 I-0.0046 K-0.0019
G3 X0.5285 Z-1.7498 I0.0889 K-0.119
G2 X0.5236 Z-1.7538 I-0.0049 K0.0011
G1 X0.5169
G1 Z-1.8098
G1 X0.5324
G2 X0.5374 Z-1.8148 I0.0 K-0.005
G1 Z-1.886
G2 X0.5358 Z-1.8897 I-0.005 K0.0
G3 X0.406 Z-2.0891 I0.3166 K-0.3481
G1 Z-2.1813
G1 X0.6617 Z-2.1793
G2 X0.6668 Z-2.1842 I0.0 K-0.005
G1 X0.673 Z-2.5015
G2 Z-2.5023 I-0.005 K-0.0001
G2 X0.3306 Z-3.4493 I-2.3325 K0.308
G3 X0.3695 Z-3.6301 I0.2121 K-0.0489
G2 X0.3681 Z-3.6374 I-0.004 K-0.003
G3 X0.2637 Z-4.0988 I0.17 K-0.281
G2 Z-4.1042 I-0.0042 K-0.0027
G1 X0.2061 Z-4.1955
G1 Z-4.3205
G1 X0.9455
G0 X0.25
M5
M30
 

Glen

Active Member
Active Member
Joined
Jun 27, 2011
Messages
39
Likes
4
#9
Ok,
I will give it a try.
I will let you know how it works out.
Right now waiting a couple of parts for my lathe.
Had a few pieces on the lathe break, so waiting on
the parts to fix it... Thanks for all the help, I will read the
gcode and see how it works, Like I said in my earlier post I have
written a gcode for turning pens and pencils which was easy,
just straight cuts once I learned how that worked it was pretty
simple to write different thickness of cuts..
 

Wreck™Wreck

Active User
H-M Supporter-Premium Member
Joined
Sep 29, 2014
Messages
1,943
Likes
1,514
#10
I just drew it in paint..
I don't know how to put all the parameters or the lines for cutting..
when it comes to that, well just say out the window with me, not
to smart when it comes to stuff like that.. Now I have written my own G Code for
turning my pen and pencils, which was easy just straight cuts, but trying to figure
out the tapper cuts I'm totally lost..
Straight tapers are easy point to point moves, a tangent to or from a radii is much more difficult and time consuming, tangent to tangent is more difficult yet.

Work at it
 

JimDawson

Global Moderator
Staff member
Director
Joined
Feb 8, 2014
Messages
6,444
Likes
4,225
#11
Ok,
I will give it a try.
I will let you know how it works out.
Right now waiting a couple of parts for my lathe.
Had a few pieces on the lathe break, so waiting on
the parts to fix it... Thanks for all the help, I will read the
gcode and see how it works, Like I said in my earlier post I have
written a gcode for turning pens and pencils which was easy,
just straight cuts once I learned how that worked it was pretty
simple to write different thickness of cuts..

I just realized that g-code is a mirror image of what you want, and a few more operations need to be added to speed up the process and make it machinable with a single tool. But let's see if the code will run at all, then we'll worry about getting it right.
 

Glen

Active Member
Active Member
Joined
Jun 27, 2011
Messages
39
Likes
4
#12
Will do,
well here is one of the Gcodes I wrote for
my Sherline Lathe

G01 X-0.0500 F15
Z-2.1138
X-0.0450
G00 Z0
G01 X-0.0600
Z-2.1138
X-0.0550
G00 Z0
G01 X-0.0700
Z-2.1138
X-0.0650
G00 Z0
G01 X-0.0800
Z-2.1138
X-0.0750
G00 Z0
G01 X-0.0900
Z-2.1138
X-0.0850
G00 Z0
G01 X-0.1000
Z-2.1138
X-0.0950
G00 Z0
G01 X-0.1100
Z-2.1138
X-0.1050
G00 Z0
G01 X-0.1200
Z-2.1138
X-0.1150
G00 Z0
G01 X-0.1300
Z-2.1138
X-0.1250
G00 Z0
G01 X-0.1490
Z-2.1138
G00 X0
Z0
M30
 

Wreck™Wreck

Active User
H-M Supporter-Premium Member
Joined
Sep 29, 2014
Messages
1,943
Likes
1,514
#13
I made this with CamBam, and compiled it with a Mach-Turn post. You might see if this will run on your machine.

( Made using CamBam - http://www.cambam.co.uk )
( ChessPiece 2/10/2015 14:30:38 )
( T0 : 0.01 )
G20 G90 G91.1 G61 G40
G0 X0.25
( T0 : 0.01 )
T0 M6
( Lathe1 )
G17
M3 S1000
G0 Z-0.1975
G0 X1.0214
G1 F5.0 X0.9439
G1 F10.0 X0.9334

G3 X0.6951 Z-0.4521 I0.1357 K-0.3659
G1 Z-0.4895
G2 X0.6901 Z-0.4945 I-0.005 K0.0
G1 X0.6867
G1 X0.6861 Z-0.6285
G2 X0.6816 Z-0.6335 I-0.005 K0.0
G3 X0.5238 Z-0.7855 I0.0168 K-0.1754
G1 Z-0.8731
G2 X0.5216 Z-0.8772 I-0.005 K0.0
G3 X0.4176 Z-1.2491 I0.1748 K-0.2494
G2 Z-1.2492 I-0.0046 K-0.002
G1 X0.5863 Z-1.6564
G2 X0.5847 Z-1.6624 I-0.0046 K-0.0019
G3 X0.5285 Z-1.7498 I0.0889 K-0.119
G2 X0.5236 Z-1.7538 I-0.0049 K0.0011
G1 X0.5169
G1 Z-1.8098
G1 X0.5324
G2 X0.5374 Z-1.8148 I0.0 K-0.005
G1 Z-1.886
G2 X0.5358 Z-1.8897 I-0.005 K0.0
G3 X0.406 Z-2.0891 I0.3166 K-0.3481
G1 Z-2.1813
G1 X0.6617 Z-2.1793
G2 X0.6668 Z-2.1842 I0.0 K-0.005
G1 X0.673 Z-2.5015
G2 Z-2.5023 I-0.005 K-0.0001
G2 X0.3306 Z-3.4493 I-2.3325 K0.308
G3 X0.3695 Z-3.6301 I0.2121 K-0.0489
G2 X0.3681 Z-3.6374 I-0.004 K-0.003
G3 X0.2637 Z-4.0988 I0.17 K-0.281
G2 Z-4.1042 I-0.0042 K-0.0027
G1 X0.2061 Z-4.1955
G1 Z-4.3205
G1 X0.9455
G0 X0.25
M5
M30
What do these 2 lines do?
 

JimDawson

Global Moderator
Staff member
Director
Joined
Feb 8, 2014
Messages
6,444
Likes
4,225
#14
What do these 2 lines do?
G1 F5.0 X0.9439
G1 F10.0 X0.9334

I just ran the code (on my desktop) in Mach-turn It looks like the first line prepositions the tool, the second line sets up the start point for the following arc. I have never created any G-code for turning, so without some study I'm not sure what is there. It looks pretty straight forward, but you have to think a lot about tool clearance and shape. The code above could not make the part with one tool, but with some changes it would.

The current goal is just to see if the lathe will even run the code (with no tool bit/material) without choking.
 

Glen

Active Member
Active Member
Joined
Jun 27, 2011
Messages
39
Likes
4
#16
Hey U.P. North,
Thanks, Now my question is, is this a single cutting tool
cut, because my lathe doesn't auto change cutting tools.
Oh yeah I forgot to mention I will be turning acrylic with
carbide inserts.
Thanks
Glen
 

Wreck™Wreck

Active User
H-M Supporter-Premium Member
Joined
Sep 29, 2014
Messages
1,943
Likes
1,514
#17
Hey U.P. North,
Thanks, Now my question is, is this a single cutting tool
cut, because my lathe doesn't auto change cutting tools.
Oh yeah I forgot to mention I will be turning acrylic with
carbide inserts.
Thanks
Glen
This will take a minimum of 2 tools.
 

Glen

Active Member
Active Member
Joined
Jun 27, 2011
Messages
39
Likes
4
#18
Welp still waiting on the parts for my lathe to get here, once they do then I can try the code out..
Will keep you guys updated on the progress
Glen
 

Glen

Active Member
Active Member
Joined
Jun 27, 2011
Messages
39
Likes
4
#19
Hello Everyone,
Well sorry it took so long to get back, I finally got the parts in
and then I wound up getting the flu, and I still have this junk..
But anyhow, I got the lathe back up and running, I hadn't had
any luck with the codes.. I noticed on the codes there is a Y axis,
I don't have Y axis on mine just X and Z, so I don't know if the is a problem.
Oh yeah when I load The file into DeksCNC it tells me unknown G code on line 4
and that's for as it gets.
 
Last edited:

Glen

Active Member
Active Member
Joined
Jun 27, 2011
Messages
39
Likes
4
#21
Hello everyone,
Well, sorry I hadn't got back with you guys,
but I was sick then had to go to the Hospital.:blue:
I'm back and I feel a lot better.. :encourage: Well enough of that.
I tried the to Gcodes you guys gave me but neither one
would work.:bawling: So looks like I will have to try something
else. maybe I will try drawing a rook or a pawn and try
making them smaller....:bash computer: Thanks for the help guys..
Glen
 

Glen

Active Member
Active Member
Joined
Jun 27, 2011
Messages
39
Likes
4
#23

Well I have rewritten my GCode for my pen making.
I am having a problem on the second half of the code I wrote.
Here is the code and I will try to explain what I'm doing..


N100 G01 X-0.0300 F10 ---------- From this point down to end of the blue is my finished pen.
N105 Z-2.3665 -----------------------No problem with this part.
N110 G01 X-0.0600
N115 Z-0
N120 G01 X-0.0900
N125 Z-2.3665
N130 G01 X-0.1200
N135 Z-0
N140 G01 X-0.1500
N145 Z-2.3665
N150 G01 X-0.1800
N155 Z-0.1660
N160 G01 X-0.2100
N165 Z-2.2760
N170 G01 X-0.2400
N175 Z-0.1660
N180 G01 X-0.2700
N185 Z-2.2760
N190 G01 X-0.3000
N195 Z-0.1660
N200 G01 X-0.3125
N205 Z-2.2760

N210 Z-0.2000 F5 ------------ now from here to the end is what I'm having problems with.
N215 G01 X-0.0400 ---------- What I want too do is to move from the end of the pen about a 1/4 inch
N220 G01 X 0.0200 ---------- and cut these six groves, but when it stops cutting the pen it then it
N225 Z-0.3500 ----------------- drops down too F5 like I want, but then it goes half way down the pen
N230 G01 X-0.0400 ---------- then goes right back to like it was starting to cut the pen again, but
N235 G01 X 0.0200 ----------- it cuts the groves without touching the pen..
N240 Z-0.5500 ----------------- Please help. I can't figure this out
N245 G01 X-0.0400 ---------- I will video it if need to
N250 G01 X 0.0200
N255 Z-0.7500
N260 G01 X-0.0400
N265 G01 X 0.0200
N270 Z-0.9500
N275 G01 X-0.0400
N280 G01 X 0.0200
N285 Z-1.1500
N290 G01 X-0.0400
N295 G01 X 0.0200

N300 G00 X0
N305 Z0
N310 M30

 

Glen

Active Member
Active Member
Joined
Jun 27, 2011
Messages
39
Likes
4
#25
Here Is the video of the pen I did it has already been turned down, I just need to
get the dang thing to cut the grooves. Thanks for any help
Glen
 
Last edited:

jumps4

Global Moderator
Staff member
Active Member
Joined
Apr 30, 2012
Messages
2,220
Likes
193
#27
I tried your code i have to delete all text or it does nothing in mach3 you have to use parentheses around text.
are you hand writing this code?
what extension does your code need?
try this code but open it in notepad check save as, choose all files as type and type in pen2.? the question is the extension you need.
this runs in mach3, it's not pretty ( it's really bad but it runs ) but it will help see the post processor type you need.
Steve
 

Attachments

Last edited:

RVJimD

Active User
Active Member
Joined
Dec 30, 2014
Messages
250
Likes
104
#28
I have got to stop reading these CNC threads, it makes me want to convert my mill so I can try all this stuff you guys are talking about. :D

Thanks for the thread!

Jim
 

bpratl

Active User
H-M Supporter-Premium Member
Joined
Sep 5, 2012
Messages
940
Likes
53
#29
I have got to stop reading these CNC threads, it makes me want to convert my mill so I can try all this stuff you guys are talking about. :D
Thanks for the thread!
Jim
That was exactly my problem, I read all of the CNC treads and I got bit. Now there is no turning back as the lathe has been stripped of all if's manual controls.
Great fun and learning curve.
 

Glen

Active Member
Active Member
Joined
Jun 27, 2011
Messages
39
Likes
4
#30
Yes that is right on the code
N215 G01 X-0.0400
N220 G01 X 0.0200

yes sir I am writing all of it by hand its just a straight cut up and down
just a simple code but trying to get the grooves to cut right
the extension on the code is DNC or NC, I use DeskCNC program that came with my
setup....
 
[6]
[5] [7]