LatheCity Safely Working with Benchtop Systems Volume 5 – CNC Benchtop Lathe Featuring Sherline ISBN-10: 0991153057 ISBN-13: 978-0-9911530-5-3 © Copyright 2015 by Uwe Burghaus, Fargo, ND, USA All Rights Reserved sales@LatheCity.com www.LatheCity.com No part of this publication including the software may be reproduced, stored in a retrieval system or transmitted in any form or by any means except as permitted by the United States Copyright Act, without prior written permission of the author. Trademarks are property of their respective owners. ################################################ The codes available for free from our website do not include any commends or explanations. For that you would need to get the book. ################################################ Disclaimer The book including the software has been written carefully and all projects and procedures have been tested thoroughly (on a Sherline CNC lathe with EMC2). However, as always, the author and publisher cannot guarantee that the procedures are perfect and without any mistakes. g-codes although tested may include mistakes. In addition, it is impossible to predict and prevent all the possible problems someone may possibly run into when working with a lathe. Using a power tool can be dangerous and the proper use is the responsibility of the one who is using the tool. Neither the author nor publisher shall be liable for damage arising herefrom. If you are not perfectly comfortable with working with power tools, then don’t do it! In this case, take a metal working class rather than following a do-it-yourself outline. Or, find a different hobby. I cannot jump in if you make a mistake which results in harming yourself or damaging the tools you use. Don’t use half broken or damaged tools, perhaps purchased for cheap at a secondhand store or who knows where. This would be overwhelming to handle in the beginning. Thoughtful work will be your responsibility. The author makes no representations or warranties with respect to the accuracy or completeness of the contents. The author is not a professional machinist or engineer. He is a hobby machinist as you probably are. In fact, the author holds a PhD in physics and teaches physical chemistry at a college. Therefore, no information provided herein represents professional advice or best practices in machining. All information is provided to help hobbyists and other non-professionals gain a better understanding of using a miniature benchtop (tabletop) CNC lathe for hobby type work. This book does not replace Sherline’s manuals and/or safety notices. This book does not replace knowledge, training, and/or experience in machining. This book features in particular Sherline CNC lathes and accessories. However, none of the statements or procedures may coincide with the manufacturer’s opinion or interests. The author is not an employee of, or agent for any of the vendors referenced in the text and does not sell or represent any of the third party products discussed. Web addresses are given without any warranty or guarantee, web sites may be infected by a computer virus and/or may not provide the best service. Web sites and their content may have changed between the time the author described them in this book and when this book is read. Neither the author nor publisher shall be liable for damage arising herefrom. You will perform all operations herein described at your own risk in any regard. Neither LatheCity nor its owner shall be liable for damage arising from unprofessional use or misuse of accessories or procedures described. Any legal action brought against LatheCity shall be tried in the State of North Dakota in Fargo, USA. In no event shall LatheCity's liability exceed the purchase price paid for the product. We shall in no event be liable for death, injuries to persons or property or incidental, contingent, special or consequential damage arising from the use of our products or described procedures. This disclaimer information is given on our website and it is available before and without purchasing any of our products. ######################################### ; PRG 8x1 g00 g20 g40 g49 g90 x0 z0 g00 x1 z1 g01 x0 z0 f2 m2 ########################################## ; PRG 8x2 g00 g20 g40 g49 g90 x0 z0 g00 x1 z1 g01 x0 z0 f2 m2 ########################################## ; PRG 8x3 g18 g00 g20 g40 g49 g90 x0 z0; m2 ########################################## ;PRG 9 x1 g18 g00 g20 g40 g49 g90 x0 z0; g01 x0 z0 f5; g01 x0 z0.5; g01 x0 z-0.5; g01 x0 z0; g01 x0.25 z0; g01 x-0.25 z0; g01 x0 z0; g01 x0.25 z1; g01 x0 z0; m2 ########################################## ;PRG 9x3 g18 g00 g20 g40 g49 g90 x0 z0; g01 x0 z0 f5; g01 x0 z-0.5; g01 x0 z0.0; g01 x-0.01 z0.0; g01 x-0.01 z-0.5; g01 x-0.01 z0.0; g01 x-0.02 z0.0; g01 x-0.02 z-0.5; g01 x-0.02 z0.0; g01 x-0.03 z0.0; g01 x-0.03 z-0.5; g01 x-0.03 z0.0; g01 x-0.04 z0.0; g01 x-0.04 z-0.5; g01 x-0.04 z0.0; g01 x-0.05 z0.0; g01 x-0.05 z-0.5; g01 x-0.05 z0.0; g01 x0 z0; m2; ########################################## ;PRG 9x 4 (msg, ...) m1 g18 g00 g20 g40 g49 g90 x0 z0; g01 x0 z0 f5; g01 x0 z-0.5; g01 x0 z0.0; g01 x-0.01 z0.0; g01 x-0.01 z-0.5; g01 x-0.01 z0.0; g01 x-0.02 z0.0; g01 x-0.02 z-0.5; g01 x-0.02 z0.0; g01 x-0.03 z0.0; g01 x-0.03 z-0.5; g01 x-0.03 z0.0; g01 x-0.04 z0.0; g01 x-0.04 z-0.5; g01 x-0.04 z0.0; g01 x-0.05 z0.0; g01 x-0.05 z-0.5; g01 x-0.05 z0.0; g01 x0 z0; m2; ########################################## ;PRG 9 x 5 g18 g00 g20 g40 g49 g91 x0 z0; g01 x0 z0 f5; g01 x0 z-0.5; g01 z0.5; g01 x-0.01; g01 z-0.5; g01 z0.5; g01 x-0.01; g01 z-0.5; g01 z0.5; g01 x-0.01; g01 z-0.5; g01 z0.5; g01 x-0.01; g01 z-0.5; g01 z0.5; g01 x-0.01; g01 z-0.5; g01 z0.5; m2; ########################################## ;PRG 9x 6 g18 g00 g20 g40 g49 g91 x0 z0; g01 x0 z0 f5; x0 z-0.5; z0.5; x-0.01; z-0.5; z0.5; x-0.01; z-0.5; z0.5; x-0.01; z-0.5; z0.5; x-0.01; z-0.5; z0.5; x-0.01; z-0.5; z0.5; m2; ########################################## ;PRG 9x7 o100 sub; (msg, ...I am subprogram 100 at your service...) 0100 endsub; (msg, I am your main program) (msg, let’s try subprograms) (msg, - are you ready?) m1; o100 call; (msg, it’s me again your main program) (msg, let’s try this again) (msg, - are you ready?) m1; o100 call; (msg, - I get bored. Bye Bye.) m2; ########################################## ;PRG 9x8 o100 sub; g01 z0.5; g01 x-0.01; g01 z-0.5; 0100 endsub; g18 g00 g20 g40 g49 g91 x0 z0; g01 x0 z0 f5; g01 x0 z-0.5; o100 call; o100 call; o100 call; o100 call; o100 call; g01 z0.5; m2; ########################################## ;PRG 9x9 o100 sub; (debug, x =#1 and z = #2); o100 endsub; o100 call [0.2] [0.2]; m2; ########################################## ;PRG 9x10 o100 sub; g0 x[#1] z[#2]; o100 endsub; g18 g00 g20 g40 g49 g91; g01 x0 z0 f5; o100 call [0.2] [0.2]; o100 call [-0.2] [-0.2]; m2; ########################################## ;PRG 9x11 o100 sub; (debug, diameter =#1 ); #2=[#1/2]; (debug, radius =#2 ); o100 endsub; o100 call [2.5]; m2; ########################################## ;PRG 9x12 o100 sub (debug, diameter =#1 ) #=[#1/2]; (debug, radius =# ) o100 endsub o100 call [2.5]; m2; ########################################## ;PRG 9x13 o sub (debug, diameter =#1 ) #=[#1/2] (debug, radius =# ) o endsub o call [2.5] m2; ########################################## ;PRG 9x14 ; 9/16 = diameter measured over the flats ; r = 9/16*0.5=0.28125 radius over flats ; radius of circumscribed circle = R = 1.155 r see handbook page 71 ; R=9/16 * 0.5 * 1.155 = 0.3248 = starting radius ; diameter of circumscribed circle = 0.6497 = starting diameter ;cut off diameter 0.6497-0.3510=0.2987 ;cut off radius 0.2987/2=0.14935 … from here use standard turning program ########################################## ;PRG 11X1 g18 g00 g20 g40 g49 g91 x0 z0; g01 x0 z0 f7; x-0.002; z-0.723; z0.723; …(see Tab. 11.2, starting diameter 0.3561) m2; ****************** #0 0.800 #1 0.723 #2 0.646 #3 0.569 #4 0.492 #5 0.415 #6 0.338 #7 0.262 #8 0.185 #9 0.108 0.002” slices **************** g18 g00 g20 g40 g49 g91 x0 z0; g01 x0 z0 f3; x-0.002; z-0.800; z0.723; x-0.002; z-0.723; z0.723; x-0.002; z-0.646; z0.723; x-0.002; z-0.569; z0.723; x-0.002; z-0.492; z0.723; x-0.002; z-0.415; z0.723; x-0.002; z-0.338; z0.723; x-0.002; z-0.262; z0.723; x-0.002; z-0.185; z0.723; x-0.002; z-0.108; z0.723; m2; ########################################## ; prg 12X1 g18 g00 g20 g40 g49 g90 x0 z0; g01 x0 z0 f6; x -0.0100 z 0.0200 x 0.0250 z -0.0500 x -0.0100 z 0.0200 x -0.0150 z 0.0200 x 0.0200 z -0.0500 x -0.0150 z 0.0200 x -0.0200 z 0.0200 x 0.0150 z -0.0500 x -0.0200 z 0.0200 x -0.0250 z 0.0200 x 0.0100 z -0.0500 x -0.0250 z 0.0200 x -0.0300 z 0.0200 x 0.0050 z -0.0500 x -0.0300 z 0.0200 m2; ########################################## ; PRG 12x2 g18 g20 g40 g49 g90; g01 x0.0145 z-0.0397 f3; g2 x-0.0397 z0.0145 r0.05; g3 x0.0145 z-0.0397 r0.05; g01 x0.0068 z-0.0473 f3; g2 x-0.0473 z0.0068 r0.05; g3 x0.0068 z-0.0473 r0.05; g01 x-0.0002 z-0.0543 f3; g2 x-0.0543 z-0.0002 r0.05; g3 x-0.0002 z-0.0543 r0.05; m2; ########################################## ;PRG 12x3 ;g18 g20 g40 g49 g90; ;g01 x0 z0 f30; ;g01 x0 z-1 ;g01 x-0.5 z-1 ;g01 x-0.5 z-0 ;g01 x0 z0 g18 g20 g40 g49 g90; g01 x0.0434 z-0.1191 f3; g2 x-0.1191 z0.0434 r0.15; g3 x0.0434 z-0.1191 r0.15; g01 x0.0309 z-0.1231 f3; g2 x-0.1231 z0.0309 r0.15; g3 x0.0309 z-0.1231 r0.15; g01 x0.0209 z-0.1331 f3; g2 x-0.1331 z0.0209 r0.15; g3 x0.0209 z-0.1331 r0.15; g01 x0.0109 z-0.1431 f3; g2 x-0.1431 z0.0109 r0.15; g3 x0.0109 z-0.1431 r0.15; ;g01 x0.0009 z-0.1531 f3; ;g2 x-0.1531 z0.0009 r0.15; ;g3 x0.0009 z-0.1531 r0.15; g01 x-0.0006 z-0.1631 f3; g2 x-0.1631 z-0.0006 r0.15; g3 x-0.0006 z-0.1631 r0.15; g01 x0 z0 f3; m2 ########################################## ;PRG 13x1 g18 g00 g20 g40 g49 g90 x0 z0; g01 x0 z0 f3; ; ********************** g01 x0 z0.1 f5; x0 z-0.313; z0.05; x-0.010; z-0.268; z0.050; x-0.020; z-0.238; z0.050; x-0.030; z-0.217; z0.050; x-0.040; z-0.196; z0.050; x-0.050; z-0.179; z0.050; x-0.060; z-0.163; z0.050; x-0.070; z-0.149; z0.050; x-0.080; z-0.136; z0.050; x-0.090; z-0.124; z0.050; x-0.100; z-0.115; z0.050; x-0.110; z-0.103; z0.050; x-0.120; z-0.094; z0.050; x-0.130; z-0.086; z0.050; x-0.140; z-0.077; z0.050; x-0.150; z-0.070; z0.050; x-0.160; z-0.064; z0.050; x-0.170; z-0.057; z0.050; x-0.180; z-0.050; z0.050; x-0.190; z-0.045; z0.050; x-0.200; z-0.039; z0.050; x-0.210; z-0.035; z0.050; x-0.220; z-0.031; z0.050; x-0.230; z-0.026; z0.050; x-0.240; z-0.023; z0.050; x-0.250; z-0.019; z0.050; x-0.260; z-0.016; z0.050; x-0.270; z-0.013; z0.050; x-0.280; z-0.010; z0.050; x-0.290; z-0.008; z0.050; x-0.300; z-0.006; z0.050; x-0.310; z-0.005; z0.050; x-0.320; z-0.003; z0.050; ;x-0.330; ;z-0.002; ;z0.050; x-0.340; z-0.002; z0.050; ;x-0.350; ;z-0.001; ;z0.050; x-0.360; z-0.001; z0.050; ;*********************** z1 f8; (msg,finished) (msg,remove part) (msg,go back to HOME - ready?) m0 x0 z0 f3; m2; ########################################## ;PRG 13x2 g18 g00 g20 g40 g49 g90 x0 z0; g01 x0 z0 f3; g01 x0 z0 f3; g2 x-0.25 z0.25 r0.25; g3 x0 z0 r0.25; g01 x0 z-0.05 f3; g2 x-0.25 z0.20 r0.25; g3 x0 z-0.05 r0.25; g01 x0 z-0.1 f3; g2 x-0.25 z0.15 r0.25; g3 x0 z-0.1 r0.25; g01 x0 z-0.15 f3; g2 x-0.25 z0.10 r0.25; g3 x0 z-0.15 r0.25; g01 x0 z-0.20 f3; g2 x-0.25 z0.05 r0.25; g3 x0 z-0.20 r0.25; g01 x0 z-0.25 f3; g2 x-0.25 z0 r0.25; g3 x0 z-0.25 r0.25; x0 z0 f3; m2; ########################################## ; prg 14X1 g18 g00 g20 g40 g49 g90 x0 z0; g01 x0 z0 f3; x -0.344 z 0.0 f3; x -0.339 z 0.0; x -0.339 z -0.505; x -0.339 z 0.0; x -0.334 z 0.0; x -0.334 z -0.505; x -0.334 z 0.0; … x -0.3125 z 0.0; x -0.3125 z -0.505; x -0.3125 z -0.0; z1 f8; (msg,finished) (msg,remove part) (msg,go back to HOME - ready?) m0 x0 z0 f3; m2; ########################################## ; prg 15X1 (msg, switch on spindle) m0 g18 g00 g20 g40 g49 g90 x0 z0; g01 x0 z0 f3; x -0.0983 z 0.0500 f3 x -0.1177 z -0.8000 x -0.0983 z 0.0500 x -0.0933 z 0.0500 x -0.1127 z -0.8000 x -0.0933 z 0.0500 x -0.0883 z 0.0500 x -0.1077 z -0.8000 x -0.0883 z 0.0500 x -0.0833 z 0.0500 x -0.1027 z -0.8000 x -0.0833 z 0.0500 x -0.0783 z 0.0500 x -0.0978 z -0.8000 x -0.0783 z 0.0500 z0.15 f8; (msg,finished) (msg,remove part) (msg,go back to HOME - ready?) m0 x0 z0 f3; m2; ########################################## ; prg 16X1 o100 sub; g0 z0 z0; o100 g18 g00 g20 g40 g49 g90 x0 z0 f3; g92 x0.0 z0.0; o100 call; g92.2; g92 x0.0 z0.0; o100 call; g92.2; m2 ########################################## ;Fig 16x2 o100 sub g18 g20 g40 g49 g90; g01 x0.0145 z-0.0397 f3; g2 x-0.0397 z0.0145 r0.05; g3 x0.0145 z-0.0397 r0.05; g01 x0.0068 z-0.0473 f3; g2 x-0.0473 z0.0068 r0.05; g3 x0.0068 z-0.0473 r0.05; g01 x-0.0002 z-0.0543 f3; g2 x-0.0543 z-0.0002 r0.05; g3 x-0.0002 z-0.0543 r0.05; g01 x0 z0 f3; o100 endsub g18 g00 g20 g40 g49 g90 x0 z0 f5; g01 x0 z-0.5; g01 x0 z0.0; g01 x-0.05 z0.0; g01 x-0.05 z-0.5; g01 x-0.05 z0.0; g01 x-0.10 z0.0; g01 x-0.10 z-0.5; g01 x-0.10 z0.0; g01 x-0.10 z0.0; g92 x0.0 z0.0; o100 call; g92.2; g01 x0 z-0.5; g92 x0.0 z0.0; o100 call; g92.2; g01 x-0.0 z1.0; m2; ########################################## tAB 11.2 0.001” slices #0 0.800 #1 0.762 #2 0.723 #3 0.685 #4 0.646 #5 0.608 #6 0.569 #7 0.531 #8 0.492 #9 0.454 #10 0.415 #11 0.377 #12 0.338 #13 0.300 #14 0.262 #15 0.223 #16 0.185 #17 0.146 #18 0.108 #19 0.069 0.002” slices #0 0.800 #1 0.723 #2 0.646 #3 0.569 #4 0.492 #5 0.415 #6 0.338 #7 0.262 #8 0.185 #9 0.108 ########################################## Tab. 13.1 #1 0.313 #2 0.268 #3 0.238 #4 0.217 #5 0.196 #6 0.179 #7 0.163 #8 0.149 #9 0.136 #10 0.124 #11 0.115 #12 0.103 #13 0.094 #14 0.086 #15 0.077 #16 0.070 #17 0.064 #18 0.057 #19 0.050 #20 0.045 #21 0.039 #22 0.035 #23 0.031 #24 0.026 #25 0.023 #26 0.019 #27 0.016 #28 0.013 #29 0.010 #30 0.008 #31 0.006 #32 0.005 #33 0.003 #34 0.002 #35 0.001 #36 0.001 ################################ Useful links http://en.wikipedia.org/wiki/G- code#Abbreviations_used_by_ programmers_and_operators List of CNC bubble terms http://www.sherline.com/CNCmenu.htm download of Sherline CNC manuals http://www.sherline.com/8400pg.htm Specs of Sherline CNC lathe, scroll down to the bottom http://linuxcnc.org/docs/EMC2_User_Manual.pdf http://www.sherline.com/8760pg.htm CNC thread cutting for Sherline lathe http://www.cadcamcadcam.com/ commercial http://www.cadcamcadcam.com/latheencoderkit.aspx http://www.imsrv.com/deskcnc/lathe/desktopcncthreading.pdf http://www.dakeng.com/threading.html self-made system Linux and EMC http://wiki.linuxcnc.org/cgi-bin/wiki.pl?LinuxCNCKnowledgeBase http://www.linuxcnc.org/ G-code http://en.wikipedia.org/wiki/G-code http://www.sherline.com/gcode.htm g-code list http://carlsonmfg.com/industrial-resources-articles/18-cnc-code-programming g-code list http://gnipsel.com/linuxcnc/index.html on-line book http://www.cnccookbook.com/CCCNCGCodeCourse.htm on-line book http://www.cnccookbook.com/CCCNCGCodeBasicLatheProgramming.html on-line book-lathe section http://www.deskcnc.com/ http://en.wikipedia.org/wiki/G-code complete list http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Simple_LinuxCNC_G-Code_Generators g-code generators Internet movies https://www.youtube.com/results?search_query=Sherline+CNC+lathe search for movies http://www.youtube.com/watch?v=Q92C9xd9Ybw intro from Sherline https://www.youtube.com/watch?v=C8zwXztmpEc thread cutting on Sherline’s CNC lathe Journals http://www.homeshopmachinist.net/home http://www.gasenginemagazine.com/ http://www.model-engineer.co.uk/ CNC controller for small machines http://www.imsrv.com/ http://www.imsrv.com/imservice_controller_model.htm ###################################### chapter 12.3 read the chapter before using this code! g18 g20 g40 g49 g91; g01 x0 z0 f2; ********** g2 x0 z0 i0 k0.5; **************** g2 x0 z0 i0.5 k0 ************* g2 x0 z0 i0.5 k0.5 g2 x0 z0 i0 k-0.5 ************** g18 g20 g40 g49 g90; g0 x0 z0 f3; g3 x-0.5 z0.5 i0 k0.5; ***************** g18 g20 g40 g49 g91; i g01 x0 z0 f2; g2 x0.5 z0.5 r0.5; ************** g18 g20 g40 g49 g91; g01 x0 z0 f2; g2 x0 z1 r0.5; *************** g18 g20 g40 g49 g90; g01 x0.5 z0.5 f3; g2 x0 z1 r0.5; g3 x0.5 z0.5 r0.5; g01 x0.4 z0.5; g2 x 0 z 0.9; g3 x0.4 z0.5 r0.5; ****************** LatheCity Safely Working with Benchtop Systems Volume 5 – CNC Benchtop Lathe Featuring Sherline © Copyright 2015 by Uwe Burghaus, Fargo, ND, USA All Rights Reserved sales@LatheCity.com www.LatheCity.com No part of this publication including the software may be reproduced, stored in a retrieval system or transmitted in any form or by any means except as permitted by the United States Copyright Act, without prior written permission of the author. Trademarks are property of their respective owners.