1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. PLEASE: Read the FORUM RULES BEFORE registering!

    Dismiss Notice

G Code for Chess piece

Discussion in 'CNC CODING FILES' started by Glen, Feb 9, 2015.

  1. Glen

    Glen United States Active Member Active Member

    Likes Received:
    4
    Trophy Points:
    8
    City:
    Houston
    State:
    Texas

    -Return to Top-

    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
     

    Attached Files:

  2. Wreck™Wreck

    Wreck™Wreck United States Active User H-M Supporter-Premium

    Likes Received:
    1,067
    Trophy Points:
    113
    City:
    Riverton
    State:
    New Jersey

    -Return to Top-

    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.
     
  3. Glen

    Glen United States Active Member Active Member

    Likes Received:
    4
    Trophy Points:
    8
    City:
    Houston
    State:
    Texas

    -Return to Top-

    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..
     
  4. Karl_T

    Karl_T United States Active User Active Member

    Likes Received:
    164
    Trophy Points:
    43
    City:
    Dassel
    State:
    Minnesota

    -Return to Top-

    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
     
  5. JimDawson

    JimDawson Global Moderator Staff Member Director

    Likes Received:
    3,571
    Trophy Points:
    113
    City:
    Sandy
    State:
    Oregon

    -Return to Top-

    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.
     
  6. Karl_T

    Karl_T United States Active User Active Member

    Likes Received:
    164
    Trophy Points:
    43
    City:
    Dassel
    State:
    Minnesota

    -Return to Top-

    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
     
  7. Glen

    Glen United States Active Member Active Member

    Likes Received:
    4
    Trophy Points:
    8
    City:
    Houston
    State:
    Texas

    -Return to Top-

    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
     
  8. JimDawson

    JimDawson Global Moderator Staff Member Director

    Likes Received:
    3,571
    Trophy Points:
    113
    City:
    Sandy
    State:
    Oregon

    -Return to Top-

    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
     
  9. Glen

    Glen United States Active Member Active Member

    Likes Received:
    4
    Trophy Points:
    8
    City:
    Houston
    State:
    Texas

    -Return to Top-

    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..
     
  10. Wreck™Wreck

    Wreck™Wreck United States Active User H-M Supporter-Premium

    Likes Received:
    1,067
    Trophy Points:
    113
    City:
    Riverton
    State:
    New Jersey

    -Return to Top-

    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
     
  11. JimDawson

    JimDawson Global Moderator Staff Member Director

    Likes Received:
    3,571
    Trophy Points:
    113
    City:
    Sandy
    State:
    Oregon

    -Return to Top-


    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.
     
  12. Glen

    Glen United States Active Member Active Member

    Likes Received:
    4
    Trophy Points:
    8
    City:
    Houston
    State:
    Texas

    -Return to Top-

    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
     
  13. Wreck™Wreck

    Wreck™Wreck United States Active User H-M Supporter-Premium

    Likes Received:
    1,067
    Trophy Points:
    113
    City:
    Riverton
    State:
    New Jersey

    -Return to Top-

    What do these 2 lines do?
     
  14. JimDawson

    JimDawson Global Moderator Staff Member Director

    Likes Received:
    3,571
    Trophy Points:
    113
    City:
    Sandy
    State:
    Oregon

    -Return to Top-

    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.
     
  15. u.p. north

    u.p. north United States Iron Registered Member

    Likes Received:
    0
    Trophy Points:
    1

    -Return to Top-

    Try this gcode
    Sorry it didn't work for me either
     

    Attached Files:

  16. Glen

    Glen United States Active Member Active Member

    Likes Received:
    4
    Trophy Points:
    8
    City:
    Houston
    State:
    Texas

    -Return to Top-

    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
     
  17. Wreck™Wreck

    Wreck™Wreck United States Active User H-M Supporter-Premium

    Likes Received:
    1,067
    Trophy Points:
    113
    City:
    Riverton
    State:
    New Jersey

    -Return to Top-

    This will take a minimum of 2 tools.
     
  18. Glen

    Glen United States Active Member Active Member

    Likes Received:
    4
    Trophy Points:
    8
    City:
    Houston
    State:
    Texas

    -Return to Top-

    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
     
  19. Glen

    Glen United States Active Member Active Member

    Likes Received:
    4
    Trophy Points:
    8
    City:
    Houston
    State:
    Texas

    -Return to Top-

    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: Feb 23, 2015
  20. Cadillac STS

    Cadillac STS United States Active User H-M Supporter-Premium

    Likes Received:
    111
    Trophy Points:
    43
    City:
    Grand Rapids
    State:
    Michigan

    -Return to Top-

    Be sure to post pictures of the chess pieces made!
     
  21. Glen

    Glen United States Active Member Active Member

    Likes Received:
    4
    Trophy Points:
    8
    City:
    Houston
    State:
    Texas

    -Return to Top-

    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
     
  22. Glen

    Glen United States Active Member Active Member

    Likes Received:
    4
    Trophy Points:
    8
    City:
    Houston
    State:
    Texas

    -Return to Top-

     
    Last edited: Apr 17, 2015
  23. Glen

    Glen United States Active Member Active Member

    Likes Received:
    4
    Trophy Points:
    8
    City:
    Houston
    State:
    Texas

    -Return to Top-


    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

     
  24. u.p. north

    u.p. north United States Iron Registered Member

    Likes Received:
    0
    Trophy Points:
    1

    -Return to Top-

    Glen sent you a private message

    Thank You,
    U.P. North
     
  25. Glen

    Glen United States Active Member Active Member

    Likes Received:
    4
    Trophy Points:
    8
    City:
    Houston
    State:
    Texas

    -Return to Top-

    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: Dec 13, 2015
  26. JimDawson

    JimDawson Global Moderator Staff Member Director

    Likes Received:
    3,571
    Trophy Points:
    113
    City:
    Sandy
    State:
    Oregon

    -Return to Top-


    Should this read?
    N215 G01 X-0.4000
    N220 G01 X 0.2000
    .

    .
     
  27. jumps4

    jumps4 Global Moderator Staff Member Active Member

    Likes Received:
    179
    Trophy Points:
    63
    City:
    New Port Richey
    State:
    Florida

    -Return to Top-

    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
     

    Attached Files:

    Last edited: Apr 18, 2015
  28. RVJimD

    RVJimD United States Active User Active Member

    Likes Received:
    80
    Trophy Points:
    28
    City:
    Des Moines
    State:
    Iowa

    -Return to Top-

    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
     
  29. bpratl

    bpratl United States Active User H-M Supporter-Premium

    Likes Received:
    53
    Trophy Points:
    48
    City:
    Gloucester
    State:
    Massachusetts

    -Return to Top-

    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.
     
  30. Glen

    Glen United States Active Member Active Member

    Likes Received:
    4
    Trophy Points:
    8
    City:
    Houston
    State:
    Texas

    -Return to Top-

    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....
     

Share This Page